|
|
@ -363,6 +363,7 @@ void CMiniDexed::ProgramChange (unsigned nProgram, unsigned nTG) |
|
|
|
|
|
|
|
|
|
|
|
assert (m_pTG[nTG]); |
|
|
|
assert (m_pTG[nTG]); |
|
|
|
m_pTG[nTG]->loadVoiceParameters (Buffer); |
|
|
|
m_pTG[nTG]->loadVoiceParameters (Buffer); |
|
|
|
|
|
|
|
m_SerialMIDI.SendSystemExclusiveVoice(nProgram,0,nTG); |
|
|
|
|
|
|
|
|
|
|
|
m_UI.ParameterChanged (); |
|
|
|
m_UI.ParameterChanged (); |
|
|
|
} |
|
|
|
} |
|
|
@ -867,6 +868,11 @@ void CMiniDexed::ProcessSound (void) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// BEGIN TG mixing
|
|
|
|
// BEGIN TG mixing
|
|
|
|
|
|
|
|
float32_t tmp_float[nFrames*2]; |
|
|
|
|
|
|
|
int16_t tmp_int[nFrames*2]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(nMasterVolume > 0.0) |
|
|
|
|
|
|
|
{ |
|
|
|
for (uint8_t i = 0; i < CConfig::ToneGenerators; i++) |
|
|
|
for (uint8_t i = 0; i < CConfig::ToneGenerators; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
tg_mixer->doAddMix(i,m_OutputLevel[i]); |
|
|
|
tg_mixer->doAddMix(i,m_OutputLevel[i]); |
|
|
@ -909,14 +915,23 @@ void CMiniDexed::ProcessSound (void) |
|
|
|
// END adding reverb
|
|
|
|
// END adding reverb
|
|
|
|
|
|
|
|
|
|
|
|
// Convert dual float array (left, right) to single int16 array (left/right)
|
|
|
|
// Convert dual float array (left, right) to single int16 array (left/right)
|
|
|
|
float32_t tmp_float[nFrames*2]; |
|
|
|
|
|
|
|
int16_t tmp_int[nFrames*2]; |
|
|
|
|
|
|
|
for(uint16_t i=0; i<nFrames;i++) |
|
|
|
for(uint16_t i=0; i<nFrames;i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if(nMasterVolume >0.0 && nMasterVolume <1.0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
tmp_float[i*2]=SampleBuffer[indexL][i] * nMasterVolume; |
|
|
|
|
|
|
|
tmp_float[(i*2)+1]=SampleBuffer[indexR][i] * nMasterVolume; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if(nMasterVolume == 1.0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
tmp_float[i*2]=SampleBuffer[indexL][i]; |
|
|
|
tmp_float[i*2]=SampleBuffer[indexL][i]; |
|
|
|
tmp_float[(i*2)+1]=SampleBuffer[indexR][i]; |
|
|
|
tmp_float[(i*2)+1]=SampleBuffer[indexR][i]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
arm_float_to_q15(tmp_float,tmp_int,nFrames*2); |
|
|
|
arm_float_to_q15(tmp_float,tmp_int,nFrames*2); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
arm_fill_q15(0, tmp_int, nFrames * 2); |
|
|
|
|
|
|
|
|
|
|
|
if (m_pSoundDevice->Write (tmp_int, sizeof(tmp_int)) != (int) sizeof(tmp_int)) |
|
|
|
if (m_pSoundDevice->Write (tmp_int, sizeof(tmp_int)) != (int) sizeof(tmp_int)) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -1183,3 +1198,14 @@ void CMiniDexed::getSysExVoiceDump(uint8_t* dest, uint8_t nTG) |
|
|
|
dest[161] = checksum & 0x7f; // Checksum
|
|
|
|
dest[161] = checksum & 0x7f; // Checksum
|
|
|
|
dest[162] = 0xF7; // SysEx end
|
|
|
|
dest[162] = 0xF7; // SysEx end
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CMiniDexed::setMasterVolume (float32_t vol) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if(vol < 0.0) |
|
|
|
|
|
|
|
vol = 0.0; |
|
|
|
|
|
|
|
else if(vol > 1.0) |
|
|
|
|
|
|
|
vol = 1.0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nMasterVolume=vol; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|