aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2021-08-02 19:32:00 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2021-08-02 19:32:00 +0800
commitc3a84c9b5f3c3a9b95f95b1d6693ef186cf0fa7d (patch)
treedd3c22e3a9b81cb82e8617a2838b5e0a74fc2858
parent63fb9a66ed871f367467c7d8b707f4c4a7273a6b (diff)
downloadoddities-c3a84c9b5f3c3a9b95f95b1d6693ef186cf0fa7d.tar.xz
Fix sample mapping.
-rw-r--r--music/it2midi.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/music/it2midi.cpp b/music/it2midi.cpp
index ca00515..f31c8b2 100644
--- a/music/it2midi.cpp
+++ b/music/it2midi.cpp
@@ -651,6 +651,7 @@ class ITConverter
if(mask>>2&1)//vol
{
if(vol<=64)par->chvelm[ch]=(vol==64?127:2*vol);
+ if(par->chvelm[ch]==0)par->chvelm[ch]=1;
else if(vol>=128&&vol<=192)
{
par->chpanm[ch]=(vol==192?127:(vol-128)*2);
@@ -663,10 +664,15 @@ class ITConverter
//default volume
uint32_t curnote=par->chnote[ch];
if(mask>>0&1)curnote=note;
- if(curnote<120)
- par->chvelm[ch]=par->c.sample[par->c.instr[par->chinst[ch]].sampleref[curnote]-1].defvol*2;
+ if(curnote<120 && curnote>=12)
+ par->chvelm[ch]=par->c.sample[par->c.instr[par->chinst[ch]].sampleref[curnote-12]-1].defvol*2;
if(par->chvelm[ch]>127)
par->chvelm[ch]=127;
+ if(par->chvelm[ch]==0)
+ {
+ //printf("!!!!inst %d samp %d note %d def vol %d\n",par->chinst[ch],par->c.instr[par->chinst[ch]].sampleref[curnote]-1,curnote,par->c.sample[par->c.instr[par->chinst[ch]].sampleref[curnote]-1].defvol*2);
+ par->chvelm[ch]=1;
+ }
}
if((mask>>0&1)&&note<120&&!((mask>>3&1)&&efx==7))//reset for pitch slides (E/F, but not G)
{