Advanced Gravis Ultrasound patch file
application/octet-stream
Magic Bytes
Offset: 0
47 49 46 38 37 61
Advanced Gravis Ultrasound patch files are instrument data files created by Advanced Gravis Computer Technology for use with the Gravis Ultrasound sound card series. These files store digital audio samples and playback parameters required to reproduce specific musical instrument sounds within MIDI-based composition software and trackers. As a legacy format from the 1990s, it is now largely obsolete, though it remains relevant in retro-computing circles and hardware emulation environments.
Validation Code
How to validate .pat files in Python
Python
def is_pat(file_path: str) -> bool:
"""Check if file is a valid PAT by magic bytes."""
signature = bytes([0x47, 0x49, 0x46, 0x38, 0x37, 0x61])
with open(file_path, "rb") as f:
return f.read(6) == signature
How to validate .pat files in Node.js
Node.js
function isPAT(buffer: Buffer): boolean {
const signature = Buffer.from([0x47, 0x49, 0x46, 0x38, 0x37, 0x61]);
return buffer.subarray(0, 6).equals(signature);
}
Go
func IsPAT(data []byte) bool {
signature := []byte{0x47, 0x49, 0x46, 0x38, 0x37, 0x61}
if len(data) < 6 {
return false
}
return bytes.Equal(data[:6], signature)
}
API Endpoint
GET
/api/v1/pat
curl https://filesignature.org/api/v1/pat