XgmTrack

Last Modified: 1/3/2021

Sets the music track to be played with the XgmPlayMusic command.

Arguments

NameTypeRequiredDescription
MusicTrack Line Label Yes The line label where the music track data is located.

Example

Syntax: XgmTrack <MusicTrack>
    XgmTrack MyMusicTrack
    XgmStartMusic
    
    On vInt GoSub Vbl
    Enable vInt
    
    playing = True
    
    While 1
        j = JoyPad()
        If j.7 Then
            If playing = True Then
                XgmStopMusic
                playing = False
            Else
                playing = True
                XgmResumeMusic
            End If
        End If
        WaitPadUp 0
        Sleep 1
    Wend
    
Vbl:
    XgmVintProc
    Return
 
    Asm
MyMusicTrack:
    INCBIN "C:\SecondBASICStudio\bin\mymusic.xgc"
    align 256
    End Asm

Remarks

If you're operating SecondBASIC Studio under Single Document Mode, you'll need to manually insert the XGM Music data as seen in the example above. In Project Mode, you can add your XGM files to the project and they will automatically be included during compilation. You can drag the XGM Music file from the Project Explorer to the code window for automatic code generation.

See Also

XgmPlayPcm, XgmResumeMusic, XgmSetBusProtection, XgmSetPcm, XgmSetTempo, XgmStartMusic, XgmStopMusic, XgmStopPcm, XgmVintProc