MOD
audio/x-mod
Magic Bytes
Offset: 0
45 78 74 65 6E 64 65 64 20 4D 6F 64 75 6C 65 3A
The Module (MOD) format is a tracked audio file structure originally created by Karsten Obarski for the Commodore Amiga, with later iterations including the Extended Module format developed by Triton. It stores musical patterns and digitized instrument samples to render complex compositions efficiently for video games and demoscene productions. While primarily a legacy format, it remains popular in chiptune communities and functions as a safe, passive data container for digital audio playback.
Validation Code
How to validate .mod files in Python
Python
def is_mod(file_path: str) -> bool:
"""Check if file is a valid MOD by magic bytes."""
signature = bytes([0x45, 0x78, 0x74, 0x65, 0x6E, 0x64, 0x65, 0x64, 0x20, 0x4D, 0x6F, 0x64, 0x75, 0x6C, 0x65, 0x3A])
with open(file_path, "rb") as f:
return f.read(16) == signature
How to validate .mod files in Node.js
Node.js
function isMOD(buffer: Buffer): boolean {
const signature = Buffer.from([0x45, 0x78, 0x74, 0x65, 0x6E, 0x64, 0x65, 0x64, 0x20, 0x4D, 0x6F, 0x64, 0x75, 0x6C, 0x65, 0x3A]);
return buffer.subarray(0, 16).equals(signature);
}
Go
func IsMOD(data []byte) bool {
signature := []byte{0x45, 0x78, 0x74, 0x65, 0x6E, 0x64, 0x65, 0x64, 0x20, 0x4D, 0x6F, 0x64, 0x75, 0x6C, 0x65, 0x3A}
if len(data) < 16 {
return false
}
return bytes.Equal(data[:16], signature)
}
API Endpoint
GET
/api/v1/mod
curl https://filesignature.org/api/v1/mod