home *** CD-ROM | disk | FTP | other *** search
- DIM byte AS STRING * 1
- COMMON c AS INTEGER
- COMMON b AS INTEGER
- COMMON a AS INTEGER
- COMMON dur AS INTEGER
- COMMON note AS INTEGER
- COMMON p AS INTEGER
- COMMON g AS INTEGER
- pattlen = 128
-
-
- CLS
- g = 1: REM, start pos to read in file
-
- OPEN "c:/martin/megadriv/music/flink.bin" FOR BINARY AS #2
- OPEN "c:/martin/megadriv/music/flink.snd" FOR BINARY AS #1
-
-
- nextpatt:
- GET #2, g, a: REM which pattern number to create
- IF a = 255 THEN GOTO endpatts
-
- PRINT " creating pattern no. "; a
-
- p = 2984 + 32 + (a * pattlen): REM pattern pos in file
- g = g + 2: REM step over patt number
-
- readloop:
- GET #2, g, a
- GOSUB split
- PUT #1, p, a: REM write note and duration to file
- IF note = -1 THEN GOTO endpatt
- p = p + 2
- g = g + 2
- GOTO readloop:
-
- endpatt:
- g = g + 2
- GOTO nextpatt
-
- endpatts: : REM end of all patterns
-
- CLOSE
-
- PRINT " All patterns converted "
-
- END
-
- REM *************** SUBROUTINES ***************
-
- REM input word value output switches high/low
- split:
- dur = a / 256: note = a - (256 * dur)
-
- RETURN
-
- REM-----------------------------------------------
-
-
-
-