noteoff is still messed up
This commit is contained in:
parent
0015cc0418
commit
383cae76d7
|
@ -64,8 +64,8 @@ void noteOn(byte channel, byte note, byte velocity) {
|
||||||
|
|
||||||
void noteOff(byte channel, byte note, byte velocity) {
|
void noteOff(byte channel, byte note, byte velocity) {
|
||||||
if (channel == MIDI_CHANNEL) {
|
if (channel == MIDI_CHANNEL) {
|
||||||
gate = 0;
|
|
||||||
updateBuffer(note, gate);
|
updateBuffer(note, gate);
|
||||||
|
gate = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,11 +83,13 @@ void updateBuffer(byte bNote, bool bGate) {
|
||||||
noteBuffer[n] = noteBuffer[n + 1]; // what happens if it's the last note in buffer?
|
noteBuffer[n] = noteBuffer[n + 1]; // what happens if it's the last note in buffer?
|
||||||
}
|
}
|
||||||
bufferIndex--;
|
bufferIndex--;
|
||||||
if (i == bufferIndex) {
|
if (i == bufferIndex && i != 0) {
|
||||||
bufferIndex--; //we need to play the notefrom previous cell of buffer write index, that's where -- and ++ come from
|
bufferIndex--; //we need to play the notefrom previous cell of buffer write index, that's where -- and ++ come from
|
||||||
gate = 1;
|
gate = 1;
|
||||||
playNote();
|
playNote();
|
||||||
bufferIndex++;
|
bufferIndex++;
|
||||||
|
} else if (i == bufferIndex && i == 0) {
|
||||||
|
gate = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue