VOGONS


First post, by Zuon

User metadata
Rank Newbie
Rank
Newbie

Forgive me if this isn't the correct subform, but I'm wondering if there is an easy way to add a loop point to a MIDI file for DOS game purposes? I know how to place Time Markers within FL Studio, but they don't seem to take effect with the exported MIDI. It's just a song with an intro, and I don't want the intro to repeat when it gets to the end, just for the song to jump back to the main part.

EDIT: Additionally, there is another MIDI song that I do not want to loop. Just have it play once and stop when it gets to the end.

Reply 1 of 6, by xjas

User metadata
Rank l33t
Rank
l33t

What game/engine is this for? Some of them handled loops very differently from one another. I know Descent used specific MIDI Event messages to set loop points, but AFAIK those aren't standardized. In that specific case, you end up adding fairly low-level MIDI commands into the sequence. If you're exporting from a modern DAW these aren't likely to be supported and there's a good chance you'll need to do it in a more dedicated .mid editor.

twitch.tv/oldskooljay - playing the obscure, forgotten & weird - most Tuesdays & Thursdays @ 6:30 PM PDT. Bonus streams elsewhen!

Reply 2 of 6, by Zuon

User metadata
Rank Newbie
Rank
Newbie
xjas wrote:

What game/engine is this for? Some of them handled loops very differently from one another. I know Descent used specific MIDI Event messages to set loop points, but AFAIK those aren't standardized. In that specific case, you end up adding fairly low-level MIDI commands into the sequence. If you're exporting from a modern DAW these aren't likely to be supported and there's a good chance you'll need to do it in a more dedicated .mid editor.

I'm getting back to work on my MegaMan X MS-DOS music mod I started last year. The game uses standard MIDIs converted to XMI files.

Reply 3 of 6, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie

Hi,
As xjas has written loop points are not a standardized feature in case of Standard Midi Files (*.mid). But there are multiple non-standard loop extensions (from more simple to more versatile extensions):
1. RPG Maker style loops use Common Controller 111 (CC#111) to designate loop start. This extension does not use dedicated loop end points, the loop end is always the end of song.
2. Final Fantasy style marker meta events. This extension use 'loopStart' meta marker events to designate loop start and 'loopEnd' meta events to designate loop end. There is no way to define the amount of loops, so loops created this way can be considered infinite.
3. EMIDI/XMI style loops use CC#116 to designate loop start and CC#117 to designate loop end. With this extension you can also define the amount of loops by using the 2nd data byte of the loop start controller.
So CC#116 2nd byte 0 means infinite loops, 1-127 means finite loops and the loop amount. The 2nd byte of loop end controller (CC#117) should always be 127.
I personally recommend to try the 3. variant since it is the most versatile and your engine uses XMI files anyway as you have written. You can use any DAW/Editor that can insert arbitrary Common Controller messages.
As a general rule loops work the following way: loop start point indicates the point where playback jumps to when loop end point is reached.

@Edit:
Under Windows you can use my Midi player (FSMP) to try your different looped MIdi files. There is also an integrated Midi Event Viewer/Debugger in FSMP with loop support so you can check what kind of loops a given midi file uses. You can even use the debugger as primitive editor to insert CC#116/117 style loops.
https://youtu.be/eJwfvv38gv0

Website, Facebook, Youtube
Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi
VST Midi Driver Midi Mapper

Reply 4 of 6, by Zuon

User metadata
Rank Newbie
Rank
Newbie
Falcosoft wrote:
Hi, As xjas has written loop points are not a standardized feature in case of Standard Midi Files (*.mid). But there are multipl […]
Show full quote

Hi,
As xjas has written loop points are not a standardized feature in case of Standard Midi Files (*.mid). But there are multiple non-standard loop extensions (from more simple to more versatile extensions):
1. RPG Maker style loops use Common Controller 111 (CC#111) to designate loop start. This extension does not use dedicated loop end points, the loop end is always the end of song.
2. Final Fantasy style marker meta events. This extension use 'loopStart' meta marker events to designate loop start and 'loopEnd' meta events to designate loop end. There is no way to define the amount of loops, so loops created this way can be considered infinite.
3. EMIDI/XMI style loops use CC#116 to designate loop start and CC#117 to designate loop end. With this extension you can also define the amount of loops by using the 2nd data byte of the loop start controller.
So CC#116 2nd byte 0 means infinite loops, 1-127 means finite loops and the loop amount. The 2nd byte of loop end controller (CC#117) should always be 127.
I personally recommend to try the 3. variant since it is the most versatile and your engine uses XMI files anyway as you have written. You can use any DAW/Editor that can insert arbitrary Common Controller messages.
As a general rule loops work the following way: loop start point indicates the point where playback jumps to when loop end point is reached.

@Edit:
Under Windows you can use my Midi player (FSMP) to try your different looped MIdi files. There is also an integrated Midi Event Viewer/Debugger in FSMP with loop support so you can check what kind of loops a given midi file uses. You can even use the debugger as primitive editor to insert CC#116/117 style loops.

https://youtu.be/eJwfvv38gv0

So this is what's interesting. I actually found your midi player while google searching before I made this post, but it didn't not loop back my MIDIs at the correct point while using the correct settings. Neither would any of my other players on my Windows 10 machine. But just for the hell of it, I copied the converted XMI into the MegaMan X directory anyway and launched the game with DOSBOX... and it worked as intended in-game, and in-game alone. I'm gonna dig out my Pentium machine and try it natively to see if this is consistent. If so, no need to further tinker, as far as the mod is concerned.

Update/Edit: I just tried it out on my Pentium 133 with a Roland SCP-55 and I was... partially correct. Just as before, my loop point after the Title Screen music prevents the song from starting back at the beginning, and gives the illusion of an endless silence.

However, when I get to the part where Vile kicks my butt and Zero appears, the song that plays during the pep talk does NOT loop back to where I told it to, and instead does start all the way at the beginning when it's over.

On a side note, sound effects start to crackle right around the part where Vile's ship looms overhead, and gets progressively worse until the game is exited and restarted. I chalk this up to a Sound Blaster Clone (ESS) issue, however, and not a problem with the MIDIs themselves. The abnormality progresses slower with regular Sound Blaster selected instead of Sound Blaster Pro, and music clarity is unaffected - just sound effects.

Is there any free editor you can recommend that supports those CC#116/CC#117 parameters you mentioned? Windows 10, 2000, 98, or DOS, it doesn't matter. I have access to each. GUI preferred. Yes, I can definitely learn how to type the command to make it happen, but clicking and saving is still much easier.

Reply 5 of 6, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie
Zuon wrote:

So this is what's interesting. I actually found your midi player while google searching before I made this post, but it didn't not loop back my MIDIs at the correct point while using the correct settings.

You could have been more specific what were the 'correct' settings in your case. According to XMI specification the really correct setting is to use CC#116/CC#117 messages:
http://www.shikadi.net/moddingwiki/XMI_Format … ler_assignments
If FSMP detects a known loop extension in a Midi file it displays 'Loop detected' on the main interface, otherwise you should not expect your 'correct point' to work. You should also check that loop points are enabled and infinite loops are overridden ( e.g. to 1) otherwise infinite loops only work when repeat one mode is enabled.

loopdetect.png
Filename
loopdetect.png
File size
573.3 KiB
Views
2275 views
File license
Fair use/fair dealing exception
Zuon wrote:

Is there any free editor you can recommend that supports those CC#116/CC#117 parameters you mentioned? Windows 10, 2000, 98, or DOS, it doesn't matter. I have access to each. GUI preferred. Yes, I can definitely learn how to type the command to make it happen, but clicking and saving is still much easier.

As I have written you can use FSMP to insert such messages:

loop1.png
Filename
loop1.png
File size
516.64 KiB
Views
2279 views
File license
Fair use/fair dealing exception

Website, Facebook, Youtube
Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi
VST Midi Driver Midi Mapper

Reply 6 of 6, by Zuon

User metadata
Rank Newbie
Rank
Newbie
Falcosoft wrote:
You could have been more specific what were the 'correct' settings in your case. According to XMI specification the really corre […]
Show full quote
Zuon wrote:

So this is what's interesting. I actually found your midi player while google searching before I made this post, but it didn't not loop back my MIDIs at the correct point while using the correct settings.

You could have been more specific what were the 'correct' settings in your case. According to XMI specification the really correct setting is to use CC#116/CC#117 messages:
http://www.shikadi.net/moddingwiki/XMI_Format … ler_assignments
If FSMP detects a known loop extension in a Midi file it displays 'Loop detected' on the main interface, otherwise you should not expect your 'correct point' to work. You should also check that loop points are enabled and infinite loops are overridden ( e.g. to 1) otherwise infinite loops only work when repeat one mode is enabled.

loopdetect.png
Zuon wrote:

Is there any free editor you can recommend that supports those CC#116/CC#117 parameters you mentioned? Windows 10, 2000, 98, or DOS, it doesn't matter. I have access to each. GUI preferred. Yes, I can definitely learn how to type the command to make it happen, but clicking and saving is still much easier.

As I have written you can use FSMP to insert such messages:

loop1.png

That's what I meant by the correct settings. As I found your MIDI player through your video on it, I just copied the settings you had, which are the same ones in your screenshots. It's not the settings that are incorrect, it's just that my MIDI file isn't compliant. I just wasn't aware you could insert the points this way. That's what I get for not watching it all the way through. Thank you.

Update: I actually watched the entire video and now that I know how to insert the controller, it works perfectly! You're a life saver.