diff --git a/plugin/barrverb.cpp b/plugin/barrverb.cpp index afeec24..469170c 100644 --- a/plugin/barrverb.cpp +++ b/plugin/barrverb.cpp @@ -83,6 +83,12 @@ void BarrVerb::initAudioPort(bool input, uint32_t index, AudioPort &port) { void BarrVerb::initProgramName(uint32_t index, String &programName) { programName = "init program"; //&prog_name[index & 0x3f]; + programName = prog_name[index & 0x3f].c_str(); + +} + +void BarrVerb::loadProgram(uint32_t index) { + prog_offset = (index & 0x3f) << 7; } // Processing functions @@ -122,7 +128,7 @@ void BarrVerb::run(const float **inputs, float **outputs, uint32_t frames) { for (uint32_t i=0; i < frames; i+=2) { // run the actual DSP engine for each sample for (uint8_t step = 0; step < 128; step++) { - opcode = rom[(128*57) + step]; + opcode = rom[prog_offset + step]; switch (opcode & 0xc000) { case 0x0000: ai = ram[ptr]; diff --git a/plugin/barrverb.hpp b/plugin/barrverb.hpp index 40c4e64..3cc1f22 100644 --- a/plugin/barrverb.hpp +++ b/plugin/barrverb.hpp @@ -45,17 +45,20 @@ class BarrVerb : public Plugin { // Initialisation void initAudioPort(bool input, uint32_t index, AudioPort &port) override; void initProgramName(uint32_t index, String &programName) override; - + void loadProgram(uint32_t index) override; + // Processing void activate() override; void deactivate() override; void run(const float **inputs, float **outputs, uint32_t frames) override; private: + float c1_1, c2_1, d0_1, c1_2, c2_2, d0_2, in_z1, in_z2, in_z12,in_z22, out_z1, out_z2; int16_t ai, li, acc; uint16_t ptr; + uint16_t prog_offset; int16_t *ram; float *lowpass;