Any way to export as MIDI with loop markers?

Started by KingWolf, August 15, 2021, 00:38:16

Previous topic - Next topic

KingWolf

Hello, I've composed something with a position jump (B01) to create a loopable sequence. However, when exporting as MIDI, this is lost. Is there a way I can include a midi macro that sets loop start and loop end messages? Any advice is appreciated.

Cheers!

LPChip

I don't think this is supported in MIDI. But keep in mind, OpenMPT is a module tracker, not a midi editor. Export to midi should only be used in very rare occasions where you need to export some notes for another program, not a whole song.
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

KingWolf

Quote from: LPChip on August 15, 2021, 10:15:28
I don't think this is supported in MIDI. But keep in mind, OpenMPT is a module tracker, not a midi editor. Export to midi should only be used in very rare occasions where you need to export some notes for another program, not a whole song.

Ah ok, that's understandable, I was able to export it without the control set pattern to get the desired loop. I understand OpenMPT is not intended for use with midi, but man... it is pretty good at it lol, especially for xmp-midi

Saga Musix

OpenMPT could support this in theory, but it's not trivially doable (otherwise it would probably already exist).  There are several non-standard ways of specifying loop markers in MIDI, but what they have in common is that a loop start marker has to be inserted at the loop start, which is not trivially doable in OpenMPT's MIDI export - OpenMPT only knows that there will be a loop once it has arrived at the loop end, and the command found at the loop end also determines where the loop start is. So by the time OpenMPT would have to write a loop start marker into the MIDI file, it doesn't even know yet that there will be a loop.

However, I think what we could be doing is write pattern names to MIDI files as cue points, and then you could name the pattern that should server as the loop start as "loopStart" - this is one of the unofficial ways to define the loop start in a MIDI file. I'm not sure if it also strictly requires a "loopEnd" marker - you'd have to add that marker past the last played pattern, I think.
» 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

After having a closer look, the loop start information as already available in the MIDI export at the right point in time, so the next OpenMPT update will write "loopStart" and "loopEnd" cue markers, which are supported by xmp-midi.
» 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.

KingWolf

Quote from: Saga Musix on August 15, 2021, 18:32:10
After having a closer look, the loop start information as already available in the MIDI export at the right point in time, so the next OpenMPT update will write "loopStart" and "loopEnd" cue markers, which are supported by xmp-midi.

Ooh excellent to hear! ;D Many thanks