updates midi in play_note to better octave

This commit is contained in:
Jack Humbert 2016-05-23 23:44:36 -04:00
parent aaa758f1d3
commit 897f5b2f9d

View File

@ -947,10 +947,10 @@ void fallthrough_callback(MidiDevice * device,
if (cnt == 3) {
switch (byte0 & 0xF0) {
case MIDI_NOTEON:
play_note(((double)261.6)*pow(2.0, -1.0)*pow(2.0,(byte1 & 0x7F)/12.0), (byte2 & 0x7F) / 8);
play_note(((double)261.6)*pow(2.0, -4.0)*pow(2.0,(byte1 & 0x7F)/12.0), (byte2 & 0x7F) / 8);
break;
case MIDI_NOTEOFF:
stop_note(((double)261.6)*pow(2.0, -1.0)*pow(2.0,(byte1 & 0x7F)/12.0));
stop_note(((double)261.6)*pow(2.0, -4.0)*pow(2.0,(byte1 & 0x7F)/12.0));
break;
}
}