home *** CD-ROM | disk | FTP | other *** search
-
-
- REM currently converting spawn5.snd
-
- REM PRESS F5 TO CONVERT PATTERNS
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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
- COMMON x AS INTEGER
- COMMON y AS INTEGER
- COMMON hi AS LONG
- COMMON lo AS LONG
- COMMON t AS LONG
- COMMON temp AS INTEGER
- COMMON temp1 AS INTEGER
- pattlen = 128
-
-
- CLS
- g = 1: REM, start pos to read in file
- OPEN "c:/martin/megadriv/spawn/spawn.bin" FOR BINARY AS #2
- OPEN "c:/martin/megadriv/spawn/spawn5.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
- a = a * 2: REM index into word table
- GET #1, 1, x: REM length of voices
- GOSUB splitt: x = t
- x = x + 12: REM x = start of sub table
- temp = x: REM store in temp
- GET #1, 3, x:
- GOSUB splitt: y = t
- temp1 = temp + y: REM temp1 = start of subroutines
- x = temp + a: REM x = pointer to sub offset in table
- x = x + 1
- GET #1, x, p
- x = p: GOSUB splitt: p = t
- p = p + temp1: REM actual pattern offset
- p = p + 1: REM this stupid basic cant do zeros
- 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
-
-
- splitt:
-
- IF x < 0 THEN
- t = 65536 + x
- ELSE t = x
- END IF
- hi = INT(t / 256): lo = t - (256 * hi)
- t = lo * 256 + hi
- RETURN
-
- REM-----------------------------------------------
-
-
-
-