Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set HEADER 0 # change this value to the entire header size in hex numbers
- set PRESERVE 0 # set this to 1 if you want to perserve the header
- set ADJUST 0 # set this to 1 if you want to adjust something(right now it does nothing else)
- set BLOCKSIZE 0 # change this value to the entire blocksize of some audio file in hex numbers
- set INTERLEAVE 0 # change this value to the entire interleave of some audio file in hex numbers
- set LAYERS 0 # set the number of layers you wan to split into
- set SKIP 0 # change this value to the size you want to prevent the script from splitting into in hex numbers
- if BLOCKSIZE == 0
- xmath BLOCKSIZE "(INTERLEAVE * LAYERS) + SKIP"
- set INTERLEAVE BLOCKSIZE
- endif
- if INTERLEAVE == 0
- xmath INTERLEAVE "BLOCKSIZE / LAYERS"
- set BLOCKSIZE INTERLEAVE
- endif
- xmath WRITESIZE "(BLOCKSIZE - SKIP) / LAYERS"
- get CYCLES asize
- xmath CYCLES "(CYCLES - HEADER) / BLOCKSIZE"
- get NAME basename
- get EXT extension
- callfunction DEINTERLEAVE
- startfunction DEINTERLEAVE
- xmath PSIZE "CYCLES * WRITESIZE"
- if PRESERVE == 1
- math PSIZE += HEADER
- goto 0
- getdstring HEADERDATA HEADER
- endif
- for l = 1 <= LAYERS
- putvarchr MEMORY_FILE PSIZE 0
- log MEMORY_FILE 0 0
- if PRESERVE == 1
- putdstring HEADERDATA HEADER MEMORY_FILE
- if LAYERS == 1
- string FNAME p= "%s.%s" NAME EXT
- else
- string FNAME p= "%s_%d.%s" NAME l EXT
- endif
- endif
- xmath BIAS_A "(l - 1) * WRITESIZE"
- xmath BIAS_B "BLOCKSIZE - BIAS_A - WRITESIZE"
- goto HEADER
- for c = 1 <= CYCLES
- getdstring DUMMYDATA BIAS_A
- getdstring WRITEDATA WRITESIZE
- putdstring WRITEDATA WRITESIZE MEMORY_FILE
- getdstring DUMMYDATA BIAS_B
- next c
- get SIZE asize MEMORY_FILE
- /*
- if ADJUST == 1
- callfunction ADJUSTHEADER 1
- endif
- */
- if LAYERS == 1
- string FNAME p= "%s.%s" NAME EXT
- else
- string FNAME p= "%s_%d.%s" NAME l EXT
- endif
- log FNAME 0 SIZE MEMORY_FILE
- next l
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement