10 REM > Playback
   20 :
   30 *FX15
   40 INPUT "SOUND file: "in$
   50 in%=OPENIN(in$):IF in%=0:PRINT"File '"in$"' not found":END
   60 sz%=EXT#in%:CLOSE#in%:DIM P% sz%-1:E%=P%+sz%
   70 OSCLI"LOAD "+in$+" "+STR$~P%
   80 IF !P% AND &FFFF:PRINT"Unexpected format - first time delta not zero":END
   90 T%=TIME:REPEAT:A%=!P%AND&FFFF:REPEATUNTILTIME-T%>=A%:A%=P%?2
  100   IFA%>&7F:SOUND(A%AND&33)OR(A%AND&4C)*64,P%?3,P%?4,P%?5:P%=P%+6
  110   IFA%<&11:ENVELOPEA%,P%?3,P%?4,P%?5,P%?6,P%?7,P%?8,P%?9,P%?10,P%?11,P%?12,P%?13,P%?14,P%?15:P%=P%+16
  120 UNTILP%>=E%
  130 END
  140 :
  150 REM File format is:
  160 REM multiples of: { lo, hi, command }
  170 REM lo,hi is centisecond time offset from start of file, must start at &0000
  180 REM command is:
  190 REM   %00000000 - reserved
  200 REM   %000nnnnn - 14-byte ENVELOPE command
  210 REM   %0nnnxxxx - reserved
  220 REM   %1hxfsscc - 4-byte SOUND chn,vol,pch,dur command
  230 REM   chn is compressed from %000h00ss000f00cc to %1h0fsscc