BGMPLAY (Command)

is a command for playing music or other sound effects. It can be used in a number of different ways.

If  is followed by one or more strings, the strings are concatenated and interpreted as MML, and the resulting song is played at maximum volume on track 0.

If  is followed by one number, a song is played on track 0 at maximum volume. If the song number is between 0 and 29 inclusive, it refers to one of the Preset Music values. If the song number is between 128 and 255 inclusive, it refers to a user-defined song (previously specified by a BGMSET or BGMSETD command).

If  is followed by two numbers, the second is the song number as described above, and the first is the track number (0 to 7 inclusive).

If  is followed by three numbers, the first two are as for the two-number command, and the third number is the volume (0 to 127 inclusive).

For example,  will play the first part of "Mary Had A Little Lamb", and   and   will play "Ultra-hard Rock" at maximum volume on track 0.

See also BGMSTOP (command).