diff options
author | Tim E. Real <termtech@rogers.com> | 2013-05-08 08:52:52 +0000 |
---|---|---|
committer | Tim E. Real <termtech@rogers.com> | 2013-05-08 08:52:52 +0000 |
commit | 2c1f2f49d2ac878c13f9c59d86166a62bbd7573d (patch) | |
tree | 96bb20b3f43823fa51cf49cfa25fae49f73882ce /muse2/synti | |
parent | 8a491e19e6520f2680bf51aec1ca7e2070ccaec7 (diff) |
Yet another MAJOR audio engine and plugin/synth process chain re-write.
And much more, see ChangeLog, May 8 2013.
Diffstat (limited to 'muse2/synti')
-rw-r--r-- | muse2/synti/deicsonze/deicsonze.cpp | 83 | ||||
-rw-r--r-- | muse2/synti/deicsonze/deicsonze.h | 2 | ||||
-rw-r--r-- | muse2/synti/deicsonze/deicsonzeplugin.cpp | 59 | ||||
-rw-r--r-- | muse2/synti/deicsonze/deicsonzepreset.h | 4 | ||||
-rw-r--r-- | muse2/synti/fluid/fluid.cpp | 2 | ||||
-rw-r--r-- | muse2/synti/fluid/fluid.h | 2 | ||||
-rw-r--r-- | muse2/synti/fluidsynth/fluidsynti.cpp | 2 | ||||
-rw-r--r-- | muse2/synti/fluidsynth/fluidsynti.h | 2 | ||||
-rw-r--r-- | muse2/synti/libsynti/mess.cpp | 2 | ||||
-rw-r--r-- | muse2/synti/libsynti/mess.h | 2 | ||||
-rw-r--r-- | muse2/synti/organ/organ.cpp | 2 | ||||
-rw-r--r-- | muse2/synti/organ/organ.h | 2 | ||||
-rw-r--r-- | muse2/synti/s1/s1.cpp | 4 | ||||
-rw-r--r-- | muse2/synti/simpledrums2/simpledrums.cpp | 2 | ||||
-rw-r--r-- | muse2/synti/simpledrums2/simpledrums.h | 2 | ||||
-rw-r--r-- | muse2/synti/vam/vam.cpp | 4 |
16 files changed, 102 insertions, 74 deletions
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 <vector> #include <string> #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" diff --git a/muse2/synti/fluid/fluid.cpp b/muse2/synti/fluid/fluid.cpp index 5ee3835f..81d914eb 100644 --- a/muse2/synti/fluid/fluid.cpp +++ b/muse2/synti/fluid/fluid.cpp @@ -355,7 +355,7 @@ void ISynth::processMessages() // Called from host, ONLY if output path is connected. //--------------------------------------------------------- -void ISynth::process(float** ports, int offset, int n) +void ISynth::process(unsigned /*pos*/, float** ports, int offset, int n) { if (!_busy) { /* diff --git a/muse2/synti/fluid/fluid.h b/muse2/synti/fluid/fluid.h index a9891f3f..152af2d8 100644 --- a/muse2/synti/fluid/fluid.h +++ b/muse2/synti/fluid/fluid.h @@ -70,7 +70,7 @@ class ISynth : public Mess { void resetAllController(int); virtual void processMessages(); - virtual void process(float**, int, int); + virtual void process(unsigned pos, float**, int, int); virtual bool playNote(int channel, int pitch, int velo); virtual bool setController(int, int, int); virtual bool sysex(int len, const unsigned char* p); diff --git a/muse2/synti/fluidsynth/fluidsynti.cpp b/muse2/synti/fluidsynth/fluidsynti.cpp index eddedc87..2e19b79a 100644 --- a/muse2/synti/fluidsynth/fluidsynti.cpp +++ b/muse2/synti/fluidsynth/fluidsynti.cpp @@ -220,7 +220,7 @@ void FluidSynth::processMessages() // Called from host, ONLY if output path is connected. //--------------------------------------------------------- -void FluidSynth::process(float** ports, int offset, int len) +void FluidSynth::process(unsigned /*pos*/, float** ports, int offset, int len) { /* //Process messages from the gui diff --git a/muse2/synti/fluidsynth/fluidsynti.h b/muse2/synti/fluidsynth/fluidsynti.h index ca24f6f8..19d682c8 100644 --- a/muse2/synti/fluidsynth/fluidsynti.h +++ b/muse2/synti/fluidsynth/fluidsynti.h @@ -132,7 +132,7 @@ public: // This is only a kludge required to support old songs' midistates. Do not use in any new synth. virtual int oldMidiStateHeader(const unsigned char** data) const; virtual void processMessages(); - virtual void process(float**, int, int); + virtual void process(unsigned pos, float**, int, int); virtual bool playNote(int channel, int pitch, int velo); virtual bool sysex(int, const unsigned char*); virtual bool setController(int, int, int); diff --git a/muse2/synti/libsynti/mess.cpp b/muse2/synti/libsynti/mess.cpp index de24ac00..08dc8223 100644 --- a/muse2/synti/libsynti/mess.cpp +++ b/muse2/synti/libsynti/mess.cpp @@ -149,6 +149,8 @@ bool Mess::processEvent(const MusECore::MidiPlayEvent& ev) return setController(ev.channel(), MusECore::CTRL_PITCH, ev.dataA()); case MusECore::ME_AFTERTOUCH: return setController(ev.channel(), MusECore::CTRL_AFTERTOUCH, ev.dataA()); + case MusECore::ME_PROGRAM: + return setController(ev.channel(), MusECore::CTRL_PROGRAM, ev.dataA()); } return false; } diff --git a/muse2/synti/libsynti/mess.h b/muse2/synti/libsynti/mess.h index db74c1c8..66022bf7 100644 --- a/muse2/synti/libsynti/mess.h +++ b/muse2/synti/libsynti/mess.h @@ -76,7 +76,7 @@ class Mess { void setSampleRate(int r) { _sampleRate = r; } virtual void processMessages() { }; - virtual void process(float** data, int offset, int len) = 0; + virtual void process(unsigned pos, float** data, int offset, int len) = 0; // the synti has to (re-)implement processEvent() or provide // some of the next three functions: diff --git a/muse2/synti/organ/organ.cpp b/muse2/synti/organ/organ.cpp index fdcd02aa..93b4c8cf 100644 --- a/muse2/synti/organ/organ.cpp +++ b/muse2/synti/organ/organ.cpp @@ -230,7 +230,7 @@ void Organ::processMessages() // Called from host, ONLY if output path is connected. //--------------------------------------------------------- -void Organ::process(float** ports, int offset, int sampleCount) +void Organ::process(unsigned /*pos*/, float** ports, int offset, int sampleCount) { /* // diff --git a/muse2/synti/organ/organ.h b/muse2/synti/organ/organ.h index 8a7de162..9ca4bbd0 100644 --- a/muse2/synti/organ/organ.h +++ b/muse2/synti/organ/organ.h @@ -193,7 +193,7 @@ class Organ : public Mess { public: virtual void processMessages(); - virtual void process(float**, int, int); + virtual void process(unsigned pos, float**, int, int); virtual bool playNote(int channel, int pitch, int velo); virtual bool setController(int channel, int ctrl, int val); diff --git a/muse2/synti/s1/s1.cpp b/muse2/synti/s1/s1.cpp index 8dd40ff8..890acdf9 100644 --- a/muse2/synti/s1/s1.cpp +++ b/muse2/synti/s1/s1.cpp @@ -59,7 +59,7 @@ class S1 : public MessMono { virtual void note(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); //virtual bool hasGui() const { return true; } //virtual bool guiVisible() const { return _showGui; } //virtual void showGui(bool); @@ -143,7 +143,7 @@ void S1::note(int /*channel*/, int pitch, int velo) // synthesize n samples into buffer+offset //--------------------------------------------------------- -void S1::process(float** buffer, int offset, int n) +void S1::process(unsigned /*pos*/, float** buffer, int offset, int n) { if (gate == 0) return; diff --git a/muse2/synti/simpledrums2/simpledrums.cpp b/muse2/synti/simpledrums2/simpledrums.cpp index a0d2b75b..734a6feb 100644 --- a/muse2/synti/simpledrums2/simpledrums.cpp +++ b/muse2/synti/simpledrums2/simpledrums.cpp @@ -812,7 +812,7 @@ void SimpleSynth::processMessages() \param len - nr of samples to process */ //--------------------------------------------------------- -void SimpleSynth::process(float** out, int offset, int len) +void SimpleSynth::process(unsigned /*pos*/, float** out, int offset, int len) { /* //Process messages from the gui diff --git a/muse2/synti/simpledrums2/simpledrums.h b/muse2/synti/simpledrums2/simpledrums.h index f4bf27ee..fdeaa946 100644 --- a/muse2/synti/simpledrums2/simpledrums.h +++ b/muse2/synti/simpledrums2/simpledrums.h @@ -147,7 +147,7 @@ class SimpleSynth : public Mess virtual const MidiPatch* getPatchInfo(int arg1, const MidiPatch* arg2) const; virtual int getControllerInfo(int arg1, const char** arg2, int* arg3, int* arg4, int* arg5, int* arg6) const; virtual void processMessages(); - virtual void process(float** data, int offset, int len); + virtual void process(unsigned pos, float** data, int offset, int len); //virtual void showGui(bool arg1); virtual void showNativeGui(bool arg1); ///virtual void getInitData(int*, const unsigned char**) const; diff --git a/muse2/synti/vam/vam.cpp b/muse2/synti/vam/vam.cpp index 713d8a59..c194a3a5 100644 --- a/muse2/synti/vam/vam.cpp +++ b/muse2/synti/vam/vam.cpp @@ -206,7 +206,7 @@ class VAM : public MessMono { virtual void getNativeGeometry(int* x, int* y, int* w, int* h) const; virtual void setNativeGeometry(int x, int y, int w, int h); virtual void processMessages(); - virtual void process(float**, int, int); + virtual void process(unsigned pos, float**, int, int); virtual void note(int channel, int pitch, int velo); virtual bool setController(int channel, int ctrl, int val); virtual bool sysex(int, const unsigned char*); @@ -471,7 +471,7 @@ void VAM::processMessages() // Called from host, ONLY if output path is connected. //--------------------------------------------------------- -void VAM::process(float** ports, int offset, int sampleCount) +void VAM::process(unsigned /*pos*/, float** ports, int offset, int sampleCount) { /* // |