Midi export from MPTM produces slightly incorrect results

Started by Timekiller, April 18, 2020, 23:23:59

Previous topic - Next topic

Timekiller

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!

Saga Musix

Welcome to the forums and thanks for taking the time to report this issue. It happens in a situation like this:
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.
» 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.

Saga Musix

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.

Timekiller

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.

Saga Musix

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.

Timekiller

Quote from: Saga Musix 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.

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