MIDI_Class Class Reference

#include <MIDI.h>

List of all members.

Public Member Functions

 MIDI_Class ()
 ~MIDI_Class ()
void begin (byte inChannel=1)
bool read ()
bool read (byte channel)
void send (byte type, byte param1, byte param2, byte canal)
void sendNoteOn (byte NoteNumber, byte Velocity, byte Channel)
void sendNoteOff (byte NoteNumber, byte Velocity, byte Channel)
void sendProgramChange (byte ProgramNumber, byte Channel)
void sendControlChange (byte ControlNumber, byte ControlValue, byte Channel)
void sendPitchBend (int PitchValue, byte Channel)
void sendPolyPressure (byte NoteNumber, byte Pressure, byte Channel)
void sendAfterTouch (byte Pressure, byte Channel)
void sendSysEx (byte length, byte *array)
void turnThruOn ()
void turnThruOff ()
void turnThru (bool state)
byte getType ()
byte getChannel ()
byte getData1 ()
byte getData2 ()
bytegetSysExArray ()
bool check ()
byte getInputChannel ()
byte getFilterMode ()
bool getThruState ()
void setDeviceID (byte sysID)
void delMsg ()
void delSysEx ()
void setInputChannel (byte channel)
void setFilter (byte filter)


Detailed Description

Definition at line 69 of file MIDI.h.


Constructor & Destructor Documentation

MIDI_Class::MIDI_Class (  ) 

Default constructor for MIDI_Class.

Definition at line 34 of file MIDI.cpp.

MIDI_Class::~MIDI_Class (  ) 

Default destructor for MIDI_Class.
This is not really useful for the Arduino, as it is never called...

Definition at line 38 of file MIDI.cpp.


Member Function Documentation

void MIDI_Class::begin ( byte  inChannel = 1  ) 

Call the begin method in the setup() function of the Arduino. All parameters are set to their default values:

  • Full thru mirroring
  • Input channel set to 1 if no value specified

Definition at line 46 of file MIDI.cpp.

bool MIDI_Class::check (  ) 

Check if a valid message is stored in the structure.

Definition at line 148 of file MIDI.cpp.

void MIDI_Class::delMsg (  ) 

Use this method to delete the message stored in the structure.

Definition at line 152 of file MIDI.cpp.

void MIDI_Class::delSysEx (  ) 

Definition at line 161 of file MIDI.cpp.

byte MIDI_Class::getChannel (  ) 

Getter method: access to the channel of the message stored in the structure.

Definition at line 140 of file MIDI.cpp.

byte MIDI_Class::getData1 (  ) 

Getter method: access to the first data byte of the message stored in the structure.
If the message is SysEx, the length of the array is stocked there.

Definition at line 142 of file MIDI.cpp.

byte MIDI_Class::getData2 (  ) 

Getter method: access to the second data byte of the message stored in the structure.

Definition at line 144 of file MIDI.cpp.

byte MIDI_Class::getFilterMode (  )  [inline]

Definition at line 105 of file MIDI.h.

byte MIDI_Class::getInputChannel (  )  [inline]

Definition at line 104 of file MIDI.h.

byte * MIDI_Class::getSysExArray (  ) 

Getter method: access to the System Exclusive byte array. Array length is stocked in Data1.

Definition at line 146 of file MIDI.cpp.

bool MIDI_Class::getThruState (  )  [inline]

Definition at line 106 of file MIDI.h.

byte MIDI_Class::getType (  ) 

Getter method: access to the message type stored in the structure.

Definition at line 138 of file MIDI.cpp.

bool MIDI_Class::read ( byte  channel  ) 

Reading/mirroring method, the same as read() with a given input channel to read on.

Definition at line 334 of file MIDI.cpp.

bool MIDI_Class::read (  ) 

Read a MIDI message from the serial port using the main input channel (see setInputChannel() for reference).
Returned value: true if any valid message has been stored in the structure, false if not. A valid message is a message that matches the input channel.

If the Thru is enabled and the messages matches the filter, it is sent back on the MIDI output.

Definition at line 330 of file MIDI.cpp.

void MIDI_Class::send ( byte  type,
byte  data1,
byte  data2,
byte  channel 
)

Generate and send a custom MIDI mMessage.

Parameters:
type The message type (see type defines for reference)
data1 The first data byte
data2 The second data byte (if the message contains only 1 data byte, set this one to 0)
channel The output channel on which the message will be sent

Definition at line 74 of file MIDI.cpp.

void MIDI_Class::sendAfterTouch ( byte  Pressure,
byte  Channel 
)

Monophonic AfterTouch

Definition at line 125 of file MIDI.cpp.

void MIDI_Class::sendControlChange ( byte  ControlNumber,
byte  ControlValue,
byte  Channel 
)

Send a Control Change message

Definition at line 121 of file MIDI.cpp.

void MIDI_Class::sendNoteOff ( byte  NoteNumber,
byte  Velocity,
byte  Channel 
)

Send a Note Off message (a real Note Off, not a Note On with null velocity)

Definition at line 117 of file MIDI.cpp.

void MIDI_Class::sendNoteOn ( byte  NoteNumber,
byte  Velocity,
byte  Channel 
)

Send a Note On message

Definition at line 115 of file MIDI.cpp.

void MIDI_Class::sendPitchBend ( int  PitchValue,
byte  Channel 
)

void MIDI_Class::sendPolyPressure ( byte  NoteNumber,
byte  Pressure,
byte  Channel 
)

Polyphonic AfterTouch (carries the information of pressure of the given key/note)

Definition at line 123 of file MIDI.cpp.

void MIDI_Class::sendProgramChange ( byte  ProgramNumber,
byte  Channel 
)

Send a Program Change message

Definition at line 119 of file MIDI.cpp.

void MIDI_Class::sendSysEx ( byte  length,
byte array 
)

Generate and send a System Exclusive frame.

Parameters:
length The size of the array to send
array The byte array containing the data to send
Don't put F0 or F7 (start & stop SysEx codes), but put destination device's Manufacturer's ID and/or Device ID in the buffer array.

Definition at line 131 of file MIDI.cpp.

void MIDI_Class::setDeviceID ( byte  sysID  ) 

Set the System Exclusive Device ID (for listening to SysEx messages)

Definition at line 165 of file MIDI.cpp.

void MIDI_Class::setFilter ( byte  filter  ) 

Set the filter for thru mirroring

Parameters:
filter a filter mode:
  • MIDI_FILTER_FULL Every incoming message is mirrored.
  • MIDI_FILTER_CANAL Every message matching the input channel is mirrored.
  • MIDI_FILTER_ANTICANAL Every message non-matching the input channel is mirrored.

Definition at line 177 of file MIDI.cpp.

void MIDI_Class::setInputChannel ( byte  channel  ) 

Set the value for the input MIDI channel

Parameters:
channel the channel value. Valid values are 1 to 16, MIDI_CHANNEL_OMNI if you want to listen all channels, and MIDI_CHANNEL_OFF to disable MIDI input.

Definition at line 170 of file MIDI.cpp.

void MIDI_Class::turnThru ( bool  val  ) 

Setter method: set message mirroring to the specified value.

Definition at line 184 of file MIDI.cpp.

void MIDI_Class::turnThruOff (  ) 

Setter method: turn message mirroring off.

Definition at line 182 of file MIDI.cpp.

void MIDI_Class::turnThruOn (  ) 

Setter method: turn message mirroring on.

Definition at line 180 of file MIDI.cpp.


The documentation for this class was generated from the following files:

Generated on Mon Dec 14 14:45:29 2009 for Arduino MIDI Library by  doxygen 1.5.8