please just work already
This commit is contained in:
parent
3cc5467f5b
commit
44d303cf95
10 changed files with 42 additions and 51 deletions
2
Makefile
2
Makefile
|
@ -42,7 +42,7 @@ LADSPA_FLAGS =
|
|||
VST_FLAGS = -Wno-write-strings -Wno-narrowing
|
||||
VST_FLAGS += -I $(VST_SDK_DIR) -DBUILDING_DLL=1
|
||||
|
||||
OPT_FLAGS = -Ofast -march=native -mfpmath=sse
|
||||
OPT_FLAGS = -Ofast -march=core2 -mfpmath=sse
|
||||
|
||||
# any possibly produced files besides intermediates
|
||||
ALL = $(SHOBJ) $(PROGRAM) $(BIN)/vstsdk.o $(EXE) $(DLL)
|
||||
|
|
|
@ -53,3 +53,4 @@ other targets:
|
|||
* scrap overly-complex makefile for a shell script
|
||||
* support for CPUs without SSE/NEON
|
||||
* don't mix CamelCase with underscores (only done for legacy reasons)
|
||||
* compressor plugin
|
||||
|
|
|
@ -130,3 +130,8 @@ struct Crap_delay_test
|
|||
c_R = c_L;
|
||||
}
|
||||
};
|
||||
|
||||
constexpr char Crap_delay_test::label[];
|
||||
constexpr char Crap_delay_test::name[];
|
||||
constexpr char Crap_delay_test::author[];
|
||||
constexpr char Crap_delay_test::copyright[];
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
template<class Mixin>
|
||||
struct Buffer2 : public virtual Mixin {
|
||||
struct Buffer2 : public Mixin {
|
||||
virtual void
|
||||
process2(v2df *buf, ulong rem) = 0;
|
||||
|
||||
|
@ -16,15 +16,15 @@ struct Buffer2 : public virtual Mixin {
|
|||
rem = count - pos;
|
||||
|
||||
for (ulong i = 0; i < rem; i++) {
|
||||
buf[i][0] = in_L[i];
|
||||
buf[i][1] = in_R[i];
|
||||
buf[i].v[0] = in_L[i];
|
||||
buf[i].v[1] = in_R[i];
|
||||
}
|
||||
|
||||
process2(buf, rem);
|
||||
|
||||
for (ulong i = 0; i < rem; i++) {
|
||||
out_L[i] = buf[i][0];
|
||||
out_R[i] = buf[i][1];
|
||||
out_L[i] = buf[i].v[0];
|
||||
out_R[i] = buf[i].v[1];
|
||||
}
|
||||
|
||||
in_L += BLOCK_SIZE;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
template<class Mixin>
|
||||
struct Buffer2OS2 : public virtual Mixin {
|
||||
struct Buffer2OS2 : public Mixin {
|
||||
virtual void
|
||||
process2(v2df *buf, ulong rem) = 0;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
template<class Mixin>
|
||||
struct Buffer4 : public virtual Mixin {
|
||||
struct Buffer4 : public Mixin {
|
||||
virtual void
|
||||
process2(v4sf *buf_L, v4sf *buf_R, ulong rem) = 0;
|
||||
|
||||
|
@ -19,19 +19,19 @@ struct Buffer4 : public virtual Mixin {
|
|||
rem = count - pos;
|
||||
|
||||
for (ulong i = 0, j = 0; i < rem; i += 2, j++) {
|
||||
buf_L[j][0] = in_L[i+0];
|
||||
buf_L[j][1] = in_L[i+1];
|
||||
buf_R[j][0] = in_R[i+0];
|
||||
buf_R[j][1] = in_R[i+1];
|
||||
buf_L[j].v[0] = in_L[i+0];
|
||||
buf_L[j].v[1] = in_L[i+1];
|
||||
buf_R[j].v[0] = in_R[i+0];
|
||||
buf_R[j].v[1] = in_R[i+1];
|
||||
}
|
||||
|
||||
process2(buf_L, buf_R, rem);
|
||||
|
||||
for (ulong i = 0, j = 0; i < rem; i += 2, j++) {
|
||||
out_L[i+0] = buf_L[j][0];
|
||||
out_L[i+1] = buf_L[j][1];
|
||||
out_R[i+0] = buf_R[j][0];
|
||||
out_R[i+1] = buf_R[j][1];
|
||||
out_L[i+0] = buf_L[j].v[0];
|
||||
out_L[i+1] = buf_L[j].v[1];
|
||||
out_R[i+0] = buf_R[j].v[0];
|
||||
out_R[i+1] = buf_R[j].v[1];
|
||||
}
|
||||
|
||||
in_L += BLOCK_SIZE;
|
||||
|
|
|
@ -2,14 +2,6 @@ struct Crap {
|
|||
virtual inline
|
||||
~Crap() {}
|
||||
|
||||
ulong id;
|
||||
char *label;
|
||||
char *name;
|
||||
char *author;
|
||||
char *copyright;
|
||||
ulong bands;
|
||||
ulong parameters;
|
||||
|
||||
virtual void
|
||||
pause() = 0;
|
||||
|
||||
|
@ -39,7 +31,7 @@ struct Crap {
|
|||
};
|
||||
|
||||
template<class Mixin>
|
||||
struct AdjustAll : public virtual Mixin {
|
||||
struct AdjustAll : public Mixin {
|
||||
ulong fs;
|
||||
|
||||
virtual void
|
||||
|
@ -60,7 +52,7 @@ struct AdjustAll : public virtual Mixin {
|
|||
};
|
||||
|
||||
template<class Mixin>
|
||||
struct NoParams : public virtual Mixin {
|
||||
struct NoParams : public Mixin {
|
||||
// etc
|
||||
|
||||
//void
|
||||
|
|
|
@ -123,18 +123,18 @@ svf_run_block_mat(svf_matrix<T> *RESTRICT mat, T *RESTRICT buf, ulong count)
|
|||
T t1, t2, t3, t4;
|
||||
T memory = mat->memory;
|
||||
for (ulong i = 0; i < count/2; i++) {
|
||||
memory[0] = buf[i][0];
|
||||
memory[1] = buf[i][1];
|
||||
memory.v[0] = buf[i].v[0];
|
||||
memory.v[1] = buf[i].v[1];
|
||||
t1 = mat->a*memory;
|
||||
t2 = mat->b*memory;
|
||||
t3 = mat->c*memory;
|
||||
t4 = mat->d*memory;
|
||||
memory[0] = t1[0] + t1[1] + t1[2] + t1[3];
|
||||
memory[1] = t2[0] + t2[1] + t2[2] + t2[3];
|
||||
memory[2] = t3[0] + t3[1] + t3[2] + t3[3];
|
||||
memory[3] = t4[0] + t4[1] + t4[2] + t4[3];
|
||||
buf[i][0] = memory[0];
|
||||
buf[i][1] = memory[1];
|
||||
memory.v[0] = t1.v[0] + t1.v[1] + t1.v[2] + t1.v[3];
|
||||
memory.v[1] = t2.v[0] + t2.v[1] + t2.v[2] + t2.v[3];
|
||||
memory.v[2] = t3.v[0] + t3.v[1] + t3.v[2] + t3.v[3];
|
||||
memory.v[3] = t4.v[0] + t4.v[1] + t4.v[2] + t4.v[3];
|
||||
buf[i].v[0] = memory.v[0];
|
||||
buf[i].v[1] = memory.v[1];
|
||||
}
|
||||
mat->memory = memory;
|
||||
}
|
||||
|
|
|
@ -73,16 +73,6 @@ struct Dumber<_v4sf> : public DumberBase<_v4sf> {
|
|||
TEMPLATE inline
|
||||
Dumber(T x)
|
||||
{ v = (_v4sf){float(x), float(x), float(x), float(x)}; }
|
||||
|
||||
inline float &
|
||||
operator[](int index) {
|
||||
return ((float *)&v)[index];
|
||||
}
|
||||
|
||||
inline const float &
|
||||
operator[](int index) const {
|
||||
return ((float *)&v)[index];
|
||||
}
|
||||
};
|
||||
|
||||
typedef Dumber<_v2df> v2df;
|
||||
|
|
|
@ -39,18 +39,20 @@ struct plugin : public AudioEffectX
|
|||
|
||||
Param params[CrapPlug::parameters];
|
||||
|
||||
CrapPlug crap;
|
||||
Crap *crap;
|
||||
};
|
||||
|
||||
AudioEffect *
|
||||
createEffectInstance(audioMasterCallback audioMaster)
|
||||
{
|
||||
// TODO: return new plugin<CrapPlug>(audioMaster);
|
||||
return new plugin(audioMaster);
|
||||
}
|
||||
|
||||
plugin::plugin(audioMasterCallback audioMaster)
|
||||
: AudioEffectX(audioMaster, 1, CrapPlug::parameters)
|
||||
{
|
||||
crap = new CrapPlug();
|
||||
setNumInputs(2);
|
||||
setNumOutputs(2);
|
||||
setUniqueID(CrapPlug::id);
|
||||
|
@ -62,12 +64,13 @@ plugin::plugin(audioMasterCallback audioMaster)
|
|||
|
||||
plugin::~plugin()
|
||||
{
|
||||
delete crap;
|
||||
}
|
||||
|
||||
void
|
||||
plugin::resume()
|
||||
{
|
||||
crap.resume();
|
||||
crap->resume();
|
||||
AudioEffectX::resume();
|
||||
}
|
||||
|
||||
|
@ -75,14 +78,14 @@ void
|
|||
plugin::suspend()
|
||||
{
|
||||
AudioEffectX::suspend();
|
||||
crap.pause();
|
||||
crap->pause();
|
||||
}
|
||||
|
||||
void
|
||||
plugin::processReplacing(
|
||||
float **inputs, float **outputs, VstInt32 count)
|
||||
{
|
||||
crap.process(
|
||||
crap->process(
|
||||
inputs[0], inputs[1],
|
||||
outputs[0], outputs[1],
|
||||
count);
|
||||
|
@ -92,7 +95,7 @@ void
|
|||
plugin::processDoubleReplacing(
|
||||
double **inputs, double **outputs, VstInt32 count)
|
||||
{
|
||||
crap.process(
|
||||
crap->process(
|
||||
inputs[0], inputs[1],
|
||||
outputs[0], outputs[1],
|
||||
count);
|
||||
|
@ -108,7 +111,7 @@ void
|
|||
plugin::setSampleRate(float fs)
|
||||
{
|
||||
AudioEffectX::setSampleRate(fs);
|
||||
crap.adjust(params, (unsigned long) fs);
|
||||
crap->adjust(params, (unsigned long) fs);
|
||||
#ifdef DELAY
|
||||
setInitialDelay(global_delay);
|
||||
#endif
|
||||
|
@ -160,7 +163,7 @@ plugin::setParameter(VstInt32 index, float value)
|
|||
{
|
||||
if (index >= CrapPlug::parameters) return;
|
||||
params[index].set(value);
|
||||
crap.adjust_one(params, index);
|
||||
crap->adjust_one(params, index);
|
||||
}
|
||||
|
||||
float
|
||||
|
|
Loading…
Add table
Reference in a new issue