Phoenard
Public Member Functions | List of all members
PHN_Midi Class Reference

Play music notes using a variety of instruments using MIDI with chip VS1053B. More...

#include <PHNMidi.h>

Public Member Functions

void begin ()
 Initializes the chip into MIDI mode.
 
void setInstrument (byte instrument)
 Sets the instrument to play with.
 
void setBank (byte bank)
 Sets the instrument bank to use.
 
void noteOn (byte channel, byte note, byte attack_velocity)
 Turns a note on (press)
 
void noteOff (byte channel, byte note, byte release_velocity)
 turns a note off (release)
 
void note (byte channel, byte note, byte velocity, boolean pressed)
 Sets whether a note is pressed or released, similar to noteOn/noteOff.
 
void talkMIDI (byte cmd, byte data1, byte data2)
 Main MIDI command sending routine.
 
void playNote (byte note)
 Plays a note at channel 0 and releases - useful for debugging.
 
void write (uint8_t byte)
 Writes a single byte to the VS1053 chip.
 

Detailed Description

Play music notes using a variety of instruments using MIDI with chip VS1053B.

Construct an instance of the class, then call begin() to put the chip into MIDI mode to set it ready for playing MIDI. You can then set the instrument and instrument bank to use, after which notes can be played.

To play a full note, first turn it on (press) and then off (release). For each note the channel of the instrument, pitch and attach velocity can be specified. Multiple notes can be turned on at the same time.

For further implementation, the write() and talkMIDI() functions can be utilized. For a full list of commands, see the MIDI specification found here: http://www.midi.org/techspecs/midimessages.php


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