Compare commits

..

No commits in common. "master" and "digital" have entirely different histories.

8 changed files with 96 additions and 348 deletions

View File

@ -27,7 +27,7 @@
#define DISTRHO_PLUGIN_IS_SYNTH 1 #define DISTRHO_PLUGIN_IS_SYNTH 1
#define DISTRHO_PLUGIN_IS_RT_SAFE 1 #define DISTRHO_PLUGIN_IS_RT_SAFE 1
#define DISTRHO_PLUGIN_WANT_PROGRAMS 1 #define DISTRHO_PLUGIN_WANT_PROGRAMS 0
enum Parameters { enum Parameters {
paramProg, paramProg,

View File

@ -18,11 +18,9 @@
#include "chassis.hpp" #include "chassis.hpp"
#include "patches.hpp"
START_NAMESPACE_DISTRHO START_NAMESPACE_DISTRHO
Chassis::Chassis() : Plugin(parameterCount, 128, 0), sampleRate(getSampleRate()) { // one parameter, no programs, no states Chassis::Chassis() : Plugin(parameterCount, 0, 0), sampleRate(getSampleRate()) { // one parameter, no programs, no states
} }
// Initialisation functions // Initialisation functions
@ -35,14 +33,6 @@ void Chassis::initAudioPort(bool input, uint32_t index, AudioPort &port) {
if (!input && index == 1) port.name = "Right Out"; if (!input && index == 1) port.name = "Right Out";
} }
void Chassis::initProgramName(uint32_t index, String &programName) {
programName = patchName[index & 0x7f].c_str();
}
void Chassis::loadProgram(uint32_t index) {
memmove(&s.patchRam, (uint8_t *)patchData + (index * 18), 18);
}
// Processing functions // Processing functions
void Chassis::activate() { void Chassis::activate() {
@ -57,6 +47,7 @@ void Chassis::activate() {
void Chassis::deactivate() { void Chassis::deactivate() {
// zero out the outputs, maybe // zero out the outputs, maybe
printf("called deactivate()\n"); printf("called deactivate()\n");
// printf("%02x", assign[1]);
} }
void Chassis::noteOn(uint8_t note) { void Chassis::noteOn(uint8_t note) {
@ -66,8 +57,10 @@ void Chassis::noteOn(uint8_t note) {
vPtr++; vPtr++;
if (vPtr == NUM_VOICES) vPtr = 0; if (vPtr == NUM_VOICES) vPtr = 0;
if (s.voice[vPtr].isFree()) { if (s.voice[vPtr].isFree()) {
// printf("voice %d is free, existing note = %d, note = %d\n", vPtr, s.voice[i].note, note);
// if it's an existing note don't reset // if it's an existing note don't reset
s.voice[vPtr].on(note, s.voice[i].note != note); s.voice[vPtr].on(note, s.voice[i].note != note);
// printf("note on %d for voice %d\n", note, vPtr);
break; break;
} }
} }
@ -80,19 +73,23 @@ void Chassis::noteOn(uint8_t note) {
} }
void Chassis::noteOff(uint8_t note) { void Chassis::noteOff(uint8_t note) {
// printf("noteoff %d\n", note);
s.keyon = false; s.keyon = false;
for (uint32_t i = 0; i < NUM_VOICES; i++) { for (uint32_t i = 0; i < NUM_VOICES; i++) {
if (s.voice[i].note == note && !s.voice[i].isFree()) { if (s.voice[i].note == note && !s.voice[i].isFree()) {
s.voice[i].off(); s.voice[i].off();
// printf("note off %d for voice %d\n", note, i);
break; break;
} }
} }
} }
void Chassis::doMidi(const MidiEvent *ev, uint32_t count, uint32_t timeLimit) { void Chassis::doMidi(const MidiEvent *ev, uint32_t count, uint32_t timeLimit) {
// printf("doMidi() handling events from %d to %d\n", lastEvent, timeLimit);
uint32_t i; uint32_t i;
if (count == 0) return; if (count == 0) return;
for (i = lastEvent; i < count; i++) { for (i = lastEvent; i < count; i++) {
// printf("doMidi event number %d of %d %02x %02x\n", i, count, ev[i].data[0], ev[i].data[1]);
if (ev[i].frame > timeLimit) break; if (ev[i].frame > timeLimit) break;
switch (ev[i].data[0]) { switch (ev[i].data[0]) {
case 0x90: case 0x90:
@ -107,15 +104,20 @@ void Chassis::doMidi(const MidiEvent *ev, uint32_t count, uint32_t timeLimit) {
} }
void Chassis::run(const float **, float **outputs, uint32_t frames, const MidiEvent *midiEvents, uint32_t midiEventCount) { void Chassis::run(const float **, float **outputs, uint32_t frames, const MidiEvent *midiEvents, uint32_t midiEventCount) {
// if (midiEventCount > 0) printf("\n--------------------\n");
uint32_t framePos = 0; uint32_t framePos = 0;
uint32_t sizeThisTime; uint32_t sizeThisTime;
s.framesLeft = frames; s.framesLeft = frames;
// printf("\n------------\ncalled run() for %d frames\n",frames);
// flatten the left channel to use as temporary storage, since // flatten the left channel to use as temporary storage, since
// the synth engine only generates a mono channel // the synth engine only generates a mono channel
bzero(outputs[0], sizeof(float) * frames); bzero(outputs[0], sizeof(float) * frames);
bzero(outputs[1], sizeof(float) * frames); bzero(outputs[1], sizeof(float) * frames);
// get any of the last block's worth of MIDI out of the way // get any of the last block's worth of MIDI out of the way
lastEvent = 0; lastEvent = 0;
doMidi(midiEvents, midiEventCount, s.blockLeft); doMidi(midiEvents, midiEventCount, s.blockLeft);
@ -125,6 +127,7 @@ void Chassis::run(const float **, float **outputs, uint32_t frames, const MidiEv
s.blockLeft = sampleRate / 238; s.blockLeft = sampleRate / 238;
doMidi(midiEvents, midiEventCount, framePos + s.blockLeft); doMidi(midiEvents, midiEventCount, framePos + s.blockLeft);
// printf("compute params and reset block size\n");
s.lfoDelay(); s.lfoDelay();
s.runLFO(); s.runLFO();
@ -132,32 +135,38 @@ void Chassis::run(const float **, float **outputs, uint32_t frames, const MidiEv
s.voice[i].calcPitch(s); s.voice[i].calcPitch(s);
switch (s.patchRam.switch1 & 0x07) { switch (s.patchRam.switch1 & 0x07) {
case 0: case 1:
s.voice[i].omega /= 2; s.voice[i].omega /= 2;
break; break;
case 2: case 4:
s.voice[i].omega *= 2; s.voice[i].omega *= 2;
default: default:
break; break;
} }
// printf("voice %d note = %02x ff71 = %04x\n",i, s.voice[i].note, s.voice[i].ff71 );
s.voice[i].envelope(s); s.voice[i].envelope(s);
s.voice[i].calcFilter(s); s.voice[i].calcFilter(s);
//printf("voice %d vcf level = %04x\n", i, s.voice[i].vcfenv );
} }
} }
sizeThisTime = (s.framesLeft < s.blockLeft) ? s.framesLeft : s.blockLeft; sizeThisTime = (s.framesLeft < s.blockLeft) ? s.framesLeft : s.blockLeft;
// printf("sL = %d bL = %d, calculating %d frames at %d\n", s.framesLeft, s.blockLeft, sizeThisTime, framePos);
// run each synth voice // run each synth voice
for (uint8_t i = 0; i < NUM_VOICES; i++) { for (uint8_t i = 0; i < NUM_VOICES; i++) {
s.voice[i].run(s, outputs[0] + framePos, sizeThisTime); s.voice[i].run(s, outputs[0] + framePos, sizeThisTime);
} }
framePos += sizeThisTime; framePos += sizeThisTime;
s.framesLeft -= sizeThisTime; s.framesLeft -= sizeThisTime;
s.blockLeft -= sizeThisTime; s.blockLeft -= sizeThisTime;
} }
// printf("and now run the rest of the process for %d frames\n\n", frames);
// copy left to right // copy left to right
memmove(outputs[1], outputs[0], sizeof(float) * frames); memmove(outputs[1], outputs[0], sizeof(float) * frames);

View File

@ -71,12 +71,12 @@ class Chassis : public Plugin {
protected: protected:
const char *getLabel() const override { return "chassis"; } const char *getLabel() const override { return "chassis"; }
const char *getDescription() const override { const char *getDescription() const override {
return "simple polysynth"; return "MIDIVerb emulation, a tribute to Keith Barr";
} }
const char *getMaker() const override { return "Gordonjcp"; } const char *getMaker() const override { return "Gordonjcp"; }
const char *getLicense() const override { return "ISC"; } const char *getLicense() const override { return "ISC"; }
uint32_t getVersion() const override { return d_version(1, 0, 0); } uint32_t getVersion() const override { return d_version(1, 0, 0); }
int64_t getUniqueId() const override { return d_cconst('P', 'h', 'e', 'r'); } int64_t getUniqueId() const override { return d_cconst('P', 'f', 'a', 'u'); }
// Initialisation // Initialisation
void initAudioPort(bool input, uint32_t index, AudioPort &port) override; void initAudioPort(bool input, uint32_t index, AudioPort &port) override;
@ -85,8 +85,8 @@ class Chassis : public Plugin {
void setParameterValue(uint32_t index, float value) override; void setParameterValue(uint32_t index, float value) override;
float getParameterValue(uint32_t index) const override; float getParameterValue(uint32_t index) const override;
void initProgramName(uint32_t index, String &programName) override; // void initProgramName(uint32_t index, String &programName) override;
void loadProgram(uint32_t index) override; // void loadProgram(uint32_t index) override;
// Processing // Processing
void activate() override; void activate() override;
@ -101,7 +101,7 @@ class Chassis : public Plugin {
double sampleRate; double sampleRate;
uint32_t lastEvent; uint32_t lastEvent;
// Voice voice[NUM_VOICES]; // Voice voice[NUM_VOICES];
uint8_t vPtr = 0; uint8_t vPtr;
Synth s; Synth s;

View File

@ -26,7 +26,7 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.symbol = "ch_lforate"; parameter.symbol = "ch_lforate";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 48.0f; parameter.ranges.def = 57.0f;
parameter.midiCC = 3; parameter.midiCC = 3;
break; break;
@ -36,7 +36,7 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.symbol = "ch_lfodelay"; parameter.symbol = "ch_lfodelay";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 0.0f; parameter.ranges.def = 45.0f;
parameter.midiCC = 9; parameter.midiCC = 9;
break; break;
@ -45,22 +45,9 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.name = "Range"; parameter.name = "Range";
parameter.symbol = "ch_vcorange"; parameter.symbol = "ch_vcorange";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 2.0f; parameter.ranges.max = 4.0f;
parameter.ranges.def = 1.0f; parameter.ranges.def = 2.0f;
parameter.midiCC = 12; parameter.midiCC = 12;
parameter.enumValues.count = 3;
parameter.enumValues.restrictedMode = true;
{
ParameterEnumerationValue* const enumValues = new ParameterEnumerationValue[3];
enumValues[0].value = 0.0f;
enumValues[0].label = "16'";
enumValues[1].value = 1.0f;
enumValues[1].label = "8'";
enumValues[2].value = 2.0f;
enumValues[2].label = "4'";
parameter.enumValues.values = enumValues;
}
break; break;
case paramVCOLFO: case paramVCOLFO:
@ -69,7 +56,7 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.symbol = "ch_lfo"; parameter.symbol = "ch_lfo";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 10.0f; parameter.ranges.def = 0.0f;
parameter.midiCC = 13; parameter.midiCC = 13;
break; break;
@ -79,29 +66,18 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.symbol = "ch_pwm"; parameter.symbol = "ch_pwm";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 48.0f; parameter.ranges.def = 55.0f;
parameter.midiCC = 14; parameter.midiCC = 14;
break; break;
case paramPWMMode: case paramPWMMode:
parameter.hints = kParameterIsAutomatable | kParameterIsBoolean; parameter.hints = kParameterIsAutomatable | kParameterIsBoolean;
parameter.name = "PWM Mode"; parameter.name = "LFO/Manual";
parameter.symbol = "ch_pwmmode"; parameter.symbol = "ch_pwmmode";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 1.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 1.0f; parameter.ranges.def = 0.0f;
parameter.midiCC = 15; parameter.midiCC = 15;
parameter.enumValues.count = 2;
parameter.enumValues.restrictedMode = true;
{
ParameterEnumerationValue* const enumValues = new ParameterEnumerationValue[2];
enumValues[0].value = 0.0f;
enumValues[0].label = "LFO";
enumValues[1].value = 1.0f;
enumValues[1].label = "MAN";
parameter.enumValues.values = enumValues;
}
break; break;
case paramSaw: case paramSaw:
@ -109,8 +85,8 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.name = "Saw"; parameter.name = "Saw";
parameter.symbol = "ch_saw"; parameter.symbol = "ch_saw";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 1.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 1.0f; parameter.ranges.def = 127.0f;
parameter.midiCC = 17; parameter.midiCC = 17;
break; break;
@ -119,8 +95,8 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.name = "Square"; parameter.name = "Square";
parameter.symbol = "ch_sqr"; parameter.symbol = "ch_sqr";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 1.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 1.0f; parameter.ranges.def = 127.0f;
parameter.midiCC = 16; parameter.midiCC = 16;
break; break;
@ -149,7 +125,7 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.name = "HPF"; parameter.name = "HPF";
parameter.symbol = "ch_hpf"; parameter.symbol = "ch_hpf";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 3.0f; parameter.ranges.max = 4.0f;
parameter.ranges.def = 0.0f; parameter.ranges.def = 0.0f;
parameter.midiCC = 20; parameter.midiCC = 20;
break; break;
@ -160,7 +136,7 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.symbol = "ch_freq"; parameter.symbol = "ch_freq";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 60.0f; parameter.ranges.def = 0.0f;
parameter.midiCC = 74; parameter.midiCC = 74;
break; break;
case paramVCFReso: case paramVCFReso:
@ -173,24 +149,13 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.midiCC = 71; parameter.midiCC = 71;
break; break;
case paramVCFMode: case paramVCFMode:
parameter.hints = kParameterIsAutomatable | kParameterIsInteger; parameter.hints = kParameterIsAutomatable | kParameterIsBoolean;
parameter.name = "Polarity"; parameter.name = "Polarity";
parameter.symbol = "ch_vcfmode"; parameter.symbol = "ch_vcfmode";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 1.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 1.0f; parameter.ranges.def = 0.0f;
parameter.midiCC = 21; parameter.midiCC = 21;
parameter.enumValues.count = 2;
parameter.enumValues.restrictedMode = true;
{
ParameterEnumerationValue* const enumValues = new ParameterEnumerationValue[2];
enumValues[0].value = 0.0f;
enumValues[0].label = "POS";
enumValues[1].value = 1.0f;
enumValues[1].label = "INV";
parameter.enumValues.values = enumValues;
}
break; break;
case paramVCFEnv: case paramVCFEnv:
parameter.hints = kParameterIsAutomatable; parameter.hints = kParameterIsAutomatable;
@ -198,7 +163,7 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.symbol = "ch_vcfenv"; parameter.symbol = "ch_vcfenv";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 46.0f; parameter.ranges.def = 0.0f;
parameter.midiCC = 22; parameter.midiCC = 22;
break; break;
case paramVCFLFO: case paramVCFLFO:
@ -216,7 +181,7 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.symbol = "ch_vcfkey"; parameter.symbol = "ch_vcfkey";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 71.0f; parameter.ranges.def = 0.0f;
parameter.midiCC = 24; parameter.midiCC = 24;
break; break;
@ -226,7 +191,7 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.symbol = "ch_attack"; parameter.symbol = "ch_attack";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 27.0f; parameter.ranges.def = 59.0f;
parameter.midiCC = 73; parameter.midiCC = 73;
break; break;
@ -236,7 +201,7 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.symbol = "ch_decay"; parameter.symbol = "ch_decay";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 57.0f; parameter.ranges.def = 32.0f;
parameter.midiCC = 75; parameter.midiCC = 75;
break; break;
@ -246,7 +211,7 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.symbol = "ch_sustain"; parameter.symbol = "ch_sustain";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 57.0f; parameter.ranges.def = 86.0f;
parameter.midiCC = 27; parameter.midiCC = 27;
break; break;
@ -256,28 +221,18 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.symbol = "ch_release"; parameter.symbol = "ch_release";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 48.0f; parameter.ranges.def = 40.0f;
parameter.midiCC = 72; parameter.midiCC = 72;
break; break;
case paramEnvGate: case paramEnvGate:
parameter.hints = kParameterIsAutomatable | kParameterIsInteger; // | kParameterIsBoolean; parameter.hints = kParameterIsAutomatable | kParameterIsBoolean;
parameter.name = "Env-Gate"; parameter.name = "Env / Gate";
parameter.symbol = "ch_envgate"; parameter.symbol = "ch_envgate";
parameter.ranges.min = 0.0f; parameter.ranges.min = 0.0f;
parameter.ranges.max = 1.0f; parameter.ranges.max = 127.0f;
parameter.ranges.def = 1.0f; parameter.ranges.def = 0.0f;
parameter.midiCC = 25; parameter.midiCC = 25;
parameter.enumValues.count = 2;
parameter.enumValues.restrictedMode = true;
{
ParameterEnumerationValue* const enumValues = new ParameterEnumerationValue[2];
enumValues[0].value = 0.0f;
enumValues[0].label = "ENV";
enumValues[1].value = 1.0f;
enumValues[1].label = "GATE";
parameter.enumValues.values = enumValues;
}
break; break;
case paramVCALevel: case paramVCALevel:
@ -366,16 +321,16 @@ void Chassis::setParameterValue(uint32_t index, float value) {
case paramVCORange: // bits 0-2 of switch 1 case paramVCORange: // bits 0-2 of switch 1
// doesn't look great in Carla because of odd behaviour with small integer knobs // doesn't look great in Carla because of odd behaviour with small integer knobs
s.patchRam.switch1 &= 0xf8; s.patchRam.switch1 &= 0xf8;
s.patchRam.switch1 |= (1 << (int)(value - 1)); s.patchRam.switch1 |= (1 << (int)value);
break; break;
case paramSqr: // bit 3 of switch 1 case paramSqr: // bit 3 of switch 1
s.patchRam.switch1 &= 0xf7; s.patchRam.switch1 &= 0xf7;
s.patchRam.switch1 |= (value >= 0.5) << 3; s.patchRam.switch1 |= (value > 63) << 3;
break; break;
case paramSaw: // bit 4 of switch 1 case paramSaw: // bit 4 of switch 1
s.patchRam.switch1 &= 0xef; s.patchRam.switch1 &= 0xef;
s.patchRam.switch1 |= (value >= 0.5) << 4; s.patchRam.switch1 |= (value > 63) << 4;
break; break;
// missing chorus switch // missing chorus switch
@ -383,23 +338,23 @@ void Chassis::setParameterValue(uint32_t index, float value) {
// switch 2 params // switch 2 params
case paramPWMMode: // bit 0 of switch 2 case paramPWMMode: // bit 0 of switch 2
s.patchRam.switch2 &= 0xfe; s.patchRam.switch2 &= 0xfe;
s.patchRam.switch2 |= (value >= 0.5); s.patchRam.switch2 |= (value > 63);
break; break;
case paramVCFMode: // bit 1 of switch 2 case paramVCFMode: // bit 1 of switch 2
s.patchRam.switch2 &= 0xfd; s.patchRam.switch2 &= 0xfd;
s.patchRam.switch2 |= (value >= 0.5) << 1; s.patchRam.switch2 |= (value > 63) << 1;
break; break;
case paramEnvGate: case paramEnvGate:
s.patchRam.switch2 &= 0xfb; s.patchRam.switch2 &= 0xfb;
s.patchRam.switch2 |= (value >= 0.5) << 2; s.patchRam.switch2 |= (value > 63) << 2;
break; break;
case paramHPF: // bits 3-4 of switch 2 case paramHPF: // bits 3-4 of switch 2
// doesn't look great in Carla because of odd behaviour with small integer knobs // doesn't look great in Carla because of odd behaviour with small integer knobs
if (value > 3) value = 3; if (value > 3) value = 3;
s.patchRam.switch2 &= 0xf3; s.patchRam.switch2 &= 0xf3;
s.patchRam.switch2 |= (int)value << 3; s.patchRam.switch2 |= (int)value << 2;
break; break;
case paramModWheel: case paramModWheel:
@ -409,70 +364,15 @@ void Chassis::setParameterValue(uint32_t index, float value) {
} }
float Chassis::getParameterValue(uint32_t index) const { float Chassis::getParameterValue(uint32_t index) const {
switch (index) { // printf("getparametervalue %d\n", index);
case paramLFORate:
return s.patchRam.lfoRate;
break;
case paramLFODelay:
return s.patchRam.lfoDelay;
break;
case paramVCORange:
// FIXME this needs to be better generally
switch (s.patchRam.switch1 & 0x07) {
case 1:
return 0;
break;
case 4:
return 2;
break;
default:
return 1;
}
break;
case paramVCOLFO:
return s.patchRam.vcoLfo;
break;
case paramPWMLFO:
return s.patchRam.pwmLfo * 1.27f;
break;
case paramPWMMode: switch (index) {
return (s.patchRam.switch2 & 0x01) != 0;
break;
case paramSaw: case paramSaw:
return (s.patchRam.switch1 & 0x10) != 0; return (s.patchRam.switch1 & 0x10) ? 127.0f : 0.0f;
break; break;
case paramSqr: case paramSqr:
return (s.patchRam.switch1 & 0x08) != 0; return (s.patchRam.switch1 & 0x08) ? 127.0f : 0.0f;
case paramSub:
return s.patchRam.sub;
break; break;
case paramNoise:
return s.patchRam.noise;
break;
case paramHPF:
return (s.patchRam.switch2 & 0x18) >> 3;
break;
case paramVCFFreq:
return s.patchRam.vcfFreq;
break;
case paramVCFReso:
return s.patchRam.vcfReso;
break;
case paramVCFEnv:
return s.patchRam.vcfEnv;
break;
case paramVCFLFO:
return s.patchRam.vcfLfo;
break;
case paramVCFKey:
return s.patchRam.vcfKey;
break;
case paramVCFMode:
return (s.patchRam.switch2 & 0x02) != 0;
break;
case paramAttack: case paramAttack:
return s.patchRam.env_a; return s.patchRam.env_a;
break; break;
@ -485,13 +385,6 @@ float Chassis::getParameterValue(uint32_t index) const {
case paramRelease: case paramRelease:
return s.patchRam.env_r; return s.patchRam.env_r;
break; break;
case paramEnvGate:
return (s.patchRam.switch2 & 0x04) != 0;
case paramVCALevel:
return s.patchRam.vca;
break;
} }
return 0; return 0;
} }

View File

@ -1,157 +0,0 @@
#pragma once
#include <stdint.h>
#include <string>
#include "DistrhoPlugin.hpp"
const std::string patchName[] = {
"Brass Set 1", "Brass Swell", "Trumpet", "Flutes", "Moving Strings", "Brass & Strings", "Choir", "Piano I",
"Organ I", "Organ II", "Combo Organ", "Calliope", "Donald Pluck", "Celeste* (1 oct.up)", "Elect. Piano I",
"Elect. Piano II", "Clock Chimes* (1 oct. up)", "Steel Drums", "Xylophone", "Brass III", "Fanfare", "String III",
"Pizzicato", "High Strings", "Bass clarinet", "English Horn", "Brass Ensemble", "Guitar", "Koto", "Dark Pluck",
"Funky I", "Synth Bass I (unison)", "Lead I", "Lead II", "Lead III", "Funky II", "Synth Bass II", "Funky III",
"Thud Wah", "Going Up", "Piano II", "Clav", "Frontier Organ", "Snare Drum (unison)", "Tom Toms (unison)",
"Timpani (unison)", "Shaker", "Synth Pad", "Sweep I", "Pluck Sweep", "Repeater", "Sweep II", "Pluck Bell",
"Dark Synth Piano", "Sustainer", "Wah Release", "Gong (play low chords)", "Resonance Funk",
"Drum Booms* (1 oct. down)", "Dust Storm", "Rocket Men", "Hand Claps", "FX Sweep", "Caverns", "Strings",
"Violin", "Chorus Vibes", "Organ 1", "Harpsichord 1", "Recorder", "Perc. Pluck", "Noise Sweep", "Space Chimes",
"Nylon Guitar", "Orchestral Pad", "Bright Pluck", "Organ Bell", "Accordion", "FX Rise 1", "FX Rise 2", "Brass",
"Helicopter", "Lute", "Chorus Funk", "Tomita", "FX Sweep 1", "Sharp Reed", "Bass Pluck", "Resonant Rise",
"Harpsichord 2", "Dark Ensemble", "Contact Wah", "Noise Sweep 2", "Glassy Wah", "Phase Ensemble", "Chorused Bell",
"Clav", "Organ 2", "Bassoon", "Auto Release Noise Sweep", "Brass Ensemble", "Ethereal", "Chorus Bell 2",
"Blizzard", "E. Piano with Tremolo", "Clarinet", "Thunder", "Reedy Organ", "Flute / Horn", "Toy Rhodes",
"Surf's Up", "OW Bass", "Piccolo", "Melodic Taps", "Meow Brass", "Violin (high)", "High Bells", "Rolling Wah",
"Ping Bell", "Brassy Organ", "Low Dark Strings", "Piccolo Trumpet", "Cello", "High Strings", "Rocket Men",
"Forbidden Planet", "Froggy", "Owgan"};
const uint8_t patchData[128][18] = {
{0x14, 0x31, 0x00, 0x66, 0x00, 0x23, 0x0d, 0x3a, 0x00, 0x56, 0x6c, 0x03, 0x31, 0x2d, 0x20, 0x00, 0x51, 0x11},
{0x06, 0x30, 0x00, 0x38, 0x00, 0x2b, 0x11, 0x1a, 0x00, 0x54, 0x4b, 0x40, 0x76, 0x26, 0x25, 0x46, 0x52, 0x19},
{0x34, 0x2d, 0x08, 0x66, 0x00, 0x37, 0x22, 0x18, 0x01, 0x3b, 0x7f, 0x05, 0x42, 0x30, 0x10, 0x00, 0x32, 0x09},
{0x3c, 0x2b, 0x01, 0x00, 0x00, 0x37, 0x20, 0x0a, 0x0b, 0x29, 0x7f, 0x17, 0x51, 0x00, 0x12, 0x00, 0x32, 0x01},
{0x3f, 0x00, 0x00, 0x27, 0x00, 0x4d, 0x14, 0x04, 0x00, 0x6f, 0x22, 0x0d, 0x57, 0x58, 0x23, 0x0e, 0x1a, 0x10},
{0x23, 0x00, 0x00, 0x38, 0x00, 0x4c, 0x11, 0x04, 0x00, 0x29, 0x4e, 0x2c, 0x42, 0x35, 0x2c, 0x17, 0x49, 0x18},
{0x3b, 0x0e, 0x0d, 0x19, 0x00, 0x3b, 0x5e, 0x02, 0x00, 0x3e, 0x7f, 0x44, 0x0b, 0x7f, 0x30, 0x00, 0x4a, 0x09},
{0x14, 0x31, 0x00, 0x50, 0x00, 0x41, 0x0c, 0x0a, 0x00, 0x1b, 0x67, 0x00, 0x42, 0x00, 0x1e, 0x56, 0x2a, 0x11},
{0x36, 0x0f, 0x00, 0x35, 0x00, 0x2b, 0x4c, 0x0e, 0x01, 0x7f, 0x64, 0x00, 0x0a, 0x52, 0x00, 0x17, 0x29, 0x1c},
{0x2c, 0x0f, 0x00, 0x35, 0x00, 0x35, 0x4c, 0x0e, 0x01, 0x55, 0x4a, 0x00, 0x0a, 0x52, 0x00, 0x3a, 0x4a, 0x1c},
{0x4b, 0x15, 0x09, 0x39, 0x00, 0x3f, 0x46, 0x04, 0x00, 0x6d, 0x60, 0x00, 0x30, 0x2b, 0x2e, 0x3d, 0x2c, 0x0d},
{0x52, 0x28, 0x0b, 0x00, 0x00, 0x57, 0x1b, 0x11, 0x00, 0x38, 0x59, 0x07, 0x7f, 0x7f, 0x06, 0x30, 0x4a, 0x0b},
{0x4c, 0x15, 0x09, 0x39, 0x00, 0x49, 0x69, 0x0f, 0x00, 0x4e, 0x52, 0x02, 0x05, 0x2b, 0x0a, 0x7f, 0x2c, 0x07},
{0x1c, 0x00, 0x00, 0x00, 0x00, 0x21, 0x18, 0x36, 0x00, 0x26, 0x60, 0x00, 0x2c, 0x00, 0x51, 0x0f, 0x2c, 0x19},
{0x3b, 0x00, 0x00, 0x00, 0x00, 0x10, 0x1f, 0x3d, 0x06, 0x23, 0x7f, 0x01, 0x55, 0x2b, 0x28, 0x00, 0x29, 0x01},
{0x00, 0x00, 0x00, 0x47, 0x00, 0x32, 0x45, 0x07, 0x00, 0x50, 0x66, 0x00, 0x44, 0x00, 0x16, 0x00, 0x49, 0x11},
{0x3b, 0x00, 0x00, 0x00, 0x16, 0x2c, 0x7f, 0x00, 0x00, 0x7f, 0x68, 0x00, 0x30, 0x00, 0x33, 0x7f, 0x44, 0x1b},
{0x21, 0x35, 0x00, 0x20, 0x09, 0x47, 0x2e, 0x1a, 0x00, 0x7f, 0x7f, 0x00, 0x1a, 0x00, 0x25, 0x21, 0x4a, 0x1b},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x18, 0x36, 0x00, 0x33, 0x7f, 0x00, 0x1d, 0x1d, 0x26, 0x0f, 0x2c, 0x19},
{0x34, 0x14, 0x00, 0x23, 0x00, 0x42, 0x18, 0x0b, 0x00, 0x0c, 0x7f, 0x3a, 0x64, 0x5e, 0x25, 0x16, 0x52, 0x19},
{0x2f, 0x00, 0x00, 0x46, 0x00, 0x2c, 0x00, 0x20, 0x00, 0x43, 0x21, 0x48, 0x68, 0x4b, 0x31, 0x32, 0x59, 0x18},
{0x30, 0x1b, 0x00, 0x66, 0x00, 0x47, 0x0e, 0x00, 0x00, 0x54, 0x49, 0x3f, 0x1f, 0x7f, 0x2d, 0x00, 0x1a, 0x10},
{0x3c, 0x12, 0x00, 0x66, 0x00, 0x42, 0x02, 0x05, 0x00, 0x2a, 0x7f, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x5a, 0x00},
{0x3a, 0x0e, 0x00, 0x66, 0x00, 0x54, 0x08, 0x02, 0x00, 0x47, 0x4d, 0x12, 0x2c, 0x7f, 0x28, 0x00, 0x0c, 0x08},
{0x34, 0x2d, 0x08, 0x00, 0x00, 0x30, 0x24, 0x19, 0x08, 0x3a, 0x68, 0x0b, 0x4b, 0x00, 0x19, 0x00, 0x29, 0x11},
{0x2f, 0x2d, 0x09, 0x66, 0x00, 0x46, 0x30, 0x07, 0x00, 0x1b, 0x7f, 0x08, 0x51, 0x1a, 0x10, 0x00, 0x2a, 0x01},
{0x34, 0x2d, 0x00, 0x66, 0x00, 0x2e, 0x2c, 0x1d, 0x01, 0x3b, 0x67, 0x10, 0x67, 0x61, 0x22, 0x1f, 0x52, 0x11},
{0x56, 0x3a, 0x00, 0x41, 0x00, 0x0c, 0x0f, 0x47, 0x00, 0x1e, 0x60, 0x00, 0x34, 0x36, 0x1f, 0x00, 0x39, 0x11},
{0x5a, 0x1c, 0x00, 0x5e, 0x00, 0x28, 0x3a, 0x1d, 0x00, 0x4b, 0x7f, 0x00, 0x38, 0x00, 0x27, 0x02, 0x4a, 0x01},
{0x1f, 0x00, 0x00, 0x57, 0x00, 0x26, 0x3d, 0x1b, 0x00, 0x47, 0x5a, 0x00, 0x34, 0x0f, 0x3f, 0x61, 0x0a, 0x19},
{0x04, 0x00, 0x00, 0x49, 0x00, 0x1f, 0x17, 0x33, 0x00, 0x29, 0x47, 0x00, 0x1e, 0x24, 0x02, 0x40, 0x59, 0x1d},
{0x3a, 0x10, 0x01, 0x39, 0x32, 0x20, 0x00, 0x42, 0x00, 0x23, 0x4b, 0x00, 0x22, 0x00, 0x24, 0x66, 0x29, 0x19},
{0x48, 0x58, 0x12, 0x00, 0x00, 0x28, 0x61, 0x24, 0x00, 0x34, 0x63, 0x00, 0x2d, 0x49, 0x00, 0x00, 0x2a, 0x1d},
{0x18, 0x58, 0x00, 0x35, 0x00, 0x2d, 0x00, 0x2b, 0x00, 0x34, 0x38, 0x01, 0x17, 0x5b, 0x4b, 0x4f, 0x39, 0x14},
{0x56, 0x47, 0x15, 0x66, 0x00, 0x3c, 0x1f, 0x12, 0x01, 0x4c, 0x7f, 0x00, 0x42, 0x30, 0x0b, 0x00, 0x32, 0x15},
{0x04, 0x00, 0x00, 0x30, 0x00, 0x05, 0x17, 0x51, 0x00, 0x29, 0x64, 0x00, 0x1e, 0x27, 0x02, 0x39, 0x4a, 0x15},
{0x5a, 0x15, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x2f, 0x00, 0x00, 0x4e, 0x00, 0x25, 0x09, 0x16, 0x2d, 0x31, 0x1c},
{0x04, 0x00, 0x00, 0x09, 0x65, 0x26, 0x36, 0x2d, 0x00, 0x0a, 0x4f, 0x00, 0x18, 0x00, 0x02, 0x7f, 0x39, 0x1d},
{0x3e, 0x00, 0x00, 0x66, 0x08, 0x4e, 0x59, 0x22, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x66, 0x2d, 0x20, 0x1a, 0x1a},
{0x00, 0x00, 0x00, 0x64, 0x1c, 0x4f, 0x7f, 0x25, 0x00, 0x41, 0x4b, 0x00, 0x6c, 0x12, 0x7f, 0x00, 0x22, 0x13},
{0x01, 0x00, 0x00, 0x48, 0x00, 0x2f, 0x00, 0x27, 0x00, 0x05, 0x4e, 0x00, 0x62, 0x00, 0x20, 0x73, 0x2a, 0x10},
{0x42, 0x0f, 0x01, 0x66, 0x00, 0x07, 0x0b, 0x56, 0x02, 0x00, 0x78, 0x00, 0x27, 0x30, 0x0e, 0x00, 0x49, 0x15},
{0x4f, 0x0f, 0x03, 0x55, 0x00, 0x45, 0x36, 0x00, 0x00, 0x34, 0x7f, 0x00, 0x00, 0x7f, 0x00, 0x1d, 0x2a, 0x1c},
{0x34, 0x1b, 0x00, 0x00, 0x5b, 0x5e, 0x0b, 0x11, 0x00, 0x00, 0x65, 0x00, 0x19, 0x00, 0x1e, 0x40, 0x22, 0x11},
{0x3e, 0x10, 0x08, 0x00, 0x7f, 0x35, 0x04, 0x28, 0x00, 0x15, 0x65, 0x00, 0x1e, 0x0f, 0x28, 0x3a, 0x21, 0x18},
{0x00, 0x00, 0x00, 0x23, 0x7f, 0x19, 0x00, 0x36, 0x00, 0x18, 0x7f, 0x01, 0x38, 0x1a, 0x47, 0x2f, 0x21, 0x11},
{0x15, 0x47, 0x00, 0x3a, 0x7f, 0x59, 0x2d, 0x01, 0x11, 0x50, 0x7f, 0x0a, 0x09, 0x00, 0x00, 0x00, 0x22, 0x01},
{0x38, 0x00, 0x05, 0x2b, 0x00, 0x25, 0x00, 0x54, 0x00, 0x7f, 0x33, 0x00, 0x55, 0x4b, 0x3e, 0x25, 0x0a, 0x18},
{0x4e, 0x00, 0x00, 0x66, 0x1c, 0x73, 0x28, 0x43, 0x00, 0x00, 0x61, 0x00, 0x3f, 0x7f, 0x52, 0x2a, 0x0c, 0x12},
{0x44, 0x30, 0x00, 0x44, 0x00, 0x3c, 0x6f, 0x09, 0x06, 0x62, 0x2d, 0x00, 0x5b, 0x00, 0x4d, 0x7d, 0x1a, 0x08},
{0x4d, 0x14, 0x09, 0x65, 0x00, 0x61, 0x1e, 0x38, 0x00, 0x39, 0x57, 0x0e, 0x00, 0x29, 0x00, 0x2c, 0x4a, 0x17},
{0x58, 0x48, 0x0f, 0x61, 0x00, 0x42, 0x66, 0x44, 0x00, 0x46, 0x65, 0x00, 0x59, 0x35, 0x4e, 0x30, 0x4a, 0x19},
{0x33, 0x00, 0x05, 0x11, 0x00, 0x27, 0x00, 0x31, 0x00, 0x7f, 0x31, 0x00, 0x55, 0x4b, 0x35, 0x31, 0x0c, 0x18},
{0x7f, 0x00, 0x00, 0x00, 0x00, 0x38, 0x56, 0x06, 0x00, 0x47, 0x4f, 0x00, 0x2f, 0x00, 0x32, 0x7f, 0x1a, 0x1a},
{0x47, 0x00, 0x05, 0x2e, 0x00, 0x27, 0x00, 0x54, 0x00, 0x7f, 0x39, 0x00, 0x55, 0x4b, 0x46, 0x31, 0x2a, 0x18},
{0x59, 0x0e, 0x01, 0x19, 0x00, 0x48, 0x58, 0x13, 0x00, 0x42, 0x68, 0x00, 0x54, 0x00, 0x1d, 0x57, 0x0a, 0x13},
{0x7f, 0x00, 0x00, 0x66, 0x38, 0x46, 0x6b, 0x05, 0x00, 0x48, 0x5b, 0x03, 0x30, 0x7f, 0x62, 0x00, 0x49, 0x13},
{0x3b, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x7f, 0x2d, 0x00, 0x59, 0x7f, 0x00, 0x13, 0x00, 0x16, 0x00, 0x21, 0x11},
{0x00, 0x00, 0x00, 0x66, 0x7f, 0x2a, 0x00, 0x22, 0x00, 0x3a, 0x7f, 0x00, 0x24, 0x0f, 0x31, 0x2e, 0x21, 0x19},
{0x00, 0x00, 0x00, 0x00, 0x7f, 0x34, 0x55, 0x00, 0x2c, 0x5e, 0x7f, 0x58, 0x5b, 0x1c, 0x55, 0x00, 0x21, 0x11},
{0x08, 0x20, 0x00, 0x66, 0x61, 0x49, 0x72, 0x08, 0x00, 0x38, 0x7f, 0x00, 0x59, 0x7f, 0x68, 0x00, 0x24, 0x03},
{0x3b, 0x00, 0x00, 0x00, 0x7f, 0x11, 0x58, 0x36, 0x00, 0x37, 0x7f, 0x01, 0x0b, 0x00, 0x08, 0x00, 0x21, 0x05},
{0x7f, 0x41, 0x74, 0x66, 0x7f, 0x47, 0x2c, 0x53, 0x00, 0x5e, 0x7f, 0x00, 0x5e, 0x00, 0x70, 0x7f, 0x29, 0x12},
{0x00, 0x00, 0x00, 0x66, 0x7f, 0x44, 0x76, 0x00, 0x00, 0x45, 0x6b, 0x00, 0x0d, 0x26, 0x2f, 0x00, 0x21, 0x08},
{0x39, 0x2d, 0x00, 0x37, 0x00, 0x55, 0x00, 0x00, 0x00, 0x6c, 0x34, 0x3b, 0x20, 0x56, 0x28, 0x00, 0x1a, 0x18},
{0x42, 0x2d, 0x14, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x78, 0x6e, 0x2b, 0x2d, 0x39, 0x1a, 0x00, 0x32, 0x18},
{0x48, 0x2d, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x3b, 0x00, 0x17, 0x58, 0x00, 0x59, 0x2f, 0x4a, 0x00, 0x4a, 0x19},
{0x2d, 0x2a, 0x00, 0x49, 0x00, 0x3c, 0x48, 0x0e, 0x00, 0x7f, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x61, 0x0a, 0x1d},
{0x17, 0x00, 0x00, 0x36, 0x00, 0x7f, 0x7f, 0x5a, 0x00, 0x56, 0x7d, 0x00, 0x3c, 0x00, 0x1f, 0x23, 0x2c, 0x00},
{0x4e, 0x00, 0x00, 0x08, 0x00, 0x06, 0x00, 0x2e, 0x00, 0x7f, 0x7f, 0x05, 0x15, 0x7f, 0x1e, 0x00, 0x2a, 0x11},
{0x3e, 0x26, 0x08, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x49, 0x41, 0x00, 0x10, 0x4e, 0x74, 0x00, 0x4a, 0x19},
{0x7f, 0x00, 0x00, 0x00, 0x7f, 0x02, 0x00, 0x4d, 0x00, 0x68, 0x5c, 0x0e, 0x4e, 0x6c, 0x78, 0x00, 0x21, 0x18},
{0x63, 0x00, 0x00, 0x00, 0x00, 0x46, 0x7f, 0x00, 0x00, 0x4a, 0x55, 0x00, 0x19, 0x00, 0x3c, 0x00, 0x4c, 0x18},
{0x48, 0x2d, 0x00, 0x1d, 0x00, 0x39, 0x00, 0x1a, 0x00, 0x19, 0x73, 0x00, 0x59, 0x00, 0x20, 0x00, 0x2a, 0x01},
{0x16, 0x2d, 0x00, 0x69, 0x00, 0x21, 0x00, 0x37, 0x00, 0x24, 0x00, 0x1d, 0x58, 0x32, 0x34, 0x7f, 0x1a, 0x18},
{0x00, 0x00, 0x00, 0x3a, 0x00, 0x39, 0x00, 0x28, 0x00, 0x56, 0x68, 0x00, 0x19, 0x2a, 0x2c, 0x00, 0x2a, 0x11},
{0x4e, 0x00, 0x06, 0x44, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x7f, 0x3e, 0x00, 0x00, 0x7f, 0x1a, 0x55, 0x5a, 0x19},
{0x00, 0x00, 0x00, 0x40, 0x00, 0x4d, 0x00, 0x0e, 0x00, 0x4a, 0x42, 0x08, 0x0b, 0x6e, 0x09, 0x50, 0x5a, 0x01},
{0x74, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x7f, 0x10, 0x7f, 0x40, 0x00, 0x00, 0x00, 0x7f, 0x54, 0x00, 0x44, 0x1a},
{0x6c, 0x00, 0x00, 0x00, 0x00, 0x5e, 0x7f, 0x50, 0x17, 0x7f, 0x00, 0x00, 0x7f, 0x33, 0x47, 0x00, 0x02, 0x1a},
{0x33, 0x7f, 0x00, 0x49, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x7f, 0x48, 0x03, 0x2c, 0x33, 0x0b, 0x00, 0x52, 0x1c},
{0x6a, 0x00, 0x00, 0x30, 0x00, 0x52, 0x05, 0x5d, 0x7f, 0x00, 0x48, 0x00, 0x00, 0x23, 0x4c, 0x7f, 0x0a, 0x1b},
{0x34, 0x00, 0x02, 0x69, 0x00, 0x1d, 0x00, 0x23, 0x00, 0x56, 0x7f, 0x00, 0x30, 0x22, 0x57, 0x00, 0x2a, 0x19},
{0x4d, 0x5e, 0x00, 0x49, 0x00, 0x2f, 0x22, 0x35, 0x00, 0x41, 0x2a, 0x00, 0x0b, 0x22, 0x00, 0x4f, 0x5a, 0x1d},
{0x4e, 0x00, 0x00, 0x69, 0x00, 0x31, 0x7d, 0x0f, 0x02, 0x7f, 0x39, 0x00, 0x0e, 0x4f, 0x00, 0x00, 0x24, 0x1f},
{0x7f, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x7f, 0x10, 0x4c, 0x40, 0x00, 0x00, 0x00, 0x7f, 0x55, 0x00, 0x44, 0x18},
{0x15, 0x00, 0x00, 0x49, 0x00, 0x21, 0x00, 0x35, 0x00, 0x41, 0x37, 0x02, 0x12, 0x70, 0x00, 0x00, 0x3c, 0x1c},
{0x00, 0x00, 0x00, 0x3c, 0x00, 0x25, 0x1d, 0x1c, 0x00, 0x2b, 0x5c, 0x00, 0x2a, 0x23, 0x00, 0x00, 0x39, 0x18},
{0x34, 0x00, 0x0f, 0x00, 0x00, 0x42, 0x6b, 0x1f, 0x00, 0x49, 0x3e, 0x00, 0x34, 0x27, 0x00, 0x00, 0x11, 0x1e},
{0x00, 0x00, 0x00, 0x69, 0x00, 0x7f, 0x5f, 0x00, 0x00, 0x7f, 0x6b, 0x00, 0x2d, 0x00, 0x00, 0x23, 0x3c, 0x11},
{0x00, 0x00, 0x00, 0x39, 0x00, 0x37, 0x00, 0x00, 0x00, 0x6b, 0x43, 0x15, 0x00, 0x7f, 0x23, 0x4b, 0x5a, 0x1b},
{0x4e, 0x00, 0x00, 0x51, 0x00, 0x3d, 0x65, 0x2e, 0x00, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x17},
{0x7f, 0x00, 0x00, 0x00, 0x7f, 0x7f, 0x00, 0x53, 0x00, 0x68, 0x74, 0x7f, 0x4f, 0x1a, 0x53, 0x00, 0x44, 0x1a},
{0x00, 0x5e, 0x00, 0x1c, 0x00, 0x18, 0x22, 0x3d, 0x00, 0x41, 0x70, 0x06, 0x12, 0x32, 0x26, 0x00, 0x2a, 0x19},
{0x0b, 0x2d, 0x05, 0x69, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x7f, 0x63, 0x54, 0x2d, 0x39, 0x31, 0x00, 0x0a, 0x18},
{0x00, 0x0b, 0x00, 0x69, 0x00, 0x3b, 0x7f, 0x00, 0x00, 0x7f, 0x3e, 0x00, 0x3e, 0x00, 0x39, 0x65, 0x4c, 0x18},
{0x32, 0x0b, 0x00, 0x5b, 0x00, 0x20, 0x00, 0x3f, 0x00, 0x00, 0x6c, 0x00, 0x2b, 0x37, 0x00, 0x07, 0x29, 0x09},
{0x51, 0x00, 0x00, 0x68, 0x00, 0x36, 0x6a, 0x07, 0x00, 0x7f, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x1d},
{0x54, 0x26, 0x09, 0x5a, 0x00, 0x23, 0x00, 0x2b, 0x09, 0x62, 0x7f, 0x05, 0x7f, 0x6a, 0x02, 0x00, 0x29, 0x01},
{0x7f, 0x00, 0x00, 0x00, 0x7f, 0x7f, 0x00, 0x7f, 0x00, 0x68, 0x6b, 0x00, 0x4f, 0x39, 0x53, 0x00, 0x44, 0x1a},
{0x19, 0x5e, 0x00, 0x49, 0x00, 0x2f, 0x22, 0x23, 0x00, 0x41, 0x27, 0x06, 0x44, 0x43, 0x26, 0x00, 0x5a, 0x18},
{0x45, 0x00, 0x00, 0x69, 0x00, 0x2f, 0x78, 0x00, 0x00, 0x7f, 0x3c, 0x5c, 0x32, 0x7f, 0x37, 0x3b, 0x1a, 0x18},
{0x48, 0x2d, 0x00, 0x1d, 0x00, 0x00, 0x66, 0x3e, 0x00, 0x5a, 0x1e, 0x00, 0x75, 0x00, 0x78, 0x00, 0x5a, 0x19},
{0x01, 0x00, 0x00, 0x69, 0x7f, 0x38, 0x59, 0x07, 0x26, 0x79, 0x7f, 0x4e, 0x62, 0x57, 0x4e, 0x00, 0x24, 0x00},
{0x2c, 0x00, 0x00, 0x15, 0x00, 0x16, 0x00, 0x23, 0x07, 0x6b, 0x67, 0x00, 0x41, 0x3c, 0x62, 0x7f, 0x2c, 0x10},
{0x45, 0x16, 0x09, 0x00, 0x00, 0x23, 0x00, 0x2b, 0x07, 0x62, 0x68, 0x05, 0x7f, 0x6a, 0x07, 0x00, 0x2a, 0x01},
{0x7f, 0x00, 0x00, 0x00, 0x7f, 0x02, 0x00, 0x4d, 0x00, 0x68, 0x6b, 0x00, 0x16, 0x6c, 0x78, 0x00, 0x21, 0x18},
{0x23, 0x12, 0x00, 0x49, 0x00, 0x21, 0x00, 0x35, 0x00, 0x41, 0x45, 0x03, 0x2c, 0x6d, 0x00, 0x00, 0x2a, 0x1c},
{0x22, 0x00, 0x00, 0x3b, 0x00, 0x19, 0x00, 0x2a, 0x00, 0x41, 0x16, 0x15, 0x49, 0x47, 0x30, 0x00, 0x19, 0x18},
{0x1e, 0x2d, 0x7f, 0x00, 0x00, 0x3a, 0x7f, 0x00, 0x00, 0x7f, 0x6b, 0x00, 0x59, 0x00, 0x27, 0x00, 0x24, 0x00},
{0x01, 0x00, 0x00, 0x69, 0x7f, 0x54, 0x0b, 0x00, 0x31, 0x36, 0x4b, 0x21, 0x61, 0x7f, 0x79, 0x00, 0x24, 0x0a},
{0x32, 0x00, 0x00, 0x32, 0x00, 0x3f, 0x54, 0x41, 0x00, 0x7f, 0x46, 0x7f, 0x00, 0x6b, 0x00, 0x2f, 0x39, 0x1f},
{0x46, 0x1c, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x3f, 0x10, 0x62, 0x57, 0x10, 0x67, 0x6a, 0x15, 0x00, 0x3c, 0x09},
{0x63, 0x00, 0x00, 0x00, 0x7f, 0x48, 0x70, 0x00, 0x00, 0x7f, 0x7f, 0x00, 0x18, 0x00, 0x18, 0x00, 0x41, 0x00},
{0x33, 0x7f, 0x00, 0x49, 0x00, 0x2d, 0x64, 0x23, 0x00, 0x41, 0x54, 0x04, 0x5a, 0x00, 0x1b, 0x00, 0x32, 0x1c},
{0x47, 0x2d, 0x16, 0x00, 0x00, 0x59, 0x00, 0x00, 0x03, 0x78, 0x55, 0x2b, 0x2d, 0x39, 0x1a, 0x00, 0x34, 0x18},
{0x1e, 0x2d, 0x7f, 0x00, 0x00, 0x4c, 0x7f, 0x00, 0x00, 0x7f, 0x6f, 0x00, 0x16, 0x34, 0x3b, 0x00, 0x24, 0x00},
{0x24, 0x00, 0x00, 0x69, 0x00, 0x3c, 0x09, 0x00, 0x7f, 0x00, 0x4d, 0x22, 0x37, 0x7f, 0x69, 0x00, 0x2a, 0x18},
{0x00, 0x0b, 0x00, 0x68, 0x00, 0x4c, 0x7f, 0x00, 0x00, 0x7f, 0x53, 0x00, 0x17, 0x17, 0x39, 0x00, 0x4c, 0x18},
{0x10, 0x00, 0x00, 0x44, 0x00, 0x08, 0x00, 0x57, 0x00, 0x34, 0x0e, 0x00, 0x24, 0x6d, 0x00, 0x38, 0x59, 0x18},
{0x15, 0x2d, 0x05, 0x51, 0x00, 0x47, 0x00, 0x00, 0x00, 0x67, 0x28, 0x53, 0x17, 0x6d, 0x2a, 0x00, 0x19, 0x18},
{0x33, 0x7f, 0x00, 0x49, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x7f, 0x61, 0x03, 0x2c, 0x33, 0x0b, 0x00, 0x32, 0x1c},
{0x39, 0x2d, 0x15, 0x00, 0x00, 0x4b, 0x00, 0x03, 0x01, 0x2d, 0x6d, 0x30, 0x41, 0x5a, 0x22, 0x00, 0x31, 0x18},
{0x50, 0x00, 0x0a, 0x46, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x47, 0x30, 0x1b, 0x39, 0x39, 0x29, 0x00, 0x1c, 0x18},
{0x6c, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x7f, 0x50, 0x3f, 0x7f, 0x00, 0x00, 0x7f, 0x33, 0x59, 0x00, 0x02, 0x1a},
{0x32, 0x0b, 0x00, 0x2c, 0x00, 0x1d, 0x04, 0x58, 0x05, 0x5f, 0x4f, 0x00, 0x30, 0x17, 0x2a, 0x09, 0x4c, 0x01},
{0x4e, 0x00, 0x00, 0x00, 0x00, 0x37, 0x7f, 0x2b, 0x00, 0x7f, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x29, 0x17},
{0x32, 0x00, 0x00, 0x2d, 0x00, 0x26, 0x54, 0x20, 0x00, 0x7f, 0x65, 0x00, 0x31, 0x37, 0x00, 0x38, 0x39, 0x19}};

View File

@ -36,10 +36,13 @@ static inline float poly3blep1(float t) {
void Voice::run(Synth &s, float *buffer, uint32_t samples) { void Voice::run(Synth &s, float *buffer, uint32_t samples) {
float y, out, t; float y, out, t;
// 325, because it needs PW to be from 0 to 0.5
// but really the control range is limited from 0 to 100
// there's a resistor on the panel board to sprag the range
float pw = s.ff4f / 32768.0f; float pw = s.ff4f / 32768.0f;
float fb, res = s.patchRam.vcfReso / 28.0f; // guess float fb, res = s.patchRam.vcfReso / 28.0f; // guess
//float cut = s.patchRam.vcfFreq / 400.0f; // guess
float cut = 248.0f * (powf(2,(vcfenv-0x1880)/1143.0f)); float cut = 248.0f * (powf(2,(vcfenv-0x1880)/1143.0f));
// now radians // now radians
@ -100,7 +103,7 @@ void Voice::run(Synth &s, float *buffer, uint32_t samples) {
out = y; out = y;
// widthDelay = pw; // widthDelay = pw;
out *= 0.707; //out *= 0.5;
for (uint8_t ovs = 0; ovs < 4; ovs++) { for (uint8_t ovs = 0; ovs < 4; ovs++) {
fb = b4; fb = b4;
@ -115,11 +118,11 @@ void Voice::run(Synth &s, float *buffer, uint32_t samples) {
b4 = ((b3 - b4) * cut) + b4; b4 = ((b3 - b4) * cut) + b4;
} }
vr58c106 += ((vcaEnv - vr58c106) * 0.005); vr58c106 += ((vcaEnv - vr58c106) * 0.0075);
lastpw = pw; lastpw = pw;
out = b4 * (0.25); out = b4 * (0.2);
buffer[i] += (gain * out * vr58c106); buffer[i] += (gain * b4 * vr58c106);
} }
} }

View File

@ -112,24 +112,24 @@ class Synth {
// the comments indicate what the defaults are set to // the comments indicate what the defaults are set to
// in the routine at 02c2h, in case they're important // in the routine at 02c2h, in case they're important
struct { struct {
uint8_t lfoRate = 0x30; // lookup value defaults to 0x0200 uint8_t lfoRate = 57; // lookup value defaults to 0x0200
uint8_t lfoDelay = 0x00; uint8_t lfoDelay = 45;
uint8_t vcoLfo = 0x0a; uint8_t vcoLfo = 0;
uint8_t pwmLfo = 0x30; uint8_t pwmLfo = 55;
uint8_t noise = 0x00; uint8_t noise = 0;
uint8_t vcfFreq = 0x3c; // 0x3f80 uint8_t vcfFreq = 85; // 0x3f80
uint8_t vcfReso = 0x00; uint8_t vcfReso = 0;
uint8_t vcfEnv = 0x2e; uint8_t vcfEnv = 0;
uint8_t vcfLfo = 0; uint8_t vcfLfo = 0;
uint8_t vcfKey = 0x47; uint8_t vcfKey = 108;
uint8_t vca = 0x28; uint8_t vca = 52;
uint8_t env_a = 0x1b; uint8_t env_a = 59;
uint8_t env_d = 0x39; uint8_t env_d = 32;
uint8_t env_s = 0x39; // 0x3f80 uint8_t env_s = 86; // 0x3f80
uint8_t env_r = 0x30; uint8_t env_r = 40;
uint8_t sub = 0x00; uint8_t sub = 0;
uint8_t switch1 = 0x1a; uint8_t switch1 = 26;
uint8_t switch2 = 0x18; uint8_t switch2 = 24;
} patchRam; } patchRam;
float pitchCV[104]; float pitchCV[104];

View File

@ -329,7 +329,7 @@ h04ac: // pitch too high
void Voice::calcFilter(Synth &s) { void Voice::calcFilter(Synth &s) {
// 04d5 // 04d5
uint16_t a, bc, ea, tos; uint16_t a, bc, ea, hl, tos;
goto h04d5; goto h04d5;