This commit is contained in:
Gordon JC Pearce 2024-09-09 14:05:43 +01:00
parent af49dcf7b6
commit f8d07cfa3d
4 changed files with 34 additions and 14 deletions

View File

@ -39,8 +39,8 @@ void Chassis::activate() {
// calculate filter coefficients and stuff // calculate filter coefficients and stuff
printf("called activate()\n"); printf("called activate()\n");
for (uint8_t i=0; i<104; i++) { for (uint8_t i = 0; i < 104; i++) {
s.pitchCV[i] = (261.63 * powf(2, (i-24) / 12.0f)) / sampleRate; s.pitchCV[i] = (261.63 * powf(2, (i - 24) / 12.0f)) / sampleRate;
} }
} }
@ -132,13 +132,17 @@ void Chassis::run(const float **, float **outputs, uint32_t frames, const MidiEv
for (uint32_t i = 0; i < NUM_VOICES; i++) { for (uint32_t i = 0; i < NUM_VOICES; i++) {
s.voice[i].calcPitch(s); s.voice[i].calcPitch(s);
switch(s.patchRam.switch1 & 0x03) { switch (s.patchRam.switch1 & 0x03) {
case 1: s.voice[i].omega /= 4; break; case 1:
case 2: s.voice[i].omega /= 2; s.voice[i].omega /= 4;
default: break; break;
case 2:
s.voice[i].omega /= 2;
default:
break;
} }
//printf("voice %d note = %02x ff71 = %04x\n",i, s.voice[i].note, s.voice[i].ff71 ); // printf("voice %d note = %02x ff71 = %04x\n",i, s.voice[i].note, s.voice[i].ff71 );
s.voice[i].gate(s); s.voice[i].gate(s);
} }
} }

View File

@ -61,6 +61,8 @@ class Chassis : public Plugin {
paramSustain, paramSustain,
paramRelease, paramRelease,
paramModWheel,
parameterCount parameterCount
}; };

View File

@ -244,6 +244,16 @@ void Chassis::initParameter(uint32_t index, Parameter &parameter) {
parameter.ranges.def = 40.0f; parameter.ranges.def = 40.0f;
parameter.midiCC = 26; parameter.midiCC = 26;
break; break;
case paramModWheel:
parameter.hints = kParameterIsAutomatable | kParameterIsHidden;
parameter.name = "Mod wheel";
parameter.symbol = "ch_modwheel";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 127.0f;
parameter.ranges.def = 0.0f;
parameter.midiCC = 1;
break;
} }
// chorus, porta, bend range, key mode still to do // chorus, porta, bend range, key mode still to do
} }
@ -265,7 +275,7 @@ void Chassis::setParameterValue(uint32_t index, float value) {
s.patchRam.vcoLfo = value; s.patchRam.vcoLfo = value;
break; break;
case paramPWMLFO: case paramPWMLFO:
s.patchRam.pwmLfo = value/1.27; s.patchRam.pwmLfo = value / 1.27;
break; break;
case paramSub: case paramSub:
s.patchRam.sub = value; s.patchRam.sub = value;
@ -307,7 +317,6 @@ void Chassis::setParameterValue(uint32_t index, float value) {
s.patchRam.env_r = value; s.patchRam.env_r = value;
break; break;
// switch 1 params // switch 1 params
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
@ -347,6 +356,10 @@ void Chassis::setParameterValue(uint32_t index, float value) {
s.patchRam.switch2 &= 0xf3; s.patchRam.switch2 &= 0xf3;
s.patchRam.switch2 |= (int)value << 2; s.patchRam.switch2 |= (int)value << 2;
break; break;
case paramModWheel:
s.ff64 = (int)value << 1;
break;
} }
} }

View File

@ -107,6 +107,7 @@ class Synth {
uint32_t framesLeft = 0; uint32_t framesLeft = 0;
bool keyon; bool keyon;
uint8_t ff63 = 0;
// RAM from ff00h to ffffh is cleared to zero // RAM from ff00h to ffffh is cleared to zero
// this is in the startup routine at 0280h // this is in the startup routine at 0280h
@ -122,7 +123,7 @@ class Synth {
uint8_t ff64 = 0; // LFO mod sens amount uint8_t ff64 = 0; // LFO mod sens amount
uint8_t ff6e = 0; // fractional pitch temp uint8_t ff6e = 0; // fractional pitch temp
uint16_t ff6f = 0; // computed pitch amount uint16_t ff6f = 0; // computed pitch amount
//uint16_t ff71 = 0; // unsure, to do with pitch // uint16_t ff71 = 0; // unsure, to do with pitch
// okay, not the greatest, this right here // okay, not the greatest, this right here
// this struct contains the bytes that make up a Juno 106 patch in // this struct contains the bytes that make up a Juno 106 patch in