diff options
author | David Robillard <d@drobilla.net> | 2012-03-28 04:51:46 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-28 04:51:46 +0000 |
commit | 42cb454c24e2772696c281860e333becffc2e2ca (patch) | |
tree | 06fdd0f78a29a4cc0d10c08d12d2ef9636e16ba1 /src | |
parent | e878fbbae2d686d86848b5353747fd9e359cb2d0 (diff) | |
download | mda.lv2-42cb454c24e2772696c281860e333becffc2e2ca.tar.gz mda.lv2-42cb454c24e2772696c281860e333becffc2e2ca.tar.bz2 mda.lv2-42cb454c24e2772696c281860e333becffc2e2ca.zip |
Remove pointless int32 typedef.
git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/mda.lv2@4127 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
74 files changed, 1121 insertions, 1121 deletions
diff --git a/src/mdaAmbience.cpp b/src/mdaAmbience.cpp index 51b7fb9..59fc7ba 100644 --- a/src/mdaAmbience.cpp +++ b/src/mdaAmbience.cpp @@ -56,7 +56,7 @@ mdaAmbience::mdaAmbience(audioMasterCallback audioMaster) : AudioEffectX(audioMa setParameter(0, 0.7f); //go and set initial values! } -void mdaAmbience::setParameter(LvzInt32 index, float value) +void mdaAmbience::setParameter(int32_t index, float value) { float tmp; @@ -110,7 +110,7 @@ void mdaAmbience::getProgramName(char *name) strcpy(name, programName); } -bool mdaAmbience::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaAmbience::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -120,7 +120,7 @@ bool mdaAmbience::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char return false; } -float mdaAmbience::getParameter(LvzInt32 index) +float mdaAmbience::getParameter(int32_t index) { float v=0; @@ -134,7 +134,7 @@ float mdaAmbience::getParameter(LvzInt32 index) return v; } -void mdaAmbience::getParameterName(LvzInt32 index, char *label) +void mdaAmbience::getParameterName(int32_t index, char *label) { switch(index) { @@ -145,7 +145,7 @@ void mdaAmbience::getParameterName(LvzInt32 index, char *label) } } -void mdaAmbience::getParameterDisplay(LvzInt32 index, char *text) +void mdaAmbience::getParameterDisplay(int32_t index, char *text) { switch(index) { @@ -156,7 +156,7 @@ void mdaAmbience::getParameterDisplay(LvzInt32 index, char *text) } } -void mdaAmbience::getParameterLabel(LvzInt32 index, char *label) +void mdaAmbience::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -170,7 +170,7 @@ void mdaAmbience::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaAmbience::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaAmbience::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -178,14 +178,14 @@ void mdaAmbience::process(float **inputs, float **outputs, LvzInt32 sampleFrames float *out2 = outputs[1]; float a, b, c, d, r; float t, f=fil, fb=fbak, dmp=damp, y=dry, w=wet; - LvzInt32 p=pos, d1, d2, d3, d4; + int32_t p=pos, d1, d2, d3, d4; if(rdy==0) suspend(); - d1 = (p + (LvzInt32)(107 * size)) & 1023; - d2 = (p + (LvzInt32)(142 * size)) & 1023; - d3 = (p + (LvzInt32)(277 * size)) & 1023; - d4 = (p + (LvzInt32)(379 * size)) & 1023; + d1 = (p + (int32_t)(107 * size)) & 1023; + d2 = (p + (int32_t)(142 * size)) & 1023; + d3 = (p + (int32_t)(277 * size)) & 1023; + d4 = (p + (int32_t)(379 * size)) & 1023; --in1; --in2; @@ -238,7 +238,7 @@ void mdaAmbience::process(float **inputs, float **outputs, LvzInt32 sampleFrames else { fil=0.0f; if(den==0) { den=1; suspend(); } } } -void mdaAmbience::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaAmbience::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -246,14 +246,14 @@ void mdaAmbience::processReplacing(float **inputs, float **outputs, LvzInt32 sam float *out2 = outputs[1]; float a, b, r; float t, f=fil, fb=fbak, dmp=damp, y=dry, w=wet; - LvzInt32 p=pos, d1, d2, d3, d4; + int32_t p=pos, d1, d2, d3, d4; if(rdy==0) suspend(); - d1 = (p + (LvzInt32)(107 * size)) & 1023; - d2 = (p + (LvzInt32)(142 * size)) & 1023; - d3 = (p + (LvzInt32)(277 * size)) & 1023; - d4 = (p + (LvzInt32)(379 * size)) & 1023; + d1 = (p + (int32_t)(107 * size)) & 1023; + d2 = (p + (int32_t)(142 * size)) & 1023; + d3 = (p + (int32_t)(277 * size)) & 1023; + d4 = (p + (int32_t)(379 * size)) & 1023; --in1; --in2; diff --git a/src/mdaAmbience.h b/src/mdaAmbience.h index 7615fe9..ebbf526 100644 --- a/src/mdaAmbience.h +++ b/src/mdaAmbience.h @@ -27,22 +27,22 @@ public: mdaAmbience(audioMasterCallback audioMaster); ~mdaAmbience(); - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam0; @@ -53,7 +53,7 @@ protected: float *buf1, *buf2, *buf3, *buf4; float fil, fbak, damp, wet, dry, size; - LvzInt32 pos, den, rdy; + int32_t pos, den, rdy; char programName[32]; }; diff --git a/src/mdaBandisto.cpp b/src/mdaBandisto.cpp index 1ac2ff2..64d893c 100644 --- a/src/mdaBandisto.cpp +++ b/src/mdaBandisto.cpp @@ -101,7 +101,7 @@ void mdaBandisto::getProgramName(char *name) strcpy(name, programName); } -bool mdaBandisto::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaBandisto::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -111,7 +111,7 @@ bool mdaBandisto::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char return false; } -void mdaBandisto::setParameter(LvzInt32 index, float value) +void mdaBandisto::setParameter(int32_t index, float value) { switch(index) { @@ -159,7 +159,7 @@ void mdaBandisto::setParameter(LvzInt32 index, float value) fi2 = (float)pow(10.0,fParam3 - 1.05); fo2=(float)(1.0 - fi2); } -float mdaBandisto::getParameter(LvzInt32 index) +float mdaBandisto::getParameter(int32_t index) { float v=0; @@ -179,7 +179,7 @@ float mdaBandisto::getParameter(LvzInt32 index) return v; } -void mdaBandisto::getParameterName(LvzInt32 index, char *label) +void mdaBandisto::getParameterName(int32_t index, char *label) { switch(index) { @@ -196,7 +196,7 @@ void mdaBandisto::getParameterName(LvzInt32 index, char *label) } } -void mdaBandisto::getParameterDisplay(LvzInt32 index, char *text) +void mdaBandisto::getParameterDisplay(int32_t index, char *text) { switch(index) { @@ -218,7 +218,7 @@ void mdaBandisto::getParameterDisplay(LvzInt32 index, char *text) } } -void mdaBandisto::getParameterLabel(LvzInt32 index, char *label) +void mdaBandisto::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -238,7 +238,7 @@ void mdaBandisto::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaBandisto::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaBandisto::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -293,7 +293,7 @@ void mdaBandisto::process(float **inputs, float **outputs, LvzInt32 sampleFrames fb1=b1; fb2=b2, fb3=l; } -void mdaBandisto::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaBandisto::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaBandisto.h b/src/mdaBandisto.h index 8d3b753..b671199 100644 --- a/src/mdaBandisto.h +++ b/src/mdaBandisto.h @@ -27,21 +27,21 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); virtual bool getEffectName(char *name); virtual bool getVendorString(char *text); virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1, fParam2, fParam3, fParam4; diff --git a/src/mdaBeatBox.cpp b/src/mdaBeatBox.cpp index 84be55f..747f5b0 100644 --- a/src/mdaBeatBox.cpp +++ b/src/mdaBeatBox.cpp @@ -60,11 +60,11 @@ mdaBeatBox::mdaBeatBox(audioMasterCallback audioMaster) : AudioEffectX(audioMast //calcs here hthr = (float)pow(10.f, 2.f * fParam1 - 2.f); - hdel = (LvzInt32)((0.04 + 0.20 * fParam2) * getSampleRate()); + hdel = (int32_t)((0.04 + 0.20 * fParam2) * getSampleRate()); sthr = (float)(40.0 * pow(10.f, 2.f * fParam7 - 2.f)); - sdel = (LvzInt32)(0.12 * getSampleRate()); + sdel = (int32_t)(0.12 * getSampleRate()); kthr = (float)(220.0 * pow(10.f, 2.f * fParam4 - 2.f)); - kdel = (LvzInt32)(0.10 * getSampleRate()); + kdel = (int32_t)(0.10 * getSampleRate()); hlev = (float)(0.0001f + fParam3 * fParam3 * 4.f); klev = (float)(0.0001f + fParam6 * fParam6 * 4.f); @@ -101,7 +101,7 @@ void mdaBeatBox::getProgramName(char *name) strcpy(name, programName); } -bool mdaBeatBox::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaBeatBox::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -111,7 +111,7 @@ bool mdaBeatBox::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* return false; } -void mdaBeatBox::setParameter(LvzInt32 index, float value) +void mdaBeatBox::setParameter(int32_t index, float value) { switch(index) { @@ -130,7 +130,7 @@ void mdaBeatBox::setParameter(LvzInt32 index, float value) } //calcs here hthr = (float)pow(10.f, 2.f * fParam1 - 2.f); - hdel = (LvzInt32)((0.04 + 0.20 * fParam2) * getSampleRate()); + hdel = (int32_t)((0.04 + 0.20 * fParam2) * getSampleRate()); sthr = (float)(40.0 * pow(10.f, 2.f * fParam7 - 2.f)); kthr = (float)(220.0 * pow(10.f, 2.f * fParam4 - 2.f)); @@ -149,10 +149,10 @@ void mdaBeatBox::setParameter(LvzInt32 index, float value) ksf1 = (float)cos(3.1415927 * kww); //p ksf2 = (float)sin(3.1415927 * kww); //q - if(wwx != ww) sfx = (LvzInt32)(2 * getSampleRate()); - if(kwwx != kww) ksfx = (LvzInt32)(2 * getSampleRate()); + if(wwx != ww) sfx = (int32_t)(2 * getSampleRate()); + if(kwwx != kww) ksfx = (int32_t)(2 * getSampleRate()); - rec = (LvzInt32)(4.9 * fParam11); + rec = (int32_t)(4.9 * fParam11); if ((rec!=recx) && (recpos>0)) //finish sample { switch(rec) @@ -182,7 +182,7 @@ void mdaBeatBox::suspend() void mdaBeatBox::synth() { - LvzInt32 t; + int32_t t; float e=0.00012f, de, o, o1=0.f, o2=0.f, p=0.2f, dp; memset(hbuf, 0, hbuflen * sizeof(float)); //generate hi-hat @@ -215,7 +215,7 @@ void mdaBeatBox::synth() } } -float mdaBeatBox::getParameter(LvzInt32 index) +float mdaBeatBox::getParameter(int32_t index) { float v=0; @@ -237,7 +237,7 @@ float mdaBeatBox::getParameter(LvzInt32 index) return v; } -void mdaBeatBox::getParameterName(LvzInt32 index, char *label) +void mdaBeatBox::getParameterName(int32_t index, char *label) { switch(index) { @@ -257,24 +257,24 @@ void mdaBeatBox::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } void float2strng(float value, char *string) { sprintf(string, "%.2f", value); } -void mdaBeatBox::getParameterDisplay(LvzInt32 index, char *text) +void mdaBeatBox::getParameterDisplay(int32_t index, char *text) { switch(index) { case 0: float2strng((float)(40.0*fParam1 - 40.0),text); break; - case 1: int2strng((LvzInt32)(1000.f * hdel / getSampleRate()),text); break; - case 2: int2strng((LvzInt32)(20.f * log10(hlev)),text); break; + case 1: int2strng((int32_t)(1000.f * hdel / getSampleRate()),text); break; + case 2: int2strng((int32_t)(20.f * log10(hlev)),text); break; case 3: float2strng((float)(40.0*fParam4 - 40.0),text); break; - case 4: int2strng((LvzInt32)(0.5 * kww * getSampleRate()), text); break; - case 5: int2strng((LvzInt32)(20.f * log10(klev)),text); break; + case 4: int2strng((int32_t)(0.5 * kww * getSampleRate()), text); break; + case 5: int2strng((int32_t)(20.f * log10(klev)),text); break; case 6: float2strng((float)(40.0*fParam7 - 40.0),text); break; - case 7: int2strng((LvzInt32)(0.5 * ww * getSampleRate()), text); break; - case 8: int2strng((LvzInt32)(20.f * log10(slev)),text); break; - case 9: int2strng((LvzInt32)(100.f * fParam10),text); break; - case 11: int2strng((LvzInt32)(20.f * log10(fParam12)),text); break; + case 7: int2strng((int32_t)(0.5 * ww * getSampleRate()), text); break; + case 8: int2strng((int32_t)(20.f * log10(slev)),text); break; + case 9: int2strng((int32_t)(100.f * fParam10),text); break; + case 11: int2strng((int32_t)(20.f * log10(fParam12)),text); break; case 10: switch(rec) { case 0: strcpy(text, "-"); break; @@ -285,7 +285,7 @@ void mdaBeatBox::getParameterDisplay(LvzInt32 index, char *text) } } -void mdaBeatBox::getParameterLabel(LvzInt32 index, char *label) +void mdaBeatBox::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -307,20 +307,20 @@ void mdaBeatBox::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaBeatBox::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaBeatBox::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; float *out1 = outputs[0]; float *out2 = outputs[1]; float a, b, c, d, e, o, hf=hfil, ht=hthr, mx3=0.f, mx1=mix; - LvzInt32 hp=hbufpos, hl=hbuflen-2, hd=hdel; + int32_t hp=hbufpos, hl=hbuflen-2, hd=hdel; float kt=kthr; - LvzInt32 kp=kbufpos, kl=kbuflen-2, kd=kdel; + int32_t kp=kbufpos, kl=kbuflen-2, kd=kdel; float st=sthr, s, f1=sb1, f2=sb2, b1=sf1, b2=sf2, b3=sf3; float k, kf1=ksb1, kf2=ksb2, kb1=ksf1, kb2=ksf2; float hlv=hlev, klv=klev, slv=slev; - LvzInt32 sp=sbufpos, sl=sbuflen-2, sd=sdel; + int32_t sp=sbufpos, sl=sbuflen-2, sd=sdel; float ya=dyna, yr=dynr, ye=dyne, ym=dynm, mx4; if(sfx>0) { mx3=0.08f; slv=0.f; klv=0.f; hlv=0.f; mx1=0.f; sfx-=sampleFrames;} //key listen (snare) @@ -402,20 +402,20 @@ void mdaBeatBox::process(float **inputs, float **outputs, LvzInt32 sampleFrames) dyne=ye; } -void mdaBeatBox::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaBeatBox::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; float *out1 = outputs[0]; float *out2 = outputs[1]; float a, b, e, o, hf=hfil, ht=hthr, mx3=0.f, mx1=mix; - LvzInt32 hp=hbufpos, hl=hbuflen-2, hd=hdel; + int32_t hp=hbufpos, hl=hbuflen-2, hd=hdel; float kt=kthr; - LvzInt32 kp=kbufpos, kl=kbuflen-2, kd=kdel; + int32_t kp=kbufpos, kl=kbuflen-2, kd=kdel; float st=sthr, s, f1=sb1, f2=sb2, b1=sf1, b2=sf2, b3=sf3; float k, kf1=ksb1, kf2=ksb2, kb1=ksf1, kb2=ksf2; float hlv=hlev, klv=klev, slv=slev; - LvzInt32 sp=sbufpos, sl=sbuflen-2, sd=sdel; + int32_t sp=sbufpos, sl=sbuflen-2, sd=sdel; float ya=dyna, yr=dynr, ye=dyne, ym=dynm, mx4; if(sfx>0) { mx3=0.08f; slv=0.f; klv=0.f; hlv=0.f; mx1=0.f; sfx-=sampleFrames;} //key listen (snare) diff --git a/src/mdaBeatBox.h b/src/mdaBeatBox.h index 414e5d2..f14426a 100644 --- a/src/mdaBeatBox.h +++ b/src/mdaBeatBox.h @@ -27,23 +27,23 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; @@ -67,10 +67,10 @@ protected: 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; + int32_t hbuflen, hbufpos, hdel; + int32_t sbuflen, sbufpos, sdel, sfx; + int32_t kbuflen, kbufpos, kdel, ksfx; + int32_t rec, recx, recpos; char programName[32]; }; diff --git a/src/mdaCombo.cpp b/src/mdaCombo.cpp index 84b5c70..bd11605 100644 --- a/src/mdaCombo.cpp +++ b/src/mdaCombo.cpp @@ -57,7 +57,7 @@ bool mdaCombo::getProductString(char* text) { strcpy(text, "MDA Combo"); return bool mdaCombo::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaCombo::getEffectName(char* name) { strcpy(name, "Combo"); return true; } -void mdaCombo::setParameter(LvzInt32 index, float value) +void mdaCombo::setParameter(int32_t index, float value) { switch(index) { @@ -180,7 +180,7 @@ void mdaCombo::getProgramName(char *name) strcpy(name, programName); } -bool mdaCombo::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaCombo::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -190,7 +190,7 @@ bool mdaCombo::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* n return false; } -float mdaCombo::getParameter(LvzInt32 index) +float mdaCombo::getParameter(int32_t index) { float v=0; @@ -207,7 +207,7 @@ float mdaCombo::getParameter(LvzInt32 index) return v; } -void mdaCombo::getParameterName(LvzInt32 index, char *label) +void mdaCombo::getParameterName(int32_t index, char *label) { switch(index) { @@ -222,10 +222,10 @@ void mdaCombo::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } void float2strng(float value, char *string) { sprintf(string, "%.2f", value); } -void mdaCombo::getParameterDisplay(LvzInt32 index, char *text) +void mdaCombo::getParameterDisplay(int32_t index, char *text) { switch(index) { @@ -241,17 +241,17 @@ void mdaCombo::getParameterDisplay(LvzInt32 index, char *text) case 6: strcpy(text, "4x12 >"); break; } break; - case 1: int2strng((LvzInt32)(200 * fParam2 - 100), text); break; - case 2: int2strng((LvzInt32)(200 * fParam3 - 100), text); break; - case 3: int2strng((LvzInt32)(40 * fParam4 - 20), text); break; + case 1: int2strng((int32_t)(200 * fParam2 - 100), text); break; + case 2: int2strng((int32_t)(200 * fParam3 - 100), text); break; + case 3: int2strng((int32_t)(40 * fParam4 - 20), text); break; case 4: if(fParam5>0.0) strcpy(text, "STEREO"); else strcpy(text, "MONO"); break; - case 5: int2strng((LvzInt32)(100 * fParam6), text); break; - case 6: int2strng((LvzInt32)(100 * fParam7), text); break; + case 5: int2strng((int32_t)(100 * fParam6), text); break; + case 6: int2strng((int32_t)(100 * fParam7), text); break; } } -void mdaCombo::getParameterLabel(LvzInt32 index, char *label) +void mdaCombo::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -268,7 +268,7 @@ void mdaCombo::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaCombo::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaCombo::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -279,7 +279,7 @@ void mdaCombo::process(float **inputs, float **outputs, LvzInt32 sampleFrames) float f1=ff1, f2=ff2, f3=ff3, f4=ff4, f5=ff5; float a2, b2, f6=ff6, f7=ff7, f8=ff8, f9=ff9, f10=ff10; float h0=hh0, h1=hh1; - LvzInt32 d1=del1, d2=del2, bp = bufpos; + int32_t d1=del1, d2=del2, bp = bufpos; trm = trim * i * i * i * i; @@ -393,7 +393,7 @@ void mdaCombo::process(float **inputs, float **outputs, LvzInt32 sampleFrames) if(fabs(h0)<1.0e-10) { hh0 = hh1 = 0.0f; } else { hh0=h0; hh1=h1; } } -void mdaCombo::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaCombo::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -404,7 +404,7 @@ void mdaCombo::processReplacing(float **inputs, float **outputs, LvzInt32 sample float f1=ff1, f2=ff2, f3=ff3, f4=ff4, f5=ff5; float a2, b2, f6=ff6, f7=ff7, f8=ff8, f9=ff9, f10=ff10; float hf=hhf, hq=hhq, h0=hh0, h1=hh1; - LvzInt32 d1=del1, d2=del2, bp = bufpos; + int32_t d1=del1, d2=del2, bp = bufpos; trm = trim * i * i * i * i; diff --git a/src/mdaCombo.h b/src/mdaCombo.h index dfa19be..24ddc7e 100644 --- a/src/mdaCombo.h +++ b/src/mdaCombo.h @@ -27,23 +27,23 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; @@ -60,7 +60,7 @@ protected: float hhf, hhq, hh0, hh1; //hpf float *buffer, *buffe2; - LvzInt32 size, bufpos, del1, del2; + int32_t size, bufpos, del1, del2; int mode, ster; char programName[32]; diff --git a/src/mdaDX10.cpp b/src/mdaDX10.cpp index 239eaf0..bc4c8d1 100644 --- a/src/mdaDX10.cpp +++ b/src/mdaDX10.cpp @@ -30,7 +30,7 @@ AudioEffect *createEffectInstance(audioMasterCallback audioMaster) mdaDX10::mdaDX10(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, NPROGS, NPARAMS) { - LvzInt32 i=0; + int32_t i=0; Fs = 44100.0f; programs = new mdaDX10Program[NPROGS]; @@ -114,7 +114,7 @@ void mdaDX10::update() //parameter change //if multitimbral would have to move if(param[4]<0.5f) ratf = 0.2f * param[4] * param[4]; else - switch((LvzInt32)(8.9f * param[4])) + switch((int32_t)(8.9f * param[4])) { case 4: ratf = 0.25f; break; case 5: ratf = 0.33333333f; break; @@ -165,21 +165,21 @@ mdaDX10::~mdaDX10 () //destroy any buffers... } -void mdaDX10::setProgram(LvzInt32 program) +void mdaDX10::setProgram(int32_t program) { curProgram = program; update(); } -void mdaDX10::setParameter(LvzInt32 index, float value) +void mdaDX10::setParameter(int32_t index, float value) { programs[curProgram].param[index] = value; update(); } -void mdaDX10::fillpatch(LvzInt32 p, const char *name, +void mdaDX10::fillpatch(int32_t 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) @@ -196,16 +196,16 @@ void mdaDX10::fillpatch(LvzInt32 p, const char *name, } -float mdaDX10::getParameter(LvzInt32 index) { return programs[curProgram].param[index]; } +float mdaDX10::getParameter(int32_t index) { return programs[curProgram].param[index]; } void mdaDX10::setProgramName(char *name) { strcpy(programs[curProgram].name, name); } void mdaDX10::getProgramName(char *name) { strcpy(name, programs[curProgram].name); } -void mdaDX10::setBlockSize(LvzInt32 blockSize) { AudioEffectX::setBlockSize(blockSize); } +void mdaDX10::setBlockSize(int32_t blockSize) { AudioEffectX::setBlockSize(blockSize); } bool mdaDX10::getEffectName(char* name) { strcpy(name, "DX10"); return true; } bool mdaDX10::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaDX10::getProductString(char* text) { strcpy(text, "MDA DX10"); return true; } -bool mdaDX10::getOutputProperties(LvzInt32 index, LvzPinProperties* properties) +bool mdaDX10::getOutputProperties(int32_t index, LvzPinProperties* properties) { if(index<NOUTS) { @@ -218,7 +218,7 @@ bool mdaDX10::getOutputProperties(LvzInt32 index, LvzPinProperties* properties) } -bool mdaDX10::getProgramNameIndexed(LvzInt32 category, LvzInt32 index, char* text) +bool mdaDX10::getProgramNameIndexed(int32_t category, int32_t index, char* text) { if ((unsigned int)index < NPROGS) { @@ -229,7 +229,7 @@ bool mdaDX10::getProgramNameIndexed(LvzInt32 category, LvzInt32 index, char* tex } -bool mdaDX10::copyProgram(LvzInt32 destination) +bool mdaDX10::copyProgram(int32_t destination) { if(destination<NPROGS) { @@ -240,7 +240,7 @@ bool mdaDX10::copyProgram(LvzInt32 destination) } -LvzInt32 mdaDX10::canDo(char* text) +int32_t mdaDX10::canDo(char* text) { if(strcmp(text, "receiveLvzEvents") == 0) return 1; if(strcmp(text, "receiveLvzMidiEvent") == 0) return 1; @@ -248,7 +248,7 @@ LvzInt32 mdaDX10::canDo(char* text) } -void mdaDX10::getParameterName(LvzInt32 index, char *label) +void mdaDX10::getParameterName(int32_t index, char *label) { switch (index) { @@ -272,7 +272,7 @@ void mdaDX10::getParameterName(LvzInt32 index, char *label) } -void mdaDX10::getParameterDisplay(LvzInt32 index, char *text) +void mdaDX10::getParameterDisplay(int32_t index, char *text) { char string[16]; float * param = programs[curProgram].param; @@ -281,7 +281,7 @@ void mdaDX10::getParameterDisplay(LvzInt32 index, char *text) { case 3: sprintf(string, "%.0f", rati); break; case 4: sprintf(string, "%.3f", ratf); break; - case 11: sprintf(string, "%d", (LvzInt32)(param[index] * 6.9f) - 3); break; + case 11: sprintf(string, "%d", (int32_t)(param[index] * 6.9f) - 3); break; case 12: sprintf(string, "%.0f", 200.0f * param[index] - 100.0f); break; case 15: sprintf(string, "%.2f", 25.0f * param[index] * param[index]); break; default: sprintf(string, "%.0f", 100.0f * param[index]); @@ -291,7 +291,7 @@ void mdaDX10::getParameterDisplay(LvzInt32 index, char *text) } -void mdaDX10::getParameterLabel(LvzInt32 index, char *label) +void mdaDX10::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -305,13 +305,13 @@ void mdaDX10::getParameterLabel(LvzInt32 index, char *label) } -void mdaDX10::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDX10::process(float **inputs, float **outputs, int32_t sampleFrames) { float* out1 = outputs[0]; float* out2 = outputs[1]; - LvzInt32 event=0, frame=0, frames, v; + int32_t event=0, frame=0, frames, v; float o, x, e, mw=MW, w=rich, m=modmix; - LvzInt32 k=K; + int32_t k=K; if(activevoices>0 || notes[event]<sampleFrames) //detect & bypass completely empty blocks { @@ -362,8 +362,8 @@ void mdaDX10::process(float **inputs, float **outputs, LvzInt32 sampleFrames) if(frame<sampleFrames) //next note on/off { - LvzInt32 note = notes[event++]; - LvzInt32 vel = notes[event++]; + int32_t note = notes[event++]; + int32_t vel = notes[event++]; noteOn(note, vel); } } @@ -385,13 +385,13 @@ void mdaDX10::process(float **inputs, float **outputs, LvzInt32 sampleFrames) } -void mdaDX10::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDX10::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float* out1 = outputs[0]; float* out2 = outputs[1]; - LvzInt32 event=0, frame=0, frames, v; + int32_t event=0, frame=0, frames, v; float o, x, e, mw=MW, w=rich, m=modmix; - LvzInt32 k=K; + int32_t k=K; if(activevoices>0 || notes[event]<sampleFrames) //detect & bypass completely empty blocks { @@ -446,8 +446,8 @@ void mdaDX10::processReplacing(float **inputs, float **outputs, LvzInt32 sampleF if(frame<sampleFrames) //next note on/off { - LvzInt32 note = notes[event++]; - LvzInt32 vel = notes[event++]; + int32_t note = notes[event++]; + int32_t vel = notes[event++]; noteOn(note, vel); } } @@ -476,11 +476,11 @@ void mdaDX10::processReplacing(float **inputs, float **outputs, LvzInt32 sampleF } -void mdaDX10::noteOn(LvzInt32 note, LvzInt32 velocity) +void mdaDX10::noteOn(int32_t note, int32_t velocity) { float * param = programs[curProgram].param; float l = 1.0f; - LvzInt32 v, vl=0; + int32_t v, vl=0; if(velocity>0) { @@ -528,11 +528,11 @@ void mdaDX10::noteOn(LvzInt32 note, LvzInt32 velocity) } -LvzInt32 mdaDX10::processEvents(LvzEvents* ev) +int32_t mdaDX10::processEvents(LvzEvents* ev) { - LvzInt32 npos=0; + int32_t npos=0; - for (LvzInt32 i=0; i<ev->numEvents; i++) + for (int32_t i=0; i<ev->numEvents; i++) { if((ev->events[i])->type != kLvzMidiType) continue; LvzMidiEvent* event = (LvzMidiEvent*)ev->events[i]; @@ -576,7 +576,7 @@ LvzInt32 mdaDX10::processEvents(LvzEvents* ev) default: //all notes off if(midiData[1]>0x7A) { - for(LvzInt32 v=0; v<NVOICES; v++) voice[v].cdec=0.99f; + for(int32_t v=0; v<NVOICES; v++) voice[v].cdec=0.99f; sustain = 0; } break; diff --git a/src/mdaDX10.h b/src/mdaDX10.h index cae4317..02cfe38 100644 --- a/src/mdaDX10.h +++ b/src/mdaDX10.h @@ -52,7 +52,7 @@ struct VOICE //voice state float cenv; //smoothed env float catt; //smoothing float cdec; //carrier envelope decay - LvzInt32 note; //remember what note triggered this + int32_t note; //remember what note triggered this }; @@ -62,37 +62,37 @@ public: mdaDX10(audioMasterCallback audioMaster); ~mdaDX10(); - 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 process(float **inputs, float **outputs, int32_t sampleframes); + virtual void processReplacing(float **inputs, float **outputs, int32_t sampleframes); + virtual int32_t processEvents(LvzEvents* events); - virtual void setProgram(LvzInt32 program); + virtual void setProgram(int32_t 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 setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); virtual void setSampleRate(float sampleRate); - virtual void setBlockSize(LvzInt32 blockSize); + virtual void setBlockSize(int32_t blockSize); 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 getOutputProperties (int32_t index, LvzPinProperties* properties); + virtual bool getProgramNameIndexed (int32_t category, int32_t index, char* text); + virtual bool copyProgram (int32_t 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); + virtual int32_t getVendorVersion () {return 1;} + virtual int32_t canDo (char* text); - virtual LvzInt32 getNumMidiInputChannels () { return 1; } + virtual int32_t getNumMidiInputChannels () { return 1; } private: void update(); //my parameter update - void noteOn(LvzInt32 note, LvzInt32 velocity); - void fillpatch(LvzInt32 p, const char *name, + void noteOn(int32_t note, int32_t velocity); + void fillpatch(int32_t 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); @@ -102,12 +102,12 @@ private: #define EVENTBUFFER 120 #define EVENTS_DONE 99999999 - LvzInt32 notes[EVENTBUFFER + 8]; //list of delta|note|velocity for current block + int32_t notes[EVENTBUFFER + 8]; //list of delta|note|velocity for current block ///global internal variables VOICE voice[NVOICES]; #define SUSTAIN 128 - LvzInt32 sustain, activevoices, K; + int32_t sustain, activevoices, K; float tune, rati, ratf, ratio; //modulator ratio float catt, cdec, crel; //carrier envelope diff --git a/src/mdaDeEss.cpp b/src/mdaDeEss.cpp index 6f394de..f3cbad1 100644 --- a/src/mdaDeEss.cpp +++ b/src/mdaDeEss.cpp @@ -47,7 +47,7 @@ bool mdaDeEss::getProductString(char* text) { strcpy(text, "MDA De-ess"); retur bool mdaDeEss::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaDeEss::getEffectName(char* name) { strcpy(name, "De-ess"); return true; } -void mdaDeEss::setParameter(LvzInt32 index, float value) +void mdaDeEss::setParameter(int32_t index, float value) { switch(index) { @@ -77,7 +77,7 @@ void mdaDeEss::getProgramName(char *name) strcpy(name, programName); } -float mdaDeEss::getParameter(LvzInt32 index) +float mdaDeEss::getParameter(int32_t index) { float v=0; @@ -90,7 +90,7 @@ float mdaDeEss::getParameter(LvzInt32 index) return v; } -void mdaDeEss::getParameterName(LvzInt32 index, char *label) +void mdaDeEss::getParameterName(int32_t index, char *label) { switch(index) { @@ -103,7 +103,7 @@ void mdaDeEss::getParameterName(LvzInt32 index, char *label) #include <stdio.h> void long2string(long value, char *string) { sprintf(string, "%ld", value); } -void mdaDeEss::getParameterDisplay(LvzInt32 index, char *text) +void mdaDeEss::getParameterDisplay(int32_t index, char *text) { switch(index) { @@ -113,7 +113,7 @@ void mdaDeEss::getParameterDisplay(LvzInt32 index, char *text) } } -void mdaDeEss::getParameterLabel(LvzInt32 index, char *label) +void mdaDeEss::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -126,7 +126,7 @@ void mdaDeEss::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaDeEss::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDeEss::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -165,7 +165,7 @@ void mdaDeEss::process(float **inputs, float **outputs, LvzInt32 sampleFrames) if(fabs(en)<1.0e-10) env=0.f; else env=en; } -void mdaDeEss::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDeEss::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaDeEss.h b/src/mdaDeEss.h index 9d2684b..c580ffa 100644 --- a/src/mdaDeEss.h +++ b/src/mdaDeEss.h @@ -27,20 +27,20 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); virtual bool getEffectName(char *name); virtual bool getVendorString(char *text); virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; diff --git a/src/mdaDegrade.cpp b/src/mdaDegrade.cpp index f8219a8..69937ba 100644 --- a/src/mdaDegrade.cpp +++ b/src/mdaDegrade.cpp @@ -52,7 +52,7 @@ bool mdaDegrade::getProductString(char* text) { strcpy(text, "MDA Degrade"); re bool mdaDegrade::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaDegrade::getEffectName(char* name) { strcpy(name, "Degrade"); return true; } -void mdaDegrade::setParameter(LvzInt32 index, float value) +void mdaDegrade::setParameter(int32_t index, float value) { float f; @@ -112,7 +112,7 @@ void mdaDegrade::getProgramName(char *name) strcpy(name, programName); } -bool mdaDegrade::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaDegrade::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -122,7 +122,7 @@ bool mdaDegrade::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* return false; } -float mdaDegrade::getParameter(LvzInt32 index) +float mdaDegrade::getParameter(int32_t index) { float v=0; @@ -138,7 +138,7 @@ float mdaDegrade::getParameter(LvzInt32 index) return v; } -void mdaDegrade::getParameterName(LvzInt32 index, char *label) +void mdaDegrade::getParameterName(int32_t index, char *label) { switch(index) { @@ -152,22 +152,22 @@ void mdaDegrade::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } -void mdaDegrade::getParameterDisplay(LvzInt32 index, char *text) +void mdaDegrade::getParameterDisplay(int32_t index, char *text) { switch(index) { - case 0: int2strng((LvzInt32)(-30.0 * (1.0 - fParam1)), text); break; - case 1: int2strng((LvzInt32)(4.0 + 12.0 * fParam2), text); break; - case 2: int2strng((LvzInt32)(getSampleRate()/tn), text); break; - case 3: int2strng((LvzInt32)pow(10.0f, 2.30104f + 2.f*fParam4), text); break; - case 4: int2strng((LvzInt32)(200.0 * fabs(fParam5 - 0.5)), text); break; - case 5: int2strng((LvzInt32)(40.0 * fParam6 - 20.0), text); break; + case 0: int2strng((int32_t)(-30.0 * (1.0 - fParam1)), text); break; + case 1: int2strng((int32_t)(4.0 + 12.0 * fParam2), text); break; + case 2: int2strng((int32_t)(getSampleRate()/tn), text); break; + case 3: int2strng((int32_t)pow(10.0f, 2.30104f + 2.f*fParam4), text); break; + case 4: int2strng((int32_t)(200.0 * fabs(fParam5 - 0.5)), text); break; + case 5: int2strng((int32_t)(40.0 * fParam6 - 20.0), text); break; } } -void mdaDegrade::getParameterLabel(LvzInt32 index, char *label) +void mdaDegrade::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -182,7 +182,7 @@ void mdaDegrade::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaDegrade::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDegrade::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -241,7 +241,7 @@ void mdaDegrade::process(float **inputs, float **outputs, LvzInt32 sampleFrames) buf8=b8, buf9=b9; buf0=b0; buf5=b5; tcount=t; } } -void mdaDegrade::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDegrade::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaDegrade.h b/src/mdaDegrade.h index f94d559..d45bf35 100644 --- a/src/mdaDegrade.h +++ b/src/mdaDegrade.h @@ -27,23 +27,23 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; diff --git a/src/mdaDelay.cpp b/src/mdaDelay.cpp index 3bfcc9c..6718fa0 100644 --- a/src/mdaDelay.cpp +++ b/src/mdaDelay.cpp @@ -56,7 +56,7 @@ bool mdaDelay::getProductString(char* text) { strcpy(text, "MDA Delay"); return bool mdaDelay::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaDelay::getEffectName(char* name) { strcpy(name, "Delay"); return true; } -void mdaDelay::setParameter(LvzInt32 index, float value) +void mdaDelay::setParameter(int32_t index, float value) { float tmp; @@ -70,7 +70,7 @@ void mdaDelay::setParameter(LvzInt32 index, float value) case 5: fParam5 = value; break; } //calcs here - ldel = (LvzInt32)(size * fParam0 * fParam0); + ldel = (int32_t)(size * fParam0 * fParam0); if(ldel<4) ldel=4; switch(int(fParam1 * 17.9f)) //fixed left/right ratios @@ -86,7 +86,7 @@ void mdaDelay::setParameter(LvzInt32 index, float value) case 9: tmp = 2.0000f; break; default: tmp = 4.0f * fParam1; break; //variable ratio } - rdel = (LvzInt32)(size * fParam0 * fParam0 * tmp); + rdel = (int32_t)(size * fParam0 * fParam0 * tmp); if(rdel>size) rdel=size; if(rdel<4) rdel=4; @@ -133,7 +133,7 @@ void mdaDelay::getProgramName(char *name) strcpy(name, programName); } -bool mdaDelay::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaDelay::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -143,7 +143,7 @@ bool mdaDelay::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* n return false; } -float mdaDelay::getParameter(LvzInt32 index) +float mdaDelay::getParameter(int32_t index) { float v=0; @@ -159,7 +159,7 @@ float mdaDelay::getParameter(LvzInt32 index) return v; } -void mdaDelay::getParameterName(LvzInt32 index, char *label) +void mdaDelay::getParameterName(int32_t index, char *label) { switch(index) { @@ -173,22 +173,22 @@ void mdaDelay::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } -void mdaDelay::getParameterDisplay(LvzInt32 index, char *text) +void mdaDelay::getParameterDisplay(int32_t index, char *text) { switch(index) { - case 0: int2strng((LvzInt32)(ldel * 1000.0f / getSampleRate()), text); break; - case 1: int2strng((LvzInt32)(100 * rdel / ldel), text); break; - case 2: int2strng((LvzInt32)(99 * fParam2), text); break; - case 3: int2strng((LvzInt32)(200 * fParam3 - 100), text); break; - case 4: int2strng((LvzInt32)(100 * fParam4), text); break; - case 5: int2strng((LvzInt32)(20 * log10(2.0 * fParam5)), text); break; + case 0: int2strng((int32_t)(ldel * 1000.0f / getSampleRate()), text); break; + case 1: int2strng((int32_t)(100 * rdel / ldel), text); break; + case 2: int2strng((int32_t)(99 * fParam2), text); break; + case 3: int2strng((int32_t)(200 * fParam3 - 100), text); break; + case 4: int2strng((int32_t)(100 * fParam4), text); break; + case 5: int2strng((int32_t)(20 * log10(2.0 * fParam5)), text); break; } } -void mdaDelay::getParameterLabel(LvzInt32 index, char *label) +void mdaDelay::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -202,7 +202,7 @@ void mdaDelay::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaDelay::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDelay::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -210,7 +210,7 @@ void mdaDelay::process(float **inputs, float **outputs, LvzInt32 sampleFrames) float *out2 = outputs[1]; float a, b, c, d, ol, or_, w=wet, y=dry, fb=fbk; float lx=lmix, hx=hmix, f=fil, f0=fil0, tmp; - LvzInt32 i=ipos, l, r, s=size; + int32_t i=ipos, l, r, s=size; l = (i + ldel) % (s + 1); r = (i + rdel) % (s + 1); @@ -244,7 +244,7 @@ void mdaDelay::process(float **inputs, float **outputs, LvzInt32 sampleFrames) if(fabs(f0)<1.0e-10) fil0=0.0f; else fil0=f0; } -void mdaDelay::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDelay::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -252,7 +252,7 @@ void mdaDelay::processReplacing(float **inputs, float **outputs, LvzInt32 sample float *out2 = outputs[1]; float a, b, ol, or_, w=wet, y=dry, fb=fbk; float lx=lmix, hx=hmix, f=fil, f0=fil0, tmp; - LvzInt32 i=ipos, l, r, s=size; + int32_t i=ipos, l, r, s=size; l = (i + ldel) % (s + 1); r = (i + rdel) % (s + 1); diff --git a/src/mdaDelay.h b/src/mdaDelay.h index 12877af..27fd5d5 100644 --- a/src/mdaDelay.h +++ b/src/mdaDelay.h @@ -27,22 +27,22 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam0; @@ -54,7 +54,7 @@ protected: float fParam6; float *buffer; //delay - LvzInt32 size, ipos, ldel, rdel; //delay max time, pointer, left time, right time + int32_t 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 diff --git a/src/mdaDetune.cpp b/src/mdaDetune.cpp index 2759ad3..cda9a48 100644 --- a/src/mdaDetune.cpp +++ b/src/mdaDetune.cpp @@ -75,17 +75,17 @@ void mdaDetune::suspend() ///clear any buffers... pos0 = 0; pos1 = pos2 = 0.0f; //recalculate crossfade window - buflen = 1 << (8 + (LvzInt32)(4.9f * programs[curProgram].param[3])); + buflen = 1 << (8 + (int32_t)(4.9f * programs[curProgram].param[3])); if (buflen > BUFMAX) buflen = BUFMAX; bufres = 1000.0f * (float)buflen / getSampleRate(); - LvzInt32 i; //hanning half-overlap-and-add + int32_t i; //hanning half-overlap-and-add double p=0.0, dp=6.28318530718/buflen; for(i=0;i<buflen;i++) { win[i] = (float)(0.5 - 0.5 * cos(p)); p+=dp; } } -void mdaDetune::setProgram(LvzInt32 program) +void mdaDetune::setProgram(int32_t program) { if ((unsigned int)program < NPROGS) { @@ -101,7 +101,7 @@ void mdaDetune::setProgram(LvzInt32 program) dry = wet - wet * param[1] * param[1]; wet = (wet + wet - wet * param[1]) * param[1]; - LvzInt32 tmp = 1 << (8 + (LvzInt32)(4.9f * param[3])); + int32_t tmp = 1 << (8 + (int32_t)(4.9f * param[3])); if(tmp!=buflen) //recalculate crossfade window { @@ -109,7 +109,7 @@ void mdaDetune::setProgram(LvzInt32 program) if (buflen > BUFMAX) buflen = BUFMAX; bufres = 1000.0f * (float)buflen / getSampleRate(); - LvzInt32 i; //hanning half-overlap-and-add + int32_t i; //hanning half-overlap-and-add double p=0.0, dp=6.28318530718/buflen; for(i=0;i<buflen;i++) { win[i] = (float)(0.5 - 0.5 * cos(p)); p+=dp; } } @@ -117,7 +117,7 @@ void mdaDetune::setProgram(LvzInt32 program) } -void mdaDetune::setParameter(LvzInt32 which, float value) +void mdaDetune::setParameter(int32_t which, float value) { float * param = programs[curProgram].param; param[which] = value; @@ -137,7 +137,7 @@ void mdaDetune::setParameter(LvzInt32 which, float value) break; case 3: { - LvzInt32 tmp = 1 << (8 + (LvzInt32)(4.9f * param[3])); + int32_t tmp = 1 << (8 + (int32_t)(4.9f * param[3])); if(tmp!=buflen) //recalculate crossfade window { @@ -145,7 +145,7 @@ void mdaDetune::setParameter(LvzInt32 which, float value) if (buflen > BUFMAX) buflen = BUFMAX; bufres = 1000.0f * (float)buflen / getSampleRate(); - LvzInt32 i; //hanning half-overlap-and-add + int32_t i; //hanning half-overlap-and-add double p=0.0, dp=6.28318530718/buflen; for(i=0;i<buflen;i++) { win[i] = (float)(0.5 - 0.5 * cos(p)); p+=dp; } } @@ -157,10 +157,10 @@ void mdaDetune::setParameter(LvzInt32 which, float value) } -float mdaDetune::getParameter(LvzInt32 which) { return programs[curProgram].param[which]; } +float mdaDetune::getParameter(int32_t which) { return programs[curProgram].param[which]; } void mdaDetune::setProgramName(char *name) { strcpy(programs[curProgram].name, name); } void mdaDetune::getProgramName(char *name) { strcpy(name, programs[curProgram].name); } -bool mdaDetune::getProgramNameIndexed (LvzInt32 category, LvzInt32 which, char* name) +bool mdaDetune::getProgramNameIndexed (int32_t category, int32_t which, char* name) { if ((unsigned int)which < NPROGS) { @@ -171,7 +171,7 @@ bool mdaDetune::getProgramNameIndexed (LvzInt32 category, LvzInt32 which, char* } -void mdaDetune::getParameterName(LvzInt32 which, char *label) +void mdaDetune::getParameterName(int32_t which, char *label) { switch(which) { @@ -183,7 +183,7 @@ void mdaDetune::getParameterName(LvzInt32 which, char *label) } -void mdaDetune::getParameterDisplay(LvzInt32 which, char *text) +void mdaDetune::getParameterDisplay(int32_t which, char *text) { char string[16]; @@ -199,7 +199,7 @@ void mdaDetune::getParameterDisplay(LvzInt32 which, char *text) } -void mdaDetune::getParameterLabel(LvzInt32 which, char *label) +void mdaDetune::getParameterLabel(int32_t which, char *label) { switch(which) { @@ -211,7 +211,7 @@ void mdaDetune::getParameterLabel(LvzInt32 which, char *label) } -void mdaDetune::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDetune::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -220,8 +220,8 @@ void mdaDetune::process(float **inputs, float **outputs, LvzInt32 sampleFrames) float a, b, c, d; float x, w=wet, y=dry, p1=pos1, p1f, d1=dpos1; float p2=pos2, d2=dpos2; - LvzInt32 p0=pos0, p1i, p2i; - LvzInt32 l=buflen-1, lh=buflen>>1; + int32_t p0=pos0, p1i, p2i; + int32_t l=buflen-1, lh=buflen>>1; float lf = (float)buflen; --in1; @@ -243,7 +243,7 @@ void mdaDetune::process(float **inputs, float **outputs, LvzInt32 sampleFrames) p1 -= d1; if(p1<0.0f) p1 += lf; //output - p1i = (LvzInt32)p1; + p1i = (int32_t)p1; p1f = p1 - (float)p1i; a = *(buf + p1i); ++p1i &= l; @@ -262,7 +262,7 @@ void mdaDetune::process(float **inputs, float **outputs, LvzInt32 sampleFrames) p2 -= d2; //repeat for downwards shift - can't see a more efficient way? if(p2<0.0f) p2 += lf; //output - p1i = (LvzInt32)p2; + p1i = (int32_t)p2; p1f = p2 - (float)p1i; a = *(buf + p1i); ++p1i &= l; @@ -286,7 +286,7 @@ void mdaDetune::process(float **inputs, float **outputs, LvzInt32 sampleFrames) } -void mdaDetune::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDetune::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -295,8 +295,8 @@ void mdaDetune::processReplacing(float **inputs, float **outputs, LvzInt32 sampl float a, b, c, d; float x, w=wet, y=dry, p1=pos1, p1f, d1=dpos1; float p2=pos2, d2=dpos2; - LvzInt32 p0=pos0, p1i, p2i; - LvzInt32 l=buflen-1, lh=buflen>>1; + int32_t p0=pos0, p1i, p2i; + int32_t l=buflen-1, lh=buflen>>1; float lf = (float)buflen; --in1; @@ -316,7 +316,7 @@ void mdaDetune::processReplacing(float **inputs, float **outputs, LvzInt32 sampl p1 -= d1; if(p1<0.0f) p1 += lf; //output - p1i = (LvzInt32)p1; + p1i = (int32_t)p1; p1f = p1 - (float)p1i; a = *(buf + p1i); ++p1i &= l; @@ -335,7 +335,7 @@ void mdaDetune::processReplacing(float **inputs, float **outputs, LvzInt32 sampl p2 -= d2; //repeat for downwards shift - can't see a more efficient way? if(p2<0.0f) p2 += lf; //output - p1i = (LvzInt32)p2; + p1i = (int32_t)p2; p1f = p2 - (float)p1i; a = *(buf + p1i); ++p1i &= l; diff --git a/src/mdaDetune.h b/src/mdaDetune.h index 59ee1a0..08741e6 100644 --- a/src/mdaDetune.h +++ b/src/mdaDetune.h @@ -38,23 +38,23 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t sampleFrames); + virtual void setProgram(int32_t 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 bool getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: mdaDetuneProgram programs[NPROGS]; @@ -62,10 +62,10 @@ protected: float win[BUFMAX]; ///global internal variables - LvzInt32 buflen; //buffer length + int32_t buflen; //buffer length float bufres; //buffer resolution display float semi; //detune display - LvzInt32 pos0; //buffer input + int32_t pos0; //buffer input float pos1, dpos1; //buffer output, rate float pos2, dpos2; //downwards shift float wet, dry; //ouput levels diff --git a/src/mdaDither.cpp b/src/mdaDither.cpp index e1aae27..34095fc 100644 --- a/src/mdaDither.cpp +++ b/src/mdaDither.cpp @@ -53,7 +53,7 @@ bool mdaDither::getProductString(char* text) { strcpy(text, "MDA Dither"); retu bool mdaDither::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaDither::getEffectName(char* name) { strcpy(name, "Dither"); return true; } -void mdaDither::setParameter(LvzInt32 index, float value) +void mdaDither::setParameter(int32_t index, float value) { switch(index) { @@ -81,7 +81,7 @@ void mdaDither::setParameter(LvzInt32 index, float value) dith = 2.0f * fParam2 / (wlen * (float)32767); shap=0.0f; - switch((LvzInt32)(fParam1*3.9)) //dither mode + switch((int32_t)(fParam1*3.9)) //dither mode { case 0: dith = 0.0f; break; //off case 3: shap = 0.5f; break; //noise shaping @@ -108,7 +108,7 @@ void mdaDither::getProgramName(char *name) strcpy(name, programName); } -bool mdaDither::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaDither::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -118,7 +118,7 @@ bool mdaDither::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* return false; } -float mdaDither::getParameter(LvzInt32 index) +float mdaDither::getParameter(int32_t index) { float v=0; @@ -133,7 +133,7 @@ float mdaDither::getParameter(LvzInt32 index) return v; } -void mdaDither::getParameterName(LvzInt32 index, char *label) +void mdaDither::getParameterName(int32_t index, char *label) { switch(index) { @@ -146,15 +146,15 @@ void mdaDither::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } void float2strng(float value, char *string) { sprintf(string, "%.2f", value); } -void mdaDither::getParameterDisplay(LvzInt32 index, char *text) +void mdaDither::getParameterDisplay(int32_t index, char *text) { switch(index) { - case 0: int2strng((LvzInt32)bits, text); break; - case 1: switch((LvzInt32)(fParam1*3.9)) + case 0: int2strng((int32_t)bits, text); break; + case 1: switch((int32_t)(fParam1*3.9)) { case 0: strcpy(text, "OFF"); break; case 1: strcpy(text, "TRI"); break; case 2: strcpy(text, "HP-TRI"); break; @@ -164,12 +164,12 @@ void mdaDither::getParameterDisplay(LvzInt32 index, char *text) case 3: float2strng(4.0f * fParam3 - 2.0f, text); break; case 4: if(fParam4>0.1f) if(gain<0.0001f) strcpy(text, "-80"); - else int2strng((LvzInt32)(20.0 * log10(gain)), text); + else int2strng((int32_t)(20.0 * log10(gain)), text); else strcpy(text, "OFF"); break; } } -void mdaDither::getParameterLabel(LvzInt32 index, char *label) +void mdaDither::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -184,7 +184,7 @@ void mdaDither::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaDither::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDither::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -195,9 +195,9 @@ void mdaDither::process(float **inputs, float **outputs, LvzInt32 sampleFrames) float dl=dith; //dither level float o=offs, w=wlen, wi=1.0f/wlen; //DC offset, word length & inverse float g=gain; //gain for Zoom mode - LvzInt32 r1=rnd1, r2, r3=rnd3, r4; //random numbers for dither - LvzInt32 m=1; //dither mode - if((LvzInt32)(fParam1 * 3.9f)==1) m=0; //what is the fastest if(?) + int32_t r1=rnd1, r2, r3=rnd3, r4; //random numbers for dither + int32_t m=1; //dither mode + if((int32_t)(fParam1 * 3.9f)==1) m=0; //what is the fastest if(?) --in1; --in2; @@ -218,14 +218,14 @@ void mdaDither::process(float **inputs, float **outputs, LvzInt32 sampleFrames) a = g * a + sl * (s1 + s1 - s2); aa = a + o + dl * (float)(r1 - r2); if(aa<0.0f) aa-=wi; - aa = wi * (float)(LvzInt32)(w * aa); + aa = wi * (float)(int32_t)(w * aa); s2 = s1; s1 = a - aa; b = g * b + sl * (s3 + s3 - s4); bb = b + o + dl * (float)(r3 - r4); if(bb<0.0f) bb-=wi; - bb = wi * (float)(LvzInt32)(w * bb); + bb = wi * (float)(int32_t)(w * bb); s4 = s3; s3 = b - bb; @@ -237,7 +237,7 @@ void mdaDither::process(float **inputs, float **outputs, LvzInt32 sampleFrames) rnd1=r1; rnd3=r3; } -void mdaDither::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDither::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -248,9 +248,9 @@ void mdaDither::processReplacing(float **inputs, float **outputs, LvzInt32 sampl float dl=dith; //dither level float o=offs, w=wlen, wi=1.0f/wlen; //DC offset, word length & inverse float g=gain; //gain for Zoom mode - LvzInt32 r1=rnd1, r2, r3=rnd3, r4; //random numbers for dither - LvzInt32 m=1; //dither mode - if((LvzInt32)(fParam1 * 3.9f)==1) m=0; //what is the fastest if(?) + int32_t r1=rnd1, r2, r3=rnd3, r4; //random numbers for dither + int32_t m=1; //dither mode + if((int32_t)(fParam1 * 3.9f)==1) m=0; //what is the fastest if(?) --in1; --in2; @@ -268,15 +268,15 @@ void mdaDither::processReplacing(float **inputs, float **outputs, LvzInt32 sampl a = g * a + sl * (s1 + s1 - s2); //target level + error feedback aa = a + o + dl * (float)(r1 - r2); // + offset + dither - if(aa<0.0f) aa-=wi; //(LvzInt32) truncates towards zero! - aa = wi * (float)(LvzInt32)(w * aa); //truncate + if(aa<0.0f) aa-=wi; //(int32_t) truncates towards zero! + aa = wi * (float)(int32_t)(w * aa); //truncate s2 = s1; s1 = a - aa; //error feedback: 2nd order noise shaping b = g * b + sl * (s3 + s3 - s4); bb = b + o + dl * (float)(r3 - r4); if(bb<0.0f) bb-=wi; - bb = wi * (float)(LvzInt32)(w * bb); + bb = wi * (float)(int32_t)(w * bb); s4 = s3; s3 = b - bb; diff --git a/src/mdaDither.h b/src/mdaDither.h index 88a0eb4..8fcf2e8 100644 --- a/src/mdaDither.h +++ b/src/mdaDither.h @@ -27,22 +27,22 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam0; @@ -52,7 +52,7 @@ protected: float fParam4; float dith; - LvzInt32 rnd1, rnd3; + int32_t rnd1, rnd3; float shap, sh1, sh2, sh3, sh4; float offs, bits, wlen, gain; diff --git a/src/mdaDubDelay.cpp b/src/mdaDubDelay.cpp index 7742ab8..7a09da4 100644 --- a/src/mdaDubDelay.cpp +++ b/src/mdaDubDelay.cpp @@ -60,7 +60,7 @@ bool mdaDubDelay::getProductString(char* text) { strcpy(text, "MDA DubDelay"); bool mdaDubDelay::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaDubDelay::getEffectName(char* name) { strcpy(name, "DubDelay"); return true; } -void mdaDubDelay::setParameter(LvzInt32 index, float value) +void mdaDubDelay::setParameter(int32_t index, float value) { float fs=getSampleRate(); if(fs < 8000.0f) fs = 44100.0f; //??? bug somewhere! @@ -124,7 +124,7 @@ void mdaDubDelay::getProgramName(char *name) strcpy(name, programName); } -bool mdaDubDelay::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaDubDelay::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -134,7 +134,7 @@ bool mdaDubDelay::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char return false; } -float mdaDubDelay::getParameter(LvzInt32 index) +float mdaDubDelay::getParameter(int32_t index) { float v=0; @@ -151,7 +151,7 @@ float mdaDubDelay::getParameter(LvzInt32 index) return v; } -void mdaDubDelay::getParameterName(LvzInt32 index, char *label) +void mdaDubDelay::getParameterName(int32_t index, char *label) { switch(index) { @@ -166,24 +166,24 @@ void mdaDubDelay::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } void float2strng(float value, char *string) { sprintf(string, "%.2f", value); } -void mdaDubDelay::getParameterDisplay(LvzInt32 index, char *text) +void mdaDubDelay::getParameterDisplay(int32_t index, char *text) { switch(index) { - case 0: int2strng((LvzInt32)(del * 1000.0f / getSampleRate()), text); break; - case 1: int2strng((LvzInt32)(220 * fParam1 - 110), text); break; - case 2: int2strng((LvzInt32)(200 * fParam2 - 100), text); break; - case 3: int2strng((LvzInt32)(100 * fParam3), text); break; + case 0: int2strng((int32_t)(del * 1000.0f / getSampleRate()), text); break; + case 1: int2strng((int32_t)(220 * fParam1 - 110), text); break; + case 2: int2strng((int32_t)(200 * fParam2 - 100), text); break; + case 3: int2strng((int32_t)(100 * fParam3), text); break; case 4: float2strng((float)pow(10.0f, 2.0f - 3.0f * fParam4), text); break; - case 5: int2strng((LvzInt32)(100 * fParam5), text); break; - case 6: int2strng((LvzInt32)(20 * log10(2.0 * fParam6)), text); break; + case 5: int2strng((int32_t)(100 * fParam5), text); break; + case 6: int2strng((int32_t)(20 * log10(2.0 * fParam6)), text); break; } } -void mdaDubDelay::getParameterLabel(LvzInt32 index, char *label) +void mdaDubDelay::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -199,7 +199,7 @@ void mdaDubDelay::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaDubDelay::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDubDelay::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -209,7 +209,7 @@ void mdaDubDelay::process(float **inputs, float **outputs, LvzInt32 sampleFrames float lx=lmix, hx=hmix, f=fil, f0=fil0, tmp; float e=env, g, r=rel; //limiter envelope, gain, release float twopi=6.2831853f; - LvzInt32 i=ipos, l, s=size, k=0; + int32_t i=ipos, l, s=size, k=0; --in1; --in2; @@ -234,7 +234,7 @@ void mdaDubDelay::process(float **inputs, float **outputs, LvzInt32 sampleFrames i--; if(i<0) i=s; //delay positions - l = (LvzInt32)dl; + l = (int32_t)dl; tmp = dl - (float)l; //remainder l += i; if(l>s) l-=(s+1); @@ -264,7 +264,7 @@ void mdaDubDelay::process(float **inputs, float **outputs, LvzInt32 sampleFrames if(fabs(f0)<1.0e-10) { fil0=0.0f; env=0.0f; } else { fil0=f0; env=e; } //trap denormals } -void mdaDubDelay::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDubDelay::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -274,7 +274,7 @@ void mdaDubDelay::processReplacing(float **inputs, float **outputs, LvzInt32 sam float lx=lmix, hx=hmix, f=fil, f0=fil0, tmp; float e=env, g, r=rel; //limiter envelope, gain, release float twopi=6.2831853f; - LvzInt32 i=ipos, l, s=size, k=0; + int32_t i=ipos, l, s=size, k=0; --in1; --in2; @@ -297,7 +297,7 @@ void mdaDubDelay::processReplacing(float **inputs, float **outputs, LvzInt32 sam i--; if(i<0) i=s; //delay positions - l = (LvzInt32)dl; + l = (int32_t)dl; tmp = dl - (float)l; //remainder l += i; if(l>s) l-=(s+1); diff --git a/src/mdaDubDelay.h b/src/mdaDubDelay.h index 72d0598..fa579ee 100644 --- a/src/mdaDubDelay.h +++ b/src/mdaDubDelay.h @@ -27,22 +27,22 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam0; @@ -54,7 +54,7 @@ protected: float fParam6; float *buffer; //delay - LvzInt32 size, ipos; //delay max time, pointer, left time, right time + int32_t 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) diff --git a/src/mdaDynamics.cpp b/src/mdaDynamics.cpp index 1210da0..2c7d644 100644 --- a/src/mdaDynamics.cpp +++ b/src/mdaDynamics.cpp @@ -67,7 +67,7 @@ void mdaDynamics::getProgramName(char *name) strcpy(name, programName); } -bool mdaDynamics::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaDynamics::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -77,7 +77,7 @@ bool mdaDynamics::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char return false; } -void mdaDynamics::setParameter(LvzInt32 index, float value) +void mdaDynamics::setParameter(int32_t index, float value) { switch(index) { @@ -117,7 +117,7 @@ void mdaDynamics::setParameter(LvzInt32 index, float value) dry = 1.0f - fParam10; trim *= fParam10; //fx mix } -float mdaDynamics::getParameter(LvzInt32 index) +float mdaDynamics::getParameter(int32_t index) { float v=0; @@ -137,7 +137,7 @@ float mdaDynamics::getParameter(LvzInt32 index) return v; } -void mdaDynamics::getParameterName(LvzInt32 index, char *label) +void mdaDynamics::getParameterName(int32_t index, char *label) { switch(index) { @@ -155,35 +155,35 @@ void mdaDynamics::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } void float2strng(float value, char *string) { sprintf(string, "%.2f", value); } -void mdaDynamics::getParameterDisplay(LvzInt32 index, char *text) +void mdaDynamics::getParameterDisplay(int32_t index, char *text) { switch(index) { - case 0: int2strng((LvzInt32)(40.0*fParam1 - 40.0),text); break; + case 0: int2strng((int32_t)(40.0*fParam1 - 40.0),text); break; case 1: if(fParam2>0.58) { if(fParam2<0.62) strcpy(text, "Limit"); else float2strng(-rat,text); } else { if(fParam2<0.2) float2strng(0.5f+2.5f*fParam2,text); else float2strng(1.f/(1.f-rat),text); } break; - case 2: int2strng((LvzInt32)(40.0*fParam3 - 0.0),text); break; ///was -20.0 - case 3: int2strng((LvzInt32)(-301030.1 / (getSampleRate() * log10(1.0 - att))),text); break; - case 4: int2strng((LvzInt32)(-301.0301 / (getSampleRate() * log10(1.0 - rel))),text); break; + case 2: int2strng((int32_t)(40.0*fParam3 - 0.0),text); break; ///was -20.0 + case 3: int2strng((int32_t)(-301030.1 / (getSampleRate() * log10(1.0 - att))),text); break; + case 4: int2strng((int32_t)(-301.0301 / (getSampleRate() * log10(1.0 - rel))),text); break; case 5: if(lthr==0.f) strcpy(text, "OFF"); - else int2strng((LvzInt32)(30.0*fParam6 - 20.0),text); break; + else int2strng((int32_t)(30.0*fParam6 - 20.0),text); break; case 6: if(xthr==0.f) strcpy(text, "OFF"); - else int2strng((LvzInt32)(60.0*fParam7 - 60.0),text); break; - case 7: int2strng((LvzInt32)(-301030.1 / (getSampleRate() * log10(1.0 - gatt))),text); break; - case 8: int2strng((LvzInt32)(-1806.0 / (getSampleRate() * log10(xrat))),text); break; - case 9: int2strng((LvzInt32)(100.0*fParam10),text); break; + else int2strng((int32_t)(60.0*fParam7 - 60.0),text); break; + case 7: int2strng((int32_t)(-301030.1 / (getSampleRate() * log10(1.0 - gatt))),text); break; + case 8: int2strng((int32_t)(-1806.0 / (getSampleRate() * log10(xrat))),text); break; + case 9: int2strng((int32_t)(100.0*fParam10),text); break; } } -void mdaDynamics::getParameterLabel(LvzInt32 index, char *label) +void mdaDynamics::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -203,7 +203,7 @@ void mdaDynamics::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaDynamics::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDynamics::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -275,7 +275,7 @@ void mdaDynamics::process(float **inputs, float **outputs, LvzInt32 sampleFrames if(ge<1.0e-10) genv=0.f; else genv=ge; } -void mdaDynamics::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaDynamics::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaDynamics.h b/src/mdaDynamics.h index ced7aca..db4e88e 100644 --- a/src/mdaDynamics.h +++ b/src/mdaDynamics.h @@ -27,21 +27,21 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); virtual bool getEffectName(char *name); virtual bool getVendorString(char *text); virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; diff --git a/src/mdaEPiano.cpp b/src/mdaEPiano.cpp index 6f45e8b..a1866bd 100644 --- a/src/mdaEPiano.cpp +++ b/src/mdaEPiano.cpp @@ -37,7 +37,7 @@ mdaEPiano::mdaEPiano(audioMasterCallback audioMaster) : AudioEffectX(audioMaster if(programs) { //fill patches... - LvzInt32 i=0; + int32_t i=0; fillpatch(i++, "Default", 0.500f, 0.500f, 0.500f, 0.500f, 0.500f, 0.650f, 0.250f, 0.500f, 0.50f, 0.500f, 0.146f, 0.000f); fillpatch(i++, "Bright", 0.500f, 0.500f, 1.000f, 0.800f, 0.500f, 0.650f, 0.250f, 0.500f, 0.50f, 0.500f, 0.146f, 0.500f); fillpatch(i++, "Mellow", 0.500f, 0.500f, 0.000f, 0.000f, 0.500f, 0.650f, 0.250f, 0.500f, 0.50f, 0.500f, 0.246f, 0.000f); @@ -109,10 +109,10 @@ mdaEPiano::mdaEPiano(audioMasterCallback audioMaster) : AudioEffectX(audioMaster kgrp[32].pos = 414487; kgrp[32].end = 422408; kgrp[32].loop = 2169; //extra xfade looping... - for(LvzInt32 k=0; k<28; k++) + for(int32_t k=0; k<28; k++) { - LvzInt32 p0 = kgrp[k].end; - LvzInt32 p1 = kgrp[k].end - kgrp[k].loop; + int32_t p0 = kgrp[k].end; + int32_t p1 = kgrp[k].end - kgrp[k].loop; float xf = 1.0f; float dxf = -0.02f; @@ -127,7 +127,7 @@ mdaEPiano::mdaEPiano(audioMasterCallback audioMaster) : AudioEffectX(audioMaster } //initialise... - for(LvzInt32 v=0; v<NVOICES; v++) + for(int32_t v=0; v<NVOICES; v++) { voice[v].env = 0.0f; voice[v].dec = 0.99f; //all notes off @@ -148,7 +148,7 @@ mdaEPiano::mdaEPiano(audioMasterCallback audioMaster) : AudioEffectX(audioMaster void mdaEPiano::update() //parameter change { float * param = programs[curProgram].param; - size = (LvzInt32)(12.0f * param[2] - 6.0f); + size = (int32_t)(12.0f * param[2] - 6.0f); treb = 4.0f * param[3] * param[3] - 1.0f; //treble gain if(param[3] > 0.5f) tfrq = 14000.0f; else tfrq = 5000.0f; //treble freq @@ -163,7 +163,7 @@ void mdaEPiano::update() //parameter change if(param[6] < 0.25f) velsens -= 0.75f - 3.0f * param[6]; width = 0.03f * param[7]; - poly = 1 + (LvzInt32)(31.9f * param[8]); + poly = 1 + (int32_t)(31.9f * param[8]); fine = param[9] - 0.5f; random = 0.077f * param[10] * param[10]; stretch = 0.0f; //0.000434f * (param[11] - 0.5f); parameter re-used for overdrive! @@ -187,14 +187,14 @@ mdaEPiano::~mdaEPiano () //destroy any buffers... } -void mdaEPiano::setProgram(LvzInt32 program) +void mdaEPiano::setProgram(int32_t program) { curProgram = program; update(); } -void mdaEPiano::setParameter(LvzInt32 index, float value) +void mdaEPiano::setParameter(int32_t index, float value) { programs[curProgram].param[index] = value; update(); @@ -205,7 +205,7 @@ void mdaEPiano::setParameter(LvzInt32 index, float value) } -void mdaEPiano::fillpatch(LvzInt32 p, const char *name, float p0, float p1, float p2, float p3, float p4, +void mdaEPiano::fillpatch(int32_t 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) { strcpy(programs[p].name, name); @@ -218,16 +218,16 @@ void mdaEPiano::fillpatch(LvzInt32 p, const char *name, float p0, float p1, floa } -float mdaEPiano::getParameter(LvzInt32 index) { return programs[curProgram].param[index]; } +float mdaEPiano::getParameter(int32_t index) { return programs[curProgram].param[index]; } void mdaEPiano::setProgramName(char *name) { strcpy(programs[curProgram].name, name); } void mdaEPiano::getProgramName(char *name) { strcpy(name, programs[curProgram].name); } -void mdaEPiano::setBlockSize(LvzInt32 blockSize) { AudioEffectX::setBlockSize(blockSize); } +void mdaEPiano::setBlockSize(int32_t blockSize) { AudioEffectX::setBlockSize(blockSize); } bool mdaEPiano::getEffectName(char* name) { strcpy(name, "ePiano"); return true; } bool mdaEPiano::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaEPiano::getProductString(char* text) { strcpy(text, "MDA ePiano"); return true; } -bool mdaEPiano::getOutputProperties(LvzInt32 index, LvzPinProperties* properties) +bool mdaEPiano::getOutputProperties(int32_t index, LvzPinProperties* properties) { if(index<NOUTS) { @@ -241,7 +241,7 @@ bool mdaEPiano::getOutputProperties(LvzInt32 index, LvzPinProperties* properties } -bool mdaEPiano::getProgramNameIndexed(LvzInt32 category, LvzInt32 index, char* text) +bool mdaEPiano::getProgramNameIndexed(int32_t category, int32_t index, char* text) { if ((unsigned int)index < NPROGS) { @@ -252,7 +252,7 @@ bool mdaEPiano::getProgramNameIndexed(LvzInt32 category, LvzInt32 index, char* t } -bool mdaEPiano::copyProgram(LvzInt32 destination) +bool mdaEPiano::copyProgram(int32_t destination) { if(destination<NPROGS) { @@ -263,7 +263,7 @@ bool mdaEPiano::copyProgram(LvzInt32 destination) } -LvzInt32 mdaEPiano::canDo(char* text) +int32_t mdaEPiano::canDo(char* text) { if(strcmp(text, "receiveLvzEvents") == 0) return 1; if(strcmp(text, "receiveLvzMidiEvent") == 0) return 1; @@ -271,7 +271,7 @@ LvzInt32 mdaEPiano::canDo(char* text) } -void mdaEPiano::getParameterName(LvzInt32 index, char *label) +void mdaEPiano::getParameterName(int32_t index, char *label) { switch (index) { @@ -294,7 +294,7 @@ void mdaEPiano::getParameterName(LvzInt32 index, char *label) } -void mdaEPiano::getParameterDisplay(LvzInt32 index, char *text) +void mdaEPiano::getParameterDisplay(int32_t index, char *text) { char string[16]; float * param = programs[curProgram].param; @@ -322,7 +322,7 @@ void mdaEPiano::getParameterDisplay(LvzInt32 index, char *text) } -void mdaEPiano::getParameterLabel(LvzInt32 index, char *label) +void mdaEPiano::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -335,7 +335,7 @@ void mdaEPiano::getParameterLabel(LvzInt32 index, char *label) } -void mdaEPiano::guiGetDisplay(LvzInt32 index, char *label) +void mdaEPiano::guiGetDisplay(int32_t index, char *label) { getParameterName(index, label); strcat(label, " = "); @@ -344,13 +344,13 @@ void mdaEPiano::guiGetDisplay(LvzInt32 index, char *label) } -void mdaEPiano::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaEPiano::process(float **inputs, float **outputs, int32_t sampleFrames) { float* out0 = outputs[0]; float* out1 = outputs[1]; - LvzInt32 event=0, frame=0, frames, v; + int32_t event=0, frame=0, frames, v; float x, l, r, od=overdrive; - LvzInt32 i; + int32_t i; while(frame<sampleFrames) { @@ -400,8 +400,8 @@ void mdaEPiano::process(float **inputs, float **outputs, LvzInt32 sampleFrames) { if(activevoices == 0 && programs[curProgram].param[4] > 0.5f) { lfo0 = -0.7071f; lfo1 = 0.7071f; } //reset LFO phase - good idea? - LvzInt32 note = notes[event++]; - LvzInt32 vel = notes[event++]; + int32_t note = notes[event++]; + int32_t vel = notes[event++]; noteOn(note, vel); } } @@ -413,13 +413,13 @@ void mdaEPiano::process(float **inputs, float **outputs, LvzInt32 sampleFrames) } -void mdaEPiano::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaEPiano::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float* out0 = outputs[0]; float* out1 = outputs[1]; - LvzInt32 event=0, frame=0, frames, v; + int32_t event=0, frame=0, frames, v; float x, l, r, od=overdrive; - LvzInt32 i; + int32_t i; while(frame<sampleFrames) { @@ -473,8 +473,8 @@ void mdaEPiano::processReplacing(float **inputs, float **outputs, LvzInt32 sampl { if(activevoices == 0 && programs[curProgram].param[4] > 0.5f) { lfo0 = -0.7071f; lfo1 = 0.7071f; } //reset LFO phase - good idea? - LvzInt32 note = notes[event++]; - LvzInt32 vel = notes[event++]; + int32_t note = notes[event++]; + int32_t vel = notes[event++]; noteOn(note, vel); } } @@ -486,11 +486,11 @@ void mdaEPiano::processReplacing(float **inputs, float **outputs, LvzInt32 sampl } -void mdaEPiano::noteOn(LvzInt32 note, LvzInt32 velocity) +void mdaEPiano::noteOn(int32_t note, int32_t velocity) { float * param = programs[curProgram].param; float l=99.0f; - LvzInt32 v, vl=0, k, s; + int32_t v, vl=0, k, s; if(velocity > 0) { @@ -513,13 +513,13 @@ void mdaEPiano::noteOn(LvzInt32 note, LvzInt32 velocity) if(note > 60) l += stretch * (float)k; //stretch s = size; - //if(velocity > 40) s += (LvzInt32)(sizevel * (float)(velocity - 40)); - no velocity to hardness in ePiano + //if(velocity > 40) s += (int32_t)(sizevel * (float)(velocity - 40)); - no velocity to hardness in ePiano k = 0; while(note > (kgrp[k].high + s)) k += 3; //find keygroup l += (float)(note - kgrp[k].root); //pitch l = 32000.0f * iFs * (float)exp(0.05776226505 * l); - voice[vl].delta = (LvzInt32)(65536.0f * l); + voice[vl].delta = (int32_t)(65536.0f * l); voice[vl].frac = 0; if(velocity > 48) k++; //mid velocity sample @@ -561,12 +561,12 @@ void mdaEPiano::noteOn(LvzInt32 note, LvzInt32 velocity) } -LvzInt32 mdaEPiano::processEvents(LvzEvents* ev) +int32_t mdaEPiano::processEvents(LvzEvents* ev) { float * param = programs[curProgram].param; - LvzInt32 npos=0; + int32_t npos=0; - for (LvzInt32 i=0; i<ev->numEvents; i++) + for (int32_t i=0; i<ev->numEvents; i++) { if((ev->events[i])->type != kLvzMidiType) continue; LvzMidiEvent* event = (LvzMidiEvent*)ev->events[i]; @@ -617,7 +617,7 @@ LvzInt32 mdaEPiano::processEvents(LvzEvents* ev) default: //all notes off if(midiData[1]>0x7A) { - for(LvzInt32 v=0; v<NVOICES; v++) voice[v].dec=0.99f; + for(int32_t v=0; v<NVOICES; v++) voice[v].dec=0.99f; sustain = 0; muff = 160.0f; } diff --git a/src/mdaEPiano.h b/src/mdaEPiano.h index 8a0977d..b24c7ce 100644 --- a/src/mdaEPiano.h +++ b/src/mdaEPiano.h @@ -42,11 +42,11 @@ private: struct VOICE //voice state { - LvzInt32 delta; //sample playback - LvzInt32 frac; - LvzInt32 pos; - LvzInt32 end; - LvzInt32 loop; + int32_t delta; //sample playback + int32_t frac; + int32_t pos; + int32_t end; + int32_t loop; float env; //envelope float dec; @@ -57,17 +57,17 @@ struct VOICE //voice state float outl; float outr; - LvzInt32 note; //remember what note triggered this + int32_t note; //remember what note triggered this }; struct KGRP //keygroup { - LvzInt32 root; //MIDI root note - LvzInt32 high; //highest note - LvzInt32 pos; - LvzInt32 end; - LvzInt32 loop; + int32_t root; //MIDI root note + int32_t high; //highest note + int32_t pos; + int32_t end; + int32_t loop; }; class mdaEPiano : public AudioEffectX @@ -76,39 +76,39 @@ public: mdaEPiano(audioMasterCallback audioMaster); ~mdaEPiano(); - 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 process(float **inputs, float **outputs, int32_t sampleframes); + virtual void processReplacing(float **inputs, float **outputs, int32_t sampleframes); + virtual int32_t processEvents(LvzEvents* events); - virtual void setProgram(LvzInt32 program); + virtual void setProgram(int32_t 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 setBlockSize(LvzInt32 blockSize); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); + virtual void setBlockSize(int32_t blockSize); 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 getOutputProperties (int32_t index, LvzPinProperties* properties); + virtual bool getProgramNameIndexed (int32_t category, int32_t index, char* text); + virtual bool copyProgram (int32_t 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); + virtual int32_t getVendorVersion () {return 1;} + virtual int32_t canDo (char* text); - virtual LvzInt32 getNumMidiInputChannels () { return 1; } + virtual int32_t getNumMidiInputChannels () { return 1; } - LvzInt32 guiUpdate; - void guiGetDisplay(LvzInt32 index, char *label); + int32_t guiUpdate; + void guiGetDisplay(int32_t index, char *label); 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, + void noteOn(int32_t note, int32_t velocity); + void fillpatch(int32_t 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); mdaEPianoProgram* programs; @@ -116,15 +116,15 @@ private: #define EVENTBUFFER 120 #define EVENTS_DONE 99999999 - LvzInt32 notes[EVENTBUFFER + 8]; //list of delta|note|velocity for current block + int32_t notes[EVENTBUFFER + 8]; //list of delta|note|velocity for current block ///global internal variables KGRP kgrp[34]; VOICE voice[NVOICES]; - LvzInt32 activevoices, poly; + int32_t activevoices, poly; short *waves; float width; - LvzInt32 size, sustain; + int32_t size, sustain; float lfo0, lfo1, dlfo, lmod, rmod; float treb, tfrq, tl, tr; float tune, fine, random, stretch, overdrive; diff --git a/src/mdaImage.cpp b/src/mdaImage.cpp index d153510..06799b6 100644 --- a/src/mdaImage.cpp +++ b/src/mdaImage.cpp @@ -49,7 +49,7 @@ bool mdaImage::getProductString(char* text) { strcpy(text, "MDA Image"); return bool mdaImage::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaImage::getEffectName(char* name) { strcpy(name, "Image"); return true; } -void mdaImage::setParameter(LvzInt32 index, float value) +void mdaImage::setParameter(int32_t index, float value) { float w, k, c, b, g; @@ -124,7 +124,7 @@ void mdaImage::getProgramName(char *name) strcpy(name, programName); } -bool mdaImage::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaImage::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -134,7 +134,7 @@ bool mdaImage::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* n return false; } -float mdaImage::getParameter(LvzInt32 index) +float mdaImage::getParameter(int32_t index) { float v=0; @@ -150,7 +150,7 @@ float mdaImage::getParameter(LvzInt32 index) return v; } -void mdaImage::getParameterName(LvzInt32 index, char *label) +void mdaImage::getParameterName(int32_t index, char *label) { switch(index) { @@ -164,9 +164,9 @@ void mdaImage::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } -void mdaImage::getParameterDisplay(LvzInt32 index, char *text) +void mdaImage::getParameterDisplay(int32_t index, char *text) { switch(index) { @@ -178,15 +178,15 @@ void mdaImage::getParameterDisplay(LvzInt32 index, char *text) case 3: strcpy(text, "LR->MS"); break; } break; - case 1: int2strng((LvzInt32)(400 * fParam2 - 200), text); break; - case 2: int2strng((LvzInt32)(200 * fParam3 - 100), text); break; - case 3: int2strng((LvzInt32)(400 * fParam4 - 200), text); break; - case 4: int2strng((LvzInt32)(200 * fParam5 - 100), text); break; - case 5: int2strng((LvzInt32)(40 * fParam6 - 20), text); break; + case 1: int2strng((int32_t)(400 * fParam2 - 200), text); break; + case 2: int2strng((int32_t)(200 * fParam3 - 100), text); break; + case 3: int2strng((int32_t)(400 * fParam4 - 200), text); break; + case 4: int2strng((int32_t)(200 * fParam5 - 100), text); break; + case 5: int2strng((int32_t)(40 * fParam6 - 20), text); break; } } -void mdaImage::getParameterLabel(LvzInt32 index, char *label) +void mdaImage::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -202,7 +202,7 @@ void mdaImage::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaImage::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaImage::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -230,7 +230,7 @@ void mdaImage::process(float **inputs, float **outputs, LvzInt32 sampleFrames) } } -void mdaImage::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaImage::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaImage.h b/src/mdaImage.h index b5cb804..fd3665f 100644 --- a/src/mdaImage.h +++ b/src/mdaImage.h @@ -27,22 +27,22 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; diff --git a/src/mdaJX10.cpp b/src/mdaJX10.cpp index 33880cf..2432fae 100644 --- a/src/mdaJX10.cpp +++ b/src/mdaJX10.cpp @@ -68,7 +68,7 @@ mdaJX10Program::mdaJX10Program() mdaJX10::mdaJX10(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, NPROGS, NPARAMS) { - LvzInt32 i=0; + int32_t i=0; Fs = 44100.0f; programs = new mdaJX10Program[NPROGS]; @@ -145,7 +145,7 @@ mdaJX10::mdaJX10(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, NP } //initialise... - for(LvzInt32 v=0; v<NVOICES; v++) + for(int32_t v=0; v<NVOICES; v++) { voice[v].dp = voice[v].dp2 = 1.0f; voice[v].saw = voice[v].p = voice[v].p2 = 0.0f; @@ -171,7 +171,7 @@ void mdaJX10::update() //parameter change double ifs = 1.0 / Fs; float * param = programs[curProgram].param; - mode = (LvzInt32)(7.9f * param[3]); + mode = (int32_t)(7.9f * param[3]); noisemix = param[21] * param[21]; voltrim = (3.2f - param[0] - 1.5f * noisemix) * (1.5f - 0.5f * param[7]); noisemix *= 0.06f; @@ -234,7 +234,7 @@ void mdaJX10::resume() void mdaJX10::suspend() //Used by Logic (have note off code in 3 places now...) { - for(LvzInt32 v=0; v<NVOICES; v++) + for(int32_t v=0; v<NVOICES; v++) { voice[v].envl = voice[v].env = 0.0f; voice[v].envd = 0.99f; @@ -250,14 +250,14 @@ mdaJX10::~mdaJX10() //destroy any buffers... } -void mdaJX10::setProgram(LvzInt32 program) +void mdaJX10::setProgram(int32_t program) { curProgram = program; update(); } //may want all notes off here - but this stops use of patches as snapshots! -void mdaJX10::setParameter(LvzInt32 index, float value) +void mdaJX10::setParameter(int32_t index, float value) { programs[curProgram].param[index] = value; update(); @@ -266,7 +266,7 @@ void mdaJX10::setParameter(LvzInt32 index, float value) } -void mdaJX10::fillpatch(LvzInt32 p, const char *name, +void mdaJX10::fillpatch(int32_t 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, @@ -288,16 +288,16 @@ void mdaJX10::fillpatch(LvzInt32 p, const char *name, } -float mdaJX10::getParameter(LvzInt32 index) { return programs[curProgram].param[index]; } +float mdaJX10::getParameter(int32_t 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); } +void mdaJX10::setBlockSize(int32_t 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) +bool mdaJX10::getOutputProperties(int32_t index, LvzPinProperties* properties) { if(index<NOUTS) { @@ -310,7 +310,7 @@ bool mdaJX10::getOutputProperties(LvzInt32 index, LvzPinProperties* properties) } -bool mdaJX10::getProgramNameIndexed(LvzInt32 category, LvzInt32 index, char* text) +bool mdaJX10::getProgramNameIndexed(int32_t category, int32_t index, char* text) { if ((unsigned int)index < NPROGS) { @@ -321,7 +321,7 @@ bool mdaJX10::getProgramNameIndexed(LvzInt32 category, LvzInt32 index, char* tex } -bool mdaJX10::copyProgram(LvzInt32 destination) +bool mdaJX10::copyProgram(int32_t destination) { if(destination<NPROGS) { @@ -332,7 +332,7 @@ bool mdaJX10::copyProgram(LvzInt32 destination) } -LvzInt32 mdaJX10::canDo(char* text) +int32_t mdaJX10::canDo(char* text) { if(!strcmp (text, "receiveLvzEvents")) return 1; if(!strcmp (text, "receiveLvzMidiEvent")) return 1; @@ -340,7 +340,7 @@ LvzInt32 mdaJX10::canDo(char* text) } -void mdaJX10::getParameterName(LvzInt32 index, char *label) +void mdaJX10::getParameterName(int32_t index, char *label) { switch (index) { @@ -379,7 +379,7 @@ void mdaJX10::getParameterName(LvzInt32 index, char *label) } -void mdaJX10::getParameterDisplay(LvzInt32 index, char *text) +void mdaJX10::getParameterDisplay(int32_t index, char *text) { char string[16]; float * param = programs[curProgram].param; @@ -407,7 +407,7 @@ void mdaJX10::getParameterDisplay(LvzInt32 index, char *text) case 19: sprintf(string, "%.3f", lfoHz); break; case 20: if(param[index]<0.5f) sprintf(string, "PWM %3.0f", 100.0f - 200.0f * param[index]); else sprintf(string, "%7.0f", 200.0f * param[index] - 100.0f); break; - case 22: sprintf(string, "%d", (LvzInt32)(param[index] * 4.9f) - 2); break; + case 22: sprintf(string, "%d", (int32_t)(param[index] * 4.9f) - 2); break; default: sprintf(string, "%.0f", 100.0f * param[index]); } string[8] = 0; @@ -415,7 +415,7 @@ void mdaJX10::getParameterDisplay(LvzInt32 index, char *text) } -void mdaJX10::getParameterLabel(LvzInt32 index, char *label) +void mdaJX10::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -431,15 +431,15 @@ void mdaJX10::getParameterLabel(LvzInt32 index, char *label) } -void mdaJX10::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaJX10::process(float **inputs, float **outputs, int32_t sampleFrames) { float* out1 = outputs[0]; float* out2 = outputs[1]; - LvzInt32 event=0, frame=0, frames, v; + int32_t event=0, frame=0, frames, v; float o, e, vib, pwm, pb=pbend, ipb=ipbend, gl=glide; float x, y, hpf=0.997f, min=1.0f, w=0.0f, ww=noisemix; float ff, fe=filtenv, fq=filtq * rezwhl, fx=1.97f-0.85f*fq, fz=fzip; - LvzInt32 k=K; + int32_t k=K; unsigned int r; vib = (float)sin(lfo); @@ -574,8 +574,8 @@ void mdaJX10::process(float **inputs, float **outputs, LvzInt32 sampleFrames) if(frame<sampleFrames) { - LvzInt32 note = notes[event++]; - LvzInt32 vel = notes[event++]; + int32_t note = notes[event++]; + int32_t vel = notes[event++]; noteOn(note, vel); } } @@ -597,15 +597,15 @@ void mdaJX10::process(float **inputs, float **outputs, LvzInt32 sampleFrames) } -void mdaJX10::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaJX10::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float* out1 = outputs[0]; float* out2 = outputs[1]; - LvzInt32 event=0, frame=0, frames, v; + int32_t event=0, frame=0, frames, v; float o, e, vib, pwm, pb=pbend, ipb=ipbend, gl=glide; float x, y, hpf=0.997f, min=1.0f, w=0.0f, ww=noisemix; float ff, fe=filtenv, fq=filtq * rezwhl, fx=1.97f-0.85f*fq, fz=fzip; - LvzInt32 k=K; + int32_t k=K; unsigned int r; vib = (float)sin(lfo); @@ -741,8 +741,8 @@ void mdaJX10::processReplacing(float **inputs, float **outputs, LvzInt32 sampleF if(frame<sampleFrames) { - LvzInt32 note = notes[event++]; - LvzInt32 vel = notes[event++]; + int32_t note = notes[event++]; + int32_t vel = notes[event++]; noteOn(note, vel); } } @@ -772,10 +772,10 @@ void mdaJX10::processReplacing(float **inputs, float **outputs, LvzInt32 sampleF } -void mdaJX10::noteOn(LvzInt32 note, LvzInt32 velocity) +void mdaJX10::noteOn(int32_t note, int32_t velocity) { float p, l=100.0f; //louder than any envelope! - LvzInt32 v=0, tmp, held=0; + int32_t v=0, tmp, held=0; if(velocity>0) //note on { @@ -912,11 +912,11 @@ void mdaJX10::noteOn(LvzInt32 note, LvzInt32 velocity) } -LvzInt32 mdaJX10::processEvents(LvzEvents* ev) +int32_t mdaJX10::processEvents(LvzEvents* ev) { - LvzInt32 npos=0; + int32_t npos=0; - for (LvzInt32 i=0; i<ev->numEvents; i++) + for (int32_t i=0; i<ev->numEvents; i++) { if((ev->events[i])->type != kLvzMidiType) continue; LvzMidiEvent* event = (LvzMidiEvent*)ev->events[i]; @@ -972,7 +972,7 @@ LvzInt32 mdaJX10::processEvents(LvzEvents* ev) default: //all notes off if(midiData[1]>0x7A) { - for(LvzInt32 v=0; v<NVOICES; v++) + for(int32_t v=0; v<NVOICES; v++) { voice[v].envl = voice[v].env = 0.0f; voice[v].envd = 0.99f; diff --git a/src/mdaJX10.h b/src/mdaJX10.h index 1050b00..932ca6d 100644 --- a/src/mdaJX10.h +++ b/src/mdaJX10.h @@ -84,7 +84,7 @@ struct VOICE //voice state float lev; //osc levels float lev2; float target; //period target - LvzInt32 note; //remember what note triggered this + int32_t note; //remember what note triggered this }; @@ -94,36 +94,36 @@ 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 process(float **inputs, float **outputs, int32_t sampleframes); + virtual void processReplacing(float **inputs, float **outputs, int32_t sampleframes); + virtual int32_t processEvents(LvzEvents* events); - virtual void setProgram(LvzInt32 program); + virtual void setProgram(int32_t 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 setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); virtual void setSampleRate(float sampleRate); - virtual void setBlockSize(LvzInt32 blockSize); + virtual void setBlockSize(int32_t 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 getOutputProperties (int32_t index, LvzPinProperties* properties); + virtual bool getProgramNameIndexed (int32_t category, int32_t index, char* text); + virtual bool copyProgram (int32_t 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); + virtual int32_t getVendorVersion () {return 1;} + virtual int32_t canDo (char* text); private: void update(); //my parameter update - void noteOn(LvzInt32 note, LvzInt32 velocity); - void fillpatch(LvzInt32 p, const char *name, + void noteOn(int32_t note, int32_t velocity); + void fillpatch(int32_t 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, @@ -134,12 +134,12 @@ private: #define EVENTBUFFER 120 #define EVENTS_DONE 99999999 - LvzInt32 notes[EVENTBUFFER + 8]; //list of delta|note|velocity for current block + int32_t notes[EVENTBUFFER + 8]; //list of delta|note|velocity for current block #define KMAX 32 ///global internal variables #define SUSTAIN -1 - LvzInt32 sustain, activevoices; + int32_t sustain, activevoices; VOICE voice[NVOICES]; float semi, cent; @@ -150,7 +150,7 @@ private: float lfo, dlfo, modwhl, press, pbend, ipbend, rezwhl; float velsens, volume, voltrim; float vibrato, pwmdep, lfoHz, glide, glidedisp; - LvzInt32 K, lastnote, veloff, mode; + int32_t K, lastnote, veloff, mode; unsigned int noise; }; diff --git a/src/mdaLeslie.cpp b/src/mdaLeslie.cpp index db37349..745936f 100644 --- a/src/mdaLeslie.cpp +++ b/src/mdaLeslie.cpp @@ -82,7 +82,7 @@ bool mdaLeslie::getProductString(char* text) { strcpy(text, "MDA Leslie"); retu bool mdaLeslie::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaLeslie::getEffectName(char* name) { strcpy(name, "Leslie"); return true; } -void mdaLeslie::setParameter(LvzInt32 index, float value) +void mdaLeslie::setParameter(int32_t index, float value) { float * param = programs[curProgram].param; @@ -107,7 +107,7 @@ mdaLeslie::~mdaLeslie() if(programs) delete [] programs; } -void mdaLeslie::setProgram(LvzInt32 program) +void mdaLeslie::setProgram(int32_t program) { curProgram = program; update(); @@ -168,7 +168,7 @@ void mdaLeslie::getProgramName(char *name) strcpy(name, programs[curProgram].name); } -bool mdaLeslie::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaLeslie::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if ((unsigned int)index < NPROGS) { @@ -178,7 +178,7 @@ bool mdaLeslie::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* return false; } -float mdaLeslie::getParameter(LvzInt32 index) +float mdaLeslie::getParameter(int32_t index) { float v=0; float * param = programs[curProgram].param; @@ -198,7 +198,7 @@ float mdaLeslie::getParameter(LvzInt32 index) return v; } -void mdaLeslie::getParameterName(LvzInt32 index, char *label) +void mdaLeslie::getParameterName(int32_t index, char *label) { switch(index) { @@ -215,9 +215,9 @@ void mdaLeslie::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } -void mdaLeslie::getParameterDisplay(LvzInt32 index, char *text) +void mdaLeslie::getParameterDisplay(int32_t index, char *text) { float * param = programs[curProgram].param; switch(index) @@ -228,18 +228,18 @@ void mdaLeslie::getParameterDisplay(LvzInt32 index, char *text) if(param[0] < 0.1f) strcpy(text, "STOP"); else strcpy(text, "SLOW"); } else strcpy(text, "FAST"); break; - case 1: int2strng((LvzInt32)(100 * param[6]), text); break; - case 2: int2strng((LvzInt32)(100 * param[8]), text); break; - case 3: int2strng((LvzInt32)(100 * param[3]), text); break; - case 4: int2strng((LvzInt32)(100 * param[4]), text); break; - case 5: int2strng((LvzInt32)(100 * param[5]), text); break; - case 6: int2strng((LvzInt32)(10*int((float)pow(10.0f,1.179f + param[2]))), text); break; - case 7: int2strng((LvzInt32)(40 * param[1] - 20), text); break; - case 8: int2strng((LvzInt32)(200 * param[7]), text); break; + case 1: int2strng((int32_t)(100 * param[6]), text); break; + case 2: int2strng((int32_t)(100 * param[8]), text); break; + case 3: int2strng((int32_t)(100 * param[3]), text); break; + case 4: int2strng((int32_t)(100 * param[4]), text); break; + case 5: int2strng((int32_t)(100 * param[5]), text); break; + case 6: int2strng((int32_t)(10*int((float)pow(10.0f,1.179f + param[2]))), text); break; + case 7: int2strng((int32_t)(40 * param[1] - 20), text); break; + case 8: int2strng((int32_t)(200 * param[7]), text); break; } } -void mdaLeslie::getParameterLabel(LvzInt32 index, char *label) +void mdaLeslie::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -252,7 +252,7 @@ void mdaLeslie::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- -void mdaLeslie::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaLeslie::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -263,7 +263,7 @@ void mdaLeslie::process(float **inputs, float **outputs, LvzInt32 sampleFrames) float hl=hlev, hs=hspd, ht, hm=hmom, hp=hphi, hw=hwid, hd=hdep; float ll=llev, ls=lspd, lt, lm=lmom, lp=lphi, lw=lwid; float hint, k0=0.03125f, k1=32.f; - LvzInt32 hdd, hdd2, k=0, hps=hpos; + int32_t hdd, hdd2, k=0, hps=hpos; ht=hset*(1.f-hm); lt=lset*(1.f-lm); @@ -296,7 +296,7 @@ void mdaLeslie::process(float **inputs, float **outputs, LvzInt32 sampleFrames) dshp = k0 * ((float)sin(hp + k1*hs) - shp); dslp = k0 * ((float)sin(lp + k1*ls) - slp); - k=(LvzInt32)k1; + k=(int32_t)k1; } fb1 = fo * (fb1 - a) + a; @@ -339,7 +339,7 @@ void mdaLeslie::process(float **inputs, float **outputs, LvzInt32 sampleFrames) if(fabs(fb2)>1.0e-10) fbuf2=fb2; else fbuf2=0.f; } -void mdaLeslie::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaLeslie::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -350,7 +350,7 @@ void mdaLeslie::processReplacing(float **inputs, float **outputs, LvzInt32 sampl float hl=hlev, hs=hspd, ht, hm=hmom, hp=hphi, hw=hwid, hd=hdep; float ll=llev, ls=lspd, lt, lm=lmom, lp=lphi, lw=lwid; float hint, k0=0.03125f, k1=32.f; //k0 = 1/k1 - LvzInt32 hdd, hdd2, k=0, hps=hpos; + int32_t hdd, hdd2, k=0, hps=hpos; ht=hset*(1.f-hm); //target speeds lt=lset*(1.f-lm); @@ -381,7 +381,7 @@ void mdaLeslie::processReplacing(float **inputs, float **outputs, LvzInt32 sampl dshp = k0 * ((float)sin(hp + k1*hs) - shp); dslp = k0 * ((float)sin(lp + k1*ls) - slp); - k=(LvzInt32)k1; + k=(int32_t)k1; } fb1 = fo * (fb1 - a) + a; //crossover diff --git a/src/mdaLeslie.h b/src/mdaLeslie.h index ba4f763..1d73023 100644 --- a/src/mdaLeslie.h +++ b/src/mdaLeslie.h @@ -40,23 +40,23 @@ public: mdaLeslie(audioMasterCallback audioMaster); ~mdaLeslie(); - 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t sampleFrames); + virtual void setProgram(int32_t 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 bool getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: void update(); @@ -68,7 +68,7 @@ protected: float hspd, hset, hmom, hphi, hwid, hlev, hdep; float lspd, lset, lmom, lphi, lwid, llev, gain; float *hbuf; //HF delay buffer - LvzInt32 size, hpos; //buffer length & pointer + int32_t size, hpos; //buffer length & pointer float chp, dchp, clp, dclp, shp, dshp, slp, dslp; }; diff --git a/src/mdaLimiter.cpp b/src/mdaLimiter.cpp index d29cf0d..baaffde 100644 --- a/src/mdaLimiter.cpp +++ b/src/mdaLimiter.cpp @@ -73,7 +73,7 @@ void mdaLimiter::getProgramName(char *name) strcpy(name, programName); } -bool mdaLimiter::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaLimiter::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -83,7 +83,7 @@ bool mdaLimiter::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* return false; } -void mdaLimiter::setParameter(LvzInt32 index, float value) +void mdaLimiter::setParameter(int32_t index, float value) { switch(index) { @@ -107,7 +107,7 @@ void mdaLimiter::setParameter(LvzInt32 index, float value) rel = (float)pow(10.0, -2.0 - (3.0 * fParam4)); } -float mdaLimiter::getParameter(LvzInt32 index) +float mdaLimiter::getParameter(int32_t index) { float v=0; @@ -122,7 +122,7 @@ float mdaLimiter::getParameter(LvzInt32 index) return v; } -void mdaLimiter::getParameterName(LvzInt32 index, char *label) +void mdaLimiter::getParameterName(int32_t index, char *label) { switch(index) { @@ -135,23 +135,23 @@ void mdaLimiter::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } -void mdaLimiter::getParameterDisplay(LvzInt32 index, char *text) +void mdaLimiter::getParameterDisplay(int32_t index, char *text) { switch(index) { - case 0: int2strng((LvzInt32)(40.0*fParam1 - 40.0),text); break; - case 1: int2strng((LvzInt32)(40.0*fParam2 - 20.0),text); break; - case 3: int2strng((LvzInt32)(-301030.1 / (getSampleRate() * log10(1.0 - att))),text); break; - case 2: int2strng((LvzInt32)(-301.0301 / (getSampleRate() * log10(1.0 - rel))),text); break; + case 0: int2strng((int32_t)(40.0*fParam1 - 40.0),text); break; + case 1: int2strng((int32_t)(40.0*fParam2 - 20.0),text); break; + case 3: int2strng((int32_t)(-301030.1 / (getSampleRate() * log10(1.0 - att))),text); break; + case 2: int2strng((int32_t)(-301.0301 / (getSampleRate() * log10(1.0 - rel))),text); break; case 4: if(fParam5>0.0) strcpy(text, "SOFT"); else strcpy(text, "HARD"); break; } } -void mdaLimiter::getParameterLabel(LvzInt32 index, char *label) +void mdaLimiter::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -166,7 +166,7 @@ void mdaLimiter::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaLimiter::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaLimiter::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -234,7 +234,7 @@ void mdaLimiter::process(float **inputs, float **outputs, LvzInt32 sampleFrames) gain = g; } -void mdaLimiter::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaLimiter::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaLimiter.h b/src/mdaLimiter.h index 539d512..e7e30cc 100644 --- a/src/mdaLimiter.h +++ b/src/mdaLimiter.h @@ -27,21 +27,21 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); virtual bool getEffectName(char *name); virtual bool getVendorString(char *text); virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; diff --git a/src/mdaLooplex.cpp b/src/mdaLooplex.cpp index 0cf408d..9e47d4e 100644 --- a/src/mdaLooplex.cpp +++ b/src/mdaLooplex.cpp @@ -263,7 +263,7 @@ void mdaLooplex::idle() if(busy) return; //only do once per bypass busy = 1; float * param = programs[curProgram].param; - bufmax = 2 * (LvzInt32)Fs * (LvzInt32)(10.5f + 190.0f * param[0]); + bufmax = 2 * (int32_t)Fs * (int32_t)(10.5f + 190.0f * param[0]); if(buffer) delete [] buffer; buffer = new short[bufmax + 10]; if(buffer) memset(buffer, 0, (bufmax + 10) * sizeof(short)); else bufmax = 0; @@ -302,19 +302,19 @@ mdaLooplex::~mdaLooplex () //destroy any buffers... char wh[44]; memcpy(wh, "RIFF____WAVEfmt \20\0\0\0\1\0\2\0________\4\0\20\0data____", 44); - LvzInt32 l = 36 + buflen * 2; + int32_t l = 36 + buflen * 2; wh[4] = (char)(l & 0xFF); l >>= 8; wh[5] = (char)(l & 0xFF); l >>= 8; wh[6] = (char)(l & 0xFF); l >>= 8; wh[7] = (char)(l & 0xFF); - l = (LvzInt32)(Fs + 0.5f); + l = (int32_t)(Fs + 0.5f); wh[24] = (char)(l & 0xFF); l >>= 8; wh[25] = (char)(l & 0xFF); l >>= 8; wh[26] = (char)(l & 0xFF); l >>= 8; wh[27] = (char)(l & 0xFF); - l = 4 * (LvzInt32)(Fs + 0.5f); + l = 4 * (int32_t)(Fs + 0.5f); wh[28] = (char)(l & 0xFF); l >>= 8; wh[29] = (char)(l & 0xFF); l >>= 8; wh[30] = (char)(l & 0xFF); l >>= 8; @@ -351,30 +351,30 @@ mdaLooplex::~mdaLooplex () //destroy any buffers... } -void mdaLooplex::setProgram(LvzInt32 program) +void mdaLooplex::setProgram(int32_t program) { curProgram = program; update(); } -void mdaLooplex::setParameter(LvzInt32 index, float value) +void mdaLooplex::setParameter(int32_t index, float value) { programs[curProgram].param[index] = value; update(); } -float mdaLooplex::getParameter(LvzInt32 index) { return programs[curProgram].param[index]; } +float mdaLooplex::getParameter(int32_t index) { return programs[curProgram].param[index]; } void mdaLooplex::setProgramName(char *name) { strcpy(programs[curProgram].name, name); } void mdaLooplex::getProgramName(char *name) { strcpy(name, programs[curProgram].name); } -void mdaLooplex::setBlockSize(LvzInt32 blockSize) { AudioEffectX::setBlockSize(blockSize); } +void mdaLooplex::setBlockSize(int32_t blockSize) { AudioEffectX::setBlockSize(blockSize); } bool mdaLooplex::getEffectName(char* name) { strcpy(name, "Looplex"); return true; } bool mdaLooplex::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaLooplex::getProductString(char* text) { strcpy(text, "MDA Looplex"); return true; } -bool mdaLooplex::getProgramNameIndexed(LvzInt32 category, LvzInt32 index, char* text) +bool mdaLooplex::getProgramNameIndexed(int32_t category, int32_t index, char* text) { if ((unsigned int)index < NPROGS) { @@ -385,7 +385,7 @@ bool mdaLooplex::getProgramNameIndexed(LvzInt32 category, LvzInt32 index, char* } -bool mdaLooplex::copyProgram(LvzInt32 destination) +bool mdaLooplex::copyProgram(int32_t destination) { if(destination<NPROGS) { @@ -396,7 +396,7 @@ bool mdaLooplex::copyProgram(LvzInt32 destination) } -LvzInt32 mdaLooplex::canDo(char* text) +int32_t mdaLooplex::canDo(char* text) { if(strcmp(text, "receiveLvzEvents") == 0) return 1; if(strcmp(text, "receiveLvzMidiEvent") == 0) return 1; @@ -404,7 +404,7 @@ LvzInt32 mdaLooplex::canDo(char* text) } -void mdaLooplex::getParameterName(LvzInt32 index, char *label) +void mdaLooplex::getParameterName(int32_t index, char *label) { switch (index) { @@ -421,7 +421,7 @@ void mdaLooplex::getParameterName(LvzInt32 index, char *label) } -void mdaLooplex::getParameterDisplay(LvzInt32 index, char *text) +void mdaLooplex::getParameterDisplay(int32_t index, char *text) { char string[16]; float * param = programs[curProgram].param; @@ -455,7 +455,7 @@ void mdaLooplex::getParameterDisplay(LvzInt32 index, char *text) } -void mdaLooplex::getParameterLabel(LvzInt32 index, char *label) +void mdaLooplex::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -467,22 +467,22 @@ void mdaLooplex::getParameterLabel(LvzInt32 index, char *label) } -void mdaLooplex::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaLooplex::process(float **inputs, float **outputs, int32_t sampleFrames) { notes[0] = EVENTS_DONE; //mark events buffer as done } -void mdaLooplex::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaLooplex::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float* in1 = inputs[0]; float* in2 = inputs[1]; float* out1 = outputs[0]; float* out2 = outputs[1]; - LvzInt32 event=0, frame=0, frames; + int32_t event=0, frame=0, frames; float l, r, dl, dr, d0 = 0.0f, d1; float imix = in_mix, ipan = in_pan, omix = out_mix, fb = feedback * modwhl; - LvzInt32 x; + int32_t x; if((bypassed = bypass)) return; @@ -519,7 +519,7 @@ void mdaLooplex::processReplacing(float **inputs, float **outputs, LvzInt32 samp dl = fb * (float)buffer[bufpos]; if(recreq) { - x = (LvzInt32)(32768.0f * l + dl + d0 - d1 + 100000.5f) - 100000; + x = (int32_t)(32768.0f * l + dl + d0 - d1 + 100000.5f) - 100000; if(x > 32767) x = 32767; else if(x < -32768) x = -32768; buffer[bufpos] = (short)x; } @@ -529,7 +529,7 @@ void mdaLooplex::processReplacing(float **inputs, float **outputs, LvzInt32 samp dr = fb * (float)buffer[bufpos]; if(recreq) { - x = (LvzInt32)(32768.0f * r + dr - d0 + d1 + 100000.5f) - 100000; + x = (int32_t)(32768.0f * r + dr - d0 + d1 + 100000.5f) - 100000; if(x > 32767) x = 32767; else if(x < -32768) x = -32768; buffer[bufpos] = (short)x; } @@ -558,8 +558,8 @@ void mdaLooplex::processReplacing(float **inputs, float **outputs, LvzInt32 samp if(frame<sampleFrames) { - LvzInt32 note = notes[event++]; - //LvzInt32 vel = notes[event++]; + int32_t note = notes[event++]; + //int32_t vel = notes[event++]; if(note == 2) { @@ -575,11 +575,11 @@ void mdaLooplex::processReplacing(float **inputs, float **outputs, LvzInt32 samp } -LvzInt32 mdaLooplex::processEvents(LvzEvents* ev) +int32_t mdaLooplex::processEvents(LvzEvents* ev) { - LvzInt32 npos=0; + int32_t npos=0; - for (LvzInt32 i=0; i<ev->numEvents; i++) + for (int32_t i=0; i<ev->numEvents; i++) { if((ev->events[i])->type != kLvzMidiType) continue; LvzMidiEvent* event = (LvzMidiEvent*)ev->events[i]; diff --git a/src/mdaLooplex.h b/src/mdaLooplex.h index 38a69e0..2ef4fb7 100644 --- a/src/mdaLooplex.h +++ b/src/mdaLooplex.h @@ -46,31 +46,31 @@ public: mdaLooplex(audioMasterCallback audioMaster); ~mdaLooplex(); - 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 process(float **inputs, float **outputs, int32_t sampleframes); + virtual void processReplacing(float **inputs, float **outputs, int32_t sampleframes); + virtual int32_t processEvents(LvzEvents* events); - virtual void setProgram(LvzInt32 program); + virtual void setProgram(int32_t 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 setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); virtual void setSampleRate(float sampleRate); - virtual void setBlockSize(LvzInt32 blockSize); + virtual void setBlockSize(int32_t blockSize); virtual void resume(); - virtual bool getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* text); - virtual bool copyProgram (LvzInt32 destination); + virtual bool getProgramNameIndexed (int32_t category, int32_t index, char* text); + virtual bool copyProgram (int32_t 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); + virtual int32_t getVendorVersion () {return 1;} + virtual int32_t canDo (char* text); - virtual LvzInt32 getNumMidiInputChannels () { return 1; } + virtual int32_t getNumMidiInputChannels () { return 1; } void idle(); @@ -82,15 +82,15 @@ private: #define EVENTBUFFER 120 #define EVENTS_DONE 99999999 - LvzInt32 notes[EVENTBUFFER + 8]; //list of delta|note|velocity for current block + int32_t notes[EVENTBUFFER + 8]; //list of delta|note|velocity for current block ///global internal variables float in_mix, in_pan, out_mix, feedback, modwhl; short *buffer; - LvzInt32 bufpos, buflen, bufmax, mode; + int32_t bufpos, buflen, bufmax, mode; - LvzInt32 bypass, bypassed, busy, status, recreq; + int32_t bypass, bypassed, busy, status, recreq; float oldParam0, oldParam1, oldParam2; }; diff --git a/src/mdaLoudness.cpp b/src/mdaLoudness.cpp index 9af8ab6..7ef3b38 100644 --- a/src/mdaLoudness.cpp +++ b/src/mdaLoudness.cpp @@ -77,7 +77,7 @@ void mdaLoudness::resume() ///update internal parameters... { float * param = programs[curProgram].param; float f, tmp; - LvzInt32 i; + int32_t i; tmp = param[0] + param[0] - 1.0f; igain = 60.0f * tmp * tmp; @@ -88,7 +88,7 @@ void mdaLoudness::resume() ///update internal parameters... if(tmp<0.0f) ogain *= -1.0f; f = 0.1f * igain + 6.0f; //coefficient index + fractional part - i = (LvzInt32)f; + i = (int32_t)f; f -= (float)i; tmp = loudness[i][0]; A0 = tmp + f * (loudness[i + 1][0] - tmp); @@ -128,22 +128,22 @@ mdaLoudness::~mdaLoudness() ///destroy any buffers... if(programs) delete[] programs; } -void mdaLoudness::setProgram(LvzInt32 program) +void mdaLoudness::setProgram(int32_t program) { curProgram = program; resume(); } -void mdaLoudness::setParameter(LvzInt32 index, float value) +void mdaLoudness::setParameter(int32_t index, float value) { programs[curProgram].param[index] = value; //bug was here! resume(); } -float mdaLoudness::getParameter(LvzInt32 index) { return programs[curProgram].param[index]; } +float mdaLoudness::getParameter(int32_t index) { return programs[curProgram].param[index]; } void mdaLoudness::setProgramName(char *name) { strcpy(programs[curProgram].name, name); } void mdaLoudness::getProgramName(char *name) { strcpy(name, programs[curProgram].name); } -bool mdaLoudness::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaLoudness::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if ((unsigned int)index < NPROGS) { @@ -154,7 +154,7 @@ bool mdaLoudness::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char } -void mdaLoudness::getParameterName(LvzInt32 index, char *label) +void mdaLoudness::getParameterName(int32_t index, char *label) { switch(index) { @@ -165,7 +165,7 @@ void mdaLoudness::getParameterName(LvzInt32 index, char *label) } -void mdaLoudness::getParameterDisplay(LvzInt32 index, char *text) +void mdaLoudness::getParameterDisplay(int32_t index, char *text) { char string[16]; @@ -181,7 +181,7 @@ void mdaLoudness::getParameterDisplay(LvzInt32 index, char *text) } -void mdaLoudness::getParameterLabel(LvzInt32 index, char *label) +void mdaLoudness::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -191,7 +191,7 @@ void mdaLoudness::getParameterLabel(LvzInt32 index, char *label) } -void mdaLoudness::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaLoudness::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -255,7 +255,7 @@ void mdaLoudness::process(float **inputs, float **outputs, LvzInt32 sampleFrames } -void mdaLoudness::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaLoudness::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaLoudness.h b/src/mdaLoudness.h index ef13620..dc0880f 100644 --- a/src/mdaLoudness.h +++ b/src/mdaLoudness.h @@ -41,24 +41,24 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t sampleFrames); + virtual void setProgram(int32_t 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 bool getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: mdaLoudnessProgram *programs; @@ -66,7 +66,7 @@ protected: ///global internal variables float Z0, Z1, Z2, Z3, A0, A1, A2, gain; float igain, ogain; - LvzInt32 mode; + int32_t mode; }; #endif diff --git a/src/mdaMultiBand.cpp b/src/mdaMultiBand.cpp index 0bf3af5..9998148 100644 --- a/src/mdaMultiBand.cpp +++ b/src/mdaMultiBand.cpp @@ -118,7 +118,7 @@ void mdaMultiBand::getProgramName(char *name) strcpy(name, programName); } -bool mdaMultiBand::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaMultiBand::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -128,7 +128,7 @@ bool mdaMultiBand::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, cha return false; } -void mdaMultiBand::setParameter(LvzInt32 index, float value) +void mdaMultiBand::setParameter(int32_t index, float value) { switch(index) { @@ -180,7 +180,7 @@ void mdaMultiBand::setParameter(LvzInt32 index, float value) if(fParam13>0.5) mswap=1; else mswap=0; } -float mdaMultiBand::getParameter(LvzInt32 index) +float mdaMultiBand::getParameter(int32_t index) { float v=0; @@ -203,7 +203,7 @@ float mdaMultiBand::getParameter(LvzInt32 index) return v; } -void mdaMultiBand::getParameterName(LvzInt32 index, char *label) +void mdaMultiBand::getParameterName(int32_t index, char *label) { switch(index) { @@ -224,9 +224,9 @@ void mdaMultiBand::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } -void mdaMultiBand::getParameterDisplay(LvzInt32 index, char *text) +void mdaMultiBand::getParameterDisplay(int32_t index, char *text) { switch(index) { @@ -235,23 +235,23 @@ void mdaMultiBand::getParameterDisplay(LvzInt32 index, char *text) case 1: case 2: strcpy(text, "Mid"); break; case 3: case 4: strcpy(text, "High"); break; default: strcpy(text, "Output"); break; } break; - case 1: int2strng((LvzInt32)(getSampleRate() * fi1 * (0.098 + 0.09*fi1 + 0.5*(float)pow(fi1,8.2f))), text); break; - case 2: int2strng((LvzInt32)(getSampleRate() * fi2 * (0.015 + 0.15*fi2 + 0.9*(float)pow(fi2,8.2f))), text); break; - case 3: int2strng((LvzInt32)(30.0 * fParam4), text); break; - case 4: int2strng((LvzInt32)(30.0 * fParam5), text); break; - case 5: int2strng((LvzInt32)(30.0 * fParam6), text); break; - case 6: int2strng((LvzInt32)(40.0 * fParam7 - 20.0), text); break; - case 7: int2strng((LvzInt32)(40.0 * fParam8 - 20.0), text); break; - case 8: int2strng((LvzInt32)(40.0 * fParam9 - 20.0), text); break; - case 9: int2strng((LvzInt32)(-301030.1 / (getSampleRate() * log10(1.0 - att2))),text); break; - case 10: int2strng((LvzInt32)(-301.0301 / (getSampleRate() * log10(1.0 - rel2))),text); break; - case 11: int2strng((LvzInt32)(200.0 * fParam12), text); break; + case 1: int2strng((int32_t)(getSampleRate() * fi1 * (0.098 + 0.09*fi1 + 0.5*(float)pow(fi1,8.2f))), text); break; + case 2: int2strng((int32_t)(getSampleRate() * fi2 * (0.015 + 0.15*fi2 + 0.9*(float)pow(fi2,8.2f))), text); break; + case 3: int2strng((int32_t)(30.0 * fParam4), text); break; + case 4: int2strng((int32_t)(30.0 * fParam5), text); break; + case 5: int2strng((int32_t)(30.0 * fParam6), text); break; + case 6: int2strng((int32_t)(40.0 * fParam7 - 20.0), text); break; + case 7: int2strng((int32_t)(40.0 * fParam8 - 20.0), text); break; + case 8: int2strng((int32_t)(40.0 * fParam9 - 20.0), text); break; + case 9: int2strng((int32_t)(-301030.1 / (getSampleRate() * log10(1.0 - att2))),text); break; + case 10: int2strng((int32_t)(-301.0301 / (getSampleRate() * log10(1.0 - rel2))),text); break; + case 11: int2strng((int32_t)(200.0 * fParam12), text); break; case 12: if(mswap) strcpy(text, "S"); else strcpy(text, "M"); break; } } -void mdaMultiBand::getParameterLabel(LvzInt32 index, char *label) +void mdaMultiBand::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -274,7 +274,7 @@ void mdaMultiBand::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaMultiBand::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaMultiBand::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -333,7 +333,7 @@ void mdaMultiBand::process(float **inputs, float **outputs, LvzInt32 sampleFrame else { fb1=b1; fb2=b2; fb3=l; } } -void mdaMultiBand::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaMultiBand::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaMultiBand.h b/src/mdaMultiBand.h index 611ccee..f2788c5 100644 --- a/src/mdaMultiBand.h +++ b/src/mdaMultiBand.h @@ -27,21 +27,21 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); virtual bool getEffectName(char *name); virtual bool getVendorString(char *text); virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1, fParam2, fParam3, fParam4; diff --git a/src/mdaOverdrive.cpp b/src/mdaOverdrive.cpp index 768997c..ea4d44c 100644 --- a/src/mdaOverdrive.cpp +++ b/src/mdaOverdrive.cpp @@ -62,7 +62,7 @@ void mdaOverdrive::getProgramName(char *name) strcpy(name, programName); } -bool mdaOverdrive::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaOverdrive::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -72,7 +72,7 @@ bool mdaOverdrive::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, cha return false; } -void mdaOverdrive::setParameter(LvzInt32 index, float value) +void mdaOverdrive::setParameter(int32_t index, float value) { switch(index) { @@ -84,7 +84,7 @@ void mdaOverdrive::setParameter(LvzInt32 index, float value) gain = (float)pow(10.0f, 2.0f * fParam3 - 1.0f); } -float mdaOverdrive::getParameter(LvzInt32 index) +float mdaOverdrive::getParameter(int32_t index) { float v=0; @@ -97,7 +97,7 @@ float mdaOverdrive::getParameter(LvzInt32 index) return v; } -void mdaOverdrive::getParameterName(LvzInt32 index, char *label) +void mdaOverdrive::getParameterName(int32_t index, char *label) { switch(index) { @@ -108,20 +108,20 @@ void mdaOverdrive::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } -void mdaOverdrive::getParameterDisplay(LvzInt32 index, char *text) +void mdaOverdrive::getParameterDisplay(int32_t index, char *text) { switch(index) { - case 0: int2strng((LvzInt32)(100 * fParam1 ), text); break; - case 1: int2strng((LvzInt32)(100 * fParam2 ), text); break; - case 2: int2strng((LvzInt32)( 40 * fParam3 - 20), text); break; + case 0: int2strng((int32_t)(100 * fParam1 ), text); break; + case 1: int2strng((int32_t)(100 * fParam2 ), text); break; + case 2: int2strng((int32_t)( 40 * fParam3 - 20), text); break; } } -void mdaOverdrive::getParameterLabel(LvzInt32 index, char *label) +void mdaOverdrive::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -134,7 +134,7 @@ void mdaOverdrive::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaOverdrive::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaOverdrive::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -172,7 +172,7 @@ void mdaOverdrive::process(float **inputs, float **outputs, LvzInt32 sampleFrame if(fabs(fb)>1.0e-10) filt2 = fb; else filt2 = 0.0f; } -void mdaOverdrive::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaOverdrive::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaOverdrive.h b/src/mdaOverdrive.h index b10e6c1..626773e 100644 --- a/src/mdaOverdrive.h +++ b/src/mdaOverdrive.h @@ -27,21 +27,21 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); virtual bool getEffectName(char *name); virtual bool getVendorString(char *text); virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; diff --git a/src/mdaPiano.cpp b/src/mdaPiano.cpp index 318e423..8f4fd76 100644 --- a/src/mdaPiano.cpp +++ b/src/mdaPiano.cpp @@ -60,7 +60,7 @@ mdaPiano::mdaPiano(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, if(programs) { //fill patches... - LvzInt32 i=0; + int32_t i=0; fillpatch(i++, "MDA Piano", 0.500f, 0.500f, 0.500f, 0.5f, 0.803f, 0.251f, 0.376f, 0.500f, 0.330f, 0.500f, 0.246f, 0.500f); fillpatch(i++, "Plain Piano", 0.500f, 0.500f, 0.500f, 0.5f, 0.751f, 0.000f, 0.452f, 0.000f, 0.000f, 0.500f, 0.000f, 0.500f); fillpatch(i++, "Compressed Piano", 0.902f, 0.399f, 0.623f, 0.5f, 1.000f, 0.331f, 0.299f, 0.499f, 0.330f, 0.500f, 0.000f, 0.500f); @@ -104,7 +104,7 @@ mdaPiano::mdaPiano(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kgrp[14].root = 93; kgrp[14].high = 999; kgrp[14].pos = 574123; kgrp[14].end = 586343; kgrp[14].loop = 2399; //initialise... - for(LvzInt32 v=0; v<NVOICES; v++) + for(int32_t v=0; v<NVOICES; v++) { voice[v].env = 0.0f; voice[v].dec = 0.99f; //all notes off @@ -125,7 +125,7 @@ mdaPiano::mdaPiano(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, void mdaPiano::update() //parameter change { float * param = programs[curProgram].param; - size = (LvzInt32)(12.0f * param[2] - 6.0f); + size = (int32_t)(12.0f * param[2] - 6.0f); sizevel = 0.12f * param[3]; muffvel = param[5] * param[5] * 5.0f; @@ -140,7 +140,7 @@ void mdaPiano::update() //parameter change trim = 1.50f - 0.79f * cdep; width = 0.04f * param[7]; if(width > 0.03f) width = 0.03f; - poly = 8 + (LvzInt32)(24.9f * param[8]); + poly = 8 + (int32_t)(24.9f * param[8]); } @@ -162,7 +162,7 @@ mdaPiano::~mdaPiano () //destroy any buffers... } -void mdaPiano::setProgram(LvzInt32 program) +void mdaPiano::setProgram(int32_t program) { curProgram = program; update(); @@ -171,7 +171,7 @@ void mdaPiano::setProgram(LvzInt32 program) } -void mdaPiano::setParameter(LvzInt32 index, float value) +void mdaPiano::setParameter(int32_t index, float value) { programs[curProgram].param[index] = value; update(); @@ -182,7 +182,7 @@ void mdaPiano::setParameter(LvzInt32 index, float value) } -void mdaPiano::fillpatch(LvzInt32 p, const char *name, float p0, float p1, float p2, float p3, float p4, +void mdaPiano::fillpatch(int32_t 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) { strcpy(programs[p].name, name); @@ -195,16 +195,16 @@ void mdaPiano::fillpatch(LvzInt32 p, const char *name, float p0, float p1, float } -float mdaPiano::getParameter(LvzInt32 index) { return programs[curProgram].param[index]; } +float mdaPiano::getParameter(int32_t index) { return programs[curProgram].param[index]; } void mdaPiano::setProgramName(char *name) { strcpy(programs[curProgram].name, name); } void mdaPiano::getProgramName(char *name) { strcpy(name, programs[curProgram].name); } -void mdaPiano::setBlockSize(LvzInt32 blockSize) { AudioEffectX::setBlockSize(blockSize); } +void mdaPiano::setBlockSize(int32_t blockSize) { AudioEffectX::setBlockSize(blockSize); } bool mdaPiano::getEffectName(char* name) { strcpy(name, "Piano"); return true; } bool mdaPiano::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaPiano::getProductString(char* text) { strcpy(text, "MDA Piano"); return true; } -bool mdaPiano::getOutputProperties(LvzInt32 index, LvzPinProperties* properties) +bool mdaPiano::getOutputProperties(int32_t index, LvzPinProperties* properties) { if(index<NOUTS) { @@ -218,7 +218,7 @@ bool mdaPiano::getOutputProperties(LvzInt32 index, LvzPinProperties* properties) } -bool mdaPiano::getProgramNameIndexed(LvzInt32 category, LvzInt32 index, char* text) +bool mdaPiano::getProgramNameIndexed(int32_t category, int32_t index, char* text) { if ((unsigned int)index < NPROGS) { @@ -229,7 +229,7 @@ bool mdaPiano::getProgramNameIndexed(LvzInt32 category, LvzInt32 index, char* te } -bool mdaPiano::copyProgram(LvzInt32 destination) +bool mdaPiano::copyProgram(int32_t destination) { if(destination<NPROGS) { @@ -240,7 +240,7 @@ bool mdaPiano::copyProgram(LvzInt32 destination) } -LvzInt32 mdaPiano::canDo(char* text) +int32_t mdaPiano::canDo(char* text) { if(strcmp(text, "receiveLvzEvents") == 0) return 1; if(strcmp(text, "receiveLvzMidiEvent") == 0) return 1; @@ -248,7 +248,7 @@ LvzInt32 mdaPiano::canDo(char* text) } -void mdaPiano::getParameterName(LvzInt32 index, char *label) +void mdaPiano::getParameterName(int32_t index, char *label) { switch (index) { @@ -271,7 +271,7 @@ void mdaPiano::getParameterName(LvzInt32 index, char *label) } -void mdaPiano::getParameterDisplay(LvzInt32 index, char *text) +void mdaPiano::getParameterDisplay(int32_t index, char *text) { char string[16]; float * param = programs[curProgram].param; @@ -292,7 +292,7 @@ void mdaPiano::getParameterDisplay(LvzInt32 index, char *text) } -void mdaPiano::getParameterLabel(LvzInt32 index, char *label) +void mdaPiano::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -305,7 +305,7 @@ void mdaPiano::getParameterLabel(LvzInt32 index, char *label) } -void mdaPiano::guiGetDisplay(LvzInt32 index, char *label) +void mdaPiano::guiGetDisplay(int32_t index, char *label) { getParameterName(index, label); strcat(label, " = "); @@ -315,13 +315,13 @@ void mdaPiano::guiGetDisplay(LvzInt32 index, char *label) -void mdaPiano::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaPiano::process(float **inputs, float **outputs, int32_t sampleFrames) { float* out0 = outputs[0]; float* out1 = outputs[1]; - LvzInt32 event=0, frame=0, frames, v; + int32_t event=0, frame=0, frames, v; float x, l, r; - LvzInt32 i; + int32_t i; while(frame<sampleFrames) { @@ -364,8 +364,8 @@ void mdaPiano::process(float **inputs, float **outputs, LvzInt32 sampleFrames) if(frame<sampleFrames) { - LvzInt32 note = notes[event++]; - LvzInt32 vel = notes[event++]; + int32_t note = notes[event++]; + int32_t vel = notes[event++]; noteOn(note, vel); } } @@ -374,13 +374,13 @@ void mdaPiano::process(float **inputs, float **outputs, LvzInt32 sampleFrames) } -void mdaPiano::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaPiano::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float* out0 = outputs[0]; float* out1 = outputs[1]; - LvzInt32 event=0, frame=0, frames, v; + int32_t event=0, frame=0, frames, v; float x, l, r; - LvzInt32 i; + int32_t i; while(frame<sampleFrames) { @@ -434,8 +434,8 @@ if(!(r > -2.0f) || !(r < 2.0f)) if(frame<sampleFrames) { - LvzInt32 note = notes[event++]; - LvzInt32 vel = notes[event++]; + int32_t note = notes[event++]; + int32_t vel = notes[event++]; noteOn(note, vel); } } @@ -444,11 +444,11 @@ if(!(r > -2.0f) || !(r < 2.0f)) } -void mdaPiano::noteOn(LvzInt32 note, LvzInt32 velocity) +void mdaPiano::noteOn(int32_t note, int32_t velocity) { float * param = programs[curProgram].param; float l=99.0f; - LvzInt32 v, vl=0, k, s; + int32_t v, vl=0, k, s; if(velocity>0) { @@ -470,14 +470,14 @@ void mdaPiano::noteOn(LvzInt32 note, LvzInt32 velocity) if(note > 60) l += stretch * (float)k; //stretch s = size; - if(velocity > 40) s += (LvzInt32)(sizevel * (float)(velocity - 40)); + if(velocity > 40) s += (int32_t)(sizevel * (float)(velocity - 40)); k = 0; while(note > (kgrp[k].high + s)) k++; //find keygroup l += (float)(note - kgrp[k].root); //pitch l = 22050.0f * iFs * (float)exp(0.05776226505 * l); - voice[vl].delta = (LvzInt32)(65536.0f * l); + voice[vl].delta = (int32_t)(65536.0f * l); voice[vl].frac = 0; voice[vl].pos = kgrp[k].pos; voice[vl].end = kgrp[k].end; @@ -518,11 +518,11 @@ void mdaPiano::noteOn(LvzInt32 note, LvzInt32 velocity) } -LvzInt32 mdaPiano::processEvents(LvzEvents* ev) +int32_t mdaPiano::processEvents(LvzEvents* ev) { - LvzInt32 npos=0; + int32_t npos=0; - for (LvzInt32 i=0; i<ev->numEvents; i++) + for (int32_t i=0; i<ev->numEvents; i++) { if((ev->events[i])->type != kLvzMidiType) continue; LvzMidiEvent* event = (LvzMidiEvent*)ev->events[i]; @@ -568,7 +568,7 @@ LvzInt32 mdaPiano::processEvents(LvzEvents* ev) default: //all notes off if(midiData[1]>0x7A) { - for(LvzInt32 v=0; v<NVOICES; v++) voice[v].dec=0.99f; + for(int32_t v=0; v<NVOICES; v++) voice[v].dec=0.99f; sustain = 0; muff = 160.0f; } diff --git a/src/mdaPiano.h b/src/mdaPiano.h index 7ce2191..1885671 100644 --- a/src/mdaPiano.h +++ b/src/mdaPiano.h @@ -46,11 +46,11 @@ private: struct VOICE //voice state { - LvzInt32 delta; //sample playback - LvzInt32 frac; - LvzInt32 pos; - LvzInt32 end; - LvzInt32 loop; + int32_t delta; //sample playback + int32_t frac; + int32_t pos; + int32_t end; + int32_t loop; float env; //envelope float dec; @@ -61,17 +61,17 @@ struct VOICE //voice state float outl; float outr; - LvzInt32 note; //remember what note triggered this + int32_t note; //remember what note triggered this }; struct KGRP //keygroup { - LvzInt32 root; //MIDI root note - LvzInt32 high; //highest note - LvzInt32 pos; - LvzInt32 end; - LvzInt32 loop; + int32_t root; //MIDI root note + int32_t high; //highest note + int32_t pos; + int32_t end; + int32_t loop; }; class mdaPiano : public AudioEffectX @@ -80,39 +80,39 @@ public: mdaPiano(audioMasterCallback audioMaster); ~mdaPiano(); - 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 process(float **inputs, float **outputs, int32_t sampleframes); + virtual void processReplacing(float **inputs, float **outputs, int32_t sampleframes); + virtual int32_t processEvents(LvzEvents* events); - virtual void setProgram(LvzInt32 program); + virtual void setProgram(int32_t 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 setBlockSize(LvzInt32 blockSize); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); + virtual void setBlockSize(int32_t blockSize); 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 getOutputProperties (int32_t index, LvzPinProperties* properties); + virtual bool getProgramNameIndexed (int32_t category, int32_t index, char* text); + virtual bool copyProgram (int32_t 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); + virtual int32_t getVendorVersion () {return 1;} + virtual int32_t canDo (char* text); - virtual LvzInt32 getNumMidiInputChannels () { return 1; } + virtual int32_t getNumMidiInputChannels () { return 1; } - LvzInt32 guiUpdate; - void guiGetDisplay(LvzInt32 index, char *label); + int32_t guiUpdate; + void guiGetDisplay(int32_t index, char *label); 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, + void noteOn(int32_t note, int32_t velocity); + void fillpatch(int32_t 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 param[NPARAMS]; @@ -121,16 +121,16 @@ private: #define EVENTBUFFER 120 #define EVENTS_DONE 99999999 - LvzInt32 notes[EVENTBUFFER + 8]; //list of delta|note|velocity for current block + int32_t notes[EVENTBUFFER + 8]; //list of delta|note|velocity for current block ///global internal variables KGRP kgrp[16]; VOICE voice[NVOICES]; - LvzInt32 activevoices, poly, cpos; + int32_t activevoices, poly, cpos; short *waves; - LvzInt32 cmax; + int32_t cmax; float *comb, cdep, width, trim; - LvzInt32 size, sustain; + int32_t size, sustain; float tune, fine, random, stretch; float muff, muffvel, sizevel, velsens, volume; }; diff --git a/src/mdaRePsycho.cpp b/src/mdaRePsycho.cpp index 2156784..7a882ce 100644 --- a/src/mdaRePsycho.cpp +++ b/src/mdaRePsycho.cpp @@ -70,7 +70,7 @@ bool mdaRePsycho::getProductString(char* text) { strcpy(text, "MDA RePsycho!"); bool mdaRePsycho::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaRePsycho::getEffectName(char* name) { strcpy(name, "RePsycho!"); return true; } -void mdaRePsycho::setParameter(LvzInt32 index, float value) +void mdaRePsycho::setParameter(int32_t index, float value) { switch(index) { @@ -124,7 +124,7 @@ void mdaRePsycho::getProgramName(char *name) strcpy(name, programName); } -float mdaRePsycho::getParameter(LvzInt32 index) +float mdaRePsycho::getParameter(int32_t index) { float v=0; @@ -141,7 +141,7 @@ float mdaRePsycho::getParameter(LvzInt32 index) return v; } -void mdaRePsycho::getParameterName(LvzInt32 index, char *label) +void mdaRePsycho::getParameterName(int32_t index, char *label) { switch(index) { @@ -158,7 +158,7 @@ void mdaRePsycho::getParameterName(LvzInt32 index, char *label) #include <stdio.h> void long2string(long value, char *string) { sprintf(string, "%ld", value); } -void mdaRePsycho::getParameterDisplay(LvzInt32 index, char *text) +void mdaRePsycho::getParameterDisplay(int32_t index, char *text) { switch(index) { @@ -173,7 +173,7 @@ void mdaRePsycho::getParameterDisplay(LvzInt32 index, char *text) } } -void mdaRePsycho::getParameterLabel(LvzInt32 index, char *label) +void mdaRePsycho::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -190,7 +190,7 @@ void mdaRePsycho::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaRePsycho::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaRePsycho::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -321,7 +321,7 @@ void mdaRePsycho::process(float **inputs, float **outputs, LvzInt32 sampleFrames buf2 = xx2; } -void mdaRePsycho::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaRePsycho::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaRePsycho.h b/src/mdaRePsycho.h index c07401d..1822b39 100644 --- a/src/mdaRePsycho.h +++ b/src/mdaRePsycho.h @@ -27,21 +27,21 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; diff --git a/src/mdaRezFilter.cpp b/src/mdaRezFilter.cpp index ae0ca56..d89f358 100644 --- a/src/mdaRezFilter.cpp +++ b/src/mdaRezFilter.cpp @@ -52,7 +52,7 @@ mdaRezFilter::mdaRezFilter(audioMasterCallback audioMaster) : AudioEffectX(audio setParameter(2, 0.5f); //go and set initial values! } -void mdaRezFilter::setParameter(LvzInt32 index, float value) +void mdaRezFilter::setParameter(int32_t index, float value) { switch(index) { @@ -116,7 +116,7 @@ void mdaRezFilter::getProgramName(char *name) strcpy(name, programName); } -bool mdaRezFilter::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaRezFilter::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -126,7 +126,7 @@ bool mdaRezFilter::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, cha return false; } -float mdaRezFilter::getParameter(LvzInt32 index) +float mdaRezFilter::getParameter(int32_t index) { float v=0; @@ -146,7 +146,7 @@ float mdaRezFilter::getParameter(LvzInt32 index) return v; } -void mdaRezFilter::getParameterName(LvzInt32 index, char *label) +void mdaRezFilter::getParameterName(int32_t index, char *label) { switch(index) { @@ -164,28 +164,28 @@ void mdaRezFilter::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } void float2strng(float value, char *string) { sprintf(string, "%.2f", value); } -void mdaRezFilter::getParameterDisplay(LvzInt32 index, char *text) +void mdaRezFilter::getParameterDisplay(int32_t index, char *text) { switch(index) { - case 0: int2strng((LvzInt32)(100 * fParam0), text); break; - case 1: int2strng((LvzInt32)(100 * fParam1), text); break; - case 2: int2strng((LvzInt32)(40 *fParam2 - 20),text); break; - case 3: int2strng((LvzInt32)(200 * fParam3 - 100), text); break; + case 0: int2strng((int32_t)(100 * fParam0), text); break; + case 1: int2strng((int32_t)(100 * fParam1), text); break; + case 2: int2strng((int32_t)(40 *fParam2 - 20),text); break; + case 3: int2strng((int32_t)(200 * fParam3 - 100), text); break; case 4: float2strng((float)(-301.0301 / (getSampleRate() * log10(1.0 - att))),text); break; case 5: float2strng((float)(-301.0301 / (getSampleRate() * log10(rel))),text); break; - case 6: int2strng((LvzInt32)(200 * fParam6 - 100), text); break; + case 6: int2strng((int32_t)(200 * fParam6 - 100), text); break; case 7: float2strng((float)pow(10.0f, 4.f*fParam7 - 2.f), text); break; case 8: if(tthr==0.f) strcpy(text, "FREE RUN"); - else int2strng((LvzInt32)(20*log10(0.5*tthr)), text); break; - case 9: int2strng((LvzInt32)(100 * fParam9), text); break; + else int2strng((int32_t)(20*log10(0.5*tthr)), text); break; + case 9: int2strng((int32_t)(100 * fParam9), text); break; } } -void mdaRezFilter::getParameterLabel(LvzInt32 index, char *label) +void mdaRezFilter::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -205,7 +205,7 @@ void mdaRezFilter::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaRezFilter::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaRezFilter::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -284,7 +284,7 @@ void mdaRezFilter::process(float **inputs, float **outputs, LvzInt32 sampleFrame phi=(float)fmod(ph,6.2831853f); } -void mdaRezFilter::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaRezFilter::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaRezFilter.h b/src/mdaRezFilter.h index e28df58..91dadd1 100644 --- a/src/mdaRezFilter.h +++ b/src/mdaRezFilter.h @@ -27,22 +27,22 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam0; diff --git a/src/mdaRingMod.cpp b/src/mdaRingMod.cpp index 714650c..f2cd0b1 100644 --- a/src/mdaRingMod.cpp +++ b/src/mdaRingMod.cpp @@ -63,7 +63,7 @@ void mdaRingMod::getProgramName(char *name) strcpy(name, programName); } -bool mdaRingMod::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaRingMod::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -73,7 +73,7 @@ bool mdaRingMod::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* return false; } -void mdaRingMod::setParameter(LvzInt32 index, float value) +void mdaRingMod::setParameter(int32_t index, float value) { switch(index) { @@ -85,7 +85,7 @@ void mdaRingMod::setParameter(LvzInt32 index, float value) ffb = 0.95f * fParam3; } -float mdaRingMod::getParameter(LvzInt32 index) +float mdaRingMod::getParameter(int32_t index) { float v=0; @@ -98,7 +98,7 @@ float mdaRingMod::getParameter(LvzInt32 index) return v; } -void mdaRingMod::getParameterName(LvzInt32 index, char *label) +void mdaRingMod::getParameterName(int32_t index, char *label) { switch(index) { @@ -109,20 +109,20 @@ void mdaRingMod::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } -void mdaRingMod::getParameterDisplay(LvzInt32 index, char *text) +void mdaRingMod::getParameterDisplay(int32_t index, char *text) { switch(index) { - case 0: int2strng((LvzInt32)(100. * floor(160. * fParam1)), text); break; - case 1: int2strng((LvzInt32)(100. * fParam2), text); break; - case 2: int2strng((LvzInt32)(100. * fParam3), text); break; + case 0: int2strng((int32_t)(100. * floor(160. * fParam1)), text); break; + case 1: int2strng((int32_t)(100. * fParam2), text); break; + case 2: int2strng((int32_t)(100. * fParam3), text); break; } } -void mdaRingMod::getParameterLabel(LvzInt32 index, char *label) +void mdaRingMod::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -135,7 +135,7 @@ void mdaRingMod::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaRingMod::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaRingMod::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -177,7 +177,7 @@ void mdaRingMod::process(float **inputs, float **outputs, LvzInt32 sampleFrames) fprev = fp; } -void mdaRingMod::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaRingMod::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaRingMod.h b/src/mdaRingMod.h index ace3107..7ebb91d 100644 --- a/src/mdaRingMod.h +++ b/src/mdaRingMod.h @@ -27,21 +27,21 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); virtual bool getEffectName(char *name); virtual bool getVendorString(char *text); virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; diff --git a/src/mdaRoundPan.cpp b/src/mdaRoundPan.cpp index 49b7a25..e5eb56b 100644 --- a/src/mdaRoundPan.cpp +++ b/src/mdaRoundPan.cpp @@ -54,7 +54,7 @@ bool mdaRoundPan::getProductString(char* text) { strcpy(text, "MDA RoundPan"); bool mdaRoundPan::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaRoundPan::getEffectName(char* name) { strcpy(name, "RoundPan"); return true; } -void mdaRoundPan::setParameter(LvzInt32 index, float value) +void mdaRoundPan::setParameter(int32_t index, float value) { switch(index) { @@ -101,7 +101,7 @@ void mdaRoundPan::getProgramName(char *name) strcpy(name, programName); } -bool mdaRoundPan::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaRoundPan::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -111,7 +111,7 @@ bool mdaRoundPan::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char return false; } -float mdaRoundPan::getParameter(LvzInt32 index) +float mdaRoundPan::getParameter(int32_t index) { float v=0; @@ -123,7 +123,7 @@ float mdaRoundPan::getParameter(LvzInt32 index) return v; } -void mdaRoundPan::getParameterName(LvzInt32 index, char *label) +void mdaRoundPan::getParameterName(int32_t index, char *label) { switch(index) { @@ -133,18 +133,18 @@ void mdaRoundPan::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } -void mdaRoundPan::getParameterDisplay(LvzInt32 index, char *text) +void mdaRoundPan::getParameterDisplay(int32_t index, char *text) { switch(index) { - case 0: int2strng((LvzInt32)(360.0 * (fParam1 - 0.5)), text); break; - case 1: int2strng((LvzInt32)(57.296 * dphi * getSampleRate()), text); break; + case 0: int2strng((int32_t)(360.0 * (fParam1 - 0.5)), text); break; + case 1: int2strng((int32_t)(57.296 * dphi * getSampleRate()), text); break; } } -void mdaRoundPan::getParameterLabel(LvzInt32 index, char *label) +void mdaRoundPan::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -156,7 +156,7 @@ void mdaRoundPan::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaRoundPan::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaRoundPan::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -191,7 +191,7 @@ void mdaRoundPan::process(float **inputs, float **outputs, LvzInt32 sampleFrames phi = ph; } -void mdaRoundPan::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaRoundPan::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaRoundPan.h b/src/mdaRoundPan.h index 85fc996..a160bb8 100644 --- a/src/mdaRoundPan.h +++ b/src/mdaRoundPan.h @@ -27,22 +27,22 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; @@ -52,7 +52,7 @@ protected: float phi, dphi; //float *buffer, *buffer2; - //LvzInt32 size, bufpos; + //int32_t size, bufpos; char programName[32]; }; diff --git a/src/mdaShepard.cpp b/src/mdaShepard.cpp index 971afe1..6bc56da 100644 --- a/src/mdaShepard.cpp +++ b/src/mdaShepard.cpp @@ -74,7 +74,7 @@ bool mdaShepard::getProductString(char* text) { strcpy(text, "MDA Shepard"); re bool mdaShepard::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaShepard::getEffectName(char* name) { strcpy(name, "Shepard"); return true; } -void mdaShepard::setParameter(LvzInt32 index, float value) +void mdaShepard::setParameter(int32_t index, float value) { switch(index) { @@ -109,7 +109,7 @@ void mdaShepard::getProgramName(char *name) strcpy(name, programName); } -bool mdaShepard::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaShepard::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -119,7 +119,7 @@ bool mdaShepard::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* return false; } -float mdaShepard::getParameter(LvzInt32 index) +float mdaShepard::getParameter(int32_t index) { float v=0; @@ -132,7 +132,7 @@ float mdaShepard::getParameter(LvzInt32 index) return v; } -void mdaShepard::getParameterName(LvzInt32 index, char *label) +void mdaShepard::getParameterName(int32_t index, char *label) { switch(index) { @@ -143,9 +143,9 @@ void mdaShepard::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } -void mdaShepard::getParameterDisplay(LvzInt32 index, char *text) +void mdaShepard::getParameterDisplay(int32_t index, char *text) { switch(index) { @@ -155,12 +155,12 @@ void mdaShepard::getParameterDisplay(LvzInt32 index, char *text) case 1: strcpy(text, "RING MOD"); break; case 2: strcpy(text, "TONES+IN"); break; } break; - case 1: int2strng((LvzInt32)(200 * fParam1 - 100), text); break; - case 2: int2strng((LvzInt32)(40 * fParam2 - 20), text); break; + case 1: int2strng((int32_t)(200 * fParam1 - 100), text); break; + case 2: int2strng((int32_t)(40 * fParam2 - 20), text); break; } } -void mdaShepard::getParameterLabel(LvzInt32 index, char *label) +void mdaShepard::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -173,7 +173,7 @@ void mdaShepard::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaShepard::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaShepard::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -181,7 +181,7 @@ void mdaShepard::process(float **inputs, float **outputs, LvzInt32 sampleFrames) float *out2 = outputs[1]; float a, b, c;//, d; float r=rate, dr=drate, o=out, p=pos, di; - LvzInt32 x=max, m=mode, i1, i2; + int32_t x=max, m=mode, i1, i2; --in1; --in2; @@ -225,7 +225,7 @@ void mdaShepard::process(float **inputs, float **outputs, LvzInt32 sampleFrames) pos=p; rate=r; } -void mdaShepard::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaShepard::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -233,7 +233,7 @@ void mdaShepard::processReplacing(float **inputs, float **outputs, LvzInt32 samp float *out2 = outputs[1]; float a, b; float r=rate, dr=drate, o=out, p=pos, di; - LvzInt32 x=max, m=mode, i1, i2; + int32_t x=max, m=mode, i1, i2; --in1; --in2; diff --git a/src/mdaShepard.h b/src/mdaShepard.h index 1042a6a..3bc6ab8 100644 --- a/src/mdaShepard.h +++ b/src/mdaShepard.h @@ -27,22 +27,22 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam0; @@ -51,7 +51,7 @@ protected: float level, pos, rate, drate, out, filt; float *buf1, *buf2; - LvzInt32 max, mode; + int32_t max, mode; char programName[32]; }; diff --git a/src/mdaSplitter.cpp b/src/mdaSplitter.cpp index 5a78cd2..d98d8ed 100644 --- a/src/mdaSplitter.cpp +++ b/src/mdaSplitter.cpp @@ -63,7 +63,7 @@ void mdaSplitter::resume() ///update internal parameters... if(freq>1.0f) freq = 1.0f; ff = -1.0f; //above - LvzInt32 tmp = (LvzInt32)(2.9f * param[2]); //frequency switching + int32_t tmp = (int32_t)(2.9f * param[2]); //frequency switching if(tmp==0) ff = 0.0f; //below if(tmp==1) freq = 0.001f; //all @@ -71,7 +71,7 @@ void mdaSplitter::resume() ///update internal parameters... level = (float)pow(10.0f, 0.05f * ldisp + 0.3f); ll = 0.0f; //above - tmp = (LvzInt32)(2.9f * param[4]); //level switching + tmp = (int32_t)(2.9f * param[4]); //level switching if(tmp==0) ll = -1.0f; //below if(tmp==1) level = 0.0f; //all @@ -86,7 +86,7 @@ void mdaSplitter::resume() ///update internal parameters... i2l = i2r = o2l = o2r = (float)pow(10.0f, 2.0f * param[6] - 1.0f); //gain - mode = (LvzInt32)(3.9f * param[0]); //output routing + mode = (int32_t)(3.9f * param[0]); //output routing switch(mode) { case 0: i2l = 0.0f; i2r = 0.0f; break; @@ -103,14 +103,14 @@ void mdaSplitter::suspend() ///clear any buffers... } -void mdaSplitter::setProgram(LvzInt32 program) +void mdaSplitter::setProgram(int32_t program) { curProgram = program; resume(); } -void mdaSplitter::setParameter(LvzInt32 which, float value) +void mdaSplitter::setParameter(int32_t which, float value) { float * param = programs[curProgram].param; param[which] = value; @@ -120,7 +120,7 @@ void mdaSplitter::setParameter(LvzInt32 which, float value) case 0: case 6: i2l = i2r = o2l = o2r = (float)pow(10.0f, 2.0f * param[6] - 1.0f); //gain - mode = (LvzInt32)(3.9f * param[0]); //output routing + mode = (int32_t)(3.9f * param[0]); //output routing switch(mode) { case 0: i2l = 0.0f; i2r = 0.0f; break; @@ -137,7 +137,7 @@ void mdaSplitter::setParameter(LvzInt32 which, float value) freq = 5.5f * fdisp / getSampleRate(); if(freq>1.0f) freq = 1.0f; ff = -1.0f; //above - LvzInt32 tmp = (LvzInt32)(2.9f * param[2]); //frequency switching + int32_t tmp = (int32_t)(2.9f * param[2]); //frequency switching if(tmp==0) ff = 0.0f; //below if(tmp==1) freq = 0.001f; //all break; @@ -148,7 +148,7 @@ void mdaSplitter::setParameter(LvzInt32 which, float value) ldisp = 40.0f * param[3] - 40.0f; //level level = (float)pow(10.0f, 0.05f * ldisp + 0.3f); ll = 0.0f; //above - LvzInt32 tmp = (LvzInt32)(2.9f * param[4]); //level switching + int32_t tmp = (int32_t)(2.9f * param[4]); //level switching if(tmp==0) ll = -1.0f; //below if(tmp==1) level = 0.0f; //all break; @@ -165,10 +165,10 @@ void mdaSplitter::setParameter(LvzInt32 which, float value) } -float mdaSplitter::getParameter(LvzInt32 which) { return programs[curProgram].param[which]; } +float mdaSplitter::getParameter(int32_t which) { return programs[curProgram].param[which]; } void mdaSplitter::setProgramName(char *name) { strcpy(programs[curProgram].name, name); } void mdaSplitter::getProgramName(char *name) { strcpy(name, programs[curProgram].name); } -bool mdaSplitter::getProgramNameIndexed (LvzInt32 category, LvzInt32 which, char* name) +bool mdaSplitter::getProgramNameIndexed (int32_t category, int32_t which, char* name) { if ((unsigned int)which < NPROGS) { @@ -178,7 +178,7 @@ bool mdaSplitter::getProgramNameIndexed (LvzInt32 category, LvzInt32 which, char return false; } -void mdaSplitter::getParameterName(LvzInt32 which, char *label) +void mdaSplitter::getParameterName(int32_t which, char *label) { switch(which) { @@ -193,7 +193,7 @@ void mdaSplitter::getParameterName(LvzInt32 which, char *label) } -void mdaSplitter::getParameterDisplay(LvzInt32 which, char *text) +void mdaSplitter::getParameterDisplay(int32_t which, char *text) { char string[16]; float * param = programs[curProgram].param; @@ -214,7 +214,7 @@ void mdaSplitter::getParameterDisplay(LvzInt32 which, char *text) case 5: sprintf(string, "%.0f", (float)pow(10.0f, 1.0f + 2.0f * param[which])); break; case 6: sprintf(string, "%.1f", 40.0f * param[which] - 20.0f); break; default: - switch((LvzInt32)(2.9f * param[which])) + switch((int32_t)(2.9f * param[which])) { case 0: strcpy (string, "BELOW"); break; case 1: strcpy (string, "ALL"); break; @@ -227,7 +227,7 @@ void mdaSplitter::getParameterDisplay(LvzInt32 which, char *text) } -void mdaSplitter::getParameterLabel(LvzInt32 which, char *label) +void mdaSplitter::getParameterLabel(int32_t which, char *label) { *label = '\0'; @@ -242,7 +242,7 @@ void mdaSplitter::getParameterLabel(LvzInt32 which, char *label) } -void mdaSplitter::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaSplitter::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -289,7 +289,7 @@ void mdaSplitter::process(float **inputs, float **outputs, LvzInt32 sampleFrames } -void mdaSplitter::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaSplitter::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaSplitter.h b/src/mdaSplitter.h index 2feabf5..398b3ca 100644 --- a/src/mdaSplitter.h +++ b/src/mdaSplitter.h @@ -50,24 +50,24 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t sampleFrames); + virtual void setProgram(int32_t 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 bool getProgramNameIndexed (int32_t category, int32_t which, char* name); + virtual void setParameter(int32_t which, float value); + virtual float getParameter(int32_t which); + virtual void getParameterLabel(int32_t which, char *label); + virtual void getParameterDisplay(int32_t which, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: mdaSplitterProgram programs[NPROGS]; @@ -76,7 +76,7 @@ protected: 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; + int32_t mode; }; diff --git a/src/mdaStereo.cpp b/src/mdaStereo.cpp index 421338f..002982d 100644 --- a/src/mdaStereo.cpp +++ b/src/mdaStereo.cpp @@ -89,7 +89,7 @@ bool mdaStereo::getProductString(char* text) { strcpy(text, "MDA Stereo"); retu bool mdaStereo::getVendorString(char* text) { strcpy(text, "mda"); return true; } bool mdaStereo::getEffectName(char* name) { strcpy(name, "Stereo"); return true; } -void mdaStereo::setParameter(LvzInt32 index, float value) +void mdaStereo::setParameter(int32_t index, float value) { switch(index) { @@ -154,7 +154,7 @@ void mdaStereo::getProgramName(char *name) strcpy(name, programName); } -bool mdaStereo::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaStereo::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -164,7 +164,7 @@ bool mdaStereo::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* return false; } -float mdaStereo::getParameter(LvzInt32 index) +float mdaStereo::getParameter(int32_t index) { float v=0; @@ -179,7 +179,7 @@ float mdaStereo::getParameter(LvzInt32 index) return v; } -void mdaStereo::getParameterName(LvzInt32 index, char *label) +void mdaStereo::getParameterName(int32_t index, char *label) { switch(index) { @@ -192,23 +192,23 @@ void mdaStereo::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } void float2strng(float value, char *string) { sprintf(string, "%.2f", value); } -void mdaStereo::getParameterDisplay(LvzInt32 index, char *text) +void mdaStereo::getParameterDisplay(int32_t index, char *text) { switch(index) { - case 0: int2strng((LvzInt32)(200.0 * fabs(fParam1 - 0.5)), text);break; + case 0: int2strng((int32_t)(200.0 * fabs(fParam1 - 0.5)), text);break; case 1: float2strng((float)(1000.0 * fdel / getSampleRate()), text); break; - case 2: int2strng((LvzInt32)(200.0 * (fParam3 - 0.5)), text); break; + case 2: int2strng((int32_t)(200.0 * (fParam3 - 0.5)), text); break; case 3: if(mod>0.f) float2strng((float)(1000.0 * mod / getSampleRate()), text); else strcpy(text, "OFF"); break; case 4: float2strng((float)pow(10.0,2.0 - 3.0 * fParam5), text); break; } } -void mdaStereo::getParameterLabel(LvzInt32 index, char *label) +void mdaStereo::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -224,7 +224,7 @@ void mdaStereo::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaStereo::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaStereo::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -232,7 +232,7 @@ void mdaStereo::process(float **inputs, float **outputs, LvzInt32 sampleFrames) float *out2 = outputs[1]; float a, b, c, d; float li, ld, ri, rd, del, ph=phi, dph=dphi, mo=mod; - LvzInt32 tmp, bp = bufpos; + int32_t tmp, bp = bufpos; li = fli; ld = fld; @@ -295,7 +295,7 @@ void mdaStereo::process(float **inputs, float **outputs, LvzInt32 sampleFrames) phi = (float)fmod(ph,6.2831853f); } -void mdaStereo::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaStereo::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -303,7 +303,7 @@ void mdaStereo::processReplacing(float **inputs, float **outputs, LvzInt32 sampl float *out2 = outputs[1]; float a, b, c, d; float li, ld, ri, rd, del, ph=phi, dph=dphi, mo=mod; - LvzInt32 tmp, bp = bufpos; + int32_t tmp, bp = bufpos; li = fli; ld = fld; diff --git a/src/mdaStereo.h b/src/mdaStereo.h index d60186c..43b6242 100644 --- a/src/mdaStereo.h +++ b/src/mdaStereo.h @@ -27,22 +27,22 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; @@ -55,7 +55,7 @@ protected: float fli, fld, fri, frd, fdel, phi, dphi, mod; float *buffer; - LvzInt32 size, bufpos; + int32_t size, bufpos; char programName[32]; }; diff --git a/src/mdaSubSynth.cpp b/src/mdaSubSynth.cpp index 8324c72..16eaf36 100644 --- a/src/mdaSubSynth.cpp +++ b/src/mdaSubSynth.cpp @@ -66,7 +66,7 @@ void mdaSubSynth::getProgramName(char *name) strcpy(name, programName); } -bool mdaSubSynth::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaSubSynth::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -76,11 +76,11 @@ bool mdaSubSynth::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char return false; } -void mdaSubSynth::setProgram(LvzInt32 program) +void mdaSubSynth::setProgram(int32_t program) { } -void mdaSubSynth::setParameter(LvzInt32 index, float value) +void mdaSubSynth::setParameter(int32_t index, float value) { switch(index) { @@ -105,7 +105,7 @@ void mdaSubSynth::setParameter(LvzInt32 index, float value) dphi = (float)(0.456159 * pow(10.0,-2.5 + (1.5 * fParam3))); } -float mdaSubSynth::getParameter(LvzInt32 index) +float mdaSubSynth::getParameter(int32_t index) { float v=0; @@ -121,7 +121,7 @@ float mdaSubSynth::getParameter(LvzInt32 index) return v; } -void mdaSubSynth::getParameterName(LvzInt32 index, char *label) +void mdaSubSynth::getParameterName(int32_t index, char *label) { switch(index) { @@ -134,17 +134,17 @@ void mdaSubSynth::getParameterName(LvzInt32 index, char *label) } } -void mdaSubSynth::getParameterDisplay(LvzInt32 index, char *text) +void mdaSubSynth::getParameterDisplay(int32_t 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 1: sprintf(string, "%d", (int32_t)(100.0f * wet)); break; + case 2: sprintf(string, "%d", (int32_t)(0.0726 * getSampleRate() * pow(10.0,-2.5 + (1.5 * fParam3)))); break; + case 3: sprintf(string, "%d", (int32_t)(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 5: sprintf(string, "%d", (int32_t)(-301.03 / (getSampleRate() * log10(rls)))); break; case 0: switch(typ) { @@ -159,7 +159,7 @@ void mdaSubSynth::getParameterDisplay(LvzInt32 index, char *text) strcpy(text, (char *)string); } -void mdaSubSynth::getParameterLabel(LvzInt32 index, char *label) +void mdaSubSynth::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -183,7 +183,7 @@ void mdaSubSynth::resume() //-------------------------------------------------------------------------------- // process -void mdaSubSynth::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaSubSynth::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -282,7 +282,7 @@ void mdaSubSynth::process(float **inputs, float **outputs, LvzInt32 sampleFrames env = en; } -void mdaSubSynth::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaSubSynth::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaSubSynth.h b/src/mdaSubSynth.h index b5a616d..2ee149d 100644 --- a/src/mdaSubSynth.h +++ b/src/mdaSubSynth.h @@ -24,23 +24,23 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t sampleFrames); + virtual void setProgram(int32_t 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 bool getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; diff --git a/src/mdaTalkBox.cpp b/src/mdaTalkBox.cpp index f615f6b..57f6aa0 100644 --- a/src/mdaTalkBox.cpp +++ b/src/mdaTalkBox.cpp @@ -82,11 +82,11 @@ void mdaTalkBox::resume() ///update internal parameters... swap = (param[2] > 0.5f)? 1 : 0; - LvzInt32 n = (LvzInt32)(0.01633f * fs); + int32_t n = (int32_t)(0.01633f * fs); if(n > BUF_MAX) n = BUF_MAX; - //O = (LvzInt32)(0.0005f * fs); - O = (LvzInt32)((0.0001f + 0.0004f * param[3]) * fs); + //O = (int32_t)(0.0005f * fs); + O = (int32_t)((0.0001f + 0.0004f * param[3]) * fs); if(n != N) //recalc hanning window { @@ -131,23 +131,23 @@ mdaTalkBox::~mdaTalkBox() ///destroy any buffers... } -void mdaTalkBox::setProgram(LvzInt32 program) +void mdaTalkBox::setProgram(int32_t program) { curProgram = program; resume(); } -void mdaTalkBox::setParameter(LvzInt32 index, float value) +void mdaTalkBox::setParameter(int32_t index, float value) { programs[curProgram].param[index] = value; //bug was here! resume(); } -float mdaTalkBox::getParameter(LvzInt32 index) { return programs[curProgram].param[index]; } +float mdaTalkBox::getParameter(int32_t index) { return programs[curProgram].param[index]; } void mdaTalkBox::setProgramName(char *name) { strcpy(programs[curProgram].name, name); } void mdaTalkBox::getProgramName(char *name) { strcpy(name, programs[curProgram].name); } -bool mdaTalkBox::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaTalkBox::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if ((unsigned int)index < NPROGS) { @@ -157,7 +157,7 @@ bool mdaTalkBox::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* return false; } -void mdaTalkBox::getParameterName(LvzInt32 index, char *label) +void mdaTalkBox::getParameterName(int32_t index, char *label) { switch(index) { @@ -170,7 +170,7 @@ void mdaTalkBox::getParameterName(LvzInt32 index, char *label) } -void mdaTalkBox::getParameterDisplay(LvzInt32 index, char *text) +void mdaTalkBox::getParameterDisplay(int32_t index, char *text) { char string[16]; float * param = programs[curProgram].param; @@ -188,7 +188,7 @@ void mdaTalkBox::getParameterDisplay(LvzInt32 index, char *text) } -void mdaTalkBox::getParameterLabel(LvzInt32 index, char *label) +void mdaTalkBox::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -200,7 +200,7 @@ void mdaTalkBox::getParameterLabel(LvzInt32 index, char *label) } -void mdaTalkBox::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaTalkBox::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -211,7 +211,7 @@ void mdaTalkBox::process(float **inputs, float **outputs, LvzInt32 sampleFrames) } float *out1 = outputs[0]; float *out2 = outputs[1]; - LvzInt32 p0=pos, p1 = (pos + N/2) % N; + int32_t p0=pos, p1 = (pos + N/2) % N; float e=emphasis, w, o, x, c, d, dr, fx=FX; float p, q, h0=0.3f, h1=0.77f; @@ -273,7 +273,7 @@ void mdaTalkBox::process(float **inputs, float **outputs, LvzInt32 sampleFrames) } -void mdaTalkBox::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaTalkBox::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -284,7 +284,7 @@ void mdaTalkBox::processReplacing(float **inputs, float **outputs, LvzInt32 samp } float *out1 = outputs[0]; float *out2 = outputs[1]; - LvzInt32 p0=pos, p1 = (pos + N/2) % N; + int32_t p0=pos, p1 = (pos + N/2) % N; float e=emphasis, w, o, x, dr, fx=FX; float p, q, h0=0.3f, h1=0.77f; @@ -343,10 +343,10 @@ void mdaTalkBox::processReplacing(float **inputs, float **outputs, LvzInt32 samp } -void mdaTalkBox::lpc(float *buf, float *car, LvzInt32 n, LvzInt32 o) +void mdaTalkBox::lpc(float *buf, float *car, int32_t n, int32_t o) { float z[ORD_MAX], r[ORD_MAX], k[ORD_MAX], G, x; - LvzInt32 i, j, nn=n; + int32_t i, j, nn=n; for(j=0; j<=o; j++, nn--) //buf[] is already emphasized and windowed { diff --git a/src/mdaTalkBox.h b/src/mdaTalkBox.h index c9d1157..ebbb096 100644 --- a/src/mdaTalkBox.h +++ b/src/mdaTalkBox.h @@ -44,29 +44,29 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t sampleFrames); + virtual void setProgram(int32_t 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 bool getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: mdaTalkBoxProgram *programs; - void lpc(float *buf, float *car, LvzInt32 n, LvzInt32 o); + void lpc(float *buf, float *car, int32_t n, int32_t o); void lpc_durbin(float *r, int p, float *k, float *g); ///global internal variables @@ -75,7 +75,7 @@ protected: float *buf0, *buf1; float emphasis; - LvzInt32 K, N, O, pos, swap; + int32_t K, N, O, pos, swap; float wet, dry, FX; float d0, d1, d2, d3, d4; diff --git a/src/mdaTestTone.cpp b/src/mdaTestTone.cpp index 5d86576..9aa98b2 100644 --- a/src/mdaTestTone.cpp +++ b/src/mdaTestTone.cpp @@ -73,7 +73,7 @@ void mdaTestTone::getProgramName(char *name) strcpy(name, programName); } -bool mdaTestTone::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaTestTone::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -84,10 +84,10 @@ bool mdaTestTone::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } void float2strng(float value, char *string) { sprintf(string, "%.2f", value); } -void mdaTestTone::setParameter(LvzInt32 index, float value) +void mdaTestTone::setParameter(int32_t index, float value) { switch(index) { @@ -111,9 +111,9 @@ void mdaTestTone::setParameter(LvzInt32 index, float value) { case 0: //MIDI note f = (float)floor(128.f*fParam3); - //int2strng((LvzInt32)f, disp1); //Semi + //int2strng((int32_t)f, disp1); //Semi midi2string(f, disp1); //Semitones - int2strng((LvzInt32)(100.f*df), disp2); //Cents + int2strng((int32_t)(100.f*df), disp2); //Cents break; case 1: //no frequency display @@ -139,8 +139,8 @@ void mdaTestTone::setParameter(LvzInt32 index, float value) case 8: //lin sweep sw = 200.f * (float)floor(100.f*fParam3); swx = 200.f * (float)floor(100.f*fParam4); - int2strng((LvzInt32)sw, disp1); //start freq - int2strng((LvzInt32)swx, disp2); //end freq + int2strng((int32_t)sw, disp1); //start freq + int2strng((int32_t)swx, disp2); //end freq break; } @@ -162,7 +162,7 @@ void mdaTestTone::update() if(fParam2<0.3f) right=0.f; else right=left; if(fParam2>0.6f) left=0.f; len = 1.f + 0.5f*(float)int(62*fParam6); - swt=(LvzInt32)(len*getSampleRate()); + swt=(int32_t)(len*getSampleRate()); if(fParam7>0.8) //output level trim { @@ -190,9 +190,9 @@ void mdaTestTone::update() { case 0: //MIDI note f = (float)floor(128.f*fParam3); - //int2strng((LvzInt32)f, disp1); //Semi + //int2strng((int32_t)f, disp1); //Semi midi2string(f, disp1); //Semitones - int2strng((LvzInt32)(100.f*df), disp2); //Cents + int2strng((int32_t)(100.f*df), disp2); //Cents dphi = 51.37006f*(float)pow(1.0594631f,f+df)/getSampleRate(); break; @@ -218,19 +218,19 @@ void mdaTestTone::update() if(sw>swx) { swd=swx; swx=sw; sw=swd; } //only sweep up if(mode==7) swx += 1.f; swd = (swx-sw) / (len*getSampleRate()); - swt= 2 * (LvzInt32)getSampleRate(); + swt= 2 * (int32_t)getSampleRate(); break; case 8: //lin sweep sw = 200.f * (float)floor(100.f*fParam3); swx = 200.f * (float)floor(100.f*fParam4); - int2strng((LvzInt32)sw, disp1); //start freq - int2strng((LvzInt32)swx, disp2); //end freq + int2strng((int32_t)sw, disp1); //start freq + int2strng((int32_t)swx, disp2); //end freq if(sw>swx) { swd=swx; swx=sw; sw=swd; } //only sweep up sw = twopi*sw/getSampleRate(); swx = twopi*swx/getSampleRate(); swd = (swx-sw) / (len*getSampleRate()); - swt= 2 * (LvzInt32)getSampleRate(); + swt= 2 * (int32_t)getSampleRate(); break; } thru = (float)pow(10.0f, (0.05f * (float)int(40.f*fParam5)) - 2.f); @@ -313,7 +313,7 @@ void mdaTestTone::iso2string(float b, char *text) } } -float mdaTestTone::getParameter(LvzInt32 index) +float mdaTestTone::getParameter(int32_t index) { float v=0; @@ -331,7 +331,7 @@ float mdaTestTone::getParameter(LvzInt32 index) return v; } -void mdaTestTone::getParameterName(LvzInt32 index, char *label) +void mdaTestTone::getParameterName(int32_t index, char *label) { switch(index) { @@ -346,7 +346,7 @@ void mdaTestTone::getParameterName(LvzInt32 index, char *label) } } -void mdaTestTone::getParameterDisplay(LvzInt32 index, char *text) +void mdaTestTone::getParameterDisplay(int32_t index, char *text) { switch(index) { @@ -363,7 +363,7 @@ void mdaTestTone::getParameterDisplay(LvzInt32 index, char *text) case 7: strcpy(text, "LOG STEP"); break; case 8: strcpy(text, "LIN SWP."); break; } break; - case 1: int2strng((LvzInt32)(int(60.f * fParam1) - 60.0 - calx), text); break; + case 1: int2strng((int32_t)(int(60.f * fParam1) - 60.0 - calx), text); break; case 2: if(fParam2>0.3f) { if(fParam2>0.7f) strcpy(text, "RIGHT"); else strcpy(text, "CENTRE"); } @@ -371,13 +371,13 @@ void mdaTestTone::getParameterDisplay(LvzInt32 index, char *text) case 3: strcpy(text, disp1); break; case 4: strcpy(text, disp2); break; case 6: if(fParam5==0) strcpy(text, "OFF"); - else int2strng((LvzInt32)(40 * fParam5 - 40), text); break; + else int2strng((int32_t)(40 * fParam5 - 40), text); break; case 5: int2strng(1000 + 500*int(62*fParam6), text); break; case 7: float2strng(cal, text); break; } } -void mdaTestTone::getParameterLabel(LvzInt32 index, char *label) +void mdaTestTone::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -395,7 +395,7 @@ void mdaTestTone::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaTestTone::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaTestTone::process(float **inputs, float **outputs, int32_t sampleFrames) { if(updateRx != updateTx) update(); @@ -407,7 +407,7 @@ void mdaTestTone::process(float **inputs, float **outputs, LvzInt32 sampleFrames float z0=zz0, z1=zz1, z2=zz2, z3=zz3, z4=zz4, z5=zz5; float ph=phi, dph=dphi, l=left, r=right, t=thru; float s=sw, sx=swx, ds=swd, fsc=fscale; - LvzInt32 st=swt; + int32_t st=swt; int m=mode; --in1; @@ -426,7 +426,7 @@ void mdaTestTone::process(float **inputs, float **outputs, LvzInt32 sampleFrames case 1: if(st>0) { st--; x=0.f; } else //impulse { x=1.f; - st=(LvzInt32)(len*getSampleRate()); + st=(int32_t)(len*getSampleRate()); } break; @@ -486,7 +486,7 @@ void mdaTestTone::process(float **inputs, float **outputs, LvzInt32 sampleFrames if(s>sx) setParameter(0, fParam0); //retrigger sweep } -void mdaTestTone::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaTestTone::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { if(updateRx != updateTx) update(); @@ -498,7 +498,7 @@ void mdaTestTone::processReplacing(float **inputs, float **outputs, LvzInt32 sam float z0=zz0, z1=zz1, z2=zz2, z3=zz3, z4=zz4, z5=zz5; float ph=phi, dph=dphi, l=left, r=right, t=thru; float s=sw, sx=swx, ds=swd, fsc=fscale; - LvzInt32 st=swt; + int32_t st=swt; int m=mode; --in1; @@ -515,7 +515,7 @@ void mdaTestTone::processReplacing(float **inputs, float **outputs, LvzInt32 sam case 1: if(st>0) { st--; x=0.f; } else //impulse { x=1.f; - st=(LvzInt32)(len*getSampleRate()); + st=(int32_t)(len*getSampleRate()); } break; diff --git a/src/mdaTestTone.h b/src/mdaTestTone.h index 2aef89c..433ca5e 100644 --- a/src/mdaTestTone.h +++ b/src/mdaTestTone.h @@ -27,16 +27,16 @@ public: mdaTestTone(audioMasterCallback audioMaster); ~mdaTestTone(); - virtual void process(float **inputs, float **outputs, LvzInt32 sampleFrames); - virtual void processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames); + virtual void process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); virtual void iso2string(float b, char *text); virtual void suspend(); void midi2string(float n, char *text); @@ -44,7 +44,7 @@ public: virtual bool getEffectName(char *name); virtual bool getVendorString(char *text); virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } + virtual int32_t getVendorVersion() { return 1000; } protected: int updateTx, updateRx; @@ -57,7 +57,7 @@ protected: float thru, left, right, len; float zz0, zz1, zz2, zz3, zz4, zz5, phi, dphi; float sw, swd, swx, fscale, cal, calx; - LvzInt32 swt; + int32_t swt; int mode; char programName[32], disp1[16], disp2[16]; diff --git a/src/mdaThruZero.cpp b/src/mdaThruZero.cpp index a35685f..a7bd16b 100644 --- a/src/mdaThruZero.cpp +++ b/src/mdaThruZero.cpp @@ -112,14 +112,14 @@ mdaThruZero::~mdaThruZero() ///destroy any buffers... } -void mdaThruZero::setProgram(LvzInt32 program) +void mdaThruZero::setProgram(int32_t program) { curProgram = program; resume(); } -void mdaThruZero::setParameter(LvzInt32 index, float value) +void mdaThruZero::setParameter(int32_t index, float value) { if(index==3) phi=0.0f; //reset cycle programs[curProgram].param[index] = value; @@ -127,10 +127,10 @@ void mdaThruZero::setParameter(LvzInt32 index, float value) } -float mdaThruZero::getParameter(LvzInt32 index) { return programs[curProgram].param[index]; } +float mdaThruZero::getParameter(int32_t index) { return programs[curProgram].param[index]; } void mdaThruZero::setProgramName(char *name) { strcpy(programs[curProgram].name, name); } void mdaThruZero::getProgramName(char *name) { strcpy(name, programs[curProgram].name); } -bool mdaThruZero::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaThruZero::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if ((unsigned int)index < NPROGS) { @@ -140,7 +140,7 @@ bool mdaThruZero::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char return false; } -void mdaThruZero::getParameterName(LvzInt32 index, char *label) +void mdaThruZero::getParameterName(int32_t index, char *label) { switch(index) { @@ -153,7 +153,7 @@ void mdaThruZero::getParameterName(LvzInt32 index, char *label) } -void mdaThruZero::getParameterDisplay(LvzInt32 index, char *text) +void mdaThruZero::getParameterDisplay(int32_t index, char *text) { char string[16]; float * param = programs[curProgram].param; @@ -171,7 +171,7 @@ void mdaThruZero::getParameterDisplay(LvzInt32 index, char *text) } -void mdaThruZero::getParameterLabel(LvzInt32 index, char *label) +void mdaThruZero::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -182,7 +182,7 @@ void mdaThruZero::getParameterLabel(LvzInt32 index, char *label) } -void mdaThruZero::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaThruZero::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -210,7 +210,7 @@ void mdaThruZero::process(float **inputs, float **outputs, LvzInt32 sampleFrames } -void mdaThruZero::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaThruZero::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -218,7 +218,7 @@ void mdaThruZero::processReplacing(float **inputs, float **outputs, LvzInt32 sam float *out2 = outputs[1]; float a, b, f=fb, f1=fb1, f2=fb2, ph=phi; float ra=rat, de=dep, we=wet, dr=dry, ds=deps, dm=dem; - LvzInt32 tmp, tmpi, bp=bufpos; + int32_t tmp, tmpi, bp=bufpos; float tmpf; --in1; diff --git a/src/mdaThruZero.h b/src/mdaThruZero.h index 2f35cb2..437de88 100644 --- a/src/mdaThruZero.h +++ b/src/mdaThruZero.h @@ -43,24 +43,24 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t sampleFrames); + virtual void setProgram(int32_t 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 bool getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: mdaThruZeroProgram *programs; @@ -69,7 +69,7 @@ protected: 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; + int32_t size, bufpos; }; #endif diff --git a/src/mdaTracker.cpp b/src/mdaTracker.cpp index d0bc277..7387a6b 100644 --- a/src/mdaTracker.cpp +++ b/src/mdaTracker.cpp @@ -46,14 +46,14 @@ mdaTracker::mdaTracker(audioMasterCallback audioMaster) : AudioEffectX(audioMast strcpy(programName, "Pitch Tracker"); dphi = 100.f/getSampleRate(); //initial pitch - min = (LvzInt32)(getSampleRate()/30.0); //lower limit + min = (int32_t)(getSampleRate()/30.0); //lower limit res1 = (float)cos(0.01); //p res2 = (float)sin(0.01); //q setParameter(0, 0.0f); } -void mdaTracker::setParameter(LvzInt32 index, float value) +void mdaTracker::setParameter(int32_t index, float value) { switch(index) { @@ -71,7 +71,7 @@ void mdaTracker::setParameter(LvzInt32 index, float value) fo = filterFreq(50.f); fi = (1.f - fo)*(1.f - fo); ddphi = fParam4 * fParam4; thr = (float)pow(10.0, 3.0*fParam7 - 3.8); - max = (LvzInt32)(getSampleRate() / pow(10.0f, 1.6f + 2.2f * fParam6)); + max = (int32_t)(getSampleRate() / pow(10.0f, 1.6f + 2.2f * fParam6)); trans = (float)pow(1.0594631,int(72.f*fParam5 - 36.f)); wet = (float)pow(10.0, 2.0*fParam8 - 1.0); if(mode<4) @@ -120,7 +120,7 @@ void mdaTracker::getProgramName(char *name) strcpy(name, programName); } -bool mdaTracker::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaTracker::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -130,7 +130,7 @@ bool mdaTracker::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* return false; } -float mdaTracker::getParameter(LvzInt32 index) +float mdaTracker::getParameter(int32_t index) { float v=0; @@ -148,7 +148,7 @@ float mdaTracker::getParameter(LvzInt32 index) return v; } -void mdaTracker::getParameterName(LvzInt32 index, char *label) +void mdaTracker::getParameterName(int32_t index, char *label) { switch(index) { @@ -164,9 +164,9 @@ void mdaTracker::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } -void mdaTracker::getParameterDisplay(LvzInt32 index, char *text) +void mdaTracker::getParameterDisplay(int32_t index, char *text) { switch(index) { @@ -178,17 +178,17 @@ void mdaTracker::getParameterDisplay(LvzInt32 index, char *text) case 3: strcpy(text, "RING"); break; case 4: strcpy(text, "EQ"); break; } break; - case 1: int2strng((LvzInt32)(100 * fParam2), text); break; - case 2: int2strng((LvzInt32)(100 * fParam3), text); break; - case 3: int2strng((LvzInt32)(100 * fParam4), text); break; - case 4: int2strng((LvzInt32)(72*fParam5 - 36), text); break; - case 5: int2strng((LvzInt32)(getSampleRate()/max), text); break; - case 6: int2strng((LvzInt32)(60*fParam7 - 60), text); break; - case 7: int2strng((LvzInt32)(40*fParam8 - 20), text); break; + case 1: int2strng((int32_t)(100 * fParam2), text); break; + case 2: int2strng((int32_t)(100 * fParam3), text); break; + case 3: int2strng((int32_t)(100 * fParam4), text); break; + case 4: int2strng((int32_t)(72*fParam5 - 36), text); break; + case 5: int2strng((int32_t)(getSampleRate()/max), text); break; + case 6: int2strng((int32_t)(60*fParam7 - 60), text); break; + case 7: int2strng((int32_t)(40*fParam8 - 20), text); break; } } -void mdaTracker::getParameterLabel(LvzInt32 index, char *label) +void mdaTracker::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -205,7 +205,7 @@ void mdaTracker::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaTracker::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaTracker::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -215,7 +215,7 @@ void mdaTracker::process(float **inputs, float **outputs, LvzInt32 sampleFrames) float o=fo, i=fi, b1=buf1, b2=buf2, twopi=6.2831853f; float we=wet, dr=dry, bo=bold, r1=res1, r2=res2, b3=buf3, b4=buf4; float sw=saw, dsw=dsaw, dy=dyn, e=env, re=rel; - LvzInt32 m=max, n=num, s=sig, mn=min, mo=mode; + int32_t m=max, n=num, s=sig, mn=min, mo=mode; --in1; --in2; @@ -289,7 +289,7 @@ void mdaTracker::process(float **inputs, float **outputs, LvzInt32 sampleFrames) env=e; saw=sw; dsaw=dsw; res1=r1; res2=r2; } -void mdaTracker::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaTracker::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -299,7 +299,7 @@ void mdaTracker::processReplacing(float **inputs, float **outputs, LvzInt32 samp float o=fo, i=fi, b1=buf1, b2=buf2, twopi=6.2831853f; float we=wet, dr=dry, bo=bold, r1=res1, r2=res2, b3=buf3, b4=buf4; float sw=saw, dsw=dsaw, dy=dyn, e=env, re=rel; - LvzInt32 m=max, n=num, s=sig, mn=min, mo=mode; + int32_t m=max, n=num, s=sig, mn=min, mo=mode; --in1; --in2; diff --git a/src/mdaTracker.h b/src/mdaTracker.h index 9d9228b..27c8fe9 100644 --- a/src/mdaTracker.h +++ b/src/mdaTracker.h @@ -27,23 +27,23 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; @@ -58,7 +58,7 @@ protected: float buf1, buf2, dn, bold, wet, dry; float dyn, env, rel, saw, dsaw; float res1, res2, buf3, buf4; - LvzInt32 max, min, num, sig, mode; + int32_t max, min, num, sig, mode; char programName[32]; }; diff --git a/src/mdaTransient.cpp b/src/mdaTransient.cpp index 752104d..0edb476 100644 --- a/src/mdaTransient.cpp +++ b/src/mdaTransient.cpp @@ -63,7 +63,7 @@ void mdaTransient::getProgramName(char *name) strcpy(name, programName); } -bool mdaTransient::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaTransient::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if (index == 0) { @@ -73,7 +73,7 @@ bool mdaTransient::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, cha return false; } -void mdaTransient::setParameter(LvzInt32 index, float value) +void mdaTransient::setParameter(int32_t index, float value) { switch(index) { @@ -124,7 +124,7 @@ void mdaTransient::setParameter(LvzInt32 index, float value) att34 = (float)pow(10.0, - 4.0 * fParam6); } -float mdaTransient::getParameter(LvzInt32 index) +float mdaTransient::getParameter(int32_t index) { float v=0; @@ -140,7 +140,7 @@ float mdaTransient::getParameter(LvzInt32 index) return v; } -void mdaTransient::getParameterName(LvzInt32 index, char *label) +void mdaTransient::getParameterName(int32_t index, char *label) { switch(index) { @@ -154,23 +154,23 @@ void mdaTransient::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } +void int2strng(int32_t value, char *string) { sprintf(string, "%d", value); } -void mdaTransient::getParameterDisplay(LvzInt32 index, char *text) +void mdaTransient::getParameterDisplay(int32_t index, char *text) { switch(index) { - case 0: int2strng((LvzInt32)(200*fParam1 - 100),text); break; - case 1: int2strng((LvzInt32)(200*fParam2 - 100),text); break; - case 2: int2strng((LvzInt32)(40.0*fParam3 - 20.0),text); break; - case 3: int2strng((LvzInt32)(20*fParam4 - 10),text); break; - case 4: int2strng((LvzInt32)(100*fParam5),text); break; - case 5: int2strng((LvzInt32)(100*fParam6),text); break; + case 0: int2strng((int32_t)(200*fParam1 - 100),text); break; + case 1: int2strng((int32_t)(200*fParam2 - 100),text); break; + case 2: int2strng((int32_t)(40.0*fParam3 - 20.0),text); break; + case 3: int2strng((int32_t)(20*fParam4 - 10),text); break; + case 4: int2strng((int32_t)(100*fParam5),text); break; + case 5: int2strng((int32_t)(100*fParam6),text); break; } } -void mdaTransient::getParameterLabel(LvzInt32 index, char *label) +void mdaTransient::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -186,7 +186,7 @@ void mdaTransient::getParameterLabel(LvzInt32 index, char *label) //-------------------------------------------------------------------------------- // process -void mdaTransient::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaTransient::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -228,7 +228,7 @@ void mdaTransient::process(float **inputs, float **outputs, LvzInt32 sampleFrame else { env1=e1; env2=e2; env3=e3; env4=e4; fbuf1=fb1; fbuf2=fb2; } } -void mdaTransient::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaTransient::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; diff --git a/src/mdaTransient.h b/src/mdaTransient.h index d62b086..f897902 100644 --- a/src/mdaTransient.h +++ b/src/mdaTransient.h @@ -27,21 +27,21 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t 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 getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); virtual bool getEffectName(char *name); virtual bool getVendorString(char *text); virtual bool getProductString(char *text); - virtual LvzInt32 getVendorVersion() { return 1000; } + virtual int32_t getVendorVersion() { return 1000; } protected: float fParam1; diff --git a/src/mdaVocInput.cpp b/src/mdaVocInput.cpp index 577e1c8..e008f80 100644 --- a/src/mdaVocInput.cpp +++ b/src/mdaVocInput.cpp @@ -64,7 +64,7 @@ void mdaVocInput::resume() ///update internal parameters... fs = getSampleRate(); ifs = 1.0f / fs; - track = (LvzInt32)(2.99f * param[0]); + track = (int32_t)(2.99f * param[0]); pmult = (float)pow(1.0594631f, floor(48.0f * param[1] - 24.0f)); if(track==0) pstep = 110.0f * pmult * ifs; @@ -90,22 +90,22 @@ mdaVocInput::~mdaVocInput() ///destroy any buffers... } -void mdaVocInput::setProgram(LvzInt32 program) +void mdaVocInput::setProgram(int32_t program) { curProgram = program; resume(); } -void mdaVocInput::setParameter(LvzInt32 index, float value) +void mdaVocInput::setParameter(int32_t index, float value) { programs[curProgram].param[index] = value; resume(); } -float mdaVocInput::getParameter(LvzInt32 index) { return programs[curProgram].param[index]; } +float mdaVocInput::getParameter(int32_t index) { return programs[curProgram].param[index]; } void mdaVocInput::setProgramName(char *name) { strcpy(programs[curProgram].name, name); } void mdaVocInput::getProgramName(char *name) { strcpy(name, programs[curProgram].name); } -bool mdaVocInput::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaVocInput::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if ((unsigned int)index < NPROGS) { @@ -115,7 +115,7 @@ bool mdaVocInput::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char return false; } -void mdaVocInput::getParameterName(LvzInt32 index, char *label) +void mdaVocInput::getParameterName(int32_t index, char *label) { switch(index) { @@ -128,7 +128,7 @@ void mdaVocInput::getParameterName(LvzInt32 index, char *label) } -void mdaVocInput::getParameterDisplay(LvzInt32 index, char *text) +void mdaVocInput::getParameterDisplay(int32_t index, char *text) { char string[16]; float * param = programs[curProgram].param; @@ -139,10 +139,10 @@ void mdaVocInput::getParameterDisplay(LvzInt32 index, char *text) case 1: strcpy(string, "FREE"); break; case 2: strcpy(string, "QUANT"); } break; - case 1: if(track) sprintf(string, "%d", (LvzInt32)(48.0f * param[1] - 24.0f)); - else midi2string((LvzInt32)(48.0f * param[1] + 21.0f), string); break; + case 1: if(track) sprintf(string, "%d", (int32_t)(48.0f * param[1] - 24.0f)); + else midi2string((int32_t)(48.0f * param[1] + 21.0f), string); break; - case 4: midi2string((LvzInt32)(48.0f * param[4] + 45.0f), string); break; + case 4: midi2string((int32_t)(48.0f * param[4] + 45.0f), string); break; default: sprintf(string, "%.0f", 100.0f * param[index]); } @@ -151,7 +151,7 @@ void mdaVocInput::getParameterDisplay(LvzInt32 index, char *text) } -void mdaVocInput::getParameterLabel(LvzInt32 index, char *label) +void mdaVocInput::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -163,10 +163,10 @@ void mdaVocInput::getParameterLabel(LvzInt32 index, char *label) } -void mdaVocInput::midi2string(LvzInt32 n, char *text) //show name of MIDI note number (60=C3) +void mdaVocInput::midi2string(int32_t n, char *text) //show name of MIDI note number (60=C3) { char t[8]; - LvzInt32 o, s, p=0; + int32_t o, s, p=0; t[p++] = ' '; t[p++] = ' '; @@ -199,7 +199,7 @@ void mdaVocInput::midi2string(LvzInt32 n, char *text) //show name of MIDI note n } -void mdaVocInput::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaVocInput::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -210,7 +210,7 @@ void mdaVocInput::process(float **inputs, float **outputs, LvzInt32 sampleFrames float l0=lbuf0, l1=lbuf1, l2=lbuf2, l3=lbuf3; float le=lenv, he=henv, et=lfreq*0.1f, lf=lfreq, v=vuv, mn=minp, mx=maxp; float rootm=39.863137f; - LvzInt32 tr=track; + int32_t tr=track; --in1; --in2; @@ -274,7 +274,7 @@ void mdaVocInput::process(float **inputs, float **outputs, LvzInt32 sampleFrames } -void mdaVocInput::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaVocInput::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; @@ -285,7 +285,7 @@ void mdaVocInput::processReplacing(float **inputs, float **outputs, LvzInt32 sam float l0=lbuf0, l1=lbuf1, l2=lbuf2, l3=lbuf3; float le=lenv, he=henv, et=lfreq*0.1f, lf=lfreq, v=vuv, mn=minp, mx=maxp; float rootm=39.863137f; - LvzInt32 tr=track; + int32_t tr=track; --in1; --in2; diff --git a/src/mdaVocInput.h b/src/mdaVocInput.h index c574182..d6ac0b2 100644 --- a/src/mdaVocInput.h +++ b/src/mdaVocInput.h @@ -42,31 +42,31 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t sampleFrames); + virtual void setProgram(int32_t 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 bool getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t index, char *text); + virtual void midi2string(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: mdaVocInputProgram *programs; ///global internal variables - LvzInt32 track; //track input pitch + int32_t track; //track input pitch float pstep; //output sawtooth inc per sample float pmult; //tuning multiplier float sawbuf; diff --git a/src/mdaVocoder.cpp b/src/mdaVocoder.cpp index 7f9f01b..cb40eed 100644 --- a/src/mdaVocoder.cpp +++ b/src/mdaVocoder.cpp @@ -81,7 +81,7 @@ void mdaVocoder::resume() ///update internal parameters... double tpofs = 6.2831853/getSampleRate(); double rr, th; //, re; float sh; - LvzInt32 i; + int32_t i; swap = 1; if(param[0]>0.5f) swap = 0; gain = (float)pow(10.0f, 2.0f * param[1] - 3.0f * param[5] - 2.0f); @@ -159,7 +159,7 @@ void mdaVocoder::resume() ///update internal parameters... void mdaVocoder::suspend() ///clear any buffers... { - LvzInt32 i, j; + int32_t i, j; for(i=0; i<nbnd; i++) for(j=3; j<12; j++) f[i][j] = 0.0f; //zero band filters and envelopes kout = 0.0f; @@ -173,22 +173,22 @@ mdaVocoder::~mdaVocoder() ///destroy any buffers... } -void mdaVocoder::setProgram(LvzInt32 program) +void mdaVocoder::setProgram(int32_t program) { curProgram = program; resume(); } -void mdaVocoder::setParameter(LvzInt32 index, float value) +void mdaVocoder::setParameter(int32_t index, float value) { programs[curProgram].param[index] = value; resume(); } -float mdaVocoder::getParameter(LvzInt32 index) { return programs[curProgram].param[index]; } +float mdaVocoder::getParameter(int32_t index) { return programs[curProgram].param[index]; } void mdaVocoder::setProgramName(char *name) { strcpy(programs[curProgram].name, name); } void mdaVocoder::getProgramName(char *name) { strcpy(name, programs[curProgram].name); } -bool mdaVocoder::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +bool mdaVocoder::getProgramNameIndexed (int32_t category, int32_t index, char* name) { if ((unsigned int)index < NPROGS) { @@ -198,7 +198,7 @@ bool mdaVocoder::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* return false; } -void mdaVocoder::getParameterName(LvzInt32 index, char *label) +void mdaVocoder::getParameterName(int32_t index, char *label) { switch(index) { @@ -214,7 +214,7 @@ void mdaVocoder::getParameterName(LvzInt32 index, char *label) } -void mdaVocoder::getParameterDisplay(LvzInt32 index, char *text) +void mdaVocoder::getParameterDisplay(int32_t index, char *text) { char string[16]; float * param = programs[curProgram].param; @@ -235,7 +235,7 @@ void mdaVocoder::getParameterDisplay(LvzInt32 index, char *text) } -void mdaVocoder::getParameterLabel(LvzInt32 index, char *label) +void mdaVocoder::getParameterLabel(int32_t index, char *label) { switch(index) { @@ -249,14 +249,14 @@ void mdaVocoder::getParameterLabel(LvzInt32 index, char *label) } -void mdaVocoder::process(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaVocoder::process(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; float *out1 = outputs[0]; float *out2 = outputs[1]; float a, b, c, d, o=0.0f, aa, bb, oo=kout, g=gain, ht=thru, hh=high, tmp; - LvzInt32 i, k=kval, sw=swap, nb=nbnd; + int32_t i, k=kval, sw=swap, nb=nbnd; --in1; --in2; @@ -327,14 +327,14 @@ void mdaVocoder::process(float **inputs, float **outputs, LvzInt32 sampleFrames) } -void mdaVocoder::processReplacing(float **inputs, float **outputs, LvzInt32 sampleFrames) +void mdaVocoder::processReplacing(float **inputs, float **outputs, int32_t sampleFrames) { float *in1 = inputs[0]; float *in2 = inputs[1]; float *out1 = outputs[0]; float *out2 = outputs[1]; float a, b, o=0.0f, aa, bb, oo=kout, g=gain, ht=thru, hh=high, tmp; - LvzInt32 i, k=kval, sw=swap, nb=nbnd; + int32_t i, k=kval, sw=swap, nb=nbnd; --in1; --in2; diff --git a/src/mdaVocoder.h b/src/mdaVocoder.h index 91d026b..8b81c70 100644 --- a/src/mdaVocoder.h +++ b/src/mdaVocoder.h @@ -43,35 +43,35 @@ 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 process(float **inputs, float **outputs, int32_t sampleFrames); + virtual void processReplacing(float **inputs, float **outputs, int32_t sampleFrames); + virtual void setProgram(int32_t 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 bool getProgramNameIndexed (int32_t category, int32_t index, char* name); + virtual void setParameter(int32_t index, float value); + virtual float getParameter(int32_t index); + virtual void getParameterLabel(int32_t index, char *label); + virtual void getParameterDisplay(int32_t index, char *text); + virtual void getParameterName(int32_t 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; } + virtual int32_t getVendorVersion() { return 1000; } protected: mdaVocoderProgram *programs; ///global internal variables - LvzInt32 swap; //input channel swap + int32_t 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 + int32_t kval; //downsample counter + int32_t 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] |