From e162cd28ab99c05f4cb4a788b7a0b26cb6ca301a Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 22 Jul 2019 16:52:02 +0200 Subject: [PATCH] Fixed bug when playing same note in 2 octaves. May slow things down --- cvkeyboard.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cvkeyboard.ino b/cvkeyboard.ino index 32f4331..2f647f1 100644 --- a/cvkeyboard.ino +++ b/cvkeyboard.ino @@ -101,7 +101,7 @@ Adafruit_MPR121 cap = Adafruit_MPR121(); void setup() { display(loadingDisplay[0]); - for (int cOCTAVE = 0; cOCTAVE < NOCTAVES; cOCTAVE++) pinMode(OCTAVE[cOCTAVE], OUTPUT); + for (int cOCTAVE = 0; cOCTAVE < NOCTAVES; cOCTAVE++) pinMode(OCTAVE[cOCTAVE], INPUT); // These have to be inputs, otherwise they'll sink current and mess with notes above octaves for (int cNOTE = 0; cNOTE < NKEYS; cNOTE++) pinMode(NOTE[cNOTE], INPUT); for (int cLED = 0; cLED < NBITS; cLED++) pinMode(LEDS[cLED], OUTPUT); pinMode(OW, INPUT_PULLUP); // Used for overwrite switch @@ -270,9 +270,11 @@ void loop() { npressed = 0; for (int cOCTAVE = 0; cOCTAVE < 4; cOCTAVE++) { + pinMode(OCTAVE[cOCTAVE], OUTPUT); digitalWrite(OCTAVE[cOCTAVE], HIGH); npressed += eval(scan(), cOCTAVE); digitalWrite(OCTAVE[cOCTAVE], LOW); + pinMode(OCTAVE[cOCTAVE], INPUT); } if (current[channel-1] != NULL && overwrite) { @@ -354,7 +356,7 @@ void clocksync(){ } void midisettings(byte channel, byte number, byte value) { - return; + if (number == 3) gate_length = (value*10)+10; } // List management functions