BGMPLAY is a command for playing music or other sound effects. In SmileBasic V1, it can only be used in one way. It is followed by one number, which gets rounded down, the song associated with that number is played on the speakers. The relationship between the numbers 0 to 29 inclusive and songs is on the page List of Preset Music.
In SmileBasic V2, the command may be used as described above. In addition, 'song numbers' between 128 and 255 inclusive can be used; these numbers refer to user-defined songs specified by
BGMPLAY 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).
BGMPLAY 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).
BGMPLAY is followed by between one and nine strings (inclusive), the strings are concatenated and interpreted as MML, and the resulting song is played at maximum volume on track 0.
BGMPLAY "EDCDEEE" will play the first part of "Mary Had A Little Lamb", and
BGMPLAY 13 and
BGMPLAY 0,13,127 will play "Ultra-hard Rock" at maximum volume on track 0.
See also BGMSTOP (Command).
No information on SmileBasic V3.