|
|
|
@ -402,21 +402,101 @@ void handleControlChange(byte inChannel, byte inData1, byte inData2) |
|
|
|
|
{ |
|
|
|
|
switch (inData1) |
|
|
|
|
{ |
|
|
|
|
case 10: // Panorama
|
|
|
|
|
configuration.pan = mapfloat(float(inData2), 0, 127, 0.0, 1.0); |
|
|
|
|
// Standard MIDI-CC
|
|
|
|
|
case MIDI_CC_PANORAMA: // Panorama
|
|
|
|
|
configuration.pan = map(inData2, 0, 127, ENC_MASTER_PAN_MIN, ENC_MASTER_PAN_MAX); |
|
|
|
|
break; |
|
|
|
|
case 91: // Reverb level
|
|
|
|
|
case MIDI_CC_REVERB_SEND: // Reverb level
|
|
|
|
|
set_reverb_level(map(inData2, 0, 127, ENC_REVERB_LEVEL_MIN, ENC_REVERB_LEVEL_MAX)); |
|
|
|
|
break; |
|
|
|
|
case 92: // Tremolo level (same as modwheel)
|
|
|
|
|
case MIDI_CC_TREMOLO_DEPTH: // Tremolo level (same as modwheel)
|
|
|
|
|
inData1 = 1; // now it's modwheel and can be processd by ep->processMidiController :-)
|
|
|
|
|
break; |
|
|
|
|
case 93: // Chorus level
|
|
|
|
|
case MIDI_CC_CHORUS_SEND: // Chorus level
|
|
|
|
|
set_chorus_level(map(inData2, 0, 127, ENC_CHORUS_LEVEL_MIN, ENC_CHORUS_LEVEL_MAX)); |
|
|
|
|
break; |
|
|
|
|
case 94: // Detune level
|
|
|
|
|
case MIDI_CC_DETUNE_DEPTH: // Detune level
|
|
|
|
|
ep->setDetune(mapfloat(float(inData2), 0, 127, 0.0, 1.0)); |
|
|
|
|
break; |
|
|
|
|
// Own MIDI-CC mapping
|
|
|
|
|
case MIDI_CC_EP_DECAY: |
|
|
|
|
ep->setDecay(mapfloat(float(inData2), 0, 127, 0.0, 1.0)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_EP_RELEASE: |
|
|
|
|
ep->setRelease(mapfloat(float(inData2), 0, 127, 0.0, 1.0)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_EP_HARDNESS: |
|
|
|
|
ep->setHardness(mapfloat(float(inData2), 0, 127, 0.0, 1.0)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_EP_TREBLE: |
|
|
|
|
ep->setTreble(mapfloat(float(inData2), 0, 127, 0.0, 1.0)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_EP_STEREO: |
|
|
|
|
ep->setStereo(mapfloat(float(inData2), 0, 127, 0.0, 1.0)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_EP_TUNE: |
|
|
|
|
ep->setTune(mapfloat(float(inData2), 0, 127, 0.0, 1.0)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_EP_VELOCITY_SENSE: |
|
|
|
|
ep->setVelocitySense(mapfloat(float(inData2), 0, 127, 0.0, 1.0)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_EP_TREM_FRQ: |
|
|
|
|
ep->setPanLFO(mapfloat(float(inData2), 0, 127, 0.0, 1.0)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_EP_OVERDRIVE: |
|
|
|
|
ep->setOverdrive(mapfloat(float(inData2), 0, 127, 0.0, 1.0)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_COMP_GAIN: |
|
|
|
|
set_comp_gain(map(inData2, 0, 127, ENC_COMP_GAIN_MIN, ENC_COMP_GAIN_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_COMP_REPOSNE: |
|
|
|
|
set_comp_response(map(inData2, 0, 127, ENC_COMP_RESPONSE_MIN, ENC_COMP_RESPONSE_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_COMP_LIMIT: |
|
|
|
|
set_comp_limit(map(inData2, 0, 127, ENC_COMP_LIMIT_MIN, ENC_COMP_LIMIT_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_COMP_THRESHOLD: |
|
|
|
|
set_comp_threshold(map(inData2, 0, 127, ENC_COMP_THRESHOLD_MIN, ENC_COMP_THRESHOLD_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_COMP_ATTACK: |
|
|
|
|
set_comp_attack(map(inData2, 0, 127, ENC_COMP_ATTACK_MIN, ENC_COMP_ATTACK_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_COMP_DECAY: |
|
|
|
|
set_comp_decay(map(inData2, 0, 127, ENC_COMP_DECAY_MIN, ENC_COMP_DECAY_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_REVERB_ROOMSIZE: |
|
|
|
|
set_reverb_roomsize(map(inData2, 0, 127, ENC_REVERB_ROOMSIZE_MIN, ENC_REVERB_ROOMSIZE_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_REVERB_DAMPING: |
|
|
|
|
set_reverb_damping(map(inData2, 0, 127, ENC_REVERB_DAMPING_MIN, ENC_REVERB_DAMPING_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_CHORUS_FREQUENCY: |
|
|
|
|
set_chorus_frequency(map(inData2, 0, 127, ENC_CHORUS_FREQUENCY_MIN, ENC_CHORUS_FREQUENCY_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_CHORUS_INTENSITY: |
|
|
|
|
set_chorus_intensity(map(inData2, 0, 127, ENC_CHORUS_INTENSITY_MIN, ENC_CHORUS_INTENSITY_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_CHORUS_WAVEFORM: |
|
|
|
|
set_chorus_waveform(map(inData2, 0, 127, ENC_CHORUS_WAVEFORM_MIN, ENC_CHORUS_WAVEFORM_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_BASS_LR_LEVEL: |
|
|
|
|
set_bass_lr_level(map(inData2, 0, 127, ENC_BASS_LR_LEVEL_MIN, ENC_BASS_LR_LEVEL_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_BASS_MONO_LEVEL: |
|
|
|
|
set_bass_mono_level(map(inData2, 0, 127, ENC_BASS_MONO_LEVEL_MIN, ENC_BASS_MONO_LEVEL_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_EQ_BASS: |
|
|
|
|
set_eq_bass(map(inData2, 0, 127, ENC_EQ_BASS_MIN, ENC_EQ_BASS_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_EQ_TREBLE: |
|
|
|
|
set_eq_treble(map(inData2, 0, 127, ENC_EQ_TREBLE_MIN, ENC_EQ_TREBLE_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_MIDI_SOFT_THRU: |
|
|
|
|
set_midi_soft_thru(map(inData2, 0, 127, ENC_MIDI_SOFT_THRU_MIN, ENC_MIDI_SOFT_THRU_MAX)); |
|
|
|
|
break; |
|
|
|
|
case MIDI_CC_MONO: |
|
|
|
|
set_mono(map(inData2, 0, 127, ENC_MONO_MIN, ENC_MONO_MAX)); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
ep->processMidiController(inData1, inData2); |
|
|
|
|
break; |
|
|
|
@ -556,6 +636,10 @@ void set_master_volume(uint8_t value) |
|
|
|
|
// http://files.csound-tutorial.net/floss_manual/Release03/Cs_FM_03_ScrapBook/b-panning-and-spatialization.html
|
|
|
|
|
volume_r.gain(tmp3 * sinf(tmp2 * PI / 2)); |
|
|
|
|
volume_l.gain(tmp3 * cosf(tmp2 * PI / 2)); |
|
|
|
|
if (configuration.mono == 2) |
|
|
|
|
volume_l.gain(0.0); |
|
|
|
|
else if (configuration.mono == 3) |
|
|
|
|
volume_r.gain(0.0); |
|
|
|
|
|
|
|
|
|
eeprom_master_volume_update_flag = true; |
|
|
|
|
eeprom_master_volume_update_timer = 0; |
|
|
|
@ -777,6 +861,6 @@ void show_sound(void) |
|
|
|
|
Serial.println(configuration.mono, DEC); |
|
|
|
|
Serial.print(F("Panorama: ")); |
|
|
|
|
Serial.println(configuration.pan, DEC); |
|
|
|
|
Serial.println(F("======END=SOUND=CONFIGURATION=======")); |
|
|
|
|
Serial.println(F("======END=OF=SOUND=CONFIGURATION=======")); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|