|
|
|
@ -317,14 +317,16 @@ void Dexed::keyup(int16_t pitch) { |
|
|
|
|
if ( voices[note].midi_note == pitch && voices[note].keydown ) { |
|
|
|
|
voices[note].keydown = false; |
|
|
|
|
voices[note].key_pressed_timer = 0; |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print(F("Stop voice: ")); |
|
|
|
|
Serial.print(note, DEC); |
|
|
|
|
Serial.print(F(" pitch: ")); |
|
|
|
|
Serial.println(pitch, DEC); |
|
|
|
|
Serial.print(F(" id: ")); |
|
|
|
|
Serial.println(id, DEC); |
|
|
|
|
#endif |
|
|
|
|
/*
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print(F("Stop voice: ")); |
|
|
|
|
Serial.print(note, DEC); |
|
|
|
|
Serial.print(F(" pitch: ")); |
|
|
|
|
Serial.println(pitch, DEC); |
|
|
|
|
Serial.print(F(" id: ")); |
|
|
|
|
Serial.println(id, DEC); |
|
|
|
|
#endif |
|
|
|
|
*/ |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -502,29 +504,29 @@ uint8_t Dexed::getNumNotesPlaying(void) |
|
|
|
|
|
|
|
|
|
memset(&voiceStatus, 0, sizeof(VoiceStatus)); |
|
|
|
|
voices[i].dx7_note->peekVoiceStatus(voiceStatus); |
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println(i); |
|
|
|
|
Serial.print("ALG: "); |
|
|
|
|
Serial.println(data[134]+1); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println(i); |
|
|
|
|
Serial.print("ALG: "); |
|
|
|
|
Serial.println(data[134]+1); |
|
|
|
|
#endif |
|
|
|
|
*/ |
|
|
|
|
for (uint8_t op = 0; op < 6; op++) |
|
|
|
|
{ |
|
|
|
|
if ((op_carrier & (1 << op))) |
|
|
|
|
{ |
|
|
|
|
// this voice is a carrier!
|
|
|
|
|
op_carrier_num++; |
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print("OP: "); |
|
|
|
|
Serial.print(op); |
|
|
|
|
Serial.print(" AMP_STEP: "); |
|
|
|
|
Serial.print(voiceStatus.ampStep[op],DEC); |
|
|
|
|
Serial.print(" AMP: "); |
|
|
|
|
Serial.println(voiceStatus.amp[op],DEC); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print("OP: "); |
|
|
|
|
Serial.print(op); |
|
|
|
|
Serial.print(" AMP_STEP: "); |
|
|
|
|
Serial.print(voiceStatus.ampStep[op],DEC); |
|
|
|
|
Serial.print(" AMP: "); |
|
|
|
|
Serial.println(voiceStatus.amp[op],DEC); |
|
|
|
|
#endif |
|
|
|
|
*/ |
|
|
|
|
if (voiceStatus.amp[op] < VOICE_SILENCE_LEVEL && voiceStatus.ampStep[op] >= 3) |
|
|
|
|
{ |
|
|
|
|
// this voice produces no audio output
|
|
|
|
@ -542,13 +544,14 @@ uint8_t Dexed::getNumNotesPlaying(void) |
|
|
|
|
Serial.println(op_amp, DEC); |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print("OP_AMP: "); |
|
|
|
|
Serial.print(op_amp); |
|
|
|
|
Serial.print(" OP_CARRIER_NUM: "); |
|
|
|
|
Serial.println(op_carrier_num); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print("OP_AMP: "); |
|
|
|
|
Serial.print(op_amp); |
|
|
|
|
Serial.print(" OP_CARRIER_NUM: "); |
|
|
|
|
Serial.println(op_carrier_num); |
|
|
|
|
#endif |
|
|
|
|
*/ |
|
|
|
|
if (op_amp == op_carrier_num) |
|
|
|
|
{ |
|
|
|
|
// all carrier-operators are silent -> disable the voice
|
|
|
|
|