modwheel
This commit is contained in:
parent
af49dcf7b6
commit
f8d07cfa3d
@ -39,8 +39,8 @@ void Chassis::activate() {
|
||||
// calculate filter coefficients and stuff
|
||||
printf("called activate()\n");
|
||||
|
||||
for (uint8_t i=0; i<104; i++) {
|
||||
s.pitchCV[i] = (261.63 * powf(2, (i-24) / 12.0f)) / sampleRate;
|
||||
for (uint8_t i = 0; i < 104; i++) {
|
||||
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++) {
|
||||
s.voice[i].calcPitch(s);
|
||||
|
||||
switch(s.patchRam.switch1 & 0x03) {
|
||||
case 1: s.voice[i].omega /= 4; break;
|
||||
case 2: s.voice[i].omega /= 2;
|
||||
default: break;
|
||||
switch (s.patchRam.switch1 & 0x03) {
|
||||
case 1:
|
||||
s.voice[i].omega /= 4;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -61,6 +61,8 @@ class Chassis : public Plugin {
|
||||
paramSustain,
|
||||
paramRelease,
|
||||
|
||||
paramModWheel,
|
||||
|
||||
parameterCount
|
||||
};
|
||||
|
||||
|
@ -244,6 +244,16 @@ void Chassis::initParameter(uint32_t index, Parameter ¶meter) {
|
||||
parameter.ranges.def = 40.0f;
|
||||
parameter.midiCC = 26;
|
||||
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
|
||||
}
|
||||
@ -265,7 +275,7 @@ void Chassis::setParameterValue(uint32_t index, float value) {
|
||||
s.patchRam.vcoLfo = value;
|
||||
break;
|
||||
case paramPWMLFO:
|
||||
s.patchRam.pwmLfo = value/1.27;
|
||||
s.patchRam.pwmLfo = value / 1.27;
|
||||
break;
|
||||
case paramSub:
|
||||
s.patchRam.sub = value;
|
||||
@ -307,7 +317,6 @@ void Chassis::setParameterValue(uint32_t index, float value) {
|
||||
s.patchRam.env_r = value;
|
||||
break;
|
||||
|
||||
|
||||
// switch 1 params
|
||||
case paramVCORange: // bits 0-2 of switch 1
|
||||
// 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 |= (int)value << 2;
|
||||
break;
|
||||
|
||||
case paramModWheel:
|
||||
s.ff64 = (int)value << 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,6 +107,7 @@ class Synth {
|
||||
uint32_t framesLeft = 0;
|
||||
|
||||
bool keyon;
|
||||
uint8_t ff63 = 0;
|
||||
|
||||
// RAM from ff00h to ffffh is cleared to zero
|
||||
// this is in the startup routine at 0280h
|
||||
@ -122,7 +123,7 @@ class Synth {
|
||||
uint8_t ff64 = 0; // LFO mod sens amount
|
||||
uint8_t ff6e = 0; // fractional pitch temp
|
||||
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
|
||||
// this struct contains the bytes that make up a Juno 106 patch in
|
||||
|
Loading…
Reference in New Issue
Block a user