Music hacking — how to loop SSEQs

1. Looping process
    1.1. Tools
    1.2. Know your song
    1.3. Procedure
2. How to make non-looped SSEQs

I will have to update this tutorial to remove useless steps and make it easier and straightforward.
This is an update for some parts of the original tutorial by Orengefox. I take no credit for this. I want to thank  KingYoshi for being patient and answering my doubts.
Also, this is my personal way of doing this, there may be easier ways. So, without further ado…

1. Looping process

1.1. Tools

1.2. Know your song

We have a MIDI file of an own composition – let us call it “orig_test.mid”. It is a song with sixty-four measures, a time signature of 4/4 and a tempo of ♩ = 128. We already know the loop starts in measure 17, but we do not know what to do with this information. Read on the next section.

1.3. Procedure

The “Time” button.

Time settings.

The MIDI events window.

Exporting the MIDI.
First off, does the song have ‘bahps’ in it? To make them work, follow this tutorial by  skawo until step three: you will only save the MIDI (do not convert it to SSEQ just yet). Load up the file with Anvil Studio. If you have never used this software before, we need set it up a bit first: somewhere on the top, just below the ‘Help’ tab, is a button that says “Time” – click it. A modal window will appear. Under “Units for Position / Time”, tick the option that says ‘Hour:Minute:Second:Frames’ and then set the amount of frames per second to 30. Click OK.

Now click the ‘Edit’ tab and choose “Insert MIDI Event...”: another modal window will appear. Make sure to tick the two checkboxes below the drop-down list. Now click said list and select “Marker”.

Now comes the fun part. Using a calculator, we will be employing very simple math to locate the loop points. The formula:
{ [ 60 s ÷ ( T × t ) ] × [ M × t ] } × m
( 60 × M × m ) ÷ T
  • T is the constant tempo or BPM. As we established, it is 128.
  • t is the duration of each beat. For further reference, crotchet (♩) equals 1 always for this equation—and a quaver (♪) equals 0.5 always and so on—and given that the time signature is 4/4, each of the beats are crotchets. If you use a program which does not consist of writing sheet music, then this value is likely 1.
  • M represents the beats per measure. As said earlier, four beats/crotchets per measure (4/4).
  • m represents a number of measures. We will solve this operation according to the loop points.

So, this is how our operation goes to calculate the location of the loop starting point.
{ [ 60 s ÷ ( 128 × 1 ) ] × [ 4 × 1 ] } × 16
= { [ 0.468 75 s ] × [ 4 ] } × 16
= { 1.875 s } × 16
= 30 s
There we go, measure seventeen starts at thirty seconds from the song.* We now need substract 1 FPS to the result: 29 s 29 FPS. We put it in the “Time of event:” field as 0:29:29. In the bottom field we write loopStart (case-sensitive).

Now we must solve the same operation but calculating the location of the loop ending point this time:
{ [ 60 s ÷ ( 128 × 1 ) ] × [ 4 × 1 ] } × 64
= { [ 0.468 75 s ] × [ 4 ] } × 64
= { 1.875 s } × 64
= 120 s
We know it is two minutes.* Now we substract 1 FPS again: 1 min 59 s 29 FPS. Then we put that as 1:59:29 in the respective field of time and write loopEnd (case-sensitive) in the last field. Click OK.

In case of getting an amount of time with decimals (eg, 32.6 s), we will do the following to convert it from s:ms to s:FPS:
  1. The whole seconds will represent the seconds (duh!):
    32 s
  2. In order to calculate how many frames per second are 0.6 s, we substract the whole seconds and apply the rule of three:
    32.6 s − 32 s = 0.6 s
    0.6 s × ( 30 FPS ÷ 1 s ) = 18 FPS
  3. Now we put both results together:
    32 s 18 FPS
    And continue on.

    If the FPS are decimals, round the number according to the common method.

Alright, so we have set the loop points to the song. Now just click the “File” tab and select ‘Export MIDI-Format 0 file...’. Save your file; you may add “AS-” at the start of the file name to differentiate it from the original MIDI in case something goes wrong.

Now drag your new MIDI into midi2sseq to produce a .sseq file. That may or may not work. If it does not, then do the following:
  • Open up cmd.exe.
  • Write this:
    midi2sseq AS-orig_test.mid orig_test.sseq
    and press Enter. (Bare in mind, though, file names must not have white spaces or else the conversion will fail.)
  • If the MIDI file name is overly long for whatever reason or you are too lazy, you may drag midi2sseq into Command Prompt, press Space, then drag your MIDI, press Space and finally drag your MIDI again but change “.mid” to “.sseq”.
Congratulations! You have successfully created a looped SSEQ. However, if your song did feature ‘bahps’, you have to continue skawo's tutorial linked earlier in this tutorial.

2. How to make non-looped SSEQs

This is unrelated, but I felt like writing this too.

Something that happens very often to me is that a MIDI without loop points will not have the final notes for some reason. To fix this, you only need create an extra note at the end of every part/instrument with a velocity of 0 (if anything, it has to be set to “user”, not “offset”). Do not mute the notes, as that will basically erase them and the trick will not work. Once you added these notes to every part, export it and convert it right away with midi2sseq and it shall work just fine; the note's existence will not be noticed.