|
|
|
@ -961,7 +961,6 @@ void handleSystemReset(void) |
|
|
|
|
/******************************************************************************
|
|
|
|
|
MIDI HELPER |
|
|
|
|
******************************************************************************/ |
|
|
|
|
|
|
|
|
|
bool checkMidiChannel(byte inChannel) |
|
|
|
|
{ |
|
|
|
|
// check for MIDI channel
|
|
|
|
@ -999,8 +998,7 @@ void set_volume(uint8_t v, int8_t p, uint8_t m) |
|
|
|
|
|
|
|
|
|
// float v = (float)(a * (a + 2))/(float)(1 << 20); // (pseudo-) logarithmic curve for volume control
|
|
|
|
|
// 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)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print(F("Setting volume: VOL=")); |
|
|
|
@ -1020,23 +1018,23 @@ void set_volume(uint8_t v, int8_t p, uint8_t m) |
|
|
|
|
switch (m) |
|
|
|
|
{ |
|
|
|
|
case 0: |
|
|
|
|
volume_r.gain(1.0); |
|
|
|
|
volume_l.gain(1.0); |
|
|
|
|
volume_r.gain(tmp3 * sinf(tmp2 * PI / 2)); |
|
|
|
|
volume_l.gain(tmp3 * cosf(tmp2 * PI / 2)); |
|
|
|
|
stereomono1.stereo(true); |
|
|
|
|
break; |
|
|
|
|
case 1: |
|
|
|
|
volume_r.gain(1.0); |
|
|
|
|
volume_l.gain(1.0); |
|
|
|
|
volume_r.gain(tmp3 * sinf(tmp2 * PI / 2)); |
|
|
|
|
volume_l.gain(tmp3 * cosf(tmp2 * PI / 2)); |
|
|
|
|
stereomono1.stereo(false); |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
volume_r.gain(1.0); |
|
|
|
|
volume_r.gain(tmp3 * sinf(tmp2 * PI / 2)); |
|
|
|
|
volume_l.gain(0.0); |
|
|
|
|
stereomono1.stereo(false); |
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
volume_r.gain(0.0); |
|
|
|
|
volume_l.gain(1.0); |
|
|
|
|
volume_l.gain(tmp3 * cosf(tmp2 * PI / 2)); |
|
|
|
|
stereomono1.stereo(false); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|