From 2c1f2f49d2ac878c13f9c59d86166a62bbd7573d Mon Sep 17 00:00:00 2001 From: "Tim E. Real" Date: Wed, 8 May 2013 08:52:52 +0000 Subject: Yet another MAJOR audio engine and plugin/synth process chain re-write. And much more, see ChangeLog, May 8 2013. --- muse2/synti/deicsonze/deicsonze.cpp | 83 ++++++++++++++++++------------- muse2/synti/deicsonze/deicsonze.h | 2 +- muse2/synti/deicsonze/deicsonzeplugin.cpp | 59 ++++++++++++---------- muse2/synti/deicsonze/deicsonzepreset.h | 4 +- 4 files changed, 87 insertions(+), 61 deletions(-) (limited to 'muse2/synti/deicsonze') diff --git a/muse2/synti/deicsonze/deicsonze.cpp b/muse2/synti/deicsonze/deicsonze.cpp index ef5644fa..1051c9eb 100644 --- a/muse2/synti/deicsonze/deicsonze.cpp +++ b/muse2/synti/deicsonze/deicsonze.cpp @@ -4096,7 +4096,7 @@ void DeicsOnze::processMessages() // write // synthesize n samples into buffer+offset //--------------------------------------------------------- -void DeicsOnze::process(float** buffer, int offset, int n) { +void DeicsOnze::process(unsigned pos, float** buffer, int offset, int n) { /* //Process messages from the gui while (_gui->fifoSize()) { @@ -4432,46 +4432,61 @@ void DeicsOnze::process(float** buffer, int offset, int n) { //apply Filter if(_global.filter) _dryFilter->process(leftOutput, rightOutput, n); //Chorus - if(_pluginIChorus && _global.isChorusActivated) { - //apply Filter - if(_global.filter) _chorusFilter->process(tempOutputChorus[0], - tempOutputChorus[1], n); - //apply Chorus - _pluginIChorus->apply(n, 2, tempInputChorus, tempOutputChorus); - for(int i = 0; i < n; i++) { - leftOutput[i] += - tempOutputChorus[0][i] * _global.chorusReturn * _global.masterVolume; - rightOutput[i] += - tempOutputChorus[1][i] * _global.chorusReturn * _global.masterVolume; + if(_pluginIChorus) { + if(_global.isChorusActivated) + { + //apply Filter + if(_global.filter) _chorusFilter->process(tempOutputChorus[0], + tempOutputChorus[1], n); + //apply Chorus + _pluginIChorus->apply(pos, n, 2, tempInputChorus, tempOutputChorus); + for(int i = 0; i < n; i++) { + leftOutput[i] += + tempOutputChorus[0][i] * _global.chorusReturn * _global.masterVolume; + rightOutput[i] += + tempOutputChorus[1][i] * _global.chorusReturn * _global.masterVolume; + } } + else + _pluginIChorus->apply(pos, n, 0, 0, 0); // Just process controls only, not audio (do not 'run'). Tim. } //Reverb - if(_pluginIReverb && _global.isReverbActivated) { - //apply Filter - if(_global.filter) _reverbFilter->process(tempOutputReverb[0], - tempOutputReverb[1], n); - //apply Reverb - _pluginIReverb->apply(n, 2, tempInputReverb, tempOutputReverb); - for(int i = 0; i < n; i++) { - leftOutput[i] += - tempOutputReverb[0][i] * _global.reverbReturn * _global.masterVolume; - rightOutput[i] += - tempOutputReverb[1][i] * _global.reverbReturn * _global.masterVolume; + if(_pluginIReverb) { + if(_global.isReverbActivated) + { + //apply Filter + if(_global.filter) _reverbFilter->process(tempOutputReverb[0], + tempOutputReverb[1], n); + //apply Reverb + _pluginIReverb->apply(pos, n, 2, tempInputReverb, tempOutputReverb); + for(int i = 0; i < n; i++) { + leftOutput[i] += + tempOutputReverb[0][i] * _global.reverbReturn * _global.masterVolume; + rightOutput[i] += + tempOutputReverb[1][i] * _global.reverbReturn * _global.masterVolume; + } } + else + _pluginIReverb->apply(pos, n, 0, 0, 0); // Just process controls only, not audio (do not 'run'). Tim. } //Delay - if(_pluginIDelay && _global.isDelayActivated) { - //apply Filter - if(_global.filter) _delayFilter->process(tempOutputDelay[0], - tempOutputDelay[1], n); - //apply Delay - _pluginIDelay->apply(n, 2, tempInputDelay, tempOutputDelay); - for(int i = 0; i < n; i++) { - leftOutput[i] += - tempOutputDelay[0][i] * _global.delayReturn * _global.masterVolume; - rightOutput[i] += - tempOutputDelay[1][i] * _global.delayReturn * _global.masterVolume; + if(_pluginIDelay) { + if(_global.isDelayActivated) + { + //apply Filter + if(_global.filter) _delayFilter->process(tempOutputDelay[0], + tempOutputDelay[1], n); + //apply Delay + _pluginIDelay->apply(pos, n, 2, tempInputDelay, tempOutputDelay); + for(int i = 0; i < n; i++) { + leftOutput[i] += + tempOutputDelay[0][i] * _global.delayReturn * _global.masterVolume; + rightOutput[i] += + tempOutputDelay[1][i] * _global.delayReturn * _global.masterVolume; + } } + else + _pluginIDelay->apply(pos, n, 0, 0, 0); // Just process controls only, not audio (do not 'run'). Tim. } } diff --git a/muse2/synti/deicsonze/deicsonze.h b/muse2/synti/deicsonze/deicsonze.h index 2df235e3..cf4b444b 100644 --- a/muse2/synti/deicsonze/deicsonze.h +++ b/muse2/synti/deicsonze/deicsonze.h @@ -604,7 +604,7 @@ class DeicsOnze : public Mess { virtual bool playNote(int channel, int pitch, int velo); virtual void processMessages(); - virtual void process(float** buffer, int offset, int n); + virtual void process(unsigned pos, float** buffer, int offset, int n); // GUI interface routines //virtual bool hasGui() const { return true; } diff --git a/muse2/synti/deicsonze/deicsonzeplugin.cpp b/muse2/synti/deicsonze/deicsonzeplugin.cpp index a9eec657..ba25e58a 100644 --- a/muse2/synti/deicsonze/deicsonzeplugin.cpp +++ b/muse2/synti/deicsonze/deicsonzeplugin.cpp @@ -125,7 +125,8 @@ void DeicsOnze::initPluginDelay(MusECore::Plugin* pluginDelay) { */ //setChorusParam(i, pluginDelay->defaultValue(i)); - setDelayParam(i, _pluginIDelay->defaultValue(i)); + //setDelayParam(i, _pluginIDelay->defaultValue(i)); + _pluginIDelay->putParam(i, _pluginIDelay->defaultValue(i)); } //setDelayDryWet(1); @@ -406,36 +407,44 @@ void DeicsOnzeGui::buildGuiChorus() { //of the parameter because it sends a double and does not //change any thing void DeicsOnzeGui::setReverbCheckBox(double v, int i) { - if(i>=256) { - printf("setReverbCheckBox Error : controller index >= 256\n"); - return; - } - float f = (float)v; - unsigned char message[sizeof(float)+4]; - message[0]=MUSE_SYNTH_SYSEX_MFG_ID; - message[1]=DEICSONZE_UNIQUE_ID; - message[2]=SYSEX_REVERBPARAM; - message[3]=(unsigned char)i; - memcpy(&message[4], &f, sizeof(float)); - sendSysex(message, sizeof(float)+4); +// REMOVE Tim. Or keep. TESTING... +// if(i>=256) { +// printf("setReverbCheckBox Error : controller index >= 256\n"); +// return; +// } +// float f = (float)v; +// unsigned char message[sizeof(float)+4]; +// message[0]=MUSE_SYNTH_SYSEX_MFG_ID; +// message[1]=DEICSONZE_UNIQUE_ID; +// message[2]=SYSEX_REVERBPARAM; +// message[3]=(unsigned char)i; +// memcpy(&message[4], &f, sizeof(float)); +// sendSysex(message, sizeof(float)+4); + + // Putting directly to the control FIFO without SYSEX should be OK. Tim. + _deicsOnze->setReverbParam(i, v); } //setChorusCheckBox is used, by the way, to send the value //of the parameter because it sends a double and does not //change any thing void DeicsOnzeGui::setChorusCheckBox(double v, int i) { - if(i>=256) { - printf("setChorusCheckBox Error : controller index >= 256\n"); - return; - } - float f = (float)v; - unsigned char message[sizeof(float)+4]; - message[0]=MUSE_SYNTH_SYSEX_MFG_ID; - message[1]=DEICSONZE_UNIQUE_ID; - message[2]=SYSEX_CHORUSPARAM; - message[3]=(unsigned char)i; - memcpy(&message[4], &f, sizeof(float)); - sendSysex(message, sizeof(float)+4); +// REMOVE Tim. Or keep. TESTING... +// if(i>=256) { +// printf("setChorusCheckBox Error : controller index >= 256\n"); +// return; +// } +// float f = (float)v; +// unsigned char message[sizeof(float)+4]; +// message[0]=MUSE_SYNTH_SYSEX_MFG_ID; +// message[1]=DEICSONZE_UNIQUE_ID; +// message[2]=SYSEX_CHORUSPARAM; +// message[3]=(unsigned char)i; +// memcpy(&message[4], &f, sizeof(float)); +// sendSysex(message, sizeof(float)+4); + + // Putting directly to the control FIFO without SYSEX should be OK. Tim. + _deicsOnze->setChorusParam(i, v); } void DeicsOnzeGui::setReverbFloatEntry(double v, int i) { diff --git a/muse2/synti/deicsonze/deicsonzepreset.h b/muse2/synti/deicsonze/deicsonzepreset.h index e9bfb185..637350e9 100644 --- a/muse2/synti/deicsonze/deicsonzepreset.h +++ b/muse2/synti/deicsonze/deicsonzepreset.h @@ -33,6 +33,7 @@ #include #include #include "al/xml.h" +#include "muse/midictrl.h" #define NBROP 4 //do not change #define MAXCHARTAG 64 @@ -46,7 +47,8 @@ // number of ctrl // following the internal DX11 organization (c.f T81Z manual) //--------------------------------------------------------- -#define CTRLOFFSET 0x100 +//#define CTRLOFFSET 0x100 +#define CTRLOFFSET (MusECore::CTRL_NRPN14_OFFSET) #define DECAPAR1 13 #define ARSTR "AR" #define ARLONGSTR "AttackRate" -- cgit v1.2.3