BGMGETV (Function)

is a system function which takes two parameters, a track number (0 to 7 inclusive) and an MML variable number (also 0 to 7 inclusive).

If MML music is playing on the selected track, the function returns the value of the corresponding variable. For instance, after the code, the function   will give the value. Uninitialized MML variables have the value -1, and if the specified track is not playing an MML string, the function will return -1.