From 4fbdf88bfb0ce05b44c53f270af863273228e61a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 15 Mar 2011 04:19:00 +0000 Subject: Convert to UNIX line ends. git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/mdala.lv2@3088 a436a847-0d15-0410-975c-d299462d15a1 --- src/mdaBandisto.h | 116 +-- src/mdaBeatBox.h | 156 ++-- src/mdaCombo.h | 138 ++-- src/mdaDeEss.h | 108 +-- src/mdaDegrade.h | 124 ++-- src/mdaDelay.h | 128 ++-- src/mdaDetune.h | 148 ++-- src/mdaDither.h | 124 ++-- src/mdaDubDelay.h | 134 ++-- src/mdaDynamics.h | 128 ++-- src/mdaImage.h | 118 +-- src/mdaJX10.cpp | 2020 +++++++++++++++++++++++++-------------------------- src/mdaJX10.h | 314 ++++---- src/mdaLimiter.h | 114 +-- src/mdaLooplex.cpp | 38 +- src/mdaLoudness.h | 144 ++-- src/mdaMultiBand.h | 118 +-- src/mdaOverdrive.h | 116 +-- src/mdaRePsycho.h | 126 ++-- src/mdaRezFilter.h | 138 ++-- src/mdaRingMod.h | 120 +-- src/mdaRoundPan.h | 120 +-- src/mdaShepard.h | 118 +-- src/mdaSpecMeter.h | 174 ++--- src/mdaSplitter.h | 166 ++--- src/mdaStereo.h | 126 ++-- src/mdaSubSynth.cpp | 760 +++++++++---------- src/mdaSubSynth.h | 118 +-- src/mdaTalkBox.h | 170 ++--- src/mdaThruZero.h | 150 ++-- src/mdaTracker.h | 132 ++-- src/mdaTransient.h | 118 +-- src/mdaVocInput.h | 168 ++--- src/mdaVocoder.h | 160 ++-- 34 files changed, 3575 insertions(+), 3575 deletions(-) (limited to 'src') diff --git a/src/mdaBandisto.h b/src/mdaBandisto.h index 042033b..2e8463a 100644 --- a/src/mdaBandisto.h +++ b/src/mdaBandisto.h @@ -1,58 +1,58 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaBandisto_H -#define __mdaBandisto_H - -#include "audioeffectx.h" - -class mdaBandisto : public AudioEffectX -{ -public: - mdaBandisto(audioMasterCallback audioMaster); - ~mdaBandisto(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1, fParam2, fParam3, fParam4; - float fParam5, fParam6, fParam7, fParam8; - float fParam9, fParam10; - float gain1, driv1, trim1; - float gain2, driv2, trim2; - float gain3, driv3, trim3; - float fi1, fb1, fo1, fi2, fb2, fo2, fb3, slev; - int valve; - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaBandisto_H +#define __mdaBandisto_H + +#include "audioeffectx.h" + +class mdaBandisto : public AudioEffectX +{ +public: + mdaBandisto(audioMasterCallback audioMaster); + ~mdaBandisto(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1, fParam2, fParam3, fParam4; + float fParam5, fParam6, fParam7, fParam8; + float fParam9, fParam10; + float gain1, driv1, trim1; + float gain2, driv2, trim2; + float gain3, driv3, trim3; + float fi1, fb1, fo1, fi2, fb2, fo2, fb3, slev; + int valve; + char programName[32]; +}; + +#endif diff --git a/src/mdaBeatBox.h b/src/mdaBeatBox.h index 9d02fff..414e5d2 100644 --- a/src/mdaBeatBox.h +++ b/src/mdaBeatBox.h @@ -1,78 +1,78 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaBeatBox_H -#define __mdaBeatBox_H - -#include "audioeffectx.h" - -class mdaBeatBox : public AudioEffectX -{ -public: - mdaBeatBox(audioMasterCallback audioMaster); - ~mdaBeatBox(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - virtual void synth(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fParam5; - float fParam6; - float fParam7; - float fParam8; - float fParam9; - float fParam10; - float fParam11; - float fParam12; - float hthr, hfil, sthr, kthr, kfil1, kfil2, mix; - float klev, hlev, slev; - float ww, wwx, sb1, sb2, sf1, sf2, sf3; - float kww, kwwx, ksb1, ksb2, ksf1, ksf2; - float dyne, dyna, dynr, dynm; - - float *hbuf; - float *kbuf; - float *sbuf, *sbuf2; - LvzInt32 hbuflen, hbufpos, hdel; - LvzInt32 sbuflen, sbufpos, sdel, sfx; - LvzInt32 kbuflen, kbufpos, kdel, ksfx; - LvzInt32 rec, recx, recpos; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaBeatBox_H +#define __mdaBeatBox_H + +#include "audioeffectx.h" + +class mdaBeatBox : public AudioEffectX +{ +public: + mdaBeatBox(audioMasterCallback audioMaster); + ~mdaBeatBox(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + virtual void synth(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fParam5; + float fParam6; + float fParam7; + float fParam8; + float fParam9; + float fParam10; + float fParam11; + float fParam12; + float hthr, hfil, sthr, kthr, kfil1, kfil2, mix; + float klev, hlev, slev; + float ww, wwx, sb1, sb2, sf1, sf2, sf3; + float kww, kwwx, ksb1, ksb2, ksf1, ksf2; + float dyne, dyna, dynr, dynm; + + float *hbuf; + float *kbuf; + float *sbuf, *sbuf2; + LvzInt32 hbuflen, hbufpos, hdel; + LvzInt32 sbuflen, sbufpos, sdel, sfx; + LvzInt32 kbuflen, kbufpos, kdel, ksfx; + LvzInt32 rec, recx, recpos; + + char programName[32]; +}; + +#endif diff --git a/src/mdaCombo.h b/src/mdaCombo.h index 2198640..dfa19be 100644 --- a/src/mdaCombo.h +++ b/src/mdaCombo.h @@ -1,69 +1,69 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaCombo_H -#define __mdaCombo_H - -#include "audioeffectx.h" - -class mdaCombo : public AudioEffectX -{ -public: - mdaCombo(audioMasterCallback audioMaster); - ~mdaCombo(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual float filterFreq(float hz); - virtual void suspend(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fParam5; - float fParam6; - float fParam7; - - float clip, drive, trim, lpf, hpf, mix1, mix2; - float ff1, ff2, ff3, ff4, ff5, bias; - float ff6, ff7, ff8, ff9, ff10; - float hhf, hhq, hh0, hh1; //hpf - - float *buffer, *buffe2; - LvzInt32 size, bufpos, del1, del2; - int mode, ster; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaCombo_H +#define __mdaCombo_H + +#include "audioeffectx.h" + +class mdaCombo : public AudioEffectX +{ +public: + mdaCombo(audioMasterCallback audioMaster); + ~mdaCombo(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual float filterFreq(float hz); + virtual void suspend(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fParam5; + float fParam6; + float fParam7; + + float clip, drive, trim, lpf, hpf, mix1, mix2; + float ff1, ff2, ff3, ff4, ff5, bias; + float ff6, ff7, ff8, ff9, ff10; + float hhf, hhq, hh0, hh1; //hpf + + float *buffer, *buffe2; + LvzInt32 size, bufpos, del1, del2; + int mode, ster; + + char programName[32]; +}; + +#endif diff --git a/src/mdaDeEss.h b/src/mdaDeEss.h index 10cacd1..9d2684b 100644 --- a/src/mdaDeEss.h +++ b/src/mdaDeEss.h @@ -1,54 +1,54 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaDeEss_H -#define __mdaDeEss_H - -#include "audioeffectx.h" - -class mdaDeEss : public AudioEffectX -{ -public: - mdaDeEss(audioMasterCallback audioMaster); - ~mdaDeEss(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - float fbuf1, fbuf2, gai; - float thr, att, rel, env, fil; - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaDeEss_H +#define __mdaDeEss_H + +#include "audioeffectx.h" + +class mdaDeEss : public AudioEffectX +{ +public: + mdaDeEss(audioMasterCallback audioMaster); + ~mdaDeEss(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + float fbuf1, fbuf2, gai; + float thr, att, rel, env, fil; + char programName[32]; +}; + +#endif diff --git a/src/mdaDegrade.h b/src/mdaDegrade.h index b1c9e92..f94d559 100644 --- a/src/mdaDegrade.h +++ b/src/mdaDegrade.h @@ -1,62 +1,62 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaDegrade_H -#define __mdaDegrade_H - -#include "audioeffectx.h" - -class mdaDegrade : public AudioEffectX -{ -public: - mdaDegrade(audioMasterCallback audioMaster); - ~mdaDegrade(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual float filterFreq(float hz); - virtual void suspend(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fParam5; - float fParam6; - float fi2, fo2, clp, lin, lin2, g1, g2, g3, mode; - float buf0, buf1, buf2, buf3, buf4, buf5, buf6, buf7, buf8, buf9; - int tn, tcount; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaDegrade_H +#define __mdaDegrade_H + +#include "audioeffectx.h" + +class mdaDegrade : public AudioEffectX +{ +public: + mdaDegrade(audioMasterCallback audioMaster); + ~mdaDegrade(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual float filterFreq(float hz); + virtual void suspend(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fParam5; + float fParam6; + float fi2, fo2, clp, lin, lin2, g1, g2, g3, mode; + float buf0, buf1, buf2, buf3, buf4, buf5, buf6, buf7, buf8, buf9; + int tn, tcount; + + char programName[32]; +}; + +#endif diff --git a/src/mdaDelay.h b/src/mdaDelay.h index 6c7535e..12877af 100644 --- a/src/mdaDelay.h +++ b/src/mdaDelay.h @@ -1,64 +1,64 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaDelay_H -#define __mdaDelay_H - -#include "audioeffectx.h" - -class mdaDelay : public AudioEffectX -{ -public: - mdaDelay(audioMasterCallback audioMaster); - ~mdaDelay(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam0; - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fParam5; - float fParam6; - - float *buffer; //delay - LvzInt32 size, ipos, ldel, rdel; //delay max time, pointer, left time, right time - float wet, dry, fbk; //wet & dry mix - float lmix, hmix, fil, fil0; //low & high mix, crossover filter coeff & buffer - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaDelay_H +#define __mdaDelay_H + +#include "audioeffectx.h" + +class mdaDelay : public AudioEffectX +{ +public: + mdaDelay(audioMasterCallback audioMaster); + ~mdaDelay(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam0; + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fParam5; + float fParam6; + + float *buffer; //delay + LvzInt32 size, ipos, ldel, rdel; //delay max time, pointer, left time, right time + float wet, dry, fbk; //wet & dry mix + float lmix, hmix, fil, fil0; //low & high mix, crossover filter coeff & buffer + + char programName[32]; +}; + +#endif diff --git a/src/mdaDetune.h b/src/mdaDetune.h index 2bfe229..59ee1a0 100644 --- a/src/mdaDetune.h +++ b/src/mdaDetune.h @@ -1,74 +1,74 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#define NPARAMS 4 ///number of parameters -#define NPROGS 4 ///number of programs -#define BUFMAX 4096 - -#ifndef __mdaDetune_H -#define __mdaDetune_H - -#include "audioeffectx.h" - -struct mdaDetuneProgram -{ - friend class mdaDetune; - float param[NPARAMS]; - char name[32]; -}; - - -class mdaDetune : public AudioEffectX -{ -public: - mdaDetune(audioMasterCallback audioMaster); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgram(LvzInt32 program); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - mdaDetuneProgram programs[NPROGS]; - float buf[BUFMAX]; - float win[BUFMAX]; - - ///global internal variables - LvzInt32 buflen; //buffer length - float bufres; //buffer resolution display - float semi; //detune display - LvzInt32 pos0; //buffer input - float pos1, dpos1; //buffer output, rate - float pos2, dpos2; //downwards shift - float wet, dry; //ouput levels -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#define NPARAMS 4 ///number of parameters +#define NPROGS 4 ///number of programs +#define BUFMAX 4096 + +#ifndef __mdaDetune_H +#define __mdaDetune_H + +#include "audioeffectx.h" + +struct mdaDetuneProgram +{ + friend class mdaDetune; + float param[NPARAMS]; + char name[32]; +}; + + +class mdaDetune : public AudioEffectX +{ +public: + mdaDetune(audioMasterCallback audioMaster); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgram(LvzInt32 program); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + mdaDetuneProgram programs[NPROGS]; + float buf[BUFMAX]; + float win[BUFMAX]; + + ///global internal variables + LvzInt32 buflen; //buffer length + float bufres; //buffer resolution display + float semi; //detune display + LvzInt32 pos0; //buffer input + float pos1, dpos1; //buffer output, rate + float pos2, dpos2; //downwards shift + float wet, dry; //ouput levels +}; + +#endif diff --git a/src/mdaDither.h b/src/mdaDither.h index 21529f8..88a0eb4 100644 --- a/src/mdaDither.h +++ b/src/mdaDither.h @@ -1,62 +1,62 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaDither_H -#define __mdaDither_H - -#include "audioeffectx.h" - -class mdaDither : public AudioEffectX -{ -public: - mdaDither(audioMasterCallback audioMaster); - ~mdaDither(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam0; - float fParam1; - float fParam2; - float fParam3; - float fParam4; - - float dith; - LvzInt32 rnd1, rnd3; - float shap, sh1, sh2, sh3, sh4; - float offs, bits, wlen, gain; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaDither_H +#define __mdaDither_H + +#include "audioeffectx.h" + +class mdaDither : public AudioEffectX +{ +public: + mdaDither(audioMasterCallback audioMaster); + ~mdaDither(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam0; + float fParam1; + float fParam2; + float fParam3; + float fParam4; + + float dith; + LvzInt32 rnd1, rnd3; + float shap, sh1, sh2, sh3, sh4; + float offs, bits, wlen, gain; + + char programName[32]; +}; + +#endif diff --git a/src/mdaDubDelay.h b/src/mdaDubDelay.h index 56be65c..72d0598 100644 --- a/src/mdaDubDelay.h +++ b/src/mdaDubDelay.h @@ -1,67 +1,67 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaDubDelay_H -#define __mdaDubDelay_H - -#include "audioeffectx.h" - -class mdaDubDelay : public AudioEffectX -{ -public: - mdaDubDelay(audioMasterCallback audioMaster); - ~mdaDubDelay(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam0; - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fParam5; - float fParam6; - - float *buffer; //delay - LvzInt32 size, ipos; //delay max time, pointer, left time, right time - float wet, dry, fbk; //wet & dry mix - float lmix, hmix, fil, fil0; //low & high mix, crossover filter coeff & buffer - float env, rel; //limiter (clipper when release is instant) - float del, mod, phi, dphi; //lfo - float dlbuf; //smoothed modulated delay - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaDubDelay_H +#define __mdaDubDelay_H + +#include "audioeffectx.h" + +class mdaDubDelay : public AudioEffectX +{ +public: + mdaDubDelay(audioMasterCallback audioMaster); + ~mdaDubDelay(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam0; + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fParam5; + float fParam6; + + float *buffer; //delay + LvzInt32 size, ipos; //delay max time, pointer, left time, right time + float wet, dry, fbk; //wet & dry mix + float lmix, hmix, fil, fil0; //low & high mix, crossover filter coeff & buffer + float env, rel; //limiter (clipper when release is instant) + float del, mod, phi, dphi; //lfo + float dlbuf; //smoothed modulated delay + + char programName[32]; +}; + +#endif diff --git a/src/mdaDynamics.h b/src/mdaDynamics.h index 7040191..ced7aca 100644 --- a/src/mdaDynamics.h +++ b/src/mdaDynamics.h @@ -1,64 +1,64 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaDynamics_H -#define __mdaDynamics_H - -#include "audioeffectx.h" - -class mdaDynamics : public AudioEffectX -{ -public: - mdaDynamics(audioMasterCallback audioMaster); - ~mdaDynamics(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fParam5; - float fParam6; - float fParam7; - float fParam8; - float fParam9; - float fParam10; - float thr, rat, env, env2, att, rel, trim, lthr, xthr, xrat, dry; - float genv, gatt, irel; - int mode; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaDynamics_H +#define __mdaDynamics_H + +#include "audioeffectx.h" + +class mdaDynamics : public AudioEffectX +{ +public: + mdaDynamics(audioMasterCallback audioMaster); + ~mdaDynamics(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fParam5; + float fParam6; + float fParam7; + float fParam8; + float fParam9; + float fParam10; + float thr, rat, env, env2, att, rel, trim, lthr, xthr, xrat, dry; + float genv, gatt, irel; + int mode; + + char programName[32]; +}; + +#endif diff --git a/src/mdaImage.h b/src/mdaImage.h index 69b53bd..b5cb804 100644 --- a/src/mdaImage.h +++ b/src/mdaImage.h @@ -1,59 +1,59 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaImage_H -#define __mdaImage_H - -#include "audioeffectx.h" - -class mdaImage : public AudioEffectX -{ -public: - mdaImage(audioMasterCallback audioMaster); - ~mdaImage(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fParam5; - float fParam6; - float l2l, l2r, r2l, r2r; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaImage_H +#define __mdaImage_H + +#include "audioeffectx.h" + +class mdaImage : public AudioEffectX +{ +public: + mdaImage(audioMasterCallback audioMaster); + ~mdaImage(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fParam5; + float fParam6; + float l2l, l2r, r2l, r2r; + + char programName[32]; +}; + +#endif diff --git a/src/mdaJX10.cpp b/src/mdaJX10.cpp index dbbc76c..33880cf 100644 --- a/src/mdaJX10.cpp +++ b/src/mdaJX10.cpp @@ -1,1010 +1,1010 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#include "mdaJX10.h" - -#include -#include //rand() -#include - - -AudioEffect *createEffectInstance(audioMasterCallback audioMaster) -{ - return new mdaJX10(audioMaster); -} - - -mdaJX10Program::mdaJX10Program() -{ - param[0] = 0.00f; //OSC Mix - param[1] = 0.25f; //OSC Tune - param[2] = 0.50f; //OSC Fine - - param[3] = 0.00f; //OSC Mode - param[4] = 0.35f; //OSC Rate - param[5] = 0.50f; //OSC Bend - - param[6] = 1.00f; //VCF Freq - param[7] = 0.15f; //VCF Reso - param[8] = 0.75f; //VCF postUpdate(); -} - - -void mdaJX10::fillpatch(LvzInt32 p, const char *name, - float p0, float p1, float p2, float p3, float p4, float p5, - float p6, float p7, float p8, float p9, float p10, float p11, - float p12, float p13, float p14, float p15, float p16, float p17, - float p18, float p19, float p20, float p21, float p22, float p23) -{ - strcpy(programs[p].name, name); - programs[p].param[0] = p0; programs[p].param[1] = p1; - programs[p].param[2] = p2; programs[p].param[3] = p3; - programs[p].param[4] = p4; programs[p].param[5] = p5; - programs[p].param[6] = p6; programs[p].param[7] = p7; - programs[p].param[8] = p8; programs[p].param[9] = p9; - programs[p].param[10] = p10; programs[p].param[11] = p11; - programs[p].param[12] = p12; programs[p].param[13] = p13; - programs[p].param[14] = p14; programs[p].param[15] = p15; - programs[p].param[16] = p16; programs[p].param[17] = p17; - programs[p].param[18] = p18; programs[p].param[19] = p19; - programs[p].param[20] = p20; programs[p].param[21] = p21; - programs[p].param[22] = p22; programs[p].param[23] = p23; -} - - -float mdaJX10::getParameter(LvzInt32 index) { return programs[curProgram].param[index]; } -void mdaJX10::setProgramName(char *name) { strcpy(programs[curProgram].name, name); } -void mdaJX10::getProgramName(char *name) { strcpy(name, programs[curProgram].name); } -void mdaJX10::setBlockSize(LvzInt32 blockSize) { AudioEffectX::setBlockSize(blockSize); } -bool mdaJX10::getEffectName(char* name) { strcpy(name, "MDA JX10 Synth"); return true; } -bool mdaJX10::getVendorString(char* text) { strcpy(text, "MDA"); return true; } -bool mdaJX10::getProductString(char* text) { strcpy(text, "MDA JX10 Synth"); return true; } - - -bool mdaJX10::getOutputProperties(LvzInt32 index, LvzPinProperties* properties) -{ - if(indexlabel, "JX10%d", index + 1); - properties->flags = kLvzPinIsActive; - if(index<2) properties->flags |= kLvzPinIsStereo; //make channel 1+2 stereo - return true; - } - return false; -} - - -bool mdaJX10::getProgramNameIndexed(LvzInt32 category, LvzInt32 index, char* text) -{ - if ((unsigned int)index < NPROGS) - { - strcpy(text, programs[index].name); - return true; - } - return false; -} - - -bool mdaJX10::copyProgram(LvzInt32 destination) -{ - if(destination0 || notes[event]sampleFrames) frames = sampleFrames; - frames -= frame; - frame += frames; - - while(--frames>=0) - { - VOICE *V = voice; - o = 0.0f; - - noise = (noise * 196314165) + 907633515; - r = (noise & 0x7FFFFF) + 0x40000000; //generate noise + fast convert to float - w = *(float *)&r; - w = ww * (w - 3.0f); - - if(--k<0) - { - lfo += dlfo; - if(lfo>PI) lfo -= TWOPI; - vib = (float)sin(lfo); - ff = filtf + filtwhl + (filtlfo + press) * vib; - pwm = 1.0f + vib * (modwhl + pwmdep); - vib = 1.0f + vib * (modwhl + vibrato); - k = KMAX; - } - - for(v=0; venv; - if(e > SILENCE) - { //Sinc-Loop Oscillator - x = V->p + V->dp; - if(x > min) - { - if(x > V->pmax) - { - x = V->pmax + V->pmax - x; - V->dp = -V->dp; - } - V->p = x; - x = V->sin0 * V->sinx - V->sin1; //sine osc - V->sin1 = V->sin0; - V->sin0 = x; - x = x / V->p; - } - else - { - V->p = x = - x; - V->dp = V->period * vib * pb; //set period for next cycle - V->pmax = (float)floor(0.5f + V->dp) - 0.5f; - V->dc = -0.5f * V->lev / V->pmax; - V->pmax *= PI; - V->dp = V->pmax / V->dp; - V->sin0 = V->lev * (float)sin(x); - V->sin1 = V->lev * (float)sin(x - V->dp); - V->sinx = 2.0f * (float)cos(V->dp); - if(x*x > .1f) x = V->sin0 / x; else x = V->lev; //was 0.01f; - } - - y = V->p2 + V->dp2; //osc2 - if(y > min) - { - if(y > V->pmax2) - { - y = V->pmax2 + V->pmax2 - y; - V->dp2 = -V->dp2; - } - V->p2 = y; - y = V->sin02 * V->sinx2 - V->sin12; - V->sin12 = V->sin02; - V->sin02 = y; - y = y / V->p2; - } - else - { - V->p2 = y = - y; - V->dp2 = V->period * V->detune * pwm * pb; - V->pmax2 = (float)floor(0.5f + V->dp2) - 0.5f; - V->dc2 = -0.5f * V->lev2 / V->pmax2; - V->pmax2 *= PI; - V->dp2 = V->pmax2 / V->dp2; - V->sin02 = V->lev2 * (float)sin(y); - V->sin12 = V->lev2 * (float)sin(y - V->dp2); - V->sinx2 = 2.0f * (float)cos(V->dp2); - if(y*y > .1f) y = V->sin02 / y; else y = V->lev2; - } - V->saw = V->saw * hpf + V->dc + x - V->dc2 - y; //integrated sinc = saw - x = V->saw + w; - V->env += V->envd * (V->envl - V->env); - - if(k==KMAX) //filter freq update at LFO rate - { - if((V->env+V->envl)>3.0f) { V->envd=dec; V->envl=sus; } //envelopes - V->fenv += V->fenvd * (V->fenvl - V->fenv); - if((V->fenv+V->fenvl)>3.0f) { V->fenvd=fdec; V->fenvl=fsus; } - - fz += 0.005f * (ff - fz); //filter zipper noise filter - y = V->fc * (float)exp(fz + fe * V->fenv) * ipb; //filter cutoff - if(y<0.005f) y=0.005f; - V->ff = y; - - V->period += gl * (V->target - V->period); //glide - if(V->target < V->period) V->period += gl * (V->target - V->period); - } - - if(V->ff > fx) V->ff = fx; //stability limit - - V->f0 += V->ff * V->f1; //state-variable filter - V->f1 -= V->ff * (V->f0 + fq * V->f1 - x - V->f2); - V->f1 -= 0.2f * V->f1 * V->f1 * V->f1; //soft limit //was 0.08f - V->f2 = x; - - o += V->env * V->f0; - } - V++; - } - - *out1++ += o; - *out2++ += o; - } - - if(frame0 || notes[event]sampleFrames) frames = sampleFrames; - frames -= frame; - frame += frames; - - while(--frames>=0) - { - VOICE *V = voice; - o = 0.0f; - - noise = (noise * 196314165) + 907633515; - r = (noise & 0x7FFFFF) + 0x40000000; //generate noise + fast convert to float - w = *(float *)&r; - w = ww * (w - 3.0f); - - if(--k<0) - { - lfo += dlfo; - if(lfo>PI) lfo -= TWOPI; - vib = (float)sin(lfo); - ff = filtf + filtwhl + (filtlfo + press) * vib; - pwm = 1.0f + vib * (modwhl + pwmdep); - vib = 1.0f + vib * (modwhl + vibrato); - k = KMAX; - } - - for(v=0; venv; - if(e > SILENCE) - { //Sinc-Loop Oscillator - x = V->p + V->dp; - if(x > min) - { - if(x > V->pmax) - { - x = V->pmax + V->pmax - x; - V->dp = -V->dp; - } - V->p = x; - x = V->sin0 * V->sinx - V->sin1; //sine osc - V->sin1 = V->sin0; - V->sin0 = x; - x = x / V->p; - } - else - { - V->p = x = - x; - V->dp = V->period * vib * pb; //set period for next cycle - V->pmax = (float)floor(0.5f + V->dp) - 0.5f; - V->dc = -0.5f * V->lev / V->pmax; - V->pmax *= PI; - V->dp = V->pmax / V->dp; - V->sin0 = V->lev * (float)sin(x); - V->sin1 = V->lev * (float)sin(x - V->dp); - V->sinx = 2.0f * (float)cos(V->dp); - if(x*x > .1f) x = V->sin0 / x; else x = V->lev; //was 0.01f; - } - - y = V->p2 + V->dp2; //osc2 - if(y > min) - { - if(y > V->pmax2) - { - y = V->pmax2 + V->pmax2 - y; - V->dp2 = -V->dp2; - } - V->p2 = y; - y = V->sin02 * V->sinx2 - V->sin12; - V->sin12 = V->sin02; - V->sin02 = y; - y = y / V->p2; - } - else - { - V->p2 = y = - y; - V->dp2 = V->period * V->detune * pwm * pb; - V->pmax2 = (float)floor(0.5f + V->dp2) - 0.5f; - V->dc2 = -0.5f * V->lev2 / V->pmax2; - V->pmax2 *= PI; - V->dp2 = V->pmax2 / V->dp2; - V->sin02 = V->lev2 * (float)sin(y); - V->sin12 = V->lev2 * (float)sin(y - V->dp2); - V->sinx2 = 2.0f * (float)cos(V->dp2); - if(y*y > .1f) y = V->sin02 / y; else y = V->lev2; - } - V->saw = V->saw * hpf + V->dc + x - V->dc2 - y; //integrated sinc = saw - x = V->saw + w; - V->env += V->envd * (V->envl - V->env); - - if(k==KMAX) //filter freq update at LFO rate - { - if((V->env+V->envl)>3.0f) { V->envd=dec; V->envl=sus; } //envelopes - V->fenv += V->fenvd * (V->fenvl - V->fenv); - if((V->fenv+V->fenvl)>3.0f) { V->fenvd=fdec; V->fenvl=fsus; } - - fz += 0.005f * (ff - fz); //filter zipper noise filter - y = V->fc * (float)exp(fz + fe * V->fenv) * ipb; //filter cutoff - if(y<0.005f) y=0.005f; - V->ff = y; - - V->period += gl * (V->target - V->period); //glide - if(V->target < V->period) V->period += gl * (V->target - V->period); - } - - if(V->ff > fx) V->ff = fx; //stability limit - - V->f0 += V->ff * V->f1; //state-variable filter - V->f1 -= V->ff * (V->f0 + fq * V->f1 - x - V->f2); - V->f1 -= 0.2f * V->f1 * V->f1 * V->f1; //soft limit - - V->f2 = x; - - o += V->env * V->f0; - } - V++; - } - - *out1++ = o; - *out2++ = o; - } - - if(frame= 0) - { - *out1++ = 0.0f; - *out2++ = 0.0f; - } - } - notes[0] = EVENTS_DONE; //mark events buffer as done - fzip = fz; - K = k; -} - - -void mdaJX10::noteOn(LvzInt32 note, LvzInt32 velocity) -{ - float p, l=100.0f; //louder than any envelope! - LvzInt32 v=0, tmp, held=0; - - if(velocity>0) //note on - { - if(veloff) velocity = 80; - - if(mode & 4) //monophonic - { - if(voice[0].note > 0) //legato pitch change - { - for(tmp=(NVOICES-1); tmp>0; tmp--) //queue any held notes - { - voice[tmp].note = voice[tmp - 1].note; - } - p = tune * (float)exp(-0.05776226505 * ((double)note + ANALOG * (double)v)); - while(p<3.0f || (p * detune)<3.0f) p += p; - voice[v].target = p; - if((mode & 2)==0) voice[v].period = p; - voice[v].fc = (float)exp(filtvel * (float)(velocity - 64)) / p; - voice[v].env += SILENCE + SILENCE; ///was missed out below if returned? - voice[v].note = note; - return; - } - } - else //polyphonic - { - for(tmp=0; tmp 0) held++; - if(voice[tmp].env0.0f) - { - p = voice[v].pmax + voice[v].pmax - voice[v].p; - voice[v].dp2 = -voice[v].dp; - } - else - { - p = voice[v].p; - voice[v].dp2 = voice[v].dp; - } - voice[v].p2 = voice[v].pmax2 = p + PI * voice[v].period; - - voice[v].dc2 = 0.0f; - voice[v].sin02 = voice[v].sin12 = voice[v].sinx2 = 0.0f; - } - - if(mode & 4) //monophonic retriggering - { - voice[v].env += SILENCE + SILENCE; - } - else - { - //if(programs[curProgram].param[15] < 0.28f) - //{ - // voice[v].f0 = voice[v].f1 = voice[v].f2 = 0.0f; //reset filter - // voice[v].env = SILENCE + SILENCE; - // voice[v].fenv = 0.0f; - //} - //else - voice[v].env += SILENCE + SILENCE; //anti-glitching trick - } - voice[v].envl = 2.0f; - voice[v].envd = att; - voice[v].fenvl = 2.0f; - voice[v].fenvd = fatt; - } - else //note off - { - if((mode & 4) && (voice[0].note==note)) //monophonic (and current note) - { - for(v=(NVOICES-1); v>0; v--) - { - if(voice[v].note>0) held = v; //any other notes queued? - } - if(held>0) - { - voice[v].note = voice[held].note; - voice[held].note = 0; - - p = tune * (float)exp(-0.05776226505 * ((double)voice[v].note + ANALOG * (double)v)); - while(p<3.0f || (p * detune)<3.0f) p += p; - voice[v].target = p; - if((mode & 2)==0) voice[v].period = p; - voice[v].fc = 1.0f / p; - } - else - { - voice[v].envl = 0.0f; - voice[v].envd = rel; - voice[v].fenvl = 0.0f; - voice[v].fenvd = frel; - voice[v].note = 0; - } - } - else //polyphonic - { - for(v=0; vnumEvents; i++) - { - if((ev->events[i])->type != kLvzMidiType) continue; - LvzMidiEvent* event = (LvzMidiEvent*)ev->events[i]; - char* midiData = event->midiData; - - switch(midiData[0] & 0xf0) //status byte (all channels) - { - case 0x80: //note off - notes[npos++] = event->deltaFrames; //delta - notes[npos++] = midiData[1] & 0x7F; //note - notes[npos++] = 0; //vel - break; - - case 0x90: //note on - notes[npos++] = event->deltaFrames; //delta - notes[npos++] = midiData[1] & 0x7F; //note - notes[npos++] = midiData[2] & 0x7F; //vel - break; - - case 0xB0: //controller - switch(midiData[1]) - { - case 0x01: //mod wheel - modwhl = 0.000005f * (float)(midiData[2] * midiData[2]); - break; - case 0x02: //filter + - case 0x4A: - filtwhl = 0.02f * (float)(midiData[2]); - break; - case 0x03: //filter - - filtwhl = -0.03f * (float)(midiData[2]); - break; - - case 0x07: //volume - volume = 0.00000005f * (float)(midiData[2] * midiData[2]); - break; - - case 0x10: //resonance - case 0x47: - rezwhl = 0.0065f * (float)(154 - midiData[2]); - break; - - case 0x40: //sustain - sustain = midiData[2] & 0x40; - if(sustain==0) - { - notes[npos++] = event->deltaFrames; - notes[npos++] = SUSTAIN; //end all sustained notes - notes[npos++] = 0; - } - break; - - default: //all notes off - if(midiData[1]>0x7A) - { - for(LvzInt32 v=0; vEVENTBUFFER) npos -= 3; //discard events if buffer full!! - event++; - } - notes[npos] = EVENTS_DONE; - return 1; -} - +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#include "mdaJX10.h" + +#include +#include //rand() +#include + + +AudioEffect *createEffectInstance(audioMasterCallback audioMaster) +{ + return new mdaJX10(audioMaster); +} + + +mdaJX10Program::mdaJX10Program() +{ + param[0] = 0.00f; //OSC Mix + param[1] = 0.25f; //OSC Tune + param[2] = 0.50f; //OSC Fine + + param[3] = 0.00f; //OSC Mode + param[4] = 0.35f; //OSC Rate + param[5] = 0.50f; //OSC Bend + + param[6] = 1.00f; //VCF Freq + param[7] = 0.15f; //VCF Reso + param[8] = 0.75f; //VCF postUpdate(); +} + + +void mdaJX10::fillpatch(LvzInt32 p, const char *name, + float p0, float p1, float p2, float p3, float p4, float p5, + float p6, float p7, float p8, float p9, float p10, float p11, + float p12, float p13, float p14, float p15, float p16, float p17, + float p18, float p19, float p20, float p21, float p22, float p23) +{ + strcpy(programs[p].name, name); + programs[p].param[0] = p0; programs[p].param[1] = p1; + programs[p].param[2] = p2; programs[p].param[3] = p3; + programs[p].param[4] = p4; programs[p].param[5] = p5; + programs[p].param[6] = p6; programs[p].param[7] = p7; + programs[p].param[8] = p8; programs[p].param[9] = p9; + programs[p].param[10] = p10; programs[p].param[11] = p11; + programs[p].param[12] = p12; programs[p].param[13] = p13; + programs[p].param[14] = p14; programs[p].param[15] = p15; + programs[p].param[16] = p16; programs[p].param[17] = p17; + programs[p].param[18] = p18; programs[p].param[19] = p19; + programs[p].param[20] = p20; programs[p].param[21] = p21; + programs[p].param[22] = p22; programs[p].param[23] = p23; +} + + +float mdaJX10::getParameter(LvzInt32 index) { return programs[curProgram].param[index]; } +void mdaJX10::setProgramName(char *name) { strcpy(programs[curProgram].name, name); } +void mdaJX10::getProgramName(char *name) { strcpy(name, programs[curProgram].name); } +void mdaJX10::setBlockSize(LvzInt32 blockSize) { AudioEffectX::setBlockSize(blockSize); } +bool mdaJX10::getEffectName(char* name) { strcpy(name, "MDA JX10 Synth"); return true; } +bool mdaJX10::getVendorString(char* text) { strcpy(text, "MDA"); return true; } +bool mdaJX10::getProductString(char* text) { strcpy(text, "MDA JX10 Synth"); return true; } + + +bool mdaJX10::getOutputProperties(LvzInt32 index, LvzPinProperties* properties) +{ + if(indexlabel, "JX10%d", index + 1); + properties->flags = kLvzPinIsActive; + if(index<2) properties->flags |= kLvzPinIsStereo; //make channel 1+2 stereo + return true; + } + return false; +} + + +bool mdaJX10::getProgramNameIndexed(LvzInt32 category, LvzInt32 index, char* text) +{ + if ((unsigned int)index < NPROGS) + { + strcpy(text, programs[index].name); + return true; + } + return false; +} + + +bool mdaJX10::copyProgram(LvzInt32 destination) +{ + if(destination0 || notes[event]sampleFrames) frames = sampleFrames; + frames -= frame; + frame += frames; + + while(--frames>=0) + { + VOICE *V = voice; + o = 0.0f; + + noise = (noise * 196314165) + 907633515; + r = (noise & 0x7FFFFF) + 0x40000000; //generate noise + fast convert to float + w = *(float *)&r; + w = ww * (w - 3.0f); + + if(--k<0) + { + lfo += dlfo; + if(lfo>PI) lfo -= TWOPI; + vib = (float)sin(lfo); + ff = filtf + filtwhl + (filtlfo + press) * vib; + pwm = 1.0f + vib * (modwhl + pwmdep); + vib = 1.0f + vib * (modwhl + vibrato); + k = KMAX; + } + + for(v=0; venv; + if(e > SILENCE) + { //Sinc-Loop Oscillator + x = V->p + V->dp; + if(x > min) + { + if(x > V->pmax) + { + x = V->pmax + V->pmax - x; + V->dp = -V->dp; + } + V->p = x; + x = V->sin0 * V->sinx - V->sin1; //sine osc + V->sin1 = V->sin0; + V->sin0 = x; + x = x / V->p; + } + else + { + V->p = x = - x; + V->dp = V->period * vib * pb; //set period for next cycle + V->pmax = (float)floor(0.5f + V->dp) - 0.5f; + V->dc = -0.5f * V->lev / V->pmax; + V->pmax *= PI; + V->dp = V->pmax / V->dp; + V->sin0 = V->lev * (float)sin(x); + V->sin1 = V->lev * (float)sin(x - V->dp); + V->sinx = 2.0f * (float)cos(V->dp); + if(x*x > .1f) x = V->sin0 / x; else x = V->lev; //was 0.01f; + } + + y = V->p2 + V->dp2; //osc2 + if(y > min) + { + if(y > V->pmax2) + { + y = V->pmax2 + V->pmax2 - y; + V->dp2 = -V->dp2; + } + V->p2 = y; + y = V->sin02 * V->sinx2 - V->sin12; + V->sin12 = V->sin02; + V->sin02 = y; + y = y / V->p2; + } + else + { + V->p2 = y = - y; + V->dp2 = V->period * V->detune * pwm * pb; + V->pmax2 = (float)floor(0.5f + V->dp2) - 0.5f; + V->dc2 = -0.5f * V->lev2 / V->pmax2; + V->pmax2 *= PI; + V->dp2 = V->pmax2 / V->dp2; + V->sin02 = V->lev2 * (float)sin(y); + V->sin12 = V->lev2 * (float)sin(y - V->dp2); + V->sinx2 = 2.0f * (float)cos(V->dp2); + if(y*y > .1f) y = V->sin02 / y; else y = V->lev2; + } + V->saw = V->saw * hpf + V->dc + x - V->dc2 - y; //integrated sinc = saw + x = V->saw + w; + V->env += V->envd * (V->envl - V->env); + + if(k==KMAX) //filter freq update at LFO rate + { + if((V->env+V->envl)>3.0f) { V->envd=dec; V->envl=sus; } //envelopes + V->fenv += V->fenvd * (V->fenvl - V->fenv); + if((V->fenv+V->fenvl)>3.0f) { V->fenvd=fdec; V->fenvl=fsus; } + + fz += 0.005f * (ff - fz); //filter zipper noise filter + y = V->fc * (float)exp(fz + fe * V->fenv) * ipb; //filter cutoff + if(y<0.005f) y=0.005f; + V->ff = y; + + V->period += gl * (V->target - V->period); //glide + if(V->target < V->period) V->period += gl * (V->target - V->period); + } + + if(V->ff > fx) V->ff = fx; //stability limit + + V->f0 += V->ff * V->f1; //state-variable filter + V->f1 -= V->ff * (V->f0 + fq * V->f1 - x - V->f2); + V->f1 -= 0.2f * V->f1 * V->f1 * V->f1; //soft limit //was 0.08f + V->f2 = x; + + o += V->env * V->f0; + } + V++; + } + + *out1++ += o; + *out2++ += o; + } + + if(frame0 || notes[event]sampleFrames) frames = sampleFrames; + frames -= frame; + frame += frames; + + while(--frames>=0) + { + VOICE *V = voice; + o = 0.0f; + + noise = (noise * 196314165) + 907633515; + r = (noise & 0x7FFFFF) + 0x40000000; //generate noise + fast convert to float + w = *(float *)&r; + w = ww * (w - 3.0f); + + if(--k<0) + { + lfo += dlfo; + if(lfo>PI) lfo -= TWOPI; + vib = (float)sin(lfo); + ff = filtf + filtwhl + (filtlfo + press) * vib; + pwm = 1.0f + vib * (modwhl + pwmdep); + vib = 1.0f + vib * (modwhl + vibrato); + k = KMAX; + } + + for(v=0; venv; + if(e > SILENCE) + { //Sinc-Loop Oscillator + x = V->p + V->dp; + if(x > min) + { + if(x > V->pmax) + { + x = V->pmax + V->pmax - x; + V->dp = -V->dp; + } + V->p = x; + x = V->sin0 * V->sinx - V->sin1; //sine osc + V->sin1 = V->sin0; + V->sin0 = x; + x = x / V->p; + } + else + { + V->p = x = - x; + V->dp = V->period * vib * pb; //set period for next cycle + V->pmax = (float)floor(0.5f + V->dp) - 0.5f; + V->dc = -0.5f * V->lev / V->pmax; + V->pmax *= PI; + V->dp = V->pmax / V->dp; + V->sin0 = V->lev * (float)sin(x); + V->sin1 = V->lev * (float)sin(x - V->dp); + V->sinx = 2.0f * (float)cos(V->dp); + if(x*x > .1f) x = V->sin0 / x; else x = V->lev; //was 0.01f; + } + + y = V->p2 + V->dp2; //osc2 + if(y > min) + { + if(y > V->pmax2) + { + y = V->pmax2 + V->pmax2 - y; + V->dp2 = -V->dp2; + } + V->p2 = y; + y = V->sin02 * V->sinx2 - V->sin12; + V->sin12 = V->sin02; + V->sin02 = y; + y = y / V->p2; + } + else + { + V->p2 = y = - y; + V->dp2 = V->period * V->detune * pwm * pb; + V->pmax2 = (float)floor(0.5f + V->dp2) - 0.5f; + V->dc2 = -0.5f * V->lev2 / V->pmax2; + V->pmax2 *= PI; + V->dp2 = V->pmax2 / V->dp2; + V->sin02 = V->lev2 * (float)sin(y); + V->sin12 = V->lev2 * (float)sin(y - V->dp2); + V->sinx2 = 2.0f * (float)cos(V->dp2); + if(y*y > .1f) y = V->sin02 / y; else y = V->lev2; + } + V->saw = V->saw * hpf + V->dc + x - V->dc2 - y; //integrated sinc = saw + x = V->saw + w; + V->env += V->envd * (V->envl - V->env); + + if(k==KMAX) //filter freq update at LFO rate + { + if((V->env+V->envl)>3.0f) { V->envd=dec; V->envl=sus; } //envelopes + V->fenv += V->fenvd * (V->fenvl - V->fenv); + if((V->fenv+V->fenvl)>3.0f) { V->fenvd=fdec; V->fenvl=fsus; } + + fz += 0.005f * (ff - fz); //filter zipper noise filter + y = V->fc * (float)exp(fz + fe * V->fenv) * ipb; //filter cutoff + if(y<0.005f) y=0.005f; + V->ff = y; + + V->period += gl * (V->target - V->period); //glide + if(V->target < V->period) V->period += gl * (V->target - V->period); + } + + if(V->ff > fx) V->ff = fx; //stability limit + + V->f0 += V->ff * V->f1; //state-variable filter + V->f1 -= V->ff * (V->f0 + fq * V->f1 - x - V->f2); + V->f1 -= 0.2f * V->f1 * V->f1 * V->f1; //soft limit + + V->f2 = x; + + o += V->env * V->f0; + } + V++; + } + + *out1++ = o; + *out2++ = o; + } + + if(frame= 0) + { + *out1++ = 0.0f; + *out2++ = 0.0f; + } + } + notes[0] = EVENTS_DONE; //mark events buffer as done + fzip = fz; + K = k; +} + + +void mdaJX10::noteOn(LvzInt32 note, LvzInt32 velocity) +{ + float p, l=100.0f; //louder than any envelope! + LvzInt32 v=0, tmp, held=0; + + if(velocity>0) //note on + { + if(veloff) velocity = 80; + + if(mode & 4) //monophonic + { + if(voice[0].note > 0) //legato pitch change + { + for(tmp=(NVOICES-1); tmp>0; tmp--) //queue any held notes + { + voice[tmp].note = voice[tmp - 1].note; + } + p = tune * (float)exp(-0.05776226505 * ((double)note + ANALOG * (double)v)); + while(p<3.0f || (p * detune)<3.0f) p += p; + voice[v].target = p; + if((mode & 2)==0) voice[v].period = p; + voice[v].fc = (float)exp(filtvel * (float)(velocity - 64)) / p; + voice[v].env += SILENCE + SILENCE; ///was missed out below if returned? + voice[v].note = note; + return; + } + } + else //polyphonic + { + for(tmp=0; tmp 0) held++; + if(voice[tmp].env0.0f) + { + p = voice[v].pmax + voice[v].pmax - voice[v].p; + voice[v].dp2 = -voice[v].dp; + } + else + { + p = voice[v].p; + voice[v].dp2 = voice[v].dp; + } + voice[v].p2 = voice[v].pmax2 = p + PI * voice[v].period; + + voice[v].dc2 = 0.0f; + voice[v].sin02 = voice[v].sin12 = voice[v].sinx2 = 0.0f; + } + + if(mode & 4) //monophonic retriggering + { + voice[v].env += SILENCE + SILENCE; + } + else + { + //if(programs[curProgram].param[15] < 0.28f) + //{ + // voice[v].f0 = voice[v].f1 = voice[v].f2 = 0.0f; //reset filter + // voice[v].env = SILENCE + SILENCE; + // voice[v].fenv = 0.0f; + //} + //else + voice[v].env += SILENCE + SILENCE; //anti-glitching trick + } + voice[v].envl = 2.0f; + voice[v].envd = att; + voice[v].fenvl = 2.0f; + voice[v].fenvd = fatt; + } + else //note off + { + if((mode & 4) && (voice[0].note==note)) //monophonic (and current note) + { + for(v=(NVOICES-1); v>0; v--) + { + if(voice[v].note>0) held = v; //any other notes queued? + } + if(held>0) + { + voice[v].note = voice[held].note; + voice[held].note = 0; + + p = tune * (float)exp(-0.05776226505 * ((double)voice[v].note + ANALOG * (double)v)); + while(p<3.0f || (p * detune)<3.0f) p += p; + voice[v].target = p; + if((mode & 2)==0) voice[v].period = p; + voice[v].fc = 1.0f / p; + } + else + { + voice[v].envl = 0.0f; + voice[v].envd = rel; + voice[v].fenvl = 0.0f; + voice[v].fenvd = frel; + voice[v].note = 0; + } + } + else //polyphonic + { + for(v=0; vnumEvents; i++) + { + if((ev->events[i])->type != kLvzMidiType) continue; + LvzMidiEvent* event = (LvzMidiEvent*)ev->events[i]; + char* midiData = event->midiData; + + switch(midiData[0] & 0xf0) //status byte (all channels) + { + case 0x80: //note off + notes[npos++] = event->deltaFrames; //delta + notes[npos++] = midiData[1] & 0x7F; //note + notes[npos++] = 0; //vel + break; + + case 0x90: //note on + notes[npos++] = event->deltaFrames; //delta + notes[npos++] = midiData[1] & 0x7F; //note + notes[npos++] = midiData[2] & 0x7F; //vel + break; + + case 0xB0: //controller + switch(midiData[1]) + { + case 0x01: //mod wheel + modwhl = 0.000005f * (float)(midiData[2] * midiData[2]); + break; + case 0x02: //filter + + case 0x4A: + filtwhl = 0.02f * (float)(midiData[2]); + break; + case 0x03: //filter - + filtwhl = -0.03f * (float)(midiData[2]); + break; + + case 0x07: //volume + volume = 0.00000005f * (float)(midiData[2] * midiData[2]); + break; + + case 0x10: //resonance + case 0x47: + rezwhl = 0.0065f * (float)(154 - midiData[2]); + break; + + case 0x40: //sustain + sustain = midiData[2] & 0x40; + if(sustain==0) + { + notes[npos++] = event->deltaFrames; + notes[npos++] = SUSTAIN; //end all sustained notes + notes[npos++] = 0; + } + break; + + default: //all notes off + if(midiData[1]>0x7A) + { + for(LvzInt32 v=0; vEVENTBUFFER) npos -= 3; //discard events if buffer full!! + event++; + } + notes[npos] = EVENTS_DONE; + return 1; +} + diff --git a/src/mdaJX10.h b/src/mdaJX10.h index 275e07f..1050b00 100644 --- a/src/mdaJX10.h +++ b/src/mdaJX10.h @@ -1,157 +1,157 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaJX10__ -#define __mdaJX10__ - -#include - -#include "audioeffectx.h" - -#define NPARAMS 24 //number of parameters -#define NPROGS 64 //number of programs -#define NOUTS 2 //number of outputs -#define NVOICES 8 //max polyphony -#define SILENCE 0.001f //voice choking -#define PI 3.1415926535897932f -#define TWOPI 6.2831853071795864f -#define ANALOG 0.002f //oscillator drift - -class mdaJX10Program -{ - friend class mdaJX10; -public: - mdaJX10Program(); -private: - float param[NPARAMS]; - char name[24]; -}; - - -struct VOICE //voice state -{ - float period; - float p; //sinc position - float pmax; //loop length - float dp; //delta - float sin0; //sine osc - float sin1; - float sinx; - float dc; //dc offset - - float detune; - float p2; //sinc position - float pmax2; //loop length - float dp2; //delta - float sin02; //sine osc - float sin12; - float sinx2; - float dc2; //dc offset - - float fc; //filter cutoff root - float ff; //filter cutoff - float f0; //filter buffers - float f1; - float f2; - - float saw; - //float vca; //current level ///eliminate osc1 level when separate amp & filter envs? - //float env; //envelope - //float att; //attack - //float dec; //decay - float env; - float envd; - float envl; - float fenv; - float fenvd; - float fenvl; - - float lev; //osc levels - float lev2; - float target; //period target - LvzInt32 note; //remember what note triggered this -}; - - -class mdaJX10 : public AudioEffectX -{ -public: - mdaJX10(audioMasterCallback audioMaster); - ~mdaJX10(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleframes); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleframes); - virtual LvzInt32 processEvents(LvzEvents* events); - - virtual void setProgram(LvzInt32 program); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void setSampleRate(float sampleRate); - virtual void setBlockSize(LvzInt32 blockSize); - virtual void suspend(); - virtual void resume(); - - virtual bool getOutputProperties (LvzInt32 index, LvzPinProperties* properties); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* text); - virtual bool copyProgram (LvzInt32 destination); - virtual bool getEffectName (char* name); - virtual bool getVendorString (char* text); - virtual bool getProductString (char* text); - virtual LvzInt32 getVendorVersion () {return 1;} - virtual LvzInt32 canDo (char* text); - -private: - void update(); //my parameter update - void noteOn(LvzInt32 note, LvzInt32 velocity); - void fillpatch(LvzInt32 p, const char *name, - float p0, float p1, float p2, float p3, float p4, float p5, - float p6, float p7, float p8, float p9, float p10, float p11, - float p12, float p13, float p14, float p15, float p16, float p17, - float p18, float p19, float p20, float p21, float p22, float p23); - - mdaJX10Program* programs; - float Fs; - - #define EVENTBUFFER 120 - #define EVENTS_DONE 99999999 - LvzInt32 notes[EVENTBUFFER + 8]; //list of delta|note|velocity for current block - #define KMAX 32 - - ///global internal variables - #define SUSTAIN -1 - LvzInt32 sustain, activevoices; - VOICE voice[NVOICES]; - - float semi, cent; - float tune, detune; - float filtf, fzip, filtq, filtlfo, filtenv, filtvel, filtwhl; - float oscmix, noisemix; - float att, dec, sus, rel, fatt, fdec, fsus, frel; - float lfo, dlfo, modwhl, press, pbend, ipbend, rezwhl; - float velsens, volume, voltrim; - float vibrato, pwmdep, lfoHz, glide, glidedisp; - LvzInt32 K, lastnote, veloff, mode; - unsigned int noise; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaJX10__ +#define __mdaJX10__ + +#include + +#include "audioeffectx.h" + +#define NPARAMS 24 //number of parameters +#define NPROGS 64 //number of programs +#define NOUTS 2 //number of outputs +#define NVOICES 8 //max polyphony +#define SILENCE 0.001f //voice choking +#define PI 3.1415926535897932f +#define TWOPI 6.2831853071795864f +#define ANALOG 0.002f //oscillator drift + +class mdaJX10Program +{ + friend class mdaJX10; +public: + mdaJX10Program(); +private: + float param[NPARAMS]; + char name[24]; +}; + + +struct VOICE //voice state +{ + float period; + float p; //sinc position + float pmax; //loop length + float dp; //delta + float sin0; //sine osc + float sin1; + float sinx; + float dc; //dc offset + + float detune; + float p2; //sinc position + float pmax2; //loop length + float dp2; //delta + float sin02; //sine osc + float sin12; + float sinx2; + float dc2; //dc offset + + float fc; //filter cutoff root + float ff; //filter cutoff + float f0; //filter buffers + float f1; + float f2; + + float saw; + //float vca; //current level ///eliminate osc1 level when separate amp & filter envs? + //float env; //envelope + //float att; //attack + //float dec; //decay + float env; + float envd; + float envl; + float fenv; + float fenvd; + float fenvl; + + float lev; //osc levels + float lev2; + float target; //period target + LvzInt32 note; //remember what note triggered this +}; + + +class mdaJX10 : public AudioEffectX +{ +public: + mdaJX10(audioMasterCallback audioMaster); + ~mdaJX10(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleframes); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleframes); + virtual LvzInt32 processEvents(LvzEvents* events); + + virtual void setProgram(LvzInt32 program); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void setSampleRate(float sampleRate); + virtual void setBlockSize(LvzInt32 blockSize); + virtual void suspend(); + virtual void resume(); + + virtual bool getOutputProperties (LvzInt32 index, LvzPinProperties* properties); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* text); + virtual bool copyProgram (LvzInt32 destination); + virtual bool getEffectName (char* name); + virtual bool getVendorString (char* text); + virtual bool getProductString (char* text); + virtual LvzInt32 getVendorVersion () {return 1;} + virtual LvzInt32 canDo (char* text); + +private: + void update(); //my parameter update + void noteOn(LvzInt32 note, LvzInt32 velocity); + void fillpatch(LvzInt32 p, const char *name, + float p0, float p1, float p2, float p3, float p4, float p5, + float p6, float p7, float p8, float p9, float p10, float p11, + float p12, float p13, float p14, float p15, float p16, float p17, + float p18, float p19, float p20, float p21, float p22, float p23); + + mdaJX10Program* programs; + float Fs; + + #define EVENTBUFFER 120 + #define EVENTS_DONE 99999999 + LvzInt32 notes[EVENTBUFFER + 8]; //list of delta|note|velocity for current block + #define KMAX 32 + + ///global internal variables + #define SUSTAIN -1 + LvzInt32 sustain, activevoices; + VOICE voice[NVOICES]; + + float semi, cent; + float tune, detune; + float filtf, fzip, filtq, filtlfo, filtenv, filtvel, filtwhl; + float oscmix, noisemix; + float att, dec, sus, rel, fatt, fdec, fsus, frel; + float lfo, dlfo, modwhl, press, pbend, ipbend, rezwhl; + float velsens, volume, voltrim; + float vibrato, pwmdep, lfoHz, glide, glidedisp; + LvzInt32 K, lastnote, veloff, mode; + unsigned int noise; +}; + +#endif diff --git a/src/mdaLimiter.h b/src/mdaLimiter.h index f162299..539d512 100644 --- a/src/mdaLimiter.h +++ b/src/mdaLimiter.h @@ -1,57 +1,57 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaLimiter_H -#define __mdaLimiter_H - -#include "audioeffectx.h" - -class mdaLimiter : public AudioEffectX -{ -public: - mdaLimiter(audioMasterCallback audioMaster); - ~mdaLimiter(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fParam5; - float thresh, gain, att, rel, trim; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaLimiter_H +#define __mdaLimiter_H + +#include "audioeffectx.h" + +class mdaLimiter : public AudioEffectX +{ +public: + mdaLimiter(audioMasterCallback audioMaster); + ~mdaLimiter(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fParam5; + float thresh, gain, att, rel, trim; + + char programName[32]; +}; + +#endif diff --git a/src/mdaLooplex.cpp b/src/mdaLooplex.cpp index 8c4fcdc..0cf408d 100644 --- a/src/mdaLooplex.cpp +++ b/src/mdaLooplex.cpp @@ -120,27 +120,27 @@ IdleList::IdleList(mdaLooplex *effect, IdleList *next) : effect(effect), next(ne timer = SetTimer(NULL, 0, IDLE_MSEC, TimerCallback); #elif __linux__ timer = 1; - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setstacksize(&attr, 16 * 1024); + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setstacksize(&attr, 16 * 1024); int policy; - - if (pthread_attr_getschedpolicy(&attr, &policy) == 0) - { - struct sched_param param; - param.sched_priority = sched_get_priority_min(policy); - pthread_attr_setschedpolicy(&attr, SCHED_OTHER); - pthread_attr_setschedparam(&attr, ¶m); - } - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, 0); - - if (pthread_create(&thread, &attr, &ThreadCallback, 0) != 0) - { + + if (pthread_attr_getschedpolicy(&attr, &policy) == 0) + { + struct sched_param param; + param.sched_priority = sched_get_priority_min(policy); + pthread_attr_setschedpolicy(&attr, SCHED_OTHER); + pthread_attr_setschedparam(&attr, ¶m); + } + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, 0); + + if (pthread_create(&thread, &attr, &ThreadCallback, 0) != 0) + { thread = 0; - timer = 0; - fprintf(stderr, "Error: mdaLooplex.cpp (line %d)\n", __LINE__); - } + timer = 0; + fprintf(stderr, "Error: mdaLooplex.cpp (line %d)\n", __LINE__); + } pthread_attr_destroy(&attr); #else //OSX double ms = kEventDurationMillisecond * (double)IDLE_MSEC; diff --git a/src/mdaLoudness.h b/src/mdaLoudness.h index 6b61ce4..ef13620 100644 --- a/src/mdaLoudness.h +++ b/src/mdaLoudness.h @@ -1,72 +1,72 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#define NPARAMS 3 ///number of parameters -#define NPROGS 8 ///number of programs - -#ifndef __mdaLoudness_H -#define __mdaLoudness_H - -#include "audioeffectx.h" - -class mdaLoudnessProgram -{ -public: - mdaLoudnessProgram(); -private: - friend class mdaLoudness; - float param[NPARAMS]; - char name[32]; -}; - - -class mdaLoudness : public AudioEffectX -{ -public: - mdaLoudness(audioMasterCallback audioMaster); - ~mdaLoudness(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgram(LvzInt32 program); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - virtual void resume(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - mdaLoudnessProgram *programs; - - ///global internal variables - float Z0, Z1, Z2, Z3, A0, A1, A2, gain; - float igain, ogain; - LvzInt32 mode; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#define NPARAMS 3 ///number of parameters +#define NPROGS 8 ///number of programs + +#ifndef __mdaLoudness_H +#define __mdaLoudness_H + +#include "audioeffectx.h" + +class mdaLoudnessProgram +{ +public: + mdaLoudnessProgram(); +private: + friend class mdaLoudness; + float param[NPARAMS]; + char name[32]; +}; + + +class mdaLoudness : public AudioEffectX +{ +public: + mdaLoudness(audioMasterCallback audioMaster); + ~mdaLoudness(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgram(LvzInt32 program); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + virtual void resume(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + mdaLoudnessProgram *programs; + + ///global internal variables + float Z0, Z1, Z2, Z3, A0, A1, A2, gain; + float igain, ogain; + LvzInt32 mode; +}; + +#endif diff --git a/src/mdaMultiBand.h b/src/mdaMultiBand.h index 657ee69..611ccee 100644 --- a/src/mdaMultiBand.h +++ b/src/mdaMultiBand.h @@ -1,59 +1,59 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaMultiBand_H -#define __mdaMultiBand_H - -#include "audioeffectx.h" - -class mdaMultiBand : public AudioEffectX -{ -public: - mdaMultiBand(audioMasterCallback audioMaster); - ~mdaMultiBand(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1, fParam2, fParam3, fParam4; - float fParam5, fParam6, fParam7, fParam8; - float fParam9, fParam10, fParam11, fParam12, fParam13; - float gain1, driv1, att1, rel1, trim1; - float gain2, driv2, att2, rel2, trim2; - float gain3, driv3, att3, rel3, trim3; - float fi1, fb1, fo1, fi2, fb2, fo2, fb3, slev; - int mswap; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaMultiBand_H +#define __mdaMultiBand_H + +#include "audioeffectx.h" + +class mdaMultiBand : public AudioEffectX +{ +public: + mdaMultiBand(audioMasterCallback audioMaster); + ~mdaMultiBand(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1, fParam2, fParam3, fParam4; + float fParam5, fParam6, fParam7, fParam8; + float fParam9, fParam10, fParam11, fParam12, fParam13; + float gain1, driv1, att1, rel1, trim1; + float gain2, driv2, att2, rel2, trim2; + float gain3, driv3, att3, rel3, trim3; + float fi1, fb1, fo1, fi2, fb2, fo2, fb3, slev; + int mswap; + + char programName[32]; +}; + +#endif diff --git a/src/mdaOverdrive.h b/src/mdaOverdrive.h index 5f0011c..b10e6c1 100644 --- a/src/mdaOverdrive.h +++ b/src/mdaOverdrive.h @@ -1,58 +1,58 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaOverdrive_H -#define __mdaOverdrive_H - -#include "audioeffectx.h" - -class mdaOverdrive : public AudioEffectX -{ -public: - mdaOverdrive(audioMasterCallback audioMaster); - ~mdaOverdrive(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - - float filt1, filt2; //filter buffers - float filt; //filter coeff. - float gain; //output gain - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaOverdrive_H +#define __mdaOverdrive_H + +#include "audioeffectx.h" + +class mdaOverdrive : public AudioEffectX +{ +public: + mdaOverdrive(audioMasterCallback audioMaster); + ~mdaOverdrive(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + + float filt1, filt2; //filter buffers + float filt; //filter coeff. + float gain; //output gain + + char programName[32]; +}; + +#endif diff --git a/src/mdaRePsycho.h b/src/mdaRePsycho.h index 57735d7..c07401d 100644 --- a/src/mdaRePsycho.h +++ b/src/mdaRePsycho.h @@ -1,63 +1,63 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaRePsycho_H -#define __mdaRePsycho_H - -#include "audioeffectx.h" - -class mdaRePsycho : public AudioEffectX -{ -public: - mdaRePsycho(audioMasterCallback audioMaster); - ~mdaRePsycho(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fParam5; - float fParam6; - float fParam7; - float thr, env, gai, tun, wet, dry, fil, buf, buf2; - long tim, dtim; - - float *buffer, *buffer2; - long size; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaRePsycho_H +#define __mdaRePsycho_H + +#include "audioeffectx.h" + +class mdaRePsycho : public AudioEffectX +{ +public: + mdaRePsycho(audioMasterCallback audioMaster); + ~mdaRePsycho(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fParam5; + float fParam6; + float fParam7; + float thr, env, gai, tun, wet, dry, fil, buf, buf2; + long tim, dtim; + + float *buffer, *buffer2; + long size; + + char programName[32]; +}; + +#endif diff --git a/src/mdaRezFilter.h b/src/mdaRezFilter.h index d113ce2..e28df58 100644 --- a/src/mdaRezFilter.h +++ b/src/mdaRezFilter.h @@ -1,69 +1,69 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaRezFilter_H -#define __mdaRezFilter_H - -#include "audioeffectx.h" - -class mdaRezFilter : public AudioEffectX -{ -public: - mdaRezFilter(audioMasterCallback audioMaster); - ~mdaRezFilter(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam0; - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fParam5; - float fParam6; - float fParam7; - float fParam8; - float fParam9; - - float fff, fq, fg, fmax; - float env, fenv, att, rel; - float flfo, phi, dphi, bufl; - float buf0, buf1, buf2, tthr, env2; - int lfomode, ttrig, tatt; - - char bugFix[32]; //Program name was corrupted here! - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaRezFilter_H +#define __mdaRezFilter_H + +#include "audioeffectx.h" + +class mdaRezFilter : public AudioEffectX +{ +public: + mdaRezFilter(audioMasterCallback audioMaster); + ~mdaRezFilter(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam0; + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fParam5; + float fParam6; + float fParam7; + float fParam8; + float fParam9; + + float fff, fq, fg, fmax; + float env, fenv, att, rel; + float flfo, phi, dphi, bufl; + float buf0, buf1, buf2, tthr, env2; + int lfomode, ttrig, tatt; + + char bugFix[32]; //Program name was corrupted here! + char programName[32]; +}; + +#endif diff --git a/src/mdaRingMod.h b/src/mdaRingMod.h index 3e8750d..ace3107 100644 --- a/src/mdaRingMod.h +++ b/src/mdaRingMod.h @@ -1,60 +1,60 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaRingMod_H -#define __mdaRingMod_H - -#include "audioeffectx.h" - -class mdaRingMod : public AudioEffectX -{ -public: - mdaRingMod(audioMasterCallback audioMaster); - ~mdaRingMod(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fPhi; - float fdPhi; - float nul; - float twoPi; - float ffb, fprev; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaRingMod_H +#define __mdaRingMod_H + +#include "audioeffectx.h" + +class mdaRingMod : public AudioEffectX +{ +public: + mdaRingMod(audioMasterCallback audioMaster); + ~mdaRingMod(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fPhi; + float fdPhi; + float nul; + float twoPi; + float ffb, fprev; + + char programName[32]; +}; + +#endif diff --git a/src/mdaRoundPan.h b/src/mdaRoundPan.h index 674c406..85fc996 100644 --- a/src/mdaRoundPan.h +++ b/src/mdaRoundPan.h @@ -1,60 +1,60 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaRoundPan_H -#define __mdaRoundPan_H - -#include "audioeffectx.h" - -class mdaRoundPan : public AudioEffectX -{ -public: - mdaRoundPan(audioMasterCallback audioMaster); - ~mdaRoundPan(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float phi, dphi; - - //float *buffer, *buffer2; - //LvzInt32 size, bufpos; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaRoundPan_H +#define __mdaRoundPan_H + +#include "audioeffectx.h" + +class mdaRoundPan : public AudioEffectX +{ +public: + mdaRoundPan(audioMasterCallback audioMaster); + ~mdaRoundPan(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float phi, dphi; + + //float *buffer, *buffer2; + //LvzInt32 size, bufpos; + + char programName[32]; +}; + +#endif diff --git a/src/mdaShepard.h b/src/mdaShepard.h index 51fda27..1042a6a 100644 --- a/src/mdaShepard.h +++ b/src/mdaShepard.h @@ -1,59 +1,59 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaShepard_H -#define __mdaShepard_H - -#include "audioeffectx.h" - -class mdaShepard : public AudioEffectX -{ -public: - mdaShepard(audioMasterCallback audioMaster); - ~mdaShepard(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam0; - float fParam1; - float fParam2; - float level, pos, rate, drate, out, filt; - - float *buf1, *buf2; - LvzInt32 max, mode; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaShepard_H +#define __mdaShepard_H + +#include "audioeffectx.h" + +class mdaShepard : public AudioEffectX +{ +public: + mdaShepard(audioMasterCallback audioMaster); + ~mdaShepard(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam0; + float fParam1; + float fParam2; + float level, pos, rate, drate, out, filt; + + float *buf1, *buf2; + LvzInt32 max, mode; + + char programName[32]; +}; + +#endif diff --git a/src/mdaSpecMeter.h b/src/mdaSpecMeter.h index 84f2df6..b23a92d 100644 --- a/src/mdaSpecMeter.h +++ b/src/mdaSpecMeter.h @@ -1,87 +1,87 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 2002 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#include "audioeffectx.h" - -#include - -#define NPROGS 4 //can hide decay settings in programs! fast...slow...peak hold -#define SILENCE 0.00000001f - -enum { - _PARAM0, //gain -// _PARAM0, //peak decay -// _PARAM1, //RMS speed -// _PARAM2, //spectrum speed -// _PARAM3, //peak reset? - - NPARAMS -}; - -class mdaSpecMeter; - -class mdaSpecMeterProgram -{ -friend class mdaSpecMeter; -public: - mdaSpecMeterProgram(); -private: - float param[NPARAMS]; - char name[24]; -}; - - -class mdaSpecMeter : public AudioEffectX -{ -public: - mdaSpecMeter(audioMasterCallback audioMaster); - ~mdaSpecMeter(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgram(LvzInt32 program); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void setSampleRate(float sampleRate); - virtual void suspend(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - - //accessible from editor - LvzInt32 counter; - float Lpeak, Lhold, Lmin, Lrms, Rpeak, Rhold, Rmin, Rrms, Corr; // #11 #12 - float band[2][16]; //8 16 31 64 125 250 500 1k 2k 4k 8k 16k 32k - -private: - mdaSpecMeterProgram *programs; - - float iK, lpeak, lmin, lrms, rpeak, rmin, rrms, corr, den; - float lpp[6][16], rpp[6][16]; - LvzInt32 topband, K, kmax; - - float gain; -}; +/* + Copyright 2008-2011 David Robillard + Copyright 2002 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#include "audioeffectx.h" + +#include + +#define NPROGS 4 //can hide decay settings in programs! fast...slow...peak hold +#define SILENCE 0.00000001f + +enum { + _PARAM0, //gain +// _PARAM0, //peak decay +// _PARAM1, //RMS speed +// _PARAM2, //spectrum speed +// _PARAM3, //peak reset? + + NPARAMS +}; + +class mdaSpecMeter; + +class mdaSpecMeterProgram +{ +friend class mdaSpecMeter; +public: + mdaSpecMeterProgram(); +private: + float param[NPARAMS]; + char name[24]; +}; + + +class mdaSpecMeter : public AudioEffectX +{ +public: + mdaSpecMeter(audioMasterCallback audioMaster); + ~mdaSpecMeter(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgram(LvzInt32 program); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void setSampleRate(float sampleRate); + virtual void suspend(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + + //accessible from editor + LvzInt32 counter; + float Lpeak, Lhold, Lmin, Lrms, Rpeak, Rhold, Rmin, Rrms, Corr; // #11 #12 + float band[2][16]; //8 16 31 64 125 250 500 1k 2k 4k 8k 16k 32k + +private: + mdaSpecMeterProgram *programs; + + float iK, lpeak, lmin, lrms, rpeak, rmin, rrms, corr, den; + float lpp[6][16], rpp[6][16]; + LvzInt32 topband, K, kmax; + + float gain; +}; diff --git a/src/mdaSplitter.h b/src/mdaSplitter.h index 32e1f3a..2feabf5 100644 --- a/src/mdaSplitter.h +++ b/src/mdaSplitter.h @@ -1,83 +1,83 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#define NPARAMS 7 ///number of parameters -#define NPROGS 3 ///number of programs - -#ifndef __mdaSplitter_H -#define __mdaSplitter_H - -#include "audioeffectx.h" - -class mdaSplitterProgram -{ -public: - mdaSplitterProgram() - { - param[0] = 0.10f; //mode - param[1] = 0.50f; //freq - param[2] = 0.25f; //freq mode - param[3] = 0.50f; //level (was 2) - param[4] = 0.50f; //level mode - param[5] = 0.50f; //envelope - param[6] = 0.50f; //gain - strcpy(name, "Frequency/Level Splitter"); - } -private: - friend class mdaSplitter; - float param[NPARAMS]; - char name[32]; -}; - - -class mdaSplitter : public AudioEffectX -{ -public: - mdaSplitter(audioMasterCallback audioMaster); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgram(LvzInt32 program); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 which, char* name); - virtual void setParameter(LvzInt32 which, float value); - virtual float getParameter(LvzInt32 which); - virtual void getParameterLabel(LvzInt32 which, char *label); - virtual void getParameterDisplay(LvzInt32 which, char *text); - virtual void getParameterName(LvzInt32 which, char *text); - virtual void suspend(); - virtual void resume(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - mdaSplitterProgram programs[NPROGS]; - - ///global internal variables - float freq, fdisp, buf0, buf1, buf2, buf3; //filter - float level, ldisp, env, att, rel; //level switch - float ff, ll, pp, i2l, i2r, o2l, o2r; //routing (freq, level, phase, output) - LvzInt32 mode; - -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#define NPARAMS 7 ///number of parameters +#define NPROGS 3 ///number of programs + +#ifndef __mdaSplitter_H +#define __mdaSplitter_H + +#include "audioeffectx.h" + +class mdaSplitterProgram +{ +public: + mdaSplitterProgram() + { + param[0] = 0.10f; //mode + param[1] = 0.50f; //freq + param[2] = 0.25f; //freq mode + param[3] = 0.50f; //level (was 2) + param[4] = 0.50f; //level mode + param[5] = 0.50f; //envelope + param[6] = 0.50f; //gain + strcpy(name, "Frequency/Level Splitter"); + } +private: + friend class mdaSplitter; + float param[NPARAMS]; + char name[32]; +}; + + +class mdaSplitter : public AudioEffectX +{ +public: + mdaSplitter(audioMasterCallback audioMaster); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgram(LvzInt32 program); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 which, char* name); + virtual void setParameter(LvzInt32 which, float value); + virtual float getParameter(LvzInt32 which); + virtual void getParameterLabel(LvzInt32 which, char *label); + virtual void getParameterDisplay(LvzInt32 which, char *text); + virtual void getParameterName(LvzInt32 which, char *text); + virtual void suspend(); + virtual void resume(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + mdaSplitterProgram programs[NPROGS]; + + ///global internal variables + float freq, fdisp, buf0, buf1, buf2, buf3; //filter + float level, ldisp, env, att, rel; //level switch + float ff, ll, pp, i2l, i2r, o2l, o2r; //routing (freq, level, phase, output) + LvzInt32 mode; + +}; + +#endif diff --git a/src/mdaStereo.h b/src/mdaStereo.h index 788b110..d60186c 100644 --- a/src/mdaStereo.h +++ b/src/mdaStereo.h @@ -1,63 +1,63 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaStereo_H -#define __mdaStereo_H - -#include "audioeffectx.h" - -class mdaStereo : public AudioEffectX -{ -public: - mdaStereo(audioMasterCallback audioMaster); - ~mdaStereo(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fParam5; - float fParam6; - - float fli, fld, fri, frd, fdel, phi, dphi, mod; - - float *buffer; - LvzInt32 size, bufpos; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaStereo_H +#define __mdaStereo_H + +#include "audioeffectx.h" + +class mdaStereo : public AudioEffectX +{ +public: + mdaStereo(audioMasterCallback audioMaster); + ~mdaStereo(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fParam5; + float fParam6; + + float fli, fld, fri, frd, fdel, phi, dphi, mod; + + float *buffer; + LvzInt32 size, bufpos; + + char programName[32]; +}; + +#endif diff --git a/src/mdaSubSynth.cpp b/src/mdaSubSynth.cpp index e6039da..8324c72 100644 --- a/src/mdaSubSynth.cpp +++ b/src/mdaSubSynth.cpp @@ -1,380 +1,380 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#include "mdaSubSynth.h" - -#include -#include - -AudioEffect *createEffectInstance(audioMasterCallback audioMaster) -{ - return new mdaSubSynth(audioMaster); -} - -mdaSubSynth::mdaSubSynth(audioMasterCallback audioMaster) - : AudioEffectX(audioMaster, 1, 6) // programs, parameters -{ - //inits here! - fParam1 = (float)0.0; //type - fParam2 = (float)0.3; //level - fParam3 = (float)0.6; //tune - fParam4 = (float)1.0; //dry mix - fParam5 = (float)0.6; //thresh - fParam6 = (float)0.65; //release - - setNumInputs(2); - setNumOutputs(2); - setUniqueID("mdaSubSynth"); // identify here - DECLARE_LVZ_DEPRECATED(canMono) (); - canProcessReplacing(); - strcpy(programName, "Sub Bass Synthesizer"); - - resume(); -} - -mdaSubSynth::~mdaSubSynth() -{ - -} - -bool mdaSubSynth::getProductString(char* text) { strcpy(text, "MDA SubSynth"); return true; } -bool mdaSubSynth::getVendorString(char* text) { strcpy(text, "mda"); return true; } -bool mdaSubSynth::getEffectName(char* name) { strcpy(name, "SubSynth"); return true; } - -void mdaSubSynth::setProgramName(char *name) -{ - strcpy(programName, name); -} - -void mdaSubSynth::getProgramName(char *name) -{ - strcpy(name, programName); -} - -bool mdaSubSynth::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) -{ - if (index == 0) - { - strcpy(name, programName); - return true; - } - return false; -} - -void mdaSubSynth::setProgram(LvzInt32 program) -{ -} - -void mdaSubSynth::setParameter(LvzInt32 index, float value) -{ - switch(index) - { - case 0: fParam1 = value; break; - case 1: fParam2 = value; break; - case 2: fParam3 = value; break; - case 3: fParam4 = value; break; - case 4: fParam5 = value; break; - case 5: fParam6 = value; break; - } - - dvd = 1.0; - phs = 1.0; - osc = 0.0; //oscillator phase - typ = int(3.5 * fParam1); - filti = (typ == 3)? 0.018f : (float)pow(10.0,-3.0 + (2.0 * fParam3)); - filto = 1.0f - filti; - wet = fParam2; - dry = fParam4; - thr = (float)pow(10.0,-3.0 + (3.0 * fParam5)); - rls = (float)(1.0 - pow(10.0, -2.0 - (3.0 * fParam6))); - dphi = (float)(0.456159 * pow(10.0,-2.5 + (1.5 * fParam3))); -} - -float mdaSubSynth::getParameter(LvzInt32 index) -{ - float v=0; - - switch(index) - { - case 0: v = fParam1; break; - case 1: v = fParam2; break; - case 2: v = fParam3; break; - case 3: v = fParam4; break; - case 4: v = fParam5; break; - case 5: v = fParam6; break; - } - return v; -} - -void mdaSubSynth::getParameterName(LvzInt32 index, char *label) -{ - switch(index) - { - case 0: strcpy(label, "Type"); break; - case 1: strcpy(label, "Level"); break; - case 2: strcpy(label, "Tune"); break; - case 3: strcpy(label, "Dry Mix"); break; - case 4: strcpy(label, "Thresh"); break; - case 5: strcpy(label, "Release"); break; - } -} - -void mdaSubSynth::getParameterDisplay(LvzInt32 index, char *text) -{ - char string[16]; - - switch(index) - { - case 1: sprintf(string, "%d", (LvzInt32)(100.0f * wet)); break; - case 2: sprintf(string, "%d", (LvzInt32)(0.0726 * getSampleRate() * pow(10.0,-2.5 + (1.5 * fParam3)))); break; - case 3: sprintf(string, "%d", (LvzInt32)(100. * dry)); break; - case 4: sprintf(string, "%.1f", 60.0f * fParam5 - 60.0f); break; - case 5: sprintf(string, "%d", (LvzInt32)(-301.03 / (getSampleRate() * log10(rls)))); break; - - case 0: switch(typ) - { - case 0: strcpy(string, "Distort"); break; - case 1: strcpy(string, "Divide"); break; - case 2: strcpy(string, "Invert"); break; - case 3: strcpy(string, "Key Osc."); break; - } - } - - string[8] = 0; - strcpy(text, (char *)string); -} - -void mdaSubSynth::getParameterLabel(LvzInt32 index, char *label) -{ - switch(index) - { - case 0: strcpy(label, " " ); break; - case 1: strcpy(label, "% "); break; - case 2: strcpy(label, "Hz"); break; - case 3: strcpy(label, "%" ); break; - case 4: strcpy(label, "dB"); break; - case 5: strcpy(label, "ms"); break; - } -} - - -void mdaSubSynth::resume() -{ - phi = env = filt1 = filt2 = filt3 = filt4 = filti = filto = 0.0f; - - setParameter(0, getParameter(0)); -} - -//-------------------------------------------------------------------------------- -// process - -void mdaSubSynth::process(float **inputs, float **outputs, LvzInt32 sampleFrames) -{ - float *in1 = inputs[0]; - float *in2 = inputs[1]; - float *out1 = outputs[0]; - float *out2 = outputs[1]; - float a, b, c, d; - float we, dr, fi, fo, f1, f2, f3, f4, sub, rl, th, dv, ph, phii, dph, os, en; - - dph = dphi; - rl = rls; - phii = phi; - en = env; - os = osc; - th = thr; - dv = dvd; - ph = phs; - we = wet; - dr = dry; - f1 = filt1; - f2 = filt2; - f3 = filt3; - f4 = filt4; - fi = filti; - fo = filto; - - --in1; - --in2; - --out1; - --out2; - while(--sampleFrames >= 0) - { - a = *++in1; - b = *++in2; - - c = out1[1]; - d = out2[1]; //process from here... - - f1 = (fo * f1) + (fi * (a + b)); - f2 = (fo * f2) + (fi * f1); - - sub = f2; - if (sub > th) - { - sub = 1.0; - } - else - { - if(sub < -th) - { - sub = -1.0; - } - else - { - sub = 0.0; - } - } - - if((sub * dv) < 0) //octave divider - { - dv = -dv; if(dv < 0.) ph = -ph; - } - - if(typ == 1) //divide - { - sub = ph * sub; - } - if(typ == 2) //invert - { - sub = (float)(ph * f2 * 2.0); - } - if(typ == 3) //osc - { - if (f2 > th) {en = 1.0; } - else {en = en * rl;} - sub = (float)(en * sin(phii)); - phii = (float)fmod( phii + dph, 6.283185f ); - } - - f3 = (fo * f3) + (fi * sub); - f4 = (fo * f4) + (fi * f3); - - c += (a * dr) + (f4 * we); // output - d += (b * dr) + (f4 * we); - - *++out1 = c; - *++out2 = d; - } - if(fabs(f1)<1.0e-10) filt1=0.f; else filt1=f1; - if(fabs(f2)<1.0e-10) filt2=0.f; else filt2=f2; - if(fabs(f3)<1.0e-10) filt3=0.f; else filt3=f3; - if(fabs(f4)<1.0e-10) filt4=0.f; else filt4=f4; - dvd = dv; - phs = ph; - osc = os; - phi = phii; - env = en; -} - -void mdaSubSynth::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) -{ - float *in1 = inputs[0]; - float *in2 = inputs[1]; - float *out1 = outputs[0]; - float *out2 = outputs[1]; - float a, b, c, d; - float we, dr, fi, fo, f1, f2, f3, f4, sub, rl, th, dv, ph, phii, dph, os, en; - - dph = dphi; - rl = rls; - phii = phi; - en = env; - os = osc; - th = thr; - dv = dvd; - ph = phs; - we = wet; - dr = dry; - f1 = filt1; - f2 = filt2; - f3 = filt3; - f4 = filt4; - - fi = filti; - fo = filto; - - --in1; - --in2; - --out1; - --out2; - while(--sampleFrames >= 0) - { - a = *++in1; - b = *++in2; //process from here... - - f1 = (fo * f1) + (fi * (a + b)); - f2 = (fo * f2) + (fi * f1); - - sub = f2; - if (sub > th) - { - sub = 1.0; - } - else - { - if(sub < -th) - { - sub = -1.0; - } - else - { - sub = 0.0; - } - } - - if((sub * dv) < 0) //octave divider - { - dv = -dv; if(dv < 0.) ph = -ph; - } - - if(typ == 1) //divide - { - sub = ph * sub; - } - if(typ == 2) //invert - { - sub = (float)(ph * f2 * 2.0); - } - if(typ == 3) //osc - { - if (f2 > th) {en = 1.0; } - else {en = en * rl;} - sub = (float)(en * sin(phii)); - phii = (float)fmod( phii + dph, 6.283185f ); - } - - f3 = (fo * f3) + (fi * sub); - f4 = (fo * f4) + (fi * f3); - - c = (a * dr) + (f4 * we); // output - d = (b * dr) + (f4 * we); - - *++out1 = c; - *++out2 = d; - } - if(fabs(f1)<1.0e-10) filt1=0.f; else filt1=f1; - if(fabs(f2)<1.0e-10) filt2=0.f; else filt2=f2; - if(fabs(f3)<1.0e-10) filt3=0.f; else filt3=f3; - if(fabs(f4)<1.0e-10) filt4=0.f; else filt4=f4; - dvd = dv; - phs = ph; - osc = os; - phi = phii; - env = en; -} +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#include "mdaSubSynth.h" + +#include +#include + +AudioEffect *createEffectInstance(audioMasterCallback audioMaster) +{ + return new mdaSubSynth(audioMaster); +} + +mdaSubSynth::mdaSubSynth(audioMasterCallback audioMaster) + : AudioEffectX(audioMaster, 1, 6) // programs, parameters +{ + //inits here! + fParam1 = (float)0.0; //type + fParam2 = (float)0.3; //level + fParam3 = (float)0.6; //tune + fParam4 = (float)1.0; //dry mix + fParam5 = (float)0.6; //thresh + fParam6 = (float)0.65; //release + + setNumInputs(2); + setNumOutputs(2); + setUniqueID("mdaSubSynth"); // identify here + DECLARE_LVZ_DEPRECATED(canMono) (); + canProcessReplacing(); + strcpy(programName, "Sub Bass Synthesizer"); + + resume(); +} + +mdaSubSynth::~mdaSubSynth() +{ + +} + +bool mdaSubSynth::getProductString(char* text) { strcpy(text, "MDA SubSynth"); return true; } +bool mdaSubSynth::getVendorString(char* text) { strcpy(text, "mda"); return true; } +bool mdaSubSynth::getEffectName(char* name) { strcpy(name, "SubSynth"); return true; } + +void mdaSubSynth::setProgramName(char *name) +{ + strcpy(programName, name); +} + +void mdaSubSynth::getProgramName(char *name) +{ + strcpy(name, programName); +} + +bool mdaSubSynth::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +{ + if (index == 0) + { + strcpy(name, programName); + return true; + } + return false; +} + +void mdaSubSynth::setProgram(LvzInt32 program) +{ +} + +void mdaSubSynth::setParameter(LvzInt32 index, float value) +{ + switch(index) + { + case 0: fParam1 = value; break; + case 1: fParam2 = value; break; + case 2: fParam3 = value; break; + case 3: fParam4 = value; break; + case 4: fParam5 = value; break; + case 5: fParam6 = value; break; + } + + dvd = 1.0; + phs = 1.0; + osc = 0.0; //oscillator phase + typ = int(3.5 * fParam1); + filti = (typ == 3)? 0.018f : (float)pow(10.0,-3.0 + (2.0 * fParam3)); + filto = 1.0f - filti; + wet = fParam2; + dry = fParam4; + thr = (float)pow(10.0,-3.0 + (3.0 * fParam5)); + rls = (float)(1.0 - pow(10.0, -2.0 - (3.0 * fParam6))); + dphi = (float)(0.456159 * pow(10.0,-2.5 + (1.5 * fParam3))); +} + +float mdaSubSynth::getParameter(LvzInt32 index) +{ + float v=0; + + switch(index) + { + case 0: v = fParam1; break; + case 1: v = fParam2; break; + case 2: v = fParam3; break; + case 3: v = fParam4; break; + case 4: v = fParam5; break; + case 5: v = fParam6; break; + } + return v; +} + +void mdaSubSynth::getParameterName(LvzInt32 index, char *label) +{ + switch(index) + { + case 0: strcpy(label, "Type"); break; + case 1: strcpy(label, "Level"); break; + case 2: strcpy(label, "Tune"); break; + case 3: strcpy(label, "Dry Mix"); break; + case 4: strcpy(label, "Thresh"); break; + case 5: strcpy(label, "Release"); break; + } +} + +void mdaSubSynth::getParameterDisplay(LvzInt32 index, char *text) +{ + char string[16]; + + switch(index) + { + case 1: sprintf(string, "%d", (LvzInt32)(100.0f * wet)); break; + case 2: sprintf(string, "%d", (LvzInt32)(0.0726 * getSampleRate() * pow(10.0,-2.5 + (1.5 * fParam3)))); break; + case 3: sprintf(string, "%d", (LvzInt32)(100. * dry)); break; + case 4: sprintf(string, "%.1f", 60.0f * fParam5 - 60.0f); break; + case 5: sprintf(string, "%d", (LvzInt32)(-301.03 / (getSampleRate() * log10(rls)))); break; + + case 0: switch(typ) + { + case 0: strcpy(string, "Distort"); break; + case 1: strcpy(string, "Divide"); break; + case 2: strcpy(string, "Invert"); break; + case 3: strcpy(string, "Key Osc."); break; + } + } + + string[8] = 0; + strcpy(text, (char *)string); +} + +void mdaSubSynth::getParameterLabel(LvzInt32 index, char *label) +{ + switch(index) + { + case 0: strcpy(label, " " ); break; + case 1: strcpy(label, "% "); break; + case 2: strcpy(label, "Hz"); break; + case 3: strcpy(label, "%" ); break; + case 4: strcpy(label, "dB"); break; + case 5: strcpy(label, "ms"); break; + } +} + + +void mdaSubSynth::resume() +{ + phi = env = filt1 = filt2 = filt3 = filt4 = filti = filto = 0.0f; + + setParameter(0, getParameter(0)); +} + +//-------------------------------------------------------------------------------- +// process + +void mdaSubSynth::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +{ + float *in1 = inputs[0]; + float *in2 = inputs[1]; + float *out1 = outputs[0]; + float *out2 = outputs[1]; + float a, b, c, d; + float we, dr, fi, fo, f1, f2, f3, f4, sub, rl, th, dv, ph, phii, dph, os, en; + + dph = dphi; + rl = rls; + phii = phi; + en = env; + os = osc; + th = thr; + dv = dvd; + ph = phs; + we = wet; + dr = dry; + f1 = filt1; + f2 = filt2; + f3 = filt3; + f4 = filt4; + fi = filti; + fo = filto; + + --in1; + --in2; + --out1; + --out2; + while(--sampleFrames >= 0) + { + a = *++in1; + b = *++in2; + + c = out1[1]; + d = out2[1]; //process from here... + + f1 = (fo * f1) + (fi * (a + b)); + f2 = (fo * f2) + (fi * f1); + + sub = f2; + if (sub > th) + { + sub = 1.0; + } + else + { + if(sub < -th) + { + sub = -1.0; + } + else + { + sub = 0.0; + } + } + + if((sub * dv) < 0) //octave divider + { + dv = -dv; if(dv < 0.) ph = -ph; + } + + if(typ == 1) //divide + { + sub = ph * sub; + } + if(typ == 2) //invert + { + sub = (float)(ph * f2 * 2.0); + } + if(typ == 3) //osc + { + if (f2 > th) {en = 1.0; } + else {en = en * rl;} + sub = (float)(en * sin(phii)); + phii = (float)fmod( phii + dph, 6.283185f ); + } + + f3 = (fo * f3) + (fi * sub); + f4 = (fo * f4) + (fi * f3); + + c += (a * dr) + (f4 * we); // output + d += (b * dr) + (f4 * we); + + *++out1 = c; + *++out2 = d; + } + if(fabs(f1)<1.0e-10) filt1=0.f; else filt1=f1; + if(fabs(f2)<1.0e-10) filt2=0.f; else filt2=f2; + if(fabs(f3)<1.0e-10) filt3=0.f; else filt3=f3; + if(fabs(f4)<1.0e-10) filt4=0.f; else filt4=f4; + dvd = dv; + phs = ph; + osc = os; + phi = phii; + env = en; +} + +void mdaSubSynth::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +{ + float *in1 = inputs[0]; + float *in2 = inputs[1]; + float *out1 = outputs[0]; + float *out2 = outputs[1]; + float a, b, c, d; + float we, dr, fi, fo, f1, f2, f3, f4, sub, rl, th, dv, ph, phii, dph, os, en; + + dph = dphi; + rl = rls; + phii = phi; + en = env; + os = osc; + th = thr; + dv = dvd; + ph = phs; + we = wet; + dr = dry; + f1 = filt1; + f2 = filt2; + f3 = filt3; + f4 = filt4; + + fi = filti; + fo = filto; + + --in1; + --in2; + --out1; + --out2; + while(--sampleFrames >= 0) + { + a = *++in1; + b = *++in2; //process from here... + + f1 = (fo * f1) + (fi * (a + b)); + f2 = (fo * f2) + (fi * f1); + + sub = f2; + if (sub > th) + { + sub = 1.0; + } + else + { + if(sub < -th) + { + sub = -1.0; + } + else + { + sub = 0.0; + } + } + + if((sub * dv) < 0) //octave divider + { + dv = -dv; if(dv < 0.) ph = -ph; + } + + if(typ == 1) //divide + { + sub = ph * sub; + } + if(typ == 2) //invert + { + sub = (float)(ph * f2 * 2.0); + } + if(typ == 3) //osc + { + if (f2 > th) {en = 1.0; } + else {en = en * rl;} + sub = (float)(en * sin(phii)); + phii = (float)fmod( phii + dph, 6.283185f ); + } + + f3 = (fo * f3) + (fi * sub); + f4 = (fo * f4) + (fi * f3); + + c = (a * dr) + (f4 * we); // output + d = (b * dr) + (f4 * we); + + *++out1 = c; + *++out2 = d; + } + if(fabs(f1)<1.0e-10) filt1=0.f; else filt1=f1; + if(fabs(f2)<1.0e-10) filt2=0.f; else filt2=f2; + if(fabs(f3)<1.0e-10) filt3=0.f; else filt3=f3; + if(fabs(f4)<1.0e-10) filt4=0.f; else filt4=f4; + dvd = dv; + phs = ph; + osc = os; + phi = phii; + env = en; +} diff --git a/src/mdaSubSynth.h b/src/mdaSubSynth.h index f4e986a..b5a616d 100644 --- a/src/mdaSubSynth.h +++ b/src/mdaSubSynth.h @@ -1,59 +1,59 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#include "audioeffectx.h" - -class mdaSubSynth : public AudioEffectX -{ -public: - mdaSubSynth(audioMasterCallback audioMaster); - ~mdaSubSynth(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgram(LvzInt32 program); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void resume(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fParam5; - float fParam6; - float filt1, filt2, filt3, filt4, filti, filto; - float thr, rls, dry, wet, dvd, phs, osc, env, phi, dphi; - int typ; - - char programName[32]; -}; - - +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#include "audioeffectx.h" + +class mdaSubSynth : public AudioEffectX +{ +public: + mdaSubSynth(audioMasterCallback audioMaster); + ~mdaSubSynth(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgram(LvzInt32 program); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void resume(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fParam5; + float fParam6; + float filt1, filt2, filt3, filt4, filti, filto; + float thr, rls, dry, wet, dvd, phs, osc, env, phi, dphi; + int typ; + + char programName[32]; +}; + + diff --git a/src/mdaTalkBox.h b/src/mdaTalkBox.h index c2894a5..c9d1157 100644 --- a/src/mdaTalkBox.h +++ b/src/mdaTalkBox.h @@ -1,85 +1,85 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#include "audioeffectx.h" - -#define NPARAMS 4 ///number of parameters -#define NPROGS 1 ///number of programs -#define BUF_MAX 1600 -#define ORD_MAX 50 -#define TWO_PI 6.28318530717958647692528676655901f - - -class mdaTalkBoxProgram -{ -public: - mdaTalkBoxProgram(); - ~mdaTalkBoxProgram() {} - -private: - friend class mdaTalkBox; - float param[NPARAMS]; - char name[24]; -}; - - -class mdaTalkBox : public AudioEffectX -{ -public: - mdaTalkBox(audioMasterCallback audioMaster); - ~mdaTalkBox(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgram(LvzInt32 program); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - virtual void resume(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - mdaTalkBoxProgram *programs; - - void lpc(float *buf, float *car, LvzInt32 n, LvzInt32 o); - void lpc_durbin(float *r, int p, float *k, float *g); - - ///global internal variables - float *car0, *car1; - float *window; - float *buf0, *buf1; - - float emphasis; - LvzInt32 K, N, O, pos, swap; - float wet, dry, FX; - - float d0, d1, d2, d3, d4; - float u0, u1, u2, u3, u4; -}; - - +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#include "audioeffectx.h" + +#define NPARAMS 4 ///number of parameters +#define NPROGS 1 ///number of programs +#define BUF_MAX 1600 +#define ORD_MAX 50 +#define TWO_PI 6.28318530717958647692528676655901f + + +class mdaTalkBoxProgram +{ +public: + mdaTalkBoxProgram(); + ~mdaTalkBoxProgram() {} + +private: + friend class mdaTalkBox; + float param[NPARAMS]; + char name[24]; +}; + + +class mdaTalkBox : public AudioEffectX +{ +public: + mdaTalkBox(audioMasterCallback audioMaster); + ~mdaTalkBox(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgram(LvzInt32 program); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + virtual void resume(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + mdaTalkBoxProgram *programs; + + void lpc(float *buf, float *car, LvzInt32 n, LvzInt32 o); + void lpc_durbin(float *r, int p, float *k, float *g); + + ///global internal variables + float *car0, *car1; + float *window; + float *buf0, *buf1; + + float emphasis; + LvzInt32 K, N, O, pos, swap; + float wet, dry, FX; + + float d0, d1, d2, d3, d4; + float u0, u1, u2, u3, u4; +}; + + diff --git a/src/mdaThruZero.h b/src/mdaThruZero.h index e4f58d0..2f35cb2 100644 --- a/src/mdaThruZero.h +++ b/src/mdaThruZero.h @@ -1,75 +1,75 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#define NPARAMS 5 ///number of parameters -#define NPROGS 4 ///number of programs -#define BUFMAX 2048 - -#ifndef __mdaThruZero_H -#define __mdaThruZero_H - -#include "audioeffectx.h" - - -class mdaThruZeroProgram -{ -public: - mdaThruZeroProgram(); -private: - friend class mdaThruZero; - float param[NPARAMS]; - char name[32]; -}; - - -class mdaThruZero : public AudioEffectX -{ -public: - mdaThruZero(audioMasterCallback audioMaster); - ~mdaThruZero(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgram(LvzInt32 program); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - virtual void resume(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - mdaThruZeroProgram *programs; - - ///global internal variables - float rat, dep, wet, dry, fb, dem; //rate, depth, wet & dry mix, feedback, mindepth - float phi, fb1, fb2, deps; //lfo & feedback buffers, depth change smoothing - float *buffer, *buffer2; //maybe use 2D buffer? - LvzInt32 size, bufpos; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#define NPARAMS 5 ///number of parameters +#define NPROGS 4 ///number of programs +#define BUFMAX 2048 + +#ifndef __mdaThruZero_H +#define __mdaThruZero_H + +#include "audioeffectx.h" + + +class mdaThruZeroProgram +{ +public: + mdaThruZeroProgram(); +private: + friend class mdaThruZero; + float param[NPARAMS]; + char name[32]; +}; + + +class mdaThruZero : public AudioEffectX +{ +public: + mdaThruZero(audioMasterCallback audioMaster); + ~mdaThruZero(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgram(LvzInt32 program); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + virtual void resume(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + mdaThruZeroProgram *programs; + + ///global internal variables + float rat, dep, wet, dry, fb, dem; //rate, depth, wet & dry mix, feedback, mindepth + float phi, fb1, fb2, deps; //lfo & feedback buffers, depth change smoothing + float *buffer, *buffer2; //maybe use 2D buffer? + LvzInt32 size, bufpos; +}; + +#endif diff --git a/src/mdaTracker.h b/src/mdaTracker.h index 9caa2c3..9d9228b 100644 --- a/src/mdaTracker.h +++ b/src/mdaTracker.h @@ -1,66 +1,66 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaTracker_H -#define __mdaTracker_H - -#include "audioeffectx.h" - -class mdaTracker : public AudioEffectX -{ -public: - mdaTracker(audioMasterCallback audioMaster); - ~mdaTracker(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual float filterFreq(float hz); - virtual void suspend(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fParam5; - float fParam6; - float fParam7; - float fParam8; - float fi, fo, thr, phi, dphi, ddphi, trans; - float buf1, buf2, dn, bold, wet, dry; - float dyn, env, rel, saw, dsaw; - float res1, res2, buf3, buf4; - LvzInt32 max, min, num, sig, mode; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaTracker_H +#define __mdaTracker_H + +#include "audioeffectx.h" + +class mdaTracker : public AudioEffectX +{ +public: + mdaTracker(audioMasterCallback audioMaster); + ~mdaTracker(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual float filterFreq(float hz); + virtual void suspend(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fParam5; + float fParam6; + float fParam7; + float fParam8; + float fi, fo, thr, phi, dphi, ddphi, trans; + float buf1, buf2, dn, bold, wet, dry; + float dyn, env, rel, saw, dsaw; + float res1, res2, buf3, buf4; + LvzInt32 max, min, num, sig, mode; + + char programName[32]; +}; + +#endif diff --git a/src/mdaTransient.h b/src/mdaTransient.h index 6511be9..d62b086 100644 --- a/src/mdaTransient.h +++ b/src/mdaTransient.h @@ -1,59 +1,59 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#ifndef __mdaTransient_H -#define __mdaTransient_H - -#include "audioeffectx.h" - -class mdaTransient : public AudioEffectX -{ -public: - mdaTransient(audioMasterCallback audioMaster); - ~mdaTransient(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - float fParam1; - float fParam2; - float fParam3; - float fParam4; - float fParam5; - float fParam6; - float dry, att1, att2, rel12, att34, rel3, rel4; - float env1, env2, env3, env4, fili, filo, filx, fbuf1, fbuf2; - - char programName[32]; -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#ifndef __mdaTransient_H +#define __mdaTransient_H + +#include "audioeffectx.h" + +class mdaTransient : public AudioEffectX +{ +public: + mdaTransient(audioMasterCallback audioMaster); + ~mdaTransient(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + float fParam1; + float fParam2; + float fParam3; + float fParam4; + float fParam5; + float fParam6; + float dry, att1, att2, rel12, att34, rel3, rel4; + float env1, env2, env3, env4, fili, filo, filx, fbuf1, fbuf2; + + char programName[32]; +}; + +#endif diff --git a/src/mdaVocInput.h b/src/mdaVocInput.h index 5df8fa1..c574182 100644 --- a/src/mdaVocInput.h +++ b/src/mdaVocInput.h @@ -1,84 +1,84 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#define NPARAMS 5 ///number of parameters -#define NPROGS 1 ///number of programs - -#ifndef __mdaVocInput_H -#define __mdaVocInput_H - -#include "audioeffectx.h" - - -class mdaVocInputProgram -{ -public: - mdaVocInputProgram(); -private: - friend class mdaVocInput; - float param[NPARAMS]; - char name[32]; -}; - - -class mdaVocInput : public AudioEffectX -{ -public: - mdaVocInput(audioMasterCallback audioMaster); - ~mdaVocInput(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgram(LvzInt32 program); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void midi2string(LvzInt32 n, char *text); - virtual void suspend(); - virtual void resume(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - mdaVocInputProgram *programs; - - ///global internal variables - LvzInt32 track; //track input pitch - float pstep; //output sawtooth inc per sample - float pmult; //tuning multiplier - float sawbuf; - float noise; //breath noise level - float lenv, henv; //LF and overall envelope - float lbuf0, lbuf1; //LF filter buffers - float lbuf2; //previous LF sample - float lbuf3; //period measurement - float lfreq; //LF filter coeff - float vuv; //voiced/unvoiced threshold - float maxp, minp; //preferred period range - double root; //tuning reference (MIDI note 0 in Hz) -}; - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#define NPARAMS 5 ///number of parameters +#define NPROGS 1 ///number of programs + +#ifndef __mdaVocInput_H +#define __mdaVocInput_H + +#include "audioeffectx.h" + + +class mdaVocInputProgram +{ +public: + mdaVocInputProgram(); +private: + friend class mdaVocInput; + float param[NPARAMS]; + char name[32]; +}; + + +class mdaVocInput : public AudioEffectX +{ +public: + mdaVocInput(audioMasterCallback audioMaster); + ~mdaVocInput(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgram(LvzInt32 program); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void midi2string(LvzInt32 n, char *text); + virtual void suspend(); + virtual void resume(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + mdaVocInputProgram *programs; + + ///global internal variables + LvzInt32 track; //track input pitch + float pstep; //output sawtooth inc per sample + float pmult; //tuning multiplier + float sawbuf; + float noise; //breath noise level + float lenv, henv; //LF and overall envelope + float lbuf0, lbuf1; //LF filter buffers + float lbuf2; //previous LF sample + float lbuf3; //period measurement + float lfreq; //LF filter coeff + float vuv; //voiced/unvoiced threshold + float maxp, minp; //preferred period range + double root; //tuning reference (MIDI note 0 in Hz) +}; + +#endif diff --git a/src/mdaVocoder.h b/src/mdaVocoder.h index 4158258..91d026b 100644 --- a/src/mdaVocoder.h +++ b/src/mdaVocoder.h @@ -1,80 +1,80 @@ -/* - Copyright 2008-2011 David Robillard - Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) - - This is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . -*/ - -#define NPARAMS 8 ///number of parameters -#define NPROGS 5 ///number of programs -#define NBANDS 16 ///max vocoder bands - -#ifndef __mdaVocoder_H -#define __mdaVocoder_H - -#include "audioeffectx.h" - - -class mdaVocoderProgram -{ -public: - mdaVocoderProgram(); -private: - friend class mdaVocoder; - float param[NPARAMS]; - char name[32]; -}; - - -class mdaVocoder : public AudioEffectX -{ -public: - mdaVocoder(audioMasterCallback audioMaster); - ~mdaVocoder(); - - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void setProgram(LvzInt32 program); - virtual void setProgramName(char *name); - virtual void getProgramName(char *name); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); - virtual void setParameter(LvzInt32 index, float value); - virtual float getParameter(LvzInt32 index); - virtual void getParameterLabel(LvzInt32 index, char *label); - virtual void getParameterDisplay(LvzInt32 index, char *text); - virtual void getParameterName(LvzInt32 index, char *text); - virtual void suspend(); - virtual void resume(); - - virtual bool getEffectName(char *name); - virtual bool getVendorString(char *text); - virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } - -protected: - mdaVocoderProgram *programs; - - ///global internal variables - LvzInt32 swap; //input channel swap - float gain; //output level - float thru, high; //hf thru - float kout; //downsampled output - LvzInt32 kval; //downsample counter - LvzInt32 nbnd; //number of bands - - //filter coeffs and buffers - seems it's faster to leave this global than make local copy - float f[NBANDS][13]; //[0-8][0 1 2 | 0 1 2 3 | 0 1 2 3 | val rate] -}; // # reson | carrier |modulator| envelope - -#endif +/* + Copyright 2008-2011 David Robillard + Copyright 1999-2000 Paul Kellett (Maxim Digital Audio) + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#define NPARAMS 8 ///number of parameters +#define NPROGS 5 ///number of programs +#define NBANDS 16 ///max vocoder bands + +#ifndef __mdaVocoder_H +#define __mdaVocoder_H + +#include "audioeffectx.h" + + +class mdaVocoderProgram +{ +public: + mdaVocoderProgram(); +private: + friend class mdaVocoder; + float param[NPARAMS]; + char name[32]; +}; + + +class mdaVocoder : public AudioEffectX +{ +public: + mdaVocoder(audioMasterCallback audioMaster); + ~mdaVocoder(); + + virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void setProgram(LvzInt32 program); + virtual void setProgramName(char *name); + virtual void getProgramName(char *name); + virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name); + virtual void setParameter(LvzInt32 index, float value); + virtual float getParameter(LvzInt32 index); + virtual void getParameterLabel(LvzInt32 index, char *label); + virtual void getParameterDisplay(LvzInt32 index, char *text); + virtual void getParameterName(LvzInt32 index, char *text); + virtual void suspend(); + virtual void resume(); + + virtual bool getEffectName(char *name); + virtual bool getVendorString(char *text); + virtual bool getProductString(char *text); + virtual LvzInt32 getVendorVersion() { return 1000; } + +protected: + mdaVocoderProgram *programs; + + ///global internal variables + LvzInt32 swap; //input channel swap + float gain; //output level + float thru, high; //hf thru + float kout; //downsampled output + LvzInt32 kval; //downsample counter + LvzInt32 nbnd; //number of bands + + //filter coeffs and buffers - seems it's faster to leave this global than make local copy + float f[NBANDS][13]; //[0-8][0 1 2 | 0 1 2 3 | 0 1 2 3 | val rate] +}; // # reson | carrier |modulator| envelope + +#endif -- cgit v1.2.1