LoginLogin

Trying to play multiple MML

Root / Programming Questions / [.]

OhBoyCreated:
So, I wrote two songs in mml and I want to figure out a way to have the program play the next song at the press of a button. From my previous attempts I end up having both the songs playing at once.
BGMSETD 128,@A
BGMPLAY 0,128
PRINT "SONG 1
@A
DATA"T130"
REM #MAIN
DATA":0@024V80 R1[
DATA"<C4C4C4C4]

REM #CHORUS
DATA":1@092V50 R1[
DATA">C2D2]

REPEAT:UNTIL BUTTON(2) AND #A

ACLS

BGMSETD 129,@A
BGMPLAY 0,129
PRINT"SONG 2
@B
DATA"T130"
REM #LEAD
DATA":2@003V90 R1[
DATA">G4G4G4G4]

REM #WAH
DATA":3@092V60 R1[
DATA"<A2B2]

REPEAT:UNTIL BUTTON(2) AND #A
END
Also, these aren't the songs I wrote, I just wanted to make the code shorter and easier to read.

Try using BGMSTOP and see if that helps (it probably will)

Oops, forgot to add that. Anyway, for the first song it still plays song1 and song2, so I'm still stumped on that.

You need DATA 0 at the end of your MML data.

Thanks a bundle!

you can also optionally put DATA. instead.