Several fixes for adapting transpose to the patched engines.

pull/2/head
Holger Wirtz 7 years ago
parent 8efb5f4406
commit 71c42214d9
  1. 2
      src/Dexed.ttl
  2. 12
      src/dexed.cpp
  3. 2
      src/dexed.h
  4. 2
      src/dexed_ttl.h

@ -488,7 +488,7 @@ The original engine comes from MSFA (music synthesizer for android) which is bas
lv2:index 28 ; lv2:index 28 ;
lv2:symbol "transpose" ; lv2:symbol "transpose" ;
lv2:name "MIDDLE C" ; lv2:name "MIDDLE C" ;
lv2:default 24 ; lv2:default 12 ;
lv2:minimum 0 ; lv2:minimum 0 ;
lv2:maximum 48 ; lv2:maximum 48 ;
lv2:portProperty lv2:integer ; lv2:portProperty lv2:integer ;

@ -133,13 +133,11 @@ Dexed::~Dexed()
{ {
TRACE("Hi"); TRACE("Hi");
TRACE("0");
if(outbuf_) 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) if(voices[note].dx7_note)
@ -148,16 +146,12 @@ Dexed::~Dexed()
} }
} }
TRACE("2");
if(engineMsfa) if(engineMsfa)
delete(engineMsfa); delete(engineMsfa);
TRACE("3");
if(engineOpl) if(engineOpl)
delete(engineOpl); delete(engineOpl);
TRACE("4");
if(engineMkI) if(engineMkI)
delete(engineMkI); delete(engineMkI);
TRACE("5");
TRACE("Bye"); TRACE("Bye");
TRACE("--------------------------------------------------------------------------------"); TRACE("--------------------------------------------------------------------------------");
@ -664,7 +658,7 @@ TRACE("pitch=%d, velo=%d\n",pitch,velo);
return; return;
} }
pitch += data[144] - 24; pitch += data[144] - 12;
uint8_t note = currentNote; uint8_t note = currentNote;
uint8_t keydown_counter=0; uint8_t keydown_counter=0;
@ -716,7 +710,7 @@ void Dexed::keyup(uint8_t pitch) {
TRACE("Hi"); TRACE("Hi");
TRACE("pitch=%d\n",pitch); TRACE("pitch=%d\n",pitch);
pitch += data[144] - 24; pitch += data[144] - 12;
uint8_t note; uint8_t note;
for (note=0; note<max_notes; ++note) { for (note=0; note<max_notes; ++note) {
@ -742,7 +736,7 @@ TRACE("pitch=%d\n",pitch);
} }
} }
if ( highNote != -1 ) { if ( highNote != -1 && voices[note].live ) {
voices[note].live = false; voices[note].live = false;
voices[target].live = true; voices[target].live = true;
voices[target].dx7_note->transferState(*voices[note].dx7_note); voices[target].dx7_note->transferState(*voices[note].dx7_note);

@ -132,7 +132,7 @@ class Dexed : public lvtk::Synth<DexedVoice, Dexed>
94, 67, 95, 60, 50, 50, 50, 50, 94, 67, 95, 60, 50, 50, 50, 50,
04, 06, 00, 04, 06, 00,
34, 33, 00, 00, 00, 04, 34, 33, 00, 00, 00, 04,
03, 24, 03, 12, // TRSPS
00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
01, 00, 99, 00, 99, 00, 99, 00, 99, 00, 01, 00, 99, 00, 99, 00, 99, 00, 99, 00,
00, 00,

@ -221,7 +221,7 @@ static const peg_data_t p_ports[] = {
{ 0, 99, 0, 0, 1, 0 }, { 0, 99, 0, 0, 1, 0 },
{ 0, 1, 0, 1, 1, 0 }, { 0, 1, 0, 1, 1, 0 },
{ 0, 5, 4, 0, 1, 0 }, { 0, 5, 4, 0, 1, 0 },
{ 0, 48, 24, 0, 1, 0 }, { 0, 48, 12, 0, 1, 0 },
{ 0, 7, 3, 0, 1, 0 }, { 0, 7, 3, 0, 1, 0 },
{ 0, 99, 94, 0, 1, 0 }, { 0, 99, 94, 0, 1, 0 },
{ 0, 99, 67, 0, 1, 0 }, { 0, 99, 67, 0, 1, 0 },

Loading…
Cancel
Save