(cherry picked from commit 3d23087c5a257f3319f7c846c6ec131cf34cbba5)
This commit is contained in:
Paul
2009-09-23 21:43:57 +03:00
committed by Tobias Doerffel
parent 9d4bdb93a9
commit b87dcc5c71
2 changed files with 8 additions and 4 deletions

View File

@@ -901,4 +901,6 @@
23 Sep 2009 (Paul Nasca)
- Added unison invert phase
- Made unison frequency spread to depend on Bandwidth controllers and parameters
- Made unison frequency spread to depend on Bandwidth controllers and parameters
- bugfixes: Voice Amplitude Envelope and FM

View File

@@ -1213,7 +1213,7 @@ inline void ADnote::ComputeVoiceOscillatorFrequencyModulation(int nvoice,int FMm
};
//normalize makes all sample-rates, oscil_sizes toproduce same sound
//normalize: makes all sample-rates, oscil_sizes to produce same sound
if (FMmode!=0) {//Frequency modulation
REALTYPE normalize=OSCIL_SIZE/262144.0*44100.0/(REALTYPE)SAMPLE_RATE;
for (int k=0;k<unison_size[nvoice];k++){
@@ -1261,7 +1261,7 @@ inline void ADnote::ComputeVoiceOscillatorFrequencyModulation(int nvoice,int FMm
poslo+=freqlo;
if (poslo>=1.0) {
poslo=fmod(freqlo,1.0);
poslo=fmod(poslo,1.0);
poshi++;
};
@@ -1385,6 +1385,7 @@ int ADnote::noteout(REALTYPE *outl,REALTYPE *outr)
// Amplitude
REALTYPE oldam=oldamplitude[nvoice]*unison_amplitude;
REALTYPE newam=newamplitude[nvoice]*unison_amplitude;
if (ABOVE_AMPLITUDE_THRESHOLD(oldam,newam)) {
int rest=SOUND_BUFFER_SIZE;
//test if the amplitude if raising and the difference is high
@@ -1419,9 +1420,10 @@ int ADnote::noteout(REALTYPE *outl,REALTYPE *outr)
//check if the amplitude envelope is finished, if yes, the voice will be fadeout
if (NoteVoicePar[nvoice].AmpEnvelope!=NULL) {
if (NoteVoicePar[nvoice].AmpEnvelope->finished()!=0)
if (NoteVoicePar[nvoice].AmpEnvelope->finished()!=0){
for (i=0;i<SOUND_BUFFER_SIZE;i++) tmpwavel[i]*=1.0-(REALTYPE)i/(REALTYPE)SOUND_BUFFER_SIZE;
if (stereo) for (i=0;i<SOUND_BUFFER_SIZE;i++) tmpwaver[i]*=1.0-(REALTYPE)i/(REALTYPE)SOUND_BUFFER_SIZE;
};
//the voice is killed later
};