Author Topic: MO3 trashes MIDI macros  (Read 12280 times)

saga

  • Posts: 2748
MO3 trashes MIDI macros
« on: 11 Sep '11 - 19:03 »
Hi Ian,
I think there's a big problem with either MO3 or UNMO3 (I guess it's the former, but I really do hope it's not) concerning MIDI macros. If you read Impulse Tracker's MIDI.TXT carefully, you can see that MIDI macros can contain several variables, not only the "z" variable - those variables are (in lower-case) a,b,c,n,p,u,v,x,y,z. Compliant trackers / players should subsitute them by the appropriate content when parsing the macro. Upper-case letters A-F are constants.
What's the problem? Well, if you take a macro that has upper-case letters A-F (f.e. by simply taking the default resonance macros in the Z80-Z8F range), the resonance parameter (last two characters of the macro) are converted to lower case when converting the file back to IT with UNMO3. That is not correct. The default resonance macros have no variables in them, so they should be completely upper-case.
Now, when converting the attached IT file to MO3 and opening it with OpenMPT 1.19, it sounds OK, as OpenMPT 1.19 and older only handle the "z" variable and interpret all other characters als constants, but with the upcoming OpenMPT 1.20's new macro system (which can handle all variables, not just z), the resonance macros (in the Z80-ZFF range) are broken. If the letters are indeed stored as lower-case in the MO3 files, I'd suggest to cast them to upper-case in UNMO3.EXE/DLL, so that compliant applications can handle the macros correctly.

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: MO3 trashes MIDI macros
« Reply #1 on: 12 Sep '11 - 17:15 »
The MIDI macros are actually stored in numerical form in MO3, but UNMO3 was indeed converting them back to string form in lowercase. Here's an update to try...

   www.un4seen.com/stuff/unmo3.exe

Let me know if there is still a problem with it.

saga

  • Posts: 2748
Re: MO3 trashes MIDI macros
« Reply #2 on: 12 Sep '11 - 18:32 »
Thanks, that seems to work. Can I now have an updated unmo3.dll as well, please? :)

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: MO3 trashes MIDI macros
« Reply #3 on: 13 Sep '11 - 14:15 »
Yep, here you go...

   www.un4seen.com/stuff/unmo3dll.zip

Let me know if any more dodginess shows up :)