semi-working MSVC support
i gave up on gcc, it kept producing segfaults.
This commit is contained in:
parent
156dcd2233
commit
398a72ef13
18 changed files with 348 additions and 151 deletions
33
build.bat
Executable file
33
build.bat
Executable file
|
@ -0,0 +1,33 @@
|
||||||
|
@ECHO OFF
|
||||||
|
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"
|
||||||
|
cd bin
|
||||||
|
|
||||||
|
set vst=../../../src/vstsdk2.4/
|
||||||
|
set vst2x=%vst%public.sdk/source/vst2.x/
|
||||||
|
set vstdef=%vst%public.sdk/samples/vst2.x/win/vstplug.def
|
||||||
|
set vst_c=/LD /I"%vst%"
|
||||||
|
set vst_ld=/DEF:"%vstdef%"
|
||||||
|
set vstsrc=%vst2x%audioeffect.cpp %vst2x%audioeffectx.cpp %vst2x%vstplugmain.cpp
|
||||||
|
|
||||||
|
set wall=/Wall /wd4100 /wd4668 /wd4820 /wd4514 /wd4365 /wd4711 /wd4996
|
||||||
|
REM the warning disabled below is function-not-inlined
|
||||||
|
set common_c=/I"../" /I"../include/" %wall% /wd4710
|
||||||
|
set release_c=%common_c% /O2 /Oy- /GL /EHsc /fp:fast /analyze- /nologo
|
||||||
|
set release_ld=
|
||||||
|
|
||||||
|
call:compile delay_test
|
||||||
|
call:compile eq
|
||||||
|
call:compile eq_const
|
||||||
|
call:compile eq_const_T420
|
||||||
|
REM call:compile eq_const_T420_svf
|
||||||
|
call:compile level
|
||||||
|
call:compile mugi4
|
||||||
|
call:compile noise
|
||||||
|
call:compile tube
|
||||||
|
goto:eof
|
||||||
|
|
||||||
|
:compile
|
||||||
|
set crap=%~1
|
||||||
|
cscript ..\util\generate.vbs %crap%
|
||||||
|
cl %release_c% %vst_c% ../crap/vst/%crap%.cpp %vstsrc% /link %release_ld% %vst_ld% /OUT:"vst/crap_%crap%.dll"
|
||||||
|
goto:eof
|
|
@ -72,12 +72,12 @@ struct channel {
|
||||||
|
|
||||||
struct Crap_delay_test
|
struct Crap_delay_test
|
||||||
:public AdjustAll<Crap> {
|
:public AdjustAll<Crap> {
|
||||||
static constexpr ulong id = 0xDEDEDEDE;
|
static const ulong id = 0xDEDEDEDE;
|
||||||
static constexpr char label[] = "crap_delay_test";
|
static const char *label;
|
||||||
static constexpr char name[] = "crap sample delay test";
|
static const char *name;
|
||||||
static constexpr char author[] = "Connor Olding";
|
static const char *author;
|
||||||
static constexpr char copyright[] = "MIT";
|
static const char *copyright;
|
||||||
static constexpr ulong parameters = 0;
|
static const ulong parameters = 0;
|
||||||
|
|
||||||
channel c_L, c_R;
|
channel c_L, c_R;
|
||||||
|
|
||||||
|
@ -100,8 +100,8 @@ struct Crap_delay_test
|
||||||
ulong count)
|
ulong count)
|
||||||
{
|
{
|
||||||
for (ulong i = 0; i < count; i++) {
|
for (ulong i = 0; i < count; i++) {
|
||||||
out_L[i] = c_L.process(in_L[i]);
|
out_L[i] = (float)c_L.process(in_L[i]);
|
||||||
out_R[i] = c_R.process(in_R[i]);
|
out_R[i] = (float)c_R.process(in_R[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ struct Crap_delay_test
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr char Crap_delay_test::label[];
|
const char *Crap_delay_test::label = "crap_delay_test";
|
||||||
constexpr char Crap_delay_test::name[];
|
const char *Crap_delay_test::name = "crap sample delay test";
|
||||||
constexpr char Crap_delay_test::author[];
|
const char *Crap_delay_test::author = "Connor Olding";
|
||||||
constexpr char Crap_delay_test::copyright[];
|
const char *Crap_delay_test::copyright = "MIT";
|
||||||
|
|
22
crap/eq.hpp
22
crap/eq.hpp
|
@ -9,14 +9,14 @@
|
||||||
|
|
||||||
struct Crap_eq
|
struct Crap_eq
|
||||||
:public AdjustAll<Buffer2<Crap>> {
|
:public AdjustAll<Buffer2<Crap>> {
|
||||||
static constexpr ulong id = 0x000CAFED;
|
static const ulong bands = 4;
|
||||||
static constexpr char label[] = "crap_eq";
|
|
||||||
static constexpr char name[] = "crap Parametric Equalizer";
|
|
||||||
static constexpr char author[] = "Connor Olding";
|
|
||||||
static constexpr char copyright[] = "MIT";
|
|
||||||
|
|
||||||
static constexpr ulong bands = 4;
|
static const ulong id = 0x000CAFED;
|
||||||
static constexpr ulong parameters = bands*3;
|
static const char *label;
|
||||||
|
static const char *name;
|
||||||
|
static const char *author;
|
||||||
|
static const char *copyright;
|
||||||
|
static const ulong parameters = bands*3;
|
||||||
|
|
||||||
biquad filters_L[bands];
|
biquad filters_L[bands];
|
||||||
biquad filters_R[bands];
|
biquad filters_R[bands];
|
||||||
|
@ -88,7 +88,7 @@ struct Crap_eq
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr char Crap_eq::label[];
|
const char *Crap_eq::label = "crap_eq";
|
||||||
constexpr char Crap_eq::name[];
|
const char *Crap_eq::name = "crap Parametric Equalizer";
|
||||||
constexpr char Crap_eq::author[];
|
const char *Crap_eq::author = "Connor Olding";
|
||||||
constexpr char Crap_eq::copyright[];
|
const char *Crap_eq::copyright = "MIT";
|
||||||
|
|
|
@ -8,14 +8,14 @@
|
||||||
|
|
||||||
struct Crap_eq_const
|
struct Crap_eq_const
|
||||||
:public AdjustAll<Buffer2<Crap>> {
|
:public AdjustAll<Buffer2<Crap>> {
|
||||||
static constexpr ulong id = 0x0DEFACED;
|
static const ulong id = 0x0DEFACED;
|
||||||
static constexpr char label[] = "crap_eq_const";
|
static const char *label;
|
||||||
static constexpr char name[] = "crap Constant Equalizer";
|
static const char *name;
|
||||||
static constexpr char author[] = "Connor Olding";
|
static const char *author;
|
||||||
static constexpr char copyright[] = "MIT";
|
static const char *copyright;
|
||||||
|
static const ulong parameters = 0;
|
||||||
|
|
||||||
static constexpr ulong bands = 12;
|
static const ulong bands = 12;
|
||||||
static constexpr ulong parameters = 0;
|
|
||||||
|
|
||||||
biquad filters_L[bands];
|
biquad filters_L[bands];
|
||||||
biquad filters_R[bands];
|
biquad filters_R[bands];
|
||||||
|
@ -71,7 +71,7 @@ struct Crap_eq_const
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr char Crap_eq_const::label[];
|
const char *Crap_eq_const::label = "crap_eq_const";
|
||||||
constexpr char Crap_eq_const::name[];
|
const char *Crap_eq_const::name = "crap Constant Equalizer";
|
||||||
constexpr char Crap_eq_const::author[];
|
const char *Crap_eq_const::author = "Connor Olding";
|
||||||
constexpr char Crap_eq_const::copyright[];
|
const char *Crap_eq_const::copyright = "MIT";
|
||||||
|
|
|
@ -8,14 +8,14 @@
|
||||||
|
|
||||||
struct Crap_eq_const_T420
|
struct Crap_eq_const_T420
|
||||||
:public AdjustAll<Buffer2<Crap>> {
|
:public AdjustAll<Buffer2<Crap>> {
|
||||||
static constexpr ulong id = 0x0DEFACED + 420;
|
static const ulong id = 0x0DEFACED + 420;
|
||||||
static constexpr char label[] = "crap_eq_const_T420";
|
static const char *label;
|
||||||
static constexpr char name[] = "crap T420 Speaker Compensation";
|
static const char *name;
|
||||||
static constexpr char author[] = "Connor Olding";
|
static const char *author;
|
||||||
static constexpr char copyright[] = "MIT";
|
static const char *copyright;
|
||||||
|
static const ulong parameters = 0;
|
||||||
|
|
||||||
static constexpr ulong bands = 16;
|
static const ulong bands = 16;
|
||||||
static constexpr ulong parameters = 0;
|
|
||||||
|
|
||||||
biquad filters_L[bands];
|
biquad filters_L[bands];
|
||||||
biquad filters_R[bands];
|
biquad filters_R[bands];
|
||||||
|
@ -75,7 +75,7 @@ struct Crap_eq_const_T420
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr char Crap_eq_const_T420::label[];
|
const char *Crap_eq_const_T420::label = "crap_eq_const_T420";
|
||||||
constexpr char Crap_eq_const_T420::name[];
|
const char *Crap_eq_const_T420::name = "crap T420 Speaker Compensation";
|
||||||
constexpr char Crap_eq_const_T420::author[];
|
const char *Crap_eq_const_T420::author = "Connor Olding";
|
||||||
constexpr char Crap_eq_const_T420::copyright[];
|
const char *Crap_eq_const_T420::copyright = "MIT";
|
||||||
|
|
|
@ -10,14 +10,14 @@
|
||||||
|
|
||||||
struct Crap_eq_const_T420_svf
|
struct Crap_eq_const_T420_svf
|
||||||
:public AdjustAll<Buffer4<Crap>> {
|
:public AdjustAll<Buffer4<Crap>> {
|
||||||
static constexpr ulong id = 0x0DEFACED + 420 + 1337;
|
static const ulong id = 0x0DEFACED + 420 + 1337;
|
||||||
static constexpr char label[] = "crap_eq_const_T420_svf";
|
static const char *label;
|
||||||
static constexpr char name[] = "crap T420 Speaker Compensation (SVF)";
|
static const char *name;
|
||||||
static constexpr char author[] = "Connor Olding";
|
static const char *author;
|
||||||
static constexpr char copyright[] = "MIT";
|
static const char *copyright;
|
||||||
|
static const ulong parameters = 0;
|
||||||
|
|
||||||
static constexpr ulong bands = 16;
|
static const ulong bands = 16;
|
||||||
static constexpr ulong parameters = 0;
|
|
||||||
|
|
||||||
svf_matrix<v4sf> filters_L[bands];
|
svf_matrix<v4sf> filters_L[bands];
|
||||||
svf_matrix<v4sf> filters_R[bands];
|
svf_matrix<v4sf> filters_R[bands];
|
||||||
|
@ -83,7 +83,7 @@ struct Crap_eq_const_T420_svf
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr char Crap_eq_const_T420_svf::label[];
|
const char *Crap_eq_const_T420_svf::label = "crap_eq_const_T420_svf";
|
||||||
constexpr char Crap_eq_const_T420_svf::name[];
|
const char *Crap_eq_const_T420_svf::name = "crap T420 Speaker Compensation (SVF)";
|
||||||
constexpr char Crap_eq_const_T420_svf::author[];
|
const char *Crap_eq_const_T420_svf::author = "Connor Olding";
|
||||||
constexpr char Crap_eq_const_T420_svf::copyright[];
|
const char *Crap_eq_const_T420_svf::copyright = "MIT";
|
||||||
|
|
|
@ -12,7 +12,7 @@ static ulong global_delay = 0;
|
||||||
|
|
||||||
TEMPLATE
|
TEMPLATE
|
||||||
struct Delay {
|
struct Delay {
|
||||||
static constexpr ulong size = 4096;
|
static const ulong size = 4096;
|
||||||
|
|
||||||
// needs to be twice the size for a memcpy trick later
|
// needs to be twice the size for a memcpy trick later
|
||||||
T buf[size*2];
|
T buf[size*2];
|
||||||
|
@ -28,7 +28,7 @@ struct Delay {
|
||||||
};
|
};
|
||||||
|
|
||||||
inline T
|
inline T
|
||||||
delay(T s)
|
delay(const T &s)
|
||||||
{
|
{
|
||||||
pos--;
|
pos--;
|
||||||
if (pos <= 0) {
|
if (pos <= 0) {
|
||||||
|
@ -52,14 +52,13 @@ struct Delay {
|
||||||
|
|
||||||
struct Crap_level
|
struct Crap_level
|
||||||
:public AdjustAll<Buffer2<Crap>> {
|
:public AdjustAll<Buffer2<Crap>> {
|
||||||
static constexpr ulong id = 0xAAAAAAAA;
|
static const ulong id = 0xAAAAAAAA;
|
||||||
static constexpr char label[] = "crap_level";
|
static const char *label;
|
||||||
static constexpr char name[] = "crap Leveller";
|
static const char *name;
|
||||||
static constexpr char author[] = "Connor Olding";
|
static const char *author;
|
||||||
static constexpr char copyright[] = "MIT";
|
static const char *copyright;
|
||||||
|
static const ulong bands = 2;
|
||||||
static constexpr ulong bands = 2;
|
static const ulong parameters = 0;
|
||||||
static constexpr ulong parameters = 0;
|
|
||||||
|
|
||||||
v2df sc[BLOCK_SIZE]; // sidechain
|
v2df sc[BLOCK_SIZE]; // sidechain
|
||||||
biquad filters_L[bands];
|
biquad filters_L[bands];
|
||||||
|
@ -80,7 +79,7 @@ struct Crap_level
|
||||||
~Crap_level()
|
~Crap_level()
|
||||||
{
|
{
|
||||||
if (window)
|
if (window)
|
||||||
free(window);
|
delete window;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
|
@ -89,20 +88,21 @@ struct Crap_level
|
||||||
biquad *f0, *f1;
|
biquad *f0, *f1;
|
||||||
f0 = filters_L;
|
f0 = filters_L;
|
||||||
f1 = filters_R;
|
f1 = filters_R;
|
||||||
memcpy(sc, buf, rem*sizeof(v2df));
|
for (ulong i = 0; i < rem; i++)
|
||||||
|
sc[i] = buf[i];
|
||||||
for (ulong i = 0; i < bands; i++) {
|
for (ulong i = 0; i < bands; i++) {
|
||||||
biquad_run_block_stereo(f0, f1, sc, rem);
|
biquad_run_block_stereo(f0, f1, sc, rem);
|
||||||
f0++;
|
f0++;
|
||||||
f1++;
|
f1++;
|
||||||
}
|
}
|
||||||
double envs[rem];
|
double envs[BLOCK_SIZE];
|
||||||
for (ulong i = 0; i < rem; i++)
|
for (ulong i = 0; i < rem; i++)
|
||||||
envs[i] = fabs(sc[i][0]) + fabs(sc[i][1]);
|
envs[i] = fabs(sc[i][0]) + fabs(sc[i][1]);
|
||||||
for (ulong i = 0; i < rem; i++)
|
for (ulong i = 0; i < rem; i++)
|
||||||
envs[i] *= 0.5;
|
envs[i] *= 0.5;
|
||||||
|
|
||||||
// MaxFIR
|
// MaxFIR
|
||||||
double applied[window_size];
|
double *applied = new double[window_size];
|
||||||
for (ulong i = 0; i < rem; i++) {
|
for (ulong i = 0; i < rem; i++) {
|
||||||
window_delay.delay(envs[i]);
|
window_delay.delay(envs[i]);
|
||||||
for (ulong j = 0; j < window_size; j++)
|
for (ulong j = 0; j < window_size; j++)
|
||||||
|
@ -112,6 +112,7 @@ struct Crap_level
|
||||||
max_ = fmax(max_, applied[j]);
|
max_ = fmax(max_, applied[j]);
|
||||||
envs[i] = max_;
|
envs[i] = max_;
|
||||||
}
|
}
|
||||||
|
delete applied;
|
||||||
|
|
||||||
// Follower
|
// Follower
|
||||||
for (ulong i = 0; i < rem; i++) {
|
for (ulong i = 0; i < rem; i++) {
|
||||||
|
@ -119,7 +120,7 @@ struct Crap_level
|
||||||
env = fmax(0.00001, env);
|
env = fmax(0.00001, env);
|
||||||
envs[i] = env;
|
envs[i] = env;
|
||||||
}
|
}
|
||||||
double gains[rem];
|
double gains[BLOCK_SIZE];
|
||||||
for (ulong i = 0; i < rem; i++)
|
for (ulong i = 0; i < rem; i++)
|
||||||
gains[i] = 0.3991 - 0.01769/(envs[i] + 0.044);
|
gains[i] = 0.3991 - 0.01769/(envs[i] + 0.044);
|
||||||
for (ulong i = 0; i < rem; i++)
|
for (ulong i = 0; i < rem; i++)
|
||||||
|
@ -153,7 +154,7 @@ struct Crap_level
|
||||||
construct_params(Param *params)
|
construct_params(Param *params)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
virtual void
|
void
|
||||||
adjust_all(Param *params)
|
adjust_all(Param *params)
|
||||||
{
|
{
|
||||||
biquad *f = filters_L;
|
biquad *f = filters_L;
|
||||||
|
@ -163,15 +164,15 @@ struct Crap_level
|
||||||
filters_R[i] = filters_L[i];
|
filters_R[i] = filters_L[i];
|
||||||
|
|
||||||
double window_length = fs*0.010/0.60;
|
double window_length = fs*0.010/0.60;
|
||||||
window_size = round(window_length);
|
window_size = (ulong) round(window_length);
|
||||||
lookahead = round(window_length*0.6);
|
lookahead = (ulong) round(window_length*0.6);
|
||||||
global_delay = lookahead;
|
global_delay = lookahead;
|
||||||
|
|
||||||
if (window)
|
if (window)
|
||||||
free(window);
|
delete window;
|
||||||
window = (double *) calloc(window_size, sizeof(double));
|
window = new double[window_size];
|
||||||
|
|
||||||
for (int i = 0; i < window_size; i++) {
|
for (ulong i = 0; i < window_size; i++) {
|
||||||
double x = double(i)/window_size;
|
double x = double(i)/window_size;
|
||||||
double y = -(x - 0)*(x - 1)*(x + 0.6)/0.288;
|
double y = -(x - 0)*(x - 1)*(x + 0.6)/0.288;
|
||||||
window[i] = y;
|
window[i] = y;
|
||||||
|
@ -184,7 +185,7 @@ struct Crap_level
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr char Crap_level::label[];
|
const char *Crap_level::label = "crap_level";
|
||||||
constexpr char Crap_level::name[];
|
const char *Crap_level::name = "crap Leveller";
|
||||||
constexpr char Crap_level::author[];
|
const char *Crap_level::author = "Connor Olding";
|
||||||
constexpr char Crap_level::copyright[];
|
const char *Crap_level::copyright = "MIT";
|
||||||
|
|
|
@ -21,10 +21,10 @@ https://aaltodoc.aalto.fi/bitstream/handle/123456789/14420/article6.pdf
|
||||||
|
|
||||||
#define VT 0.026
|
#define VT 0.026
|
||||||
#define N 4
|
#define N 4
|
||||||
#define VT2 T(2.*VT)
|
#define VT2 2.*VT
|
||||||
|
|
||||||
TEMPLATE INNER PURE T
|
TEMPLATE INNER PURE T
|
||||||
tanh2(T x)
|
tanh2(const T &x)
|
||||||
{
|
{
|
||||||
//return T(tanh(x[0]), tanh(x[1]));
|
//return T(tanh(x[0]), tanh(x[1]));
|
||||||
T xx = x*x;
|
T xx = x*x;
|
||||||
|
@ -47,12 +47,12 @@ struct stage {
|
||||||
v2df sum, sumback, dout;
|
v2df sum, sumback, dout;
|
||||||
|
|
||||||
TEMPLATE inline T
|
TEMPLATE inline T
|
||||||
process(freqdata fd, T in)
|
process(const freqdata &fd, const T &in)
|
||||||
{
|
{
|
||||||
T temp = (in + sumback)*VT2*fd.L_p0*fd.g;
|
T temp = (in + sumback)*T(VT2)*fd.L_p0*fd.g;
|
||||||
T out = temp + sum;
|
T out = temp + sum;
|
||||||
sum += T(2)*temp;
|
sum += T(2)*temp;
|
||||||
dout = tanh2<T>(out/VT2);
|
dout = tanh2<T>(out/T(VT2));
|
||||||
sumback = in*fd.L_r1 - dout*fd.L_q0;
|
sumback = in*fd.L_r1 - dout*fd.L_q0;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
@ -64,25 +64,26 @@ struct mugi4 {
|
||||||
v2df sumback1, sumback2, sumback3, sumback4;
|
v2df sumback1, sumback2, sumback3, sumback4;
|
||||||
v2df drive, feedback;
|
v2df drive, feedback;
|
||||||
|
|
||||||
TEMPLATE inline T
|
inline v2df
|
||||||
process(T in)
|
process(const v2df &in_)
|
||||||
{
|
{
|
||||||
in *= drive;
|
v2df in = in_*drive;
|
||||||
|
|
||||||
T sum = in + sumback1;
|
v2df sum = in + sumback1;
|
||||||
T pre = -fd.p0*sum;
|
v2df pre = -fd.p0*sum;
|
||||||
s1.process<T>(fd, tanh2<T>(pre/VT2));
|
v2df temp = tanh2<v2df>(pre/VT2);
|
||||||
s2.process<T>(fd, s1.dout);
|
s1.process<v2df>(fd, temp);
|
||||||
s3.process<T>(fd, s2.dout);
|
s2.process<v2df>(fd, s1.dout);
|
||||||
T out = s4.process<T>(fd, s3.dout);
|
s3.process<v2df>(fd, s2.dout);
|
||||||
|
v2df out = s4.process<v2df>(fd, s3.dout);
|
||||||
|
|
||||||
T back = feedback*out;
|
v2df back = feedback*out;
|
||||||
sumback1 = fd.r1*in + fd.q0*back + sumback2;
|
sumback1 = fd.r1*in + fd.q0*back + sumback2;
|
||||||
sumback2 = fd.r2*in + fd.q1*back + sumback3;
|
sumback2 = fd.r2*in + fd.q1*back + sumback3;
|
||||||
sumback3 = fd.r3*in + fd.q2*back + sumback4;
|
sumback3 = fd.r3*in + fd.q2*back + sumback4;
|
||||||
sumback4 = fd.r4*in + fd.q3*back;
|
sumback4 = fd.r4*in + fd.q3*back;
|
||||||
|
|
||||||
T compensate = -(feedback + T(1));
|
v2df compensate = -(feedback + v2df(1));
|
||||||
return out/drive*compensate;
|
return out/drive*compensate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +100,7 @@ struct mugi4 {
|
||||||
double bc4 = -1; //-binomial(N, 4);
|
double bc4 = -1; //-binomial(N, 4);
|
||||||
|
|
||||||
// apparently fd_set is used by some stdio implementations, so
|
// apparently fd_set is used by some stdio implementations, so
|
||||||
#define crap_fd_set(L, R) double L = R; fd.L = (v2df){L, L}
|
#define crap_fd_set(L, R) double L = R; fd.L = v2df(L, L)
|
||||||
crap_fd_set(g, tan(wc));
|
crap_fd_set(g, tan(wc));
|
||||||
double gg1 = g/(g + 1);
|
double gg1 = g/(g + 1);
|
||||||
double gg1Nk = k*gg1*gg1*gg1*gg1;
|
double gg1Nk = k*gg1*gg1*gg1*gg1;
|
||||||
|
@ -124,13 +125,12 @@ struct mugi4 {
|
||||||
|
|
||||||
struct Crap_mugi4
|
struct Crap_mugi4
|
||||||
:public AdjustAll<Buffer2OS2<Crap>> {
|
:public AdjustAll<Buffer2OS2<Crap>> {
|
||||||
static constexpr ulong id = 0xD8D0D8D0;
|
static const ulong id = 0xD8D0D8D0;
|
||||||
static constexpr char label[] = "crap_mugi4";
|
static const char *label;
|
||||||
static constexpr char name[] = "crap mugi4 (moog-like)";
|
static const char *name;
|
||||||
static constexpr char author[] = "Connor Olding";
|
static const char *author;
|
||||||
static constexpr char copyright[] = "MIT";
|
static const char *copyright;
|
||||||
|
static const ulong parameters = 3;
|
||||||
static constexpr ulong parameters = 3;
|
|
||||||
|
|
||||||
mugi4 filter;
|
mugi4 filter;
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ struct Crap_mugi4
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr char Crap_mugi4::label[];
|
const char *Crap_mugi4::label = "crap_mugi4";
|
||||||
constexpr char Crap_mugi4::name[];
|
const char *Crap_mugi4::name = "crap mugi4 (moog-like)";
|
||||||
constexpr char Crap_mugi4::author[];
|
const char *Crap_mugi4::author = "Connor Olding";
|
||||||
constexpr char Crap_mugi4::copyright[];
|
const char *Crap_mugi4::copyright = "MIT";
|
||||||
|
|
|
@ -6,12 +6,12 @@
|
||||||
|
|
||||||
struct Crap_noise
|
struct Crap_noise
|
||||||
:public AdjustAll<Crap> {
|
:public AdjustAll<Crap> {
|
||||||
static constexpr ulong id = 0xEC57A71C;
|
static const ulong id = 0xEC57A71C;
|
||||||
static constexpr char label[] = "crap_noise";
|
static const char *label;
|
||||||
static constexpr char name[] = "crap noise generator";
|
static const char *name;
|
||||||
static constexpr char author[] = "Connor Olding";
|
static const char *author;
|
||||||
static constexpr char copyright[] = "MIT";
|
static const char *copyright;
|
||||||
static constexpr ulong parameters = 0;
|
static const ulong parameters = 0;
|
||||||
|
|
||||||
unsigned int mirand_L, mirand_R;
|
unsigned int mirand_L, mirand_R;
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ struct Crap_noise
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr char Crap_noise::label[];
|
const char *Crap_noise::label = "crap_noise";
|
||||||
constexpr char Crap_noise::name[];
|
const char *Crap_noise::name = "crap noise generator";
|
||||||
constexpr char Crap_noise::author[];
|
const char *Crap_noise::author = "Connor Olding";
|
||||||
constexpr char Crap_noise::copyright[];
|
const char *Crap_noise::copyright = "MIT";
|
||||||
|
|
|
@ -33,13 +33,13 @@ typedef struct {
|
||||||
|
|
||||||
namespace Tube {
|
namespace Tube {
|
||||||
TEMPLATE INNER CONST T
|
TEMPLATE INNER CONST T
|
||||||
distort(T x)
|
distort(const T &x)
|
||||||
{
|
{
|
||||||
return (T(27.)*x + T(9.)) / (T(9.)*x*x + T(6.)*x + T(19.)) - T(9./19.);
|
return (T(27.)*x + T(9.)) / (T(9.)*x*x + T(6.)*x + T(19.)) - T(9./19.);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEMPLATE INNER CONST T
|
TEMPLATE INNER CONST T
|
||||||
process(T x, T drive, T wet)
|
process(const T &x, const T &drive, const T &wet)
|
||||||
{
|
{
|
||||||
return (distort<T>(x*drive)/drive*T(0.79) - x)*wet + x;
|
return (distort<T>(x*drive)/drive*T(0.79) - x)*wet + x;
|
||||||
}
|
}
|
||||||
|
@ -47,13 +47,12 @@ namespace Tube {
|
||||||
|
|
||||||
struct Crap_tube
|
struct Crap_tube
|
||||||
:public Buffer2OS2<Crap> {
|
:public Buffer2OS2<Crap> {
|
||||||
static constexpr ulong id = 0x50F7BA11;
|
static const ulong id = 0x50F7BA11;
|
||||||
static constexpr char label[] = "crap_tube";
|
static const char *label;
|
||||||
static constexpr char name[] = "crap Tube Distortion";
|
static const char *name;
|
||||||
static constexpr char author[] = "Connor Olding";
|
static const char *author;
|
||||||
static constexpr char copyright[] = "MIT";
|
static const char *copyright;
|
||||||
|
static const ulong parameters = 2;
|
||||||
static constexpr ulong parameters = 2;
|
|
||||||
|
|
||||||
smoothval drive, wet;
|
smoothval drive, wet;
|
||||||
|
|
||||||
|
@ -121,7 +120,7 @@ struct Crap_tube
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr char Crap_tube::label[];
|
const char *Crap_tube::label = "crap_tube";
|
||||||
constexpr char Crap_tube::name[];
|
const char *Crap_tube::name = "crap Tube Distortion";
|
||||||
constexpr char Crap_tube::author[];
|
const char *Crap_tube::author = "Connor Olding";
|
||||||
constexpr char Crap_tube::copyright[];
|
const char *Crap_tube::copyright = "MIT";
|
||||||
|
|
|
@ -23,8 +23,8 @@ struct Buffer2 : public Mixin {
|
||||||
process2(buf, rem);
|
process2(buf, rem);
|
||||||
|
|
||||||
for (ulong i = 0; i < rem; i++) {
|
for (ulong i = 0; i < rem; i++) {
|
||||||
out_L[i] = buf[i][0];
|
out_L[i] = (T)buf[i][0];
|
||||||
out_R[i] = buf[i][1];
|
out_R[i] = (T)buf[i][1];
|
||||||
}
|
}
|
||||||
|
|
||||||
in_L += BLOCK_SIZE;
|
in_L += BLOCK_SIZE;
|
||||||
|
|
|
@ -37,8 +37,8 @@ struct Buffer2OS2 : public Mixin {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ulong i = 0; i < rem; i++) {
|
for (ulong i = 0; i < rem; i++) {
|
||||||
out_L[i] = buf[i][0];
|
out_L[i] = (T)buf[i][0];
|
||||||
out_R[i] = buf[i][1];
|
out_R[i] = (T)buf[i][1];
|
||||||
}
|
}
|
||||||
|
|
||||||
in_L += BLOCK_SIZE;
|
in_L += BLOCK_SIZE;
|
||||||
|
|
|
@ -19,14 +19,15 @@ design(double cw, double sw,
|
||||||
double num0, double num1, double num2,
|
double num0, double num1, double num2,
|
||||||
double den0, double den1, double den2)
|
double den0, double den1, double den2)
|
||||||
{
|
{
|
||||||
return (biquad_interim) {
|
const biquad_interim ret = {
|
||||||
.b0 = num0* (1 + cw) + num1*sw + num2* (1 - cw),
|
num0* (1 + cw) + num1*sw + num2* (1 - cw),
|
||||||
.b1 = num0*-2*(1 + cw) + num2*2*(1 - cw),
|
num0*-2*(1 + cw) + num2*2*(1 - cw),
|
||||||
.b2 = num0* (1 + cw) - num1*sw + num2* (1 - cw),
|
num0* (1 + cw) - num1*sw + num2* (1 - cw),
|
||||||
.a0 = den0* (1 + cw) + den1*sw + den2* (1 - cw),
|
den0* (1 + cw) + den1*sw + den2* (1 - cw),
|
||||||
.a1 = den0*-2*(1 + cw) + den2*2*(1 - cw),
|
den0*-2*(1 + cw) + den2*2*(1 - cw),
|
||||||
.a2 = den0* (1 + cw) - den1*sw + den2* (1 - cw),
|
den0* (1 + cw) - den1*sw + den2* (1 - cw),
|
||||||
};
|
};
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: rename to biquad_gen_raw, fix up parameters like you did with svf
|
// TODO: rename to biquad_gen_raw, fix up parameters like you did with svf
|
||||||
|
@ -55,6 +56,8 @@ biquad_gen(filter_t type, double fc, double gain, double bw, double fs)
|
||||||
case FILT_BANDPASS_2: d(0, 1/Q, 0, 1, 1/Q, 1); break;
|
case FILT_BANDPASS_2: d(0, 1/Q, 0, 1, 1/Q, 1); break;
|
||||||
case FILT_NOTCH: d(1, 0, 1, 1, 1/Q, 1); break;
|
case FILT_NOTCH: d(1, 0, 1, 1, 1/Q, 1); break;
|
||||||
case FILT_GAIN: d(A, A, A, 1/A, 1/A, 1/A); break;
|
case FILT_GAIN: d(A, A, A, 1/A, 1/A, 1/A); break;
|
||||||
|
// TODO: error or something
|
||||||
|
default: d(1, 1, 1, 1, 1, 1); break;
|
||||||
}
|
}
|
||||||
#undef d
|
#undef d
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ struct halfband_t {
|
||||||
};
|
};
|
||||||
|
|
||||||
TEMPLATE INNER void
|
TEMPLATE INNER void
|
||||||
halfband_a(T a[8], T ao[8], T x0, T x2)
|
halfband_a(T a[8], T ao[8], const T &x0, const T &x2)
|
||||||
{
|
{
|
||||||
a[0] = x2 + (x0 - ao[0])*T(0.006185967461045014);
|
a[0] = x2 + (x0 - ao[0])*T(0.006185967461045014);
|
||||||
a[1] = ao[0] + (a[0] - ao[1])*T(0.054230780876613788);
|
a[1] = ao[0] + (a[0] - ao[1])*T(0.054230780876613788);
|
||||||
|
@ -30,7 +30,7 @@ halfband_a(T a[8], T ao[8], T x0, T x2)
|
||||||
}
|
}
|
||||||
|
|
||||||
TEMPLATE INNER void
|
TEMPLATE INNER void
|
||||||
halfband_b(T b[8], T bo[8], T x1, T x3)
|
halfband_b(T b[8], T bo[8], const T &x1, const T &x3)
|
||||||
{
|
{
|
||||||
b[0] = x3 + (x1 - bo[0])*T(0.024499027624721819);
|
b[0] = x3 + (x1 - bo[0])*T(0.024499027624721819);
|
||||||
b[1] = bo[0] + (b[0] - bo[1])*T(0.094283481125726432);
|
b[1] = bo[0] + (b[0] - bo[1])*T(0.094283481125726432);
|
||||||
|
@ -43,7 +43,7 @@ halfband_b(T b[8], T bo[8], T x1, T x3)
|
||||||
}
|
}
|
||||||
|
|
||||||
TEMPLATE INNER T
|
TEMPLATE INNER T
|
||||||
halfband(halfband_t<T> *h, T x0)
|
halfband(halfband_t<T> *h, const T &x0)
|
||||||
{
|
{
|
||||||
T a[8], b[8];
|
T a[8], b[8];
|
||||||
halfband_a(a, h->ao, x0, h->x2);
|
halfband_a(a, h->ao, x0, h->x2);
|
||||||
|
@ -59,7 +59,7 @@ halfband(halfband_t<T> *h, T x0)
|
||||||
}
|
}
|
||||||
|
|
||||||
TEMPLATE INNER T
|
TEMPLATE INNER T
|
||||||
decimate_a(halfband_t<T> *h, T x0)
|
decimate_a(halfband_t<T> *h, const T &x0)
|
||||||
{
|
{
|
||||||
T c[8];
|
T c[8];
|
||||||
halfband_b(c, h->bo, x0, h->x2);
|
halfband_b(c, h->bo, x0, h->x2);
|
||||||
|
@ -70,7 +70,7 @@ decimate_a(halfband_t<T> *h, T x0)
|
||||||
}
|
}
|
||||||
|
|
||||||
TEMPLATE INNER T
|
TEMPLATE INNER T
|
||||||
decimate_b(halfband_t<T> *h, T x0)
|
decimate_b(halfband_t<T> *h, const T &x0)
|
||||||
{
|
{
|
||||||
T c[8];
|
T c[8];
|
||||||
halfband_a(c, h->ao, x0, h->x2);
|
halfband_a(c, h->ao, x0, h->x2);
|
||||||
|
@ -82,7 +82,7 @@ decimate_b(halfband_t<T> *h, T x0)
|
||||||
|
|
||||||
// note: do not zero-stuff! send the input each time.
|
// note: do not zero-stuff! send the input each time.
|
||||||
TEMPLATE INNER T
|
TEMPLATE INNER T
|
||||||
interpolate_a(halfband_t<T> *h, T x0)
|
interpolate_a(halfband_t<T> *h, const T &x0)
|
||||||
{
|
{
|
||||||
T c[8];
|
T c[8];
|
||||||
halfband_a(c, h->ao, x0, h->x1);
|
halfband_a(c, h->ao, x0, h->x1);
|
||||||
|
@ -92,7 +92,7 @@ interpolate_a(halfband_t<T> *h, T x0)
|
||||||
|
|
||||||
// note: do not zero-stuff! send the input each time.
|
// note: do not zero-stuff! send the input each time.
|
||||||
TEMPLATE INNER T
|
TEMPLATE INNER T
|
||||||
interpolate_b(halfband_t<T> *h, T x0)
|
interpolate_b(halfband_t<T> *h, const T &x0)
|
||||||
{
|
{
|
||||||
T c[8];
|
T c[8];
|
||||||
halfband_b(c, h->bo, x0, h->x1);
|
halfband_b(c, h->bo, x0, h->x1);
|
||||||
|
|
|
@ -2,15 +2,27 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifndef M_PI
|
||||||
|
#define M_PI 3.14159265358979323846
|
||||||
|
#define M_SQRT2 1.41421356237309504880
|
||||||
|
#define M_SQRT1_2 0.707106781186547524401
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __SSE2__
|
#ifdef __SSE2__
|
||||||
#include <emmintrin.h>
|
#include <emmintrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TEMPLATE template<typename T>
|
#define TEMPLATE template<typename T>
|
||||||
#define INNER static inline
|
#define INNER static inline
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define PURE
|
||||||
|
#define CONST
|
||||||
|
#define RESTRICT
|
||||||
|
#else
|
||||||
#define PURE __attribute__((pure))
|
#define PURE __attribute__((pure))
|
||||||
#define CONST __attribute__((const))
|
#define CONST __attribute__((const))
|
||||||
#define RESTRICT __restrict__
|
#define RESTRICT __restrict__
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef unsigned long ulong; // __attribute((aligned(16)));
|
typedef unsigned long ulong; // __attribute((aligned(16)));
|
||||||
|
|
||||||
|
@ -18,8 +30,12 @@ typedef unsigned long ulong; // __attribute((aligned(16)));
|
||||||
#define BLOCK_SIZE 256
|
#define BLOCK_SIZE 256
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#include "vectors_simple.hpp"
|
||||||
|
#else
|
||||||
#include "Dumber.hpp"
|
#include "Dumber.hpp"
|
||||||
#include "vectors.hpp"
|
#include "vectors.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef FORCE_SINGLE
|
#ifdef FORCE_SINGLE
|
||||||
#define v2df v2sf
|
#define v2df v2sf
|
||||||
|
|
123
include/vectors_simple.hpp
Executable file
123
include/vectors_simple.hpp
Executable file
|
@ -0,0 +1,123 @@
|
||||||
|
#include <emmintrin.h>
|
||||||
|
typedef __m128d _v2df;
|
||||||
|
typedef __m64 _v2sf;
|
||||||
|
typedef __m128 _v4sf;
|
||||||
|
|
||||||
|
struct v2df {
|
||||||
|
_v2df v;
|
||||||
|
|
||||||
|
v2df()
|
||||||
|
{}
|
||||||
|
|
||||||
|
v2df(double d)
|
||||||
|
{ v = _mm_set1_pd(d); }
|
||||||
|
|
||||||
|
v2df(double d0, double d1)
|
||||||
|
{ v = _mm_setr_pd(d0,d1); }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator-(const v2df &a)
|
||||||
|
{ v2df c; c.v =_mm_sub_pd(_mm_setzero_pd(),a.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator+(const v2df &a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_add_pd(a.v,b.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator-(const v2df &a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_sub_pd(a.v,b.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator*(const v2df &a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_mul_pd(a.v,b.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator/(const v2df &a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_div_pd(a.v,b.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
sqrt(const v2df &a)
|
||||||
|
{ v2df c; c.v = _mm_sqrt_pd(a.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator+(double a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_add_pd(_mm_set1_pd(a),b.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator-(double a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_sub_pd(_mm_set1_pd(a),b.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator*(double a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_mul_pd(_mm_set1_pd(a),b.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator/(double a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_div_pd(_mm_set1_pd(a),b.v); return c; }
|
||||||
|
|
||||||
|
inline v2df &
|
||||||
|
operator+=(const v2df &a)
|
||||||
|
{ v = _mm_add_pd(v,a.v); return *this; }
|
||||||
|
|
||||||
|
inline v2df &
|
||||||
|
operator-=(const v2df &a)
|
||||||
|
{ v = _mm_sub_pd(v,a.v); return *this; }
|
||||||
|
|
||||||
|
inline v2df &
|
||||||
|
operator*=(const v2df &a)
|
||||||
|
{ v = _mm_mul_pd(v,a.v); return *this; }
|
||||||
|
|
||||||
|
inline v2df &
|
||||||
|
operator/=(const v2df &a)
|
||||||
|
{ v = _mm_div_pd(v,a.v); return *this; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator&(const v2df &a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_and_pd(a.v,b.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator|(const v2df &a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_or_pd(a.v,b.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator^(const v2df &a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_xor_pd(a.v,b.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
andnot(const v2df &a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_andnot_pd(a.v,b.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator<(const v2df &a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_cmplt_pd(a.v,b.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator>(const v2df &a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_cmpgt_pd(a.v,b.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator==(const v2df &a, const v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_cmpeq_pd(a.v,b.v); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator<(const v2df &a, double b)
|
||||||
|
{ v2df c; c.v = _mm_cmplt_pd(a.v,_mm_set1_pd(b)); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
operator>(const v2df &a, double b)
|
||||||
|
{ v2df c; c.v = _mm_cmpgt_pd(a.v,_mm_set1_pd(b)); return c; }
|
||||||
|
|
||||||
|
friend inline v2df
|
||||||
|
max(const v2df &a, v2df &b)
|
||||||
|
{ v2df c; c.v = _mm_max_pd(a.v,b.v); return c; }
|
||||||
|
|
||||||
|
inline double &
|
||||||
|
operator[](int index) {
|
||||||
|
return ((double *)&v)[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const double &
|
||||||
|
operator[](int index) const {
|
||||||
|
return ((double *)&v)[index];
|
||||||
|
}
|
||||||
|
};
|
|
@ -37,7 +37,7 @@ struct plugin : public AudioEffectX
|
||||||
|
|
||||||
char programName[kVstMaxProgNameLen];
|
char programName[kVstMaxProgNameLen];
|
||||||
|
|
||||||
Param params[CrapPlug::parameters];
|
Param *params;
|
||||||
|
|
||||||
Crap *crap;
|
Crap *crap;
|
||||||
};
|
};
|
||||||
|
@ -53,6 +53,8 @@ plugin::plugin(audioMasterCallback audioMaster)
|
||||||
: AudioEffectX(audioMaster, 1, CrapPlug::parameters)
|
: AudioEffectX(audioMaster, 1, CrapPlug::parameters)
|
||||||
{
|
{
|
||||||
crap = new CrapPlug();
|
crap = new CrapPlug();
|
||||||
|
if (CrapPlug::parameters)
|
||||||
|
params = new Param[CrapPlug::parameters];
|
||||||
setNumInputs(2);
|
setNumInputs(2);
|
||||||
setNumOutputs(2);
|
setNumOutputs(2);
|
||||||
setUniqueID(CrapPlug::id);
|
setUniqueID(CrapPlug::id);
|
||||||
|
@ -65,6 +67,8 @@ plugin::plugin(audioMasterCallback audioMaster)
|
||||||
plugin::~plugin()
|
plugin::~plugin()
|
||||||
{
|
{
|
||||||
delete crap;
|
delete crap;
|
||||||
|
if (CrapPlug::parameters)
|
||||||
|
delete[] params;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
18
util/generate.vbs
Executable file
18
util/generate.vbs
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
Set FSO = CreateObject("Scripting.FileSystemObject")
|
||||||
|
|
||||||
|
Name = WScript.Arguments(0)
|
||||||
|
|
||||||
|
IPath = "../template/vst.cpp"
|
||||||
|
OPath = "../crap/vst/"&Name&".cpp"
|
||||||
|
Inc = "crap/"&Name&".hpp"
|
||||||
|
|
||||||
|
Set File = FSO.OpenTextFile(IPath)
|
||||||
|
Text = File.ReadAll
|
||||||
|
File.Close
|
||||||
|
|
||||||
|
Text = Replace(Text, "//#INCLUDE", "#include """&Inc&"""")
|
||||||
|
Text = Replace(Text, "//#REDEFINE", "#define CrapPlug Crap_"&Name)
|
||||||
|
|
||||||
|
Set File = FSO.CreateTextFile(OPath, True)
|
||||||
|
File.Write Text
|
||||||
|
File.Close
|
Loading…
Add table
Reference in a new issue