Several fixes:

- MW/AT/FC/BC should now work.
- Fix for avoid crashing at removing plugin.
pull/2/head
Holger Wirtz 7 years ago
parent 5feb790b60
commit 58f8f4c3f8
  1. 35
      src/dexed.cpp
  2. 14
      src/msfa/controllers.h

@ -133,29 +133,31 @@ Dexed::~Dexed()
{ {
TRACE("Hi"); TRACE("Hi");
if(outbuf_!=NULL) TRACE("0");
if(outbuf_)
delete [] outbuf_; delete [] outbuf_;
currentNote = -1; currentNote = -1;
TRACE("1");
for (uint8_t note = 0; note < MAX_ACTIVE_NOTES; ++note) for (uint8_t note = 0; note < MAX_ACTIVE_NOTES; ++note)
{ {
if ( voices[note].dx7_note != NULL ) if(voices[note].dx7_note)
{ {
delete voices[note].dx7_note; delete voices[note].dx7_note;
voices[note].dx7_note = NULL;
} }
voices[note].keydown = false;
voices[note].sustained = false;
voices[note].live = false;
} }
TRACE("2");
if(engineMsfa) if(engineMsfa)
delete(engineMkI); delete(engineMsfa);
TRACE("3");
if(engineOpl) if(engineOpl)
delete(engineMkI); delete(engineOpl);
TRACE("4");
if(engineMkI) if(engineMkI)
delete(engineMkI); delete(engineMkI);
TRACE("5");
TRACE("Bye"); TRACE("Bye");
TRACE("--------------------------------------------------------------------------------"); TRACE("--------------------------------------------------------------------------------");
@ -784,29 +786,44 @@ void Dexed::onParam(uint8_t param_num,float param_val)
controllers.values_[kControllerPitchStep]=data[param_num]; controllers.values_[kControllerPitchStep]=data[param_num];
break; break;
case 157: case 157:
TRACE("wheel.setRange(%d)",data[param_num]);
controllers.wheel.setRange(data[param_num]); controllers.wheel.setRange(data[param_num]);
controllers.wheel.setTarget(data[param_num+1]);
controllers.refresh();
break; break;
case 158: case 158:
controllers.wheel.setRange(data[param_num-1]);
controllers.wheel.setTarget(data[param_num]); controllers.wheel.setTarget(data[param_num]);
controllers.refresh();
break; break;
case 159: case 159:
controllers.foot.setRange(data[param_num]); controllers.foot.setRange(data[param_num]);
controllers.foot.setTarget(data[param_num+1]);
controllers.refresh();
break; break;
case 160: case 160:
controllers.foot.setRange(data[param_num-1]);
controllers.foot.setTarget(data[param_num]); controllers.foot.setTarget(data[param_num]);
controllers.refresh();
break; break;
case 161: case 161:
controllers.breath.setRange(data[param_num]); controllers.breath.setRange(data[param_num]);
controllers.breath.setTarget(data[param_num+1]);
controllers.refresh();
break; break;
case 162: case 162:
controllers.breath.setRange(data[param_num-1]);
controllers.breath.setTarget(data[param_num]); controllers.breath.setTarget(data[param_num]);
controllers.refresh();
break; break;
case 163: case 163:
controllers.at.setRange(data[param_num]); controllers.at.setRange(data[param_num]);
controllers.at.setTarget(data[param_num+1]);
controllers.refresh();
break; break;
case 164: case 164:
controllers.at.setRange(data[param_num-1]);
controllers.at.setTarget(data[param_num]); controllers.at.setTarget(data[param_num]);
controllers.refresh();
break; break;
case 165: case 165:
tune=param_val*0x4000; tune=param_val*0x4000;

@ -52,13 +52,13 @@ struct FmMod {
} }
void setTarget(uint8_t assign) { void setTarget(uint8_t assign) {
TRACE("Target: %d", assign);
assign=assign < 0 && assign > 7 ? 0 : assign; assign=assign < 0 && assign > 7 ? 0 : assign;
if(assign&1) // AMP pitch=assign&1; // AMP
pitch=true; amp=assign&2; // PITCH
if(assign&2) // PITCH eg=assign&4; // EG
amp=true;
if(assign&4) // EG TRACE("pitch[%d] amp[%d] eg[%d]", pitch,amp,eg);
eg=true;
} }
}; };
@ -115,8 +115,6 @@ public:
if ( ! ((wheel.eg || foot.eg) || (breath.eg || at.eg)) ) if ( ! ((wheel.eg || foot.eg) || (breath.eg || at.eg)) )
eg_mod = 127; eg_mod = 127;
TRACE("amp_mod %d pitch_mod %d", amp_mod, pitch_mod);
} }
FmCore *core; FmCore *core;

Loading…
Cancel
Save