Commit 02e07ada authored by Jacob Vosmaer's avatar Jacob Vosmaer

Add pitch bend midi msg

parent 9e1416d6
......@@ -142,6 +142,33 @@ test_control_change(void)
assert_status(MIDI_CONTROL_CHANGE, 1, 0x7162);
}
void
test_pitch_bend(void)
{
desc("test pitch bend messages");
status_init();
assert_status(MIDI_NUM_STATUSES, 0, 0);
midi_parse(0xe0);
midi_parse(0x34);
midi_parse(0x45);
assert_status(MIDI_PITCH_BEND, 1, 0x3445);
midi_parse(0x90);
midi_parse(0x60);
midi_parse(0x64);
assert_status(MIDI_NOTE_ON, 1, 0x6064);
midi_parse(0xe0);
midi_parse(0x55);
midi_parse(0x67);
assert_status(MIDI_PITCH_BEND, 1, 0x5567);
midi_parse(0x71);
midi_parse(0x62);
assert_status(MIDI_PITCH_BEND, 1, 0x7162);
}
int
main(int argc, char** argv)
{
......@@ -150,6 +177,7 @@ main(int argc, char** argv)
test_note_off();
test_program_change();
test_control_change();
test_pitch_bend();
return 0;
}
......@@ -26,6 +26,7 @@ const uint8_t statuses[MIDI_NUM_STATUSES] = {
0b1000, // note off
0b1100, // program change
0b1011, // control change
0b1110, // pitch bend
};
uint8_t
......
......@@ -8,6 +8,7 @@ enum _statuses {
MIDI_NOTE_OFF,
MIDI_PROGRAM_CHANGE,
MIDI_CONTROL_CHANGE,
MIDI_PITCH_BEND,
MIDI_NUM_STATUSES,
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment