Fixed initialization of pitch-bend.

Added opSwitch to the controllers and changed controller code for this.
pull/1/head
Holger Wirtz 8 years ago
parent f77c154c69
commit fb64a8b33f
  1. 9
      src/dexed.cpp
  2. 7
      src/msfa/controllers.h
  3. 3
      src/msfa/dx7note.cc

@ -48,13 +48,15 @@ Dexed::Dexed(double rate) : lvtk::Synth<DexedVoice, Dexed>(p_n_ports, p_midi_in)
} }
currentNote = 0; currentNote = 0;
memset(&controllers.values_, 0, sizeof(controllers.values_));
controllers.values_[kControllerPitch] = 0x2000; controllers.values_[kControllerPitch] = 0x2000;
controllers.values_[kControllerPitchRange] = data[156];
controllers.values_[kControllerPitchStep] = data[157];
controllers.modwheel_cc = 0; controllers.modwheel_cc = 0;
controllers.foot_cc = 0; controllers.foot_cc = 0;
controllers.breath_cc = 0; controllers.breath_cc = 0;
controllers.aftertouch_cc = 0; controllers.aftertouch_cc = 0;
controllers.masterTune=0; controllers.masterTune=0;
controllers.opSwitch=0;
bufsize_=256; bufsize_=256;
@ -694,7 +696,7 @@ void Dexed::onParam(uint8_t param_num,float param_val)
_param_change_counter++; _param_change_counter++;
if(param_num==144 || param_num==134) if(param_num==144 || param_num==134 || param_num==155)
panic(); panic();
refreshVoice=true; refreshVoice=true;
@ -703,6 +705,9 @@ void Dexed::onParam(uint8_t param_num,float param_val)
switch(param_num) switch(param_num)
{ {
case 155:
controllers.opSwitch=data[param_num];
break;
case 156: case 156:
controllers.values_[kControllerPitchRange]=data[param_num]; controllers.values_[kControllerPitchRange]=data[param_num];
break; break;

@ -76,9 +76,7 @@ class Controllers {
} }
public: public:
int32_t values_[16]; int32_t values_[3];
char opSwitch[7];
int amp_mod; int amp_mod;
int pitch_mod; int pitch_mod;
@ -91,6 +89,8 @@ public:
int masterTune; int masterTune;
uint8_t opSwitch;
FmMod wheel; FmMod wheel;
FmMod foot; FmMod foot;
FmMod breath; FmMod breath;
@ -100,7 +100,6 @@ public:
amp_mod = 0; amp_mod = 0;
pitch_mod = 0; pitch_mod = 0;
eg_mod = 0; eg_mod = 0;
strcpy(opSwitch, "111111");
} }
void refresh() { void refresh() {

@ -216,7 +216,8 @@ void Dx7Note::compute(int32_t *buf, int32_t lfo_val, int32_t lfo_delay, const Co
// ==== OP RENDER ==== // ==== OP RENDER ====
for (int op = 0; op < 6; op++) { for (int op = 0; op < 6; op++) {
if ( ctrls->opSwitch[op] == '0' ) { //if ( ctrls->opSwitch[op] == '0' ) {
if ( ctrls->opSwitch & (1<<op) ) {
env_[op].getsample(); // advance the envelop even if it is not playing env_[op].getsample(); // advance the envelop even if it is not playing
params_[op].level_in = 0; params_[op].level_in = 0;
} else { } else {

Loading…
Cancel
Save