-
Notifications
You must be signed in to change notification settings - Fork 0
MIDI Message Parser
nyannkov edited this page Jun 28, 2020
·
2 revisions
MIDI Message Parser is located as follows:
https://github.com/nyannkov/nano_midi/tree/master/src/sound/midi
Examples are here:
https://github.com/nyannkov/nano_midi/tree/master/src/sound/app
// If you have unnecessary handlers, register NULL to them.
const MIDI_Message_Callbacks_t _ymf825_midi_msg_callbacks = {
// MIDI_ChannelMessage_t
{
// MIDI_ChannelVoiceMessage_t
{
_ymf825_NoteOff,
_ymf825_NoteOn,
NULL,
_ymf825_ControlChange,
_ymf825_ProgramChange,
NULL,
_ymf825_PitchBendChange
}
},
// MIDI_SystemMessage_t
{
// MIDI_SystemExclusiveMessage_t
{
NULL
}
}
};
MIDI_Handle_t *phMIDI;
phMIDI = MIDI_Init(&_ymf825_midi_msg_callbacks);
NOTE
By default, allocation and free of any instance of MIDI_Handle_t are executed by following functions.
__WEAK__ MIDI_Handle_t *MIDI_Alloc(void) { static MIDI_Handle_t hMIDI; return &hMIDI; } __WEAK__ void MIDI_Free(MIDI_Handle_t *phMIDI) { (void)phMIDI; }If you need to create multiple instances of MIDI_Handle_t, please redefine these functions.