debugging buffer
This commit is contained in:
parent
032d9f3e1a
commit
16c22072a1
26
FM/FM.ino
26
FM/FM.ino
|
@ -75,17 +75,18 @@ void updateBuffer(byte bNote, bool bGate) {
|
||||||
playNote();
|
playNote();
|
||||||
bufferIndex++;
|
bufferIndex++;
|
||||||
}
|
}
|
||||||
if (bGate == 0 && bufferIndex != 0) {
|
if (bGate == 0) { // && bufferIndex != 0
|
||||||
for (int i = 0; i <= bufferIndex; i++) {
|
for (int i = 0; i <= bufferIndex; i++) {
|
||||||
if (noteBuffer[i] == bNote) {
|
if (noteBuffer[i] == bNote) {
|
||||||
// Removing the note from the array and shifting everything to close the gap
|
// Removing the note from the array and shifting everything to close the gap
|
||||||
for (int n = i; n <= bufferIndex; n++) {
|
for (int n = i; n <= bufferIndex; n++) {
|
||||||
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?
|
||||||
}
|
}
|
||||||
if (i == bufferIndex) {
|
if (i == bufferIndex) { //this does not fire
|
||||||
bufferIndex--;
|
bufferIndex--;
|
||||||
|
gate = 1;
|
||||||
playNote();
|
playNote();
|
||||||
} else {
|
} else { //this does fire
|
||||||
bufferIndex--;
|
bufferIndex--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,6 +139,7 @@ void updateControl(){
|
||||||
aCarrier.setFreq(carrier_freq);
|
aCarrier.setFreq(carrier_freq);
|
||||||
aModulator.setFreq(mod_freq);
|
aModulator.setFreq(mod_freq);
|
||||||
|
|
||||||
|
//Knob 1
|
||||||
int Knob1value= mozziAnalogRead(CONTROLL1); // value is 0-1023
|
int Knob1value= mozziAnalogRead(CONTROLL1); // value is 0-1023
|
||||||
int Knob1calibrated = kMapIntensity(Knob1value);
|
int Knob1calibrated = kMapIntensity(Knob1value);
|
||||||
|
|
||||||
|
@ -151,6 +153,24 @@ void updateControl(){
|
||||||
float mod_speed = (float)kMapModSpeed(Knob2value)/1000;
|
float mod_speed = (float)kMapModSpeed(Knob2value)/1000;
|
||||||
kIntensityMod.setFreq(mod_speed);
|
kIntensityMod.setFreq(mod_speed);
|
||||||
|
|
||||||
|
// Debugging
|
||||||
|
Serial.print("Buffer Index: ");
|
||||||
|
Serial.print(bufferIndex);
|
||||||
|
|
||||||
|
Serial.print(" | Knob1: "); //3rd on the pannel, connected to A0
|
||||||
|
Serial.print(Knob1calibrated);
|
||||||
|
|
||||||
|
Serial.print(" | Knob2: "); //2nd on the pannel, conntcted to A1
|
||||||
|
Serial.print(Knob2value);
|
||||||
|
|
||||||
|
Serial.print(" | Knob3: "); //1st on the pannel, connected to A2, unstable around 0
|
||||||
|
Serial.print(FRQ);
|
||||||
|
|
||||||
|
Serial.print(" | Knob4: "); //4th on the pannel, A3
|
||||||
|
Serial.print(knob4calibrated);
|
||||||
|
|
||||||
|
Serial.println();
|
||||||
|
|
||||||
// MIDI DIN
|
// MIDI DIN
|
||||||
MIDI.read();
|
MIDI.read();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,3 +5,5 @@ DIY Arduino-based synth built with [Mozzi library](https://sensorium.github.io/M
|
||||||
## ToDo:
|
## ToDo:
|
||||||
- Add note buffer
|
- Add note buffer
|
||||||
- Tune the values, remap the knobs, clean up the code
|
- Tune the values, remap the knobs, clean up the code
|
||||||
|
- Update readme
|
||||||
|
- Add schematics and documentations
|
Loading…
Reference in New Issue