Author Topic: Midi export from MPTM produces slightly incorrect results  (Read 485 times)

Offline Timekiller

  • Shy artist
  • Posts: 3
Hello!

I have a weird problem when converting mptm module to a midi file. It's a progression of piano chords, and I want the notes to end up on a single channel; however, when I export it to "channel 1", some notes have "SC0" effect applied to them. See rows 36 and 100 in the attached files.

This problem doesn't seem to happen if I let it map piano to "Melodic(any)", since the chords just spread over 4 channels normally, but this melody is actually a part of a bigger project with a lot of instruments, so I'd rather keep it to a single channel with polyphony.

Version used:
OpenMPT amd64 (64 bit) Version 1.28.10.00
Also the same happens on  1.28.09.00

I'm rather new to this, so I might be doing something wrong. Any help is appreciated!

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,955
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Midi export from MPTM produces slightly incorrect results
« Reply #1 on: April 19, 2020, 12:17:11 »
Welcome to the forums and thanks for taking the time to report this issue. It happens in a situation like this:
Code: [Select]
ModPlug Tracker MPT
|F-401v34...|A#401v34...
|A#401v45...|D-501v45...
As you can see, the A#4 "moves" one channel to the left. As channels are evaluated left-to-right, the new A#4 on the second row is triggered before the old A#4 is released. This causes the old note-off cutting off the new note directly (at least in MIDI implementations that do not support the same note being played more than once on a channel, like OpenMPT's MIDI import).

As a temporary fix, you can either
- reorder the notes so that the situation above is not present
- export each channel to its own MIDI channel (i.e. set to "Melodic (any)") and merge the channels in another tool.

OpenMPT already handles this note-off situation correctly when sending events to VST plugins, so I guess it should be fixable in MIDI export too.
« Last Edit: April 19, 2020, 16:06:06 by Saga Musix »
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,955
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Midi export from MPTM produces slightly incorrect results
« Reply #2 on: April 19, 2020, 16:10:29 »
r12688 / OpenMPT 1.29.00.53 should fix this issue (and hopefully not break anything else in MIDI export). You will be able to download it from https://builds.openmpt.org/builds/ in the next few hours. Please let me know how export works for you now.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Timekiller

  • Shy artist
  • Posts: 3
Re: Midi export from MPTM produces slightly incorrect results
« Reply #3 on: April 19, 2020, 17:09:20 »
Wow, that was a fast response, thanks! I'll let you know as soon as I test it.

Also, I know it's bad practice to ask different questions in the same report, but it's visible in the example above, so might as well. I've noticed that "set volume" command values differ significantly in the mptm and the resulting midi; is that by design? It seems they are recalculated relatively to v64 or something. Couldn't find anything with quick search, and it's a bit hard to tell by ear.

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,955
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Midi export from MPTM produces slightly incorrect results
« Reply #4 on: April 19, 2020, 18:04:45 »
When importing MIDI, OpenMPT always squares the volume because most MIDI gear uses logarithmic volume and OpenMPT's volume column is linear; however on export the volume is not converted from linear to logarithmic, which explains the behaviour your are seeing. This is happening for a variety of reasons, among others is that OpenMPT sends volume the same way to VST instruments. I suppose one way to fix this could be to offer the user to export logarithmic volume rather than linear. As I rarely use the feature myself, it's hard to estimate for me what would be the most useful.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Timekiller

  • Shy artist
  • Posts: 3
Re: Midi export from MPTM produces slightly incorrect results
« Reply #5 on: April 21, 2020, 02:25:27 »
r12688 / OpenMPT 1.29.00.53 should fix this issue (and hopefully not break anything else in MIDI export). You will be able to download it from https://builds.openmpt.org/builds/ in the next few hours. Please let me know how export works for you now.

Just checked the export using 1.29.00.53 r12736, everything seems fine now. Thanks!