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