Need Help with Looping Music


hihihi i need to brag

So I ported over some samples for a song in the Legend of Zelda, A Link to the Past, and uh I’m proud of what I’ve done, nearly flawlessly porting a song between consoles like @Agro’s FEDS song ports. Little of an issue though: I never learned how to loop music.

Ive tried it in Anvil Studio and it doesn’t seem to work, any one know how to make music loop?


Noyce. I wish more people went to the lengths to learn to music hack. :slightly_smiling_face:
It’s pretty simple if I remember correctly.
Go into Anvil…
Have the very start (or the start of the loop, I suppose) of the song selected and hit new cue. Insert a single opening solid bracket, like so (except not a curly bracket because I’m dumb).

Then, with where you want it to loop from (the end) selected, do the same thing, except a closing bracket, and that should do it. If it doesn’t work, try saving as a type 0 and reinserting.


If you are doing with midi, please add a loop label.
The midi standard is for conveying the signal that pushes the key of Electone.
Therefore, the concept of loop does not exist in midi.
“You need a loop? You should play the piano once more.”

Even so, the piano is good, but the game requires a loop.
For this reason, an implementation that creates a loop by using the label function of midi has been devised.

If you are using the s file, it is slightly more complicated.

Please look at the existing *.s file.
There, the loop is stated.

Loops need to be done in units of tracks.
If you have five tracks, you need to create five loops.

First, add a loop label at the beginning of the track.

@ 000 ----------------------------------------
.byte KEYSH , song03_key+0
Label_0_AA496A: <<< THIS
.byte TEMPO , 128*song03_tbs/2

The loop is executed with the GOTO command.
@ 033 ----------------------------------------
.byte GOTO << THIS
.word Label_0_AA496A << THIS
.byte FINE

A track consists of measures, but if the length of the measure is different, please add a measure of whole rest and align the length.
If you do not align the lengths of the tracks, the sound will be out of sync when looping, and it will be like a chorus.
The track of GBAFE is 96.(Sometimes it is different)
W96 will be whole rest.

@ 032   ----------------------------------------
 .byte   W96 << THIS
@ 033   ----------------------------------------
 .byte   GOTO
  .word Label_6_AA52DE
 .byte   FINE

For example, suppose the longest track is 33.
And suppose the shortest track is 31.
In that case, for a short track, you need two whole rest.

@ 031   ----------------------------------------
 .byte   FINE


@ 031   ----------------------------------------
 .byte   W96
@ 032   ----------------------------------------
 .byte   W96
@ 033   ----------------------------------------
 .byte   GOTO
  .word Label_3_12345
 .byte   FINE

If TIE is used immediately before the loop, you must stop the sound with the EOT command before issuing the GOTO command.
The TIE command is a command that sounds all the way until the EOT command is issued.
If you create a loop without issuing EOT, the sound continues to sound even after looping.

@ 032   ----------------------------------------
 .byte   TIE ,En3
 .byte   W72
@ 033   ----------------------------------------
 .byte   EOT     << THIS
 .byte   GOTO
  .word Label_6_AA52DE
 .byte   FINE

When midi is inserted in FEBuilderGBA, these are fully automatic and adjusted. :slight_smile:


don’t add loop commands manually (you’ll inevitably fuck up the timing), just use mid2agb.exe with the [ and ] commands as @Snakey1 suggested and she’ll be right

also, good job


Well, what do you know. I used {} brackets instead of [] brackets. Oopsies.

I could probably edit the .s file like 7743 suggested but the bracket method got my looping working. Thanks, @Snakey1.

also, good job

thanks~ I’ve always wanted to reach your level of song ports, and now I feel that quality is just in my grasp!


Wow, this rip sounds phenomenal. Good job.