diff options
author | Nil Geisweiller <a-lin@sourceforge.net> | 2006-12-08 10:47:53 +0000 |
---|---|---|
committer | Nil Geisweiller <a-lin@sourceforge.net> | 2006-12-08 10:47:53 +0000 |
commit | 61d913774ad80c21e89edf3bdce782d47373727a (patch) | |
tree | c150f1429a60533cb990c7fe43963247b83651af | |
parent | 00b569445cf38f20f55602c8144bc04b9198a24b (diff) |
see ChangeLog
-rw-r--r-- | muse/ChangeLog | 2 | ||||
-rw-r--r-- | muse/synti/deicsonze/TODO | 2 | ||||
-rw-r--r-- | muse/synti/deicsonze/deicsonze.cpp | 195 | ||||
-rw-r--r-- | muse/synti/deicsonze/deicsonzegui.ui | 15 |
4 files changed, 118 insertions, 96 deletions
diff --git a/muse/ChangeLog b/muse/ChangeLog index ce0fa10a..5db277da 100644 --- a/muse/ChangeLog +++ b/muse/ChangeLog @@ -1,3 +1,5 @@ +08.12 (ng) deicsonze + - fix LFO and Ctrl modulation 07.12 (ws) - xml lib cleanups 06.12 (ng) deicsonze diff --git a/muse/synti/deicsonze/TODO b/muse/synti/deicsonze/TODO index 06bb119d..ba2303bd 100644 --- a/muse/synti/deicsonze/TODO +++ b/muse/synti/deicsonze/TODO @@ -1,4 +1,4 @@ -- Fix LFO Delay bug and modulation CTRL +- Fix sync - Eg Rate Scaling - Foot Control, Modulation Wheel, Breath Control, After Touch - analogue reverb diff --git a/muse/synti/deicsonze/deicsonze.cpp b/muse/synti/deicsonze/deicsonze.cpp index db033da1..908dc1f5 100644 --- a/muse/synti/deicsonze/deicsonze.cpp +++ b/muse/synti/deicsonze/deicsonze.cpp @@ -852,18 +852,48 @@ void DeicsOnze::setLfo(int c/*channel*/) _global.channel[c].lfoMaxIndex = (_global.channel[c].lfoFreq==0?0:(int)((1.0/_global.channel[c].lfoFreq) *(double)_global.deiSampleRate)); - _global.channel[c].lfoPitch = - (((double)_preset[c]->lfo.pModDepth/(double)MAXPMODDEPTH) - *(COEFPLFO(_preset[c]->sensitivity.pitch))); + double totalpDepth = + ((double)_preset[c]->lfo.pModDepth + + (((double)_global.channel[c].modulation)/127.0) + * ((double)(MAXPMODDEPTH - _preset[c]->lfo.pModDepth)) + )/(double)MAXPMODDEPTH; + _global.channel[c].lfoPitch = + totalpDepth * (COEFPLFO(_preset[c]->sensitivity.pitch)); //Amplitude LFO + double totalaDepth = + ((double)_preset[c]->lfo.aModDepth + + (((double)_global.channel[c].modulation)/127.0) + * ((double)(MAXAMODDEPTH - _preset[c]->lfo.aModDepth)) + )/(double)MAXAMODDEPTH; _global.channel[c].lfoMaxAmp = - (((double)_preset[c]->lfo.aModDepth/(double)MAXAMODDEPTH) - *(COEFALFO(_preset[c]->sensitivity.amplitude))); + totalaDepth * (COEFALFO(_preset[c]->sensitivity.amplitude)); //index is concidered on the frequency of the delay _global.channel[c].lfoDelayMaxIndex = delay2Time(_preset[c]->lfo.delay)*_global.channel[c].lfoFreq; _global.channel[c].lfoDelayInct = (double)(RESOLUTION/4)/_global.channel[c].lfoDelayMaxIndex; + + //update the actuall values controlling the modulation now + if(_global.channel[c].lfoDelayIndex<(double)(RESOLUTION/4)) { + double delayCoef = + (double)waveTable[0][(int)_global.channel[c].lfoDelayIndex]; + _global.channel[c].lfoMaxCoefInct = + exp((log(2.0)/12.0)*_global.channel[c].lfoPitch*delayCoef); + _global.channel[c].lfoCoefInctInct = + exp((log(2.0)/12.0)*((2*_global.channel[c].lfoPitch*delayCoef) + /_global.channel[c].lfoMaxIndex)); + _global.channel[c].lfoDelayIndex += _global.channel[c].lfoDelayInct; + _global.channel[c].lfoMaxDAmp = delayCoef*_global.channel[c].lfoMaxAmp; + } + else + if(_global.channel[c].delayPassed) { + _global.channel[c].lfoMaxCoefInct = + exp((log(2.0)/12.0)*_global.channel[c].lfoPitch); + _global.channel[c].lfoCoefInctInct= + exp((log(2.0)/12.0)*((2*_global.channel[c].lfoPitch) + /_global.channel[c].lfoMaxIndex)); + _global.channel[c].lfoMaxDAmp=_global.channel[c].lfoMaxAmp; + } } //----------------------------------------------------------------- @@ -1452,93 +1482,79 @@ inline double pitch2freq(double p) { inline void lfoUpdate(Preset* p, Channel* p_c, float* wt) { double delayCoef; - if(p_c->lfoIndex==0) - { - if(p_c->lfoDelayIndex<(double)(RESOLUTION/4)) - { - delayCoef=(double)wt[(int)p_c->lfoDelayIndex]; - p_c->lfoMaxCoefInct=exp((log(2.0)/12.0)*p_c->lfoPitch*delayCoef); - p_c->lfoCoefInctInct= - exp((log(2.0)/12.0)*((2*p_c->lfoPitch*delayCoef) - /p_c->lfoMaxIndex)); - p_c->lfoDelayIndex+=p_c->lfoDelayInct; - p_c->lfoMaxDAmp=delayCoef*p_c->lfoMaxAmp; - } - else - if(!p_c->delayPassed) - { - p_c->lfoMaxCoefInct=exp((log(2.0)/12.0)*p_c->lfoPitch); - p_c->lfoCoefInctInct= - exp((log(2.0)/12.0)*((2*p_c->lfoPitch)/p_c->lfoMaxIndex)); - p_c->delayPassed=true; - p_c->lfoMaxDAmp=p_c->lfoMaxDAmp; - } + if(p_c->lfoIndex==0 || p_c->lfoIndex==p_c->lfoMaxIndex/2) { + if(p_c->lfoDelayIndex<(double)(RESOLUTION/4)) { + delayCoef=(double)wt[(int)p_c->lfoDelayIndex]; + p_c->lfoMaxCoefInct=exp((log(2.0)/12.0)*p_c->lfoPitch*delayCoef); + p_c->lfoCoefInctInct= + exp((log(2.0)/12.0)*((2*p_c->lfoPitch*delayCoef)/p_c->lfoMaxIndex)); + p_c->lfoDelayIndex+=p_c->lfoDelayInct; + p_c->lfoMaxDAmp=delayCoef*p_c->lfoMaxAmp; } + else + if(!p_c->delayPassed) { + p_c->lfoMaxCoefInct=exp((log(2.0)/12.0)*p_c->lfoPitch); + p_c->lfoCoefInctInct= + exp((log(2.0)/12.0)*((2*p_c->lfoPitch)/p_c->lfoMaxIndex)); + p_c->delayPassed=true; + p_c->lfoMaxDAmp=p_c->lfoMaxAmp; + } + } - switch(p->lfo.wave) - { - case SAWUP : - if(p_c->lfoIndex==0) - { - p_c->lfoCoefInct=1.0/(p_c->lfoMaxCoefInct); - p_c->lfoCoefAmp=p_c->lfoMaxDAmp/(double)p_c->lfoMaxIndex; - p_c->lfoAmp=1.0; - } - else - { - p_c->lfoCoefInct*=p_c->lfoCoefInctInct; - p_c->lfoAmp-=p_c->lfoCoefAmp; - } - break; - case SQUARE : - if(p_c->lfoIndex==0) - { - p_c->lfoCoefInct=p_c->lfoMaxCoefInct; - p_c->lfoAmp=1.0; - } - if(p_c->lfoIndex==(p_c->lfoMaxIndex/2)) - { - p_c->lfoCoefInct=1.0/p_c->lfoMaxCoefInct; - p_c->lfoAmp=1.0-p_c->lfoMaxDAmp; - } - break; - case TRIANGL : - if(p_c->lfoIndex==0) - { - p_c->lfoCoefInct=1.0; - p_c->lfoCoefAmp=p_c->lfoMaxDAmp - /(double)(p_c->lfoMaxIndex/2); - p_c->lfoAmp=1.0-p_c->lfoMaxDAmp/2.0; - } - else if(p_c->lfoIndex<(p_c->lfoMaxIndex/4)) - { - p_c->lfoCoefInct*=p_c->lfoCoefInctInct; - p_c->lfoAmp-=p_c->lfoCoefAmp; - } - else if(p_c->lfoIndex<((3*p_c->lfoMaxIndex)/4)) - { - p_c->lfoCoefInct/=p_c->lfoCoefInctInct; - p_c->lfoAmp+=p_c->lfoCoefAmp; - } - else if(p_c->lfoIndex<p_c->lfoMaxIndex) - { - p_c->lfoCoefInct*=p_c->lfoCoefInctInct; - p_c->lfoAmp-=p_c->lfoCoefAmp; - } - break; - case SHOLD : - if(p_c->lfoIndex==0||p_c->lfoIndex==(p_c->lfoMaxIndex/2)) - { - double r;//uniform random between -1.0 and 1.0 - r = (double)(2*rand()-RAND_MAX)/(double)RAND_MAX; - p_c->lfoCoefInct=(r>=0.0?1.0+r*(p_c->lfoMaxCoefInct-1.0) - :1.0/(1.0-r*(p_c->lfoMaxCoefInct-1.0))); - p_c->lfoAmp=1.0-(r/2.0+0.5)*p_c->lfoMaxDAmp; - } - break; - default : printf("Error : lfo wave does not exist\n"); - break; + switch(p->lfo.wave) { + case SAWUP : + if(p_c->lfoIndex==0) { + p_c->lfoCoefInct=1.0/(p_c->lfoMaxCoefInct); + p_c->lfoCoefAmp=p_c->lfoMaxDAmp/(double)p_c->lfoMaxIndex; + p_c->lfoAmp=1.0; } + else { + p_c->lfoCoefInct*=p_c->lfoCoefInctInct; + p_c->lfoAmp-=p_c->lfoCoefAmp; + } + break; + case SQUARE : + if(p_c->lfoIndex==0) { + p_c->lfoCoefInct=p_c->lfoMaxCoefInct; + p_c->lfoAmp=1.0; + } + if(p_c->lfoIndex==(p_c->lfoMaxIndex/2)) { + p_c->lfoCoefInct=1.0/p_c->lfoMaxCoefInct; + p_c->lfoAmp=1.0-p_c->lfoMaxDAmp; + } + break; + case TRIANGL : + if(p_c->lfoIndex==0) { + p_c->lfoCoefInct=1.0; + p_c->lfoCoefAmp=p_c->lfoMaxDAmp + /(double)(p_c->lfoMaxIndex/2); + p_c->lfoAmp=1.0-p_c->lfoMaxDAmp/2.0; + } + else if(p_c->lfoIndex<(p_c->lfoMaxIndex/4)) { + p_c->lfoCoefInct*=p_c->lfoCoefInctInct; + p_c->lfoAmp-=p_c->lfoCoefAmp; + } + else if(p_c->lfoIndex<((3*p_c->lfoMaxIndex)/4)) { + p_c->lfoCoefInct/=p_c->lfoCoefInctInct; + p_c->lfoAmp+=p_c->lfoCoefAmp; + } + else if(p_c->lfoIndex<p_c->lfoMaxIndex) { + p_c->lfoCoefInct*=p_c->lfoCoefInctInct; + p_c->lfoAmp-=p_c->lfoCoefAmp; + } + break; + case SHOLD : + if(p_c->lfoIndex==0||p_c->lfoIndex==(p_c->lfoMaxIndex/2)) { + double r;//uniform random between -1.0 and 1.0 + r = (double)(2*rand()-RAND_MAX)/(double)RAND_MAX; + p_c->lfoCoefInct=(r>=0.0?1.0+r*(p_c->lfoMaxCoefInct-1.0) + :1.0/(1.0-r*(p_c->lfoMaxCoefInct-1.0))); + p_c->lfoAmp=1.0-(r/2.0+0.5)*p_c->lfoMaxDAmp; + } + break; + default : printf("Error : lfo wave does not exist\n"); + break; + } p_c->lfoIndex=(p_c->lfoIndex<p_c->lfoMaxIndex?p_c->lfoIndex+1:0); } @@ -1869,6 +1885,7 @@ void DeicsOnze::programSelect(int c, int hbank, int lbank, int prog) { //--------------------------------------------------------- void DeicsOnze::setModulation(int c, int val) { _global.channel[c].modulation = (unsigned char) val; + setLfo(c); } //--------------------------------------------------------- // setPitchBendCoef diff --git a/muse/synti/deicsonze/deicsonzegui.ui b/muse/synti/deicsonze/deicsonzegui.ui index 14fab8b0..289aa057 100644 --- a/muse/synti/deicsonze/deicsonzegui.ui +++ b/muse/synti/deicsonze/deicsonzegui.ui @@ -5363,6 +5363,9 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin </item> <item row="2" column="2" > <widget class="QGroupBox" name="reverbGroupBox" > + <property name="enabled" > + <bool>false</bool> + </property> <property name="title" > <string>Reverb</string> </property> @@ -7000,7 +7003,7 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin </size> </property> <property name="value" > - <double>-9.319760856591806</double> + <double>-8.748632009724199</double> </property> <property name="minValue" > <double>0.000000000000000</double> @@ -7024,15 +7027,15 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <layoutdefault spacing="6" margin="11" /> <customwidgets> <customwidget> - <class>Awl::VolKnob</class> - <extends>Awl::Knob</extends> - <header>awl/volknob.h</header> - </customwidget> - <customwidget> <class>Awl::Knob</class> <extends>QWidget</extends> <header>awl/knob.h</header> </customwidget> + <customwidget> + <class>Awl::VolKnob</class> + <extends>Awl::Knob</extends> + <header>awl/volknob.h</header> + </customwidget> </customwidgets> <tabstops> <tabstop>deicsOnzeTabWidget</tabstop> |