diff --git a/plugin/Makefile b/plugin/Makefile index 043d661..37ca068 100644 --- a/plugin/Makefile +++ b/plugin/Makefile @@ -15,7 +15,7 @@ FILES_DSP = \ include ../dpf/Makefile.plugins.mk -TARGETS += jack +TARGETS += jack lv2 all: $(TARGETS) diff --git a/plugin/chassis.cpp b/plugin/chassis.cpp index 1a286dc..b3d440f 100644 --- a/plugin/chassis.cpp +++ b/plugin/chassis.cpp @@ -33,7 +33,7 @@ void Chassis::initParameter(uint32_t index, Parameter ¶meter) { parameter.symbol = "saw"; parameter.ranges.min = 0.0f; parameter.ranges.max = 127.0f; - parameter.ranges.def = 127.0f; + parameter.ranges.def = 0.0f; } } @@ -121,7 +121,7 @@ void Chassis::run(const float **, float **outputs, uint32_t frames, const MidiEv // run each synth voice bzero(outputs[0], sizeof(float) * frames); for (uint8_t i = 0; i < NUM_VOICES; i++) { - s.voice[i].run(outputs[0], frames); + s.voice[i].run(s, outputs[0], frames); } // copy left to right memmove(outputs[1], outputs[0], sizeof(float) * frames); diff --git a/plugin/voice.cpp b/plugin/voice.cpp index 72e4d8b..e811c1a 100644 --- a/plugin/voice.cpp +++ b/plugin/voice.cpp @@ -54,7 +54,7 @@ void Voice::off() { target = 0; } -void Voice::run(float *buffer, uint32_t samples) { +void Voice::run(Synth &s, float *buffer, uint32_t samples) { float y; env = ((target - env) * 0.01) + env; for (uint32_t i = 0; i < samples; i++) { @@ -63,6 +63,6 @@ void Voice::run(float *buffer, uint32_t samples) { y = (2 * phase) - 1; y -= blep(phase, omega); - buffer[i] += 0.25 * y * env; + buffer[i] += (0.25 * y * env) * s.p.saw; } } diff --git a/plugin/voice.hpp b/plugin/voice.hpp index 6f0ac0e..f6d9634 100644 --- a/plugin/voice.hpp +++ b/plugin/voice.hpp @@ -20,6 +20,8 @@ #include +class Synth; + class Patch { public: float saw,sqr; @@ -36,7 +38,7 @@ class Voice { bool isFree(); - void run(float *buffer, uint32_t samples); + void run(Synth &s, float *buffer, uint32_t samples); private: enum { ATTACK,