Merge branch 'main' into Pitch-bender-and-Portamento

pull/206/head
probonopd 3 years ago committed by GitHub
commit d06e8e2368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      src/effect_mixer.hpp
  2. 2
      src/serialmididevice.cpp

@ -52,7 +52,7 @@ public:
gain = MAX_GAIN;
else if (gain < MIN_GAIN)
gain = MIN_GAIN;
multiplier[channel] = gain;
multiplier[channel] = powf(gain, 4); // see: https://www.dr-lex.be/info-stuff/volumecontrols.html#ideal2
}
void gain(float32_t gain)
@ -63,7 +63,7 @@ public:
gain = MAX_GAIN;
else if (gain < MIN_GAIN)
gain = MIN_GAIN;
multiplier[i] = gain;
multiplier[i] = powf(gain, 4); // see: https://www.dr-lex.be/info-stuff/volumecontrols.html#ideal2
}
}
@ -114,16 +114,22 @@ public:
void doAddMix(uint8_t channel, float32_t* in)
{
float32_t tmp[buffer_length];
float32_t sin_pan;
float32_t cos_pan;
assert(in);
// From: https://stackoverflow.com/questions/67062207/how-to-pan-audio-sample-data-naturally
sin_pan=arm_sin_f32(mapfloat(panorama[channel], MIN_PANORAMA, MAX_PANORAMA, 0.0, M_PI/2.0));
cos_pan=arm_cos_f32(mapfloat(panorama[channel], MIN_PANORAMA, MAX_PANORAMA, 0.0, M_PI/2.0));
// left
arm_scale_f32(in, 1.0f-panorama[channel], tmp, buffer_length);
arm_scale_f32(in, sin_pan, tmp, buffer_length);
if(multiplier[channel]!=UNITY_GAIN)
arm_scale_f32(tmp,multiplier[channel],tmp,buffer_length);
arm_add_f32(sumbufL, tmp, sumbufL, buffer_length);
// right
arm_scale_f32(in, panorama[channel], tmp, buffer_length);
arm_scale_f32(in, cos_pan, tmp, buffer_length);
if(multiplier[channel]!=UNITY_GAIN)
arm_scale_f32(tmp,multiplier[channel],tmp,buffer_length);
arm_add_f32(sumbufR, tmp, sumbufR, buffer_length);

@ -57,6 +57,8 @@ void CSerialMIDIDevice::Process (void)
int nResult = m_Serial.Read (Buffer, sizeof Buffer);
if (nResult <= 0)
{
if(nResult!=0)
printf("Serial-Read: %d\n",nResult);
return;
}

Loading…
Cancel
Save