|
|
@ -49,27 +49,27 @@ Dexed::Dexed(double rate) : lvtk::Synth<DexedVoice, Dexed>(p_n_ports, p_midi_in) |
|
|
|
Env::init_sr(rate); |
|
|
|
Env::init_sr(rate); |
|
|
|
fx.init(rate); |
|
|
|
fx.init(rate); |
|
|
|
|
|
|
|
|
|
|
|
engineMkI=new EngineMkI; |
|
|
|
if((engineMkI=new EngineMkI)==NULL) |
|
|
|
if(!engineMkI) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
TRACE("Cannot not create engine EngineMkI"); |
|
|
|
TRACE("Cannot not create engine EngineMkI"); |
|
|
|
|
|
|
|
exit(400); |
|
|
|
} |
|
|
|
} |
|
|
|
engineOpl=new EngineOpl; |
|
|
|
if((engineOpl=new EngineOpl)==NULL) |
|
|
|
if(!engineOpl) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
TRACE("Cannot not create engine EngineOpl"); |
|
|
|
TRACE("Cannot not create engine EngineOpl"); |
|
|
|
|
|
|
|
exit(401); |
|
|
|
} |
|
|
|
} |
|
|
|
engineMsfa=new FmCore; |
|
|
|
if((engineMsfa=new FmCore)==NULL) |
|
|
|
if(!engineMsfa) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
TRACE("Cannot create engine FmCore"); |
|
|
|
TRACE("Cannot create engine FmCore"); |
|
|
|
|
|
|
|
exit(402); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for(i=0; i<MAX_ACTIVE_NOTES; i++) { |
|
|
|
for(i=0; i<MAX_ACTIVE_NOTES; i++) { |
|
|
|
voices[i].dx7_note = new Dx7Note; |
|
|
|
if((voices[i].dx7_note = new Dx7Note)==NULL) |
|
|
|
if(!voices[i].dx7_note) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
TRACE("Cannot create DX7Note [%d]",i); |
|
|
|
TRACE("Cannot create DX7Note [%d]",i); |
|
|
|
|
|
|
|
exit(403); |
|
|
|
}
|
|
|
|
}
|
|
|
|
voices[i].keydown = false; |
|
|
|
voices[i].keydown = false; |
|
|
|
voices[i].sustained = false; |
|
|
|
voices[i].sustained = false; |
|
|
@ -97,14 +97,15 @@ Dexed::Dexed(double rate) : lvtk::Synth<DexedVoice, Dexed>(p_n_ports, p_midi_in) |
|
|
|
|
|
|
|
|
|
|
|
bufsize_=256; |
|
|
|
bufsize_=256; |
|
|
|
|
|
|
|
|
|
|
|
outbuf_=new float[bufsize_]; |
|
|
|
if((outbuf_=new float[bufsize_])==NULL) |
|
|
|
if(outbuf_) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
TRACE("Cannot create outbuf_ buffer"); |
|
|
|
TRACE("Cannot create outbuf_ buffer"); |
|
|
|
|
|
|
|
exit(404); |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lfo.reset(data+137); |
|
|
|
lfo.reset(data+137); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setMonoMode(false); |
|
|
|
setMonoMode(false); |
|
|
|
|
|
|
|
|
|
|
|
sustain = false; |
|
|
|
sustain = false; |
|
|
@ -126,22 +127,23 @@ Dexed::~Dexed() |
|
|
|
{ |
|
|
|
{ |
|
|
|
TRACE("Hi"); |
|
|
|
TRACE("Hi"); |
|
|
|
|
|
|
|
|
|
|
|
if(outbuf_) |
|
|
|
if(outbuf_!=NULL) |
|
|
|
delete [] outbuf_; |
|
|
|
delete [] outbuf_; |
|
|
|
|
|
|
|
|
|
|
|
for(uint8_t note = 0; note < MAX_ACTIVE_NOTES; ++note) |
|
|
|
currentNote = -1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (uint8_t note = 0; note < MAX_ACTIVE_NOTES; ++note) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(voices[note].dx7_note) |
|
|
|
if ( voices[note].dx7_note != NULL ) |
|
|
|
|
|
|
|
{ |
|
|
|
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; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(engineMkI) |
|
|
|
|
|
|
|
delete(engineMkI); |
|
|
|
|
|
|
|
if(engineOpl) |
|
|
|
|
|
|
|
delete(engineOpl); |
|
|
|
|
|
|
|
if(engineMsfa) |
|
|
|
|
|
|
|
delete(engineMsfa); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TRACE("Bye"); |
|
|
|
TRACE("Bye"); |
|
|
|
TRACE("--------------------------------------------------------------------------------"); |
|
|
|
TRACE("--------------------------------------------------------------------------------"); |
|
|
|
} |
|
|
|
} |
|
|
|