This works but causes a windows fault near the end of the "clip".
REM
DEFLNG A-Z
'assumes the sound is in the current directory
mid1& = _SNDOPEN("pacman2.mid", "vol")
_SNDVOL mid1&, 0.7
DO
IF NOT _SNDPLAYING(mid1&) THEN
_SNDPLAY mid1&
END IF
IF _KEYDOWN(27) THEN
EXIT DO
END IF
LOOP
_SNDSTOP mid1&
_SNDCLOSE mid1&
SLEEP
SYSTEM