From 63fb9a66ed871f367467c7d8b707f4c4a7273a6b Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Tue, 9 Jun 2020 09:23:28 +0800 Subject: More fix for portamento in it2midi. --- music/it2midi.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/music/it2midi.cpp b/music/it2midi.cpp index 2fe3b26..ca00515 100644 --- a/music/it2midi.cpp +++ b/music/it2midi.cpp @@ -668,7 +668,7 @@ class ITConverter if(par->chvelm[ch]>127) par->chvelm[ch]=127; } - if((mask>>0&1)&¬e<120)//reset for pitch slides (E/F/G) + if((mask>>0&1)&¬e<120&&!((mask>>3&1)&&efx==7))//reset for pitch slides (E/F, but not G) { if(fabs(par->chpitchm[ch])>1e-6) { @@ -750,6 +750,11 @@ class ITConverter par->chefxmem[ch][efx]=fxp; //if(!(mask>>0&1)||note>=120) // puts("no note to slide to?"); + if(par->chnote[ch]>=120)//Gxx without a prior note doesn't seem to have any effect? + { + efx=par->chefxmem[ch][efx]=0; + break; + } par->chportasrcnote[ch]=par->chnote[ch]; par->chportadstnote[ch]=note; } @@ -926,6 +931,10 @@ class ITConverter par->f.tracks[par->minstch[std::make_pair(ch,par->chinst[ch])]]. eventList.push_back(MidiEvent::noteOn(par->curmiditk+notedelay,0,note,par->chvelm[ch])); } + else + { + par->chportadstnote[ch]=note; + } } } } @@ -968,7 +977,7 @@ class ITConverter if(chnote[i]!=255) f.tracks[minstch[std::make_pair(i,chinst[i])]]. eventList.push_back(MidiEvent::noteOff(curmiditk,0,chnote[i])); - f.dumpFile(); + //f.dumpFile(); for(auto i=f.tracks.begin()+1;i!=f.tracks.end();) { bool df=false; -- cgit v1.2.3