Got it to spit out an empty mod that OpenMPT loads.
This commit is contained in:
29
modgen.py
Executable file
29
modgen.py
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import struct
|
||||
|
||||
with open("out.mod", "wb") as fo:
|
||||
|
||||
# Module name.
|
||||
fo.write(struct.pack("20s", "TEMP".encode('utf-8')))
|
||||
|
||||
for i in range(1,32):
|
||||
# Sample name.
|
||||
fo.write(struct.pack("22s", "SMPL".encode('utf-8')))
|
||||
|
||||
fo.write(struct.pack(">H", 0)) # Sample length.
|
||||
fo.write(struct.pack(">B", 8)) # Finetune.
|
||||
fo.write(struct.pack(">B", 64)) # Volume.
|
||||
fo.write(struct.pack(">H", 0)) # Loop offset.
|
||||
fo.write(struct.pack(">H", 0)) # Loop length.
|
||||
|
||||
fo.write(struct.pack(">B", 0)) # Song positions.
|
||||
fo.write(struct.pack(">B", 42)) # Obsolete.
|
||||
|
||||
# Pattern table.
|
||||
for i in range(0, 128):
|
||||
fo.write(bytes(b"\x00"))
|
||||
|
||||
# 31 samples mode.
|
||||
fo.write(struct.pack("4s", "M.K.".encode("ascii")))
|
||||
Reference in New Issue
Block a user