mirror of
https://git.alemi.dev/cv-keyboard.git
synced 2024-11-23 17:04:49 +01:00
Added off counter but with value 0
This commit is contained in:
parent
54fc6f26ab
commit
3e477f4ca8
1 changed files with 13 additions and 6 deletions
|
@ -18,7 +18,7 @@
|
|||
#define Oct4 10
|
||||
|
||||
#define noteOffset 36
|
||||
#define offCounter 100
|
||||
#define offCounter 0
|
||||
|
||||
#include <MIDI.h>
|
||||
#include <HID.h>
|
||||
|
@ -60,6 +60,11 @@ void send() {
|
|||
for (int c = 48; c >= 0; c--) {
|
||||
if (flip[c] == HIGH) {
|
||||
flip[c] = LOW;
|
||||
if (noteCounter[c] > 0) {
|
||||
noteCounter[c]--;
|
||||
}
|
||||
else {
|
||||
noteCounter[c] = offCounter;
|
||||
noteBuffer = c + noteOffset;
|
||||
if (status[c] == HIGH) {
|
||||
MIDI.sendNoteOn(noteBuffer, velocity, 1);
|
||||
|
@ -69,10 +74,12 @@ void send() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void scan() {
|
||||
for (int cOctave = 0; cOctave < 4; cOctave++) {
|
||||
octBuffer = 12 * cOctave;
|
||||
digitalWrite(octave[cOctave], HIGH);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue