Simple mbed 5-pin DIN to USB MIDI Converter library

Dependents:   5-PinMIDIDemo

Embed: (wiki syntax)

« Back to documentation index

Midi5Pin Class Reference

Midi5Pin Class Reference

The 5-pin MIDI helper class. More...

#include <Midi5Pin.h>

Public Member Functions

 Midi5Pin (PinName txPin, PinName rxPin)
 Create a Midi5Pin object with the specified transmit and receive pins.
void write (char command, char param1, char param2)
 Send a command to the 5-pin output port.
void noteOn (char note, char velocity)
 Send a noteOn MIDI message to the 5-pin output.
void noteOff (char note)
 Send a noteOff MIDI message to the 5-pin output.
void contCtrl (char ccNumber, char value)
 Send a continuous control message to the 5-pin output.
void read ()
 Read from the 5-pin input connection and send it to the PC through the USB virtual com port.

Detailed Description

The 5-pin MIDI helper class.

Definition at line 11 of file Midi5Pin.h.


Constructor & Destructor Documentation

Midi5Pin ( PinName  txPin,
PinName  rxPin 
)

Create a Midi5Pin object with the specified transmit and receive pins.

Parameters:
txPinTransmit pin
rxPinReceive pin

Definition at line 11 of file Midi5Pin.cpp.


Member Function Documentation

void contCtrl ( char  ccNumber,
char  value 
)

Send a continuous control message to the 5-pin output.

Parameters:
ccNumberThe continuous control message number
valueValue of the continuous control message

Definition at line 36 of file Midi5Pin.cpp.

void noteOff ( char  note )

Send a noteOff MIDI message to the 5-pin output.

Parameters:
noteMIDI note number

Definition at line 30 of file Midi5Pin.cpp.

void noteOn ( char  note,
char  velocity 
)

Send a noteOn MIDI message to the 5-pin output.

Parameters:
noteMIDI note number
velocityMIDI note velocity (loudness)

Definition at line 24 of file Midi5Pin.cpp.

void read (  )

Read from the 5-pin input connection and send it to the PC through the USB virtual com port.

Definition at line 42 of file Midi5Pin.cpp.

void write ( char  command,
char  param1,
char  param2 
)

Send a command to the 5-pin output port.

Parameters:
commandThe MIDI command byte
param1First parameter (depends on command)
param2Second parameter (depends on command)

Definition at line 18 of file Midi5Pin.cpp.