diff --git a/configure.py b/configure.py index 3da0b0f0..3dd63f3c 100755 --- a/configure.py +++ b/configure.py @@ -919,10 +919,10 @@ LIBS = [ }, { "lib": "musyx", - #"mw_version": "1.2.5", - #"cflags": "-proc gecko -fp hard -nodefaults -nosyspath -i include -i libc -g -sym on -D_DEBUG=1 -enum int ", - "mw_version": "1.3.2", - "cflags": "$cflags_musyx", + "mw_version": "1.2.5", + "cflags": "-proc gecko -fp hard -nodefaults -nosyspath -i include -i libc -g -sym on -D_DEBUG=1 -enum int ", + #"mw_version": "1.3.2", + #"cflags": "$cflags_musyx", "host": False, "objects": [ "musyx/runtime/seq", @@ -956,6 +956,7 @@ LIBS = [ ["musyx/runtime/StdReverb/reverb", False], ["musyx/runtime/Delay/delay_fx", True], ["musyx/runtime/Chorus/chorus_fx", True], + ["musyx/runtime/profile", True], ], }, { diff --git a/src/musyx/runtime/s_data.c b/src/musyx/runtime/s_data.c index 5b3726d0..8366a9c5 100644 --- a/src/musyx/runtime/s_data.c +++ b/src/musyx/runtime/s_data.c @@ -271,6 +271,7 @@ unsigned long sndPopGroup() { + */ u32 seqPlaySong(u16 sgid, u16 sid, void* arrfile, SND_PLAYPARA* para, u8 irq_call, u8 studio) { diff --git a/src/musyx/runtime/synth_ac.c b/src/musyx/runtime/synth_ac.c index 3d3e4d81..e6ab78cd 100644 --- a/src/musyx/runtime/synth_ac.c +++ b/src/musyx/runtime/synth_ac.c @@ -52,19 +52,22 @@ float tonedown_tab[128] = { s32 sndPitchUpOne(u16 note) { return note * 1.0594631f; } -u32 sndGetPitch(u8 arg0, u32 arg1) { - f32 pitch; - double tmp; - u32 temp_r6; - - if (arg1 == 0xFFFFFFFF) { - arg1 = 0x40005622; +u32 sndGetPitch(u8 key, u32 sInfo) { + u8 okey; // r31 + float frq; // r63 + if (sInfo == 0xffffffff) { + sInfo = 0x40005622; } - pitch = 4096.f; - temp_r6 = (arg1 >> 24); - pitch *= (f32)(arg0 != temp_r6 - ? (f32)((arg1 & 0xFFFFFF) * (temp_r6 < arg0 ? toneup_tab[(arg0 - temp_r6)] - : tonedown_tab[temp_r6 - arg0])) - : (f32)(arg1 & 0xFFFFFF)); - return pitch / synthInfo.mixFrq; + + okey = sInfo >> 24; + + if (key != okey) { + frq = (float)(sInfo & 0xFFFFFF) * + (okey < key ? toneup_tab[key - okey] : tonedown_tab[okey - key]); + + } else { + frq = sInfo & 0xFFFFFF; + } + + return (4096.f * frq) / synthInfo.mixFrq; }