1.32.02, creating and exporting MIDI

Started by Marwellus, August 11, 2025, 12:35:01

Previous topic - Next topic

Marwellus

Hi there,

First off, I'd like to thank the developers working on OpenMPT. As a beginner, it's currently my tool of choice and I'm gradually finding my way around. :-) While I already scan these forums for answers I would appreciate any help more specific to my own, current problems :-)

My background is that I'm currently working on a retro DOS game and want to create MIDI songs for it, specifically for the AWE32. That's a topic in itself, but it's not what I'm getting at here. I want to use OpenMPT specifically to create these MIDI songs and have started with one. Basically, it's a 16-channel MPTM song - I don't need many more channels right now. For this, I've also loaded the same SoundFont in OpenMPT that I use for the AWE32 and mapped it via drag & drop to the instruments I'm using.

This means the instruments are set to MIDI channels (10 for drums, etc.). I'm using far fewer than 16 instruments, so each instrument is set to a specific MIDI channel, with drums naturally set to channel 10. The MIDI channels are not mapped to the tracker channels - they're independent of each other. I've also looked at how other MIDI songs are loaded and configured by OpenMPT, and what their tracks look like, to get an idea of which MIDI "quirks" I should consider. Delay, for example, is quite important - otherwise it won't work.

I'm working my way through all of this. I haven't tried creating MIDI songs before, only have some experience with MOD editors, which is why I came to OpenMPT - it's a tracker that can export MIDIs ;-)

The problem is - even though I explicitly do everything to let OpenMPT know what's what, which instrument I'm using on which MIDI channel, the export still doesn't produce a usable MIDI song. The instruments work fine, that part functions, but the channels get mixed up sometimes, the drums are fully there at first, then disappear completely after a drum roll, the volume control just doesn't fit.

My first question here is - what can and must I still do to make the export understand what to do? Basically, it doesn't need to do anything special or "interpret" anything - it's already a MIDI song. Just keep it straight? I've looked at all the options related to MIDI and tried various things, but it tends to get worse rather than better.

To be frank: does the export really work, or is it more of a "work-in-progress" feature that only gets developed when someone feels like it? More of a "nice-to-have-but-it-still-doesn't-work-as-intended"? (no offense meant)

When I load the exported MIDI song back into OpenMPT, by the way, things get really wild. That doesn't correspond to what even the Windows MIDI player plays anymore.

The thing is, I don't really want to work with DAWs - their complexity is a topic in itself. All I want is to build a few simple MIDI songs without a lot of fuss around it, to be played by an AWE32. Is this ultimately possible with OpenMPT, or not?

I'm willing to work through everything, but I also need to know if it's worth it in this case ;-)

Thanks! :-)

Saga Musix

#1
Welcome to the forums.

This would be a lot easier to analyze with an example file, so please cut down your problematic file as much as possible (remove parts that don't contribute to the problem, etc.) so that we can look at it. If MIDI channels have been specified correctly (double-check also in the export window), there should be no such issues.

QuoteTo be frank: does the export really work, or is it more of a "work-in-progress" feature that only gets developed when someone feels like it? More of a "nice-to-have-but-it-still-doesn't-work-as-intended"? (no offense meant)
There may always be unknown issues, as well as known limitations (perfect MOD to MIDI conversions are simply not possible), but general, you won't find any half-finished features in OpenMPT. Either the feature is considered to be done or it's not released to the public.
» 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.

Marwellus

Hi and thanks,

I've attached a zip, it includes the mptm-file, it's nothing special, more like a (short) test song. To shrink its size I switched all instruments to the default "MIDI Library" (I think OpenMPT came with it). For convinience it also includes the exported MIDI song.

I get that I'm actually creating a mod song in OpenMPT and if I listen to it it gets played like a mod song. The export then "recreates" the entire song as MIDI, interpreting the data from this mod song. And this is quite tricky, I can imagine, MIDI is a beast for itself.

I took a deeper look into the exported MIDI myself now and for what I can say, the issues I have here are the volume per note / delay and cut settings that just get "overwritten". The song is "compressed" to 4-rows/beat (its 8 in the .mptm) and especially the volume settings look quite different and "weird" in certain parts. They do reflect settings like "volume commands with note are velocities" (if I checked this option in the instrument panel) but the export gets it kinda wrong, muting the drums completely after a drum roll for example or setting the volume to a far to low value. Another issue is the mixing of instruments in the channels, drums are mostly effected by this and it kinda breaks things sometimes.


It would be cool, if OpenMPT could just send the notes with their commands straight to a (virtual) MIDI device, it would help figuring out what I'm doing wrong. Or an option in the export to just parse the notes and commands as they are, without changing anything - even if this means the exported MIDI might not work at all and I've to figure it out myself what's going wrong.

But this might be to much of a niché use case ;-) I'm not "demanding" anything here, I'll be happy already if we could find work arounds and/or you could give some advice how to create my song in the editor so that the export can understand what I'm trying to do.

I tried to fix the MIDI file in OpenMTP - but then again, I can only export. I guess, at the end of the day, it might be just a better idea to use an actual MIDI editor ...

Again: I'm a novice, don't be to harsh on me if you see what I'm doing wrong ;-)

Thanks in advance!

Saga Musix

I will have a look at the file in question later, here are some quick answers to what I can tell you without looking at the file itself:

QuoteI took a deeper look into the exported MIDI myself now and for what I can say, the issues I have here are the volume per note / delay and cut settings that just get "overwritten". The song is "compressed" to 4-rows/beat (its 8 in the .mptm) and especially the volume settings look quite different and "weird" in certain parts.

MIDI files have no concept of "rows". As such, the fact that you wrote the original pattern data at 8 rows per beat is not encoded in the MIDI file at all. The detail level at which MIDI files is imported can be configured in OpenMPT's MIDI settings. Please note that there is absolutely no way that OpenMPT could ever guarantee a clean module -> MIDI -> module round-trip, so even after adjusting this setting a lot of things will look different.

QuoteThey do reflect settings like "volume commands with note are velocities" (if I checked this option in the instrument panel) but the export gets it kinda wrong, muting the drums completely after a drum roll for example or setting the volume to a far to low value. Another issue is the mixing of instruments in the channels, drums are mostly effected by this and it kinda breaks things sometimes.
This sounds like you mix and match between instruments with different volume command handling on the same MIDI channel. This is not a bug in the MIDI export per se; that's simply how OpenMPT's internal plugin architecture works. If one instrument modifies the MIDI channel volume, and another instrument is not configured to do so, then the second instrument will continue to use the MIDI channel volume set by the previous instrument.

QuoteIt would be cool, if OpenMPT could just send the notes with their commands straight to a (virtual) MIDI device, it would help figuring out what I'm doing wrong.
The MIDI Input / Output Plugin does exactly that. In fact, this is the only way I can recommend writing a MIDI score in OpenMPT, because plugin-based instruments and MIDI export share identical behaviour, while sample-based instruments behave different in many ways (e.g. the MIDI volume command handling setting you found are specifically meant for plugins, not sample-based instruments, so you would have no way of judging their behaviour while working with sample-based instruments).

QuoteOr an option in the export to just parse the notes and commands as they are, without changing anything - even if this means the exported MIDI might not work at all and I've to figure it out myself what's going wrong.
MIDI export really doesn't do much more than that anyway. If you don't set any specific MIDI volume command handling, it cannot affect the exported output, for instance.
» 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.

Marwellus

Thanks!

Your answer clarified a few important facts for me already, and I think, there's no need to take a look at my ("bugged") song anymore. The hint at the midi-input/-output plugin is already helping me, the instruments are now routed to VirtualMIDISynth and it behaves like the midi export - I simply need to figure out, what I'm doing wrong and need to understand a bit more about MIDI, before I'll waste more of your time ;-)

Again, thanks! I might report back, if I made progress and the export result is satisfying enough or if I still need some more specific advice. :-)






Saga Musix

One thing I can add here about your sample file: You are running into one of the fundamental differences between modules and MIDI: The only way to modify a note's volume after it has been triggered is through MIDI channel volume, and all notes playing on the same channel at the same time are affected by this (as the name implies). You cannot set the "volume command handling" option to "MIDI volume" if you have more than one note playing on a channel at a time, because then each note will update the MIDI channel volume, also affecting other any notes on that MIDI channel!
» 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.

Marwellus

Yep, I figured that one out myself quite quickly, hehe. I made several changes and it plays fine now, export is working perfect, which makes me really happy. It means I can stick with OpenMPT, it's the perfect tool for the job. :-)

Alas, I "only" have to debug my own built-in midi player now, that's a different topic. The MID-file itself is fine, there's no problem reading it but I still have some issues there, I need to fix. ;-)

I mark this thread as solved, thanks again for your help!