A .PAT file is one instrument for the Gravis UltraSound — the first mass PC wavetable card, which streamed samples from disk into its own on-board RAM. There is no chunk grid: it is a run of fixed-size headers nested four deep — a 129-byte patch header, then instrument (63 B), layer (47 B), and sample (96 B) records, each header immediately followed by its children, and the raw PCM sitting right after each sample header. Everything is little-endian (the card lived on the ISA bus of an x86 PC) — the mirror image of Kurzweil's 68k banks. The tabs open each structure, drawn byte by byte from a real factory patch. Hover a field to light its bytes, click a field with a + for its table. Color marks kind (see the key).
Where a SoundFont packs a whole bank into one file, a GUS patch is one instrument — a full General MIDI set is 100-plus separate .PAT files, loaded into the card's RAM one at a time as a song calls for them. Inside, the shape is a strict four-level nest: a patch header counts instruments; each instrument counts layers (velocity/zone splits); each layer counts samples; and each sample header is followed immediately by its raw PCM. No offsets, no tables — you walk it by adding fixed header sizes and the PCM length. The patch below is a real factory instrument, ALTOSAX.PAT.
.PAT patches streamed off disk.ULTRASND directory) is the canonical GM-to-PAT mapping.129 (patch), then per instrument 63, per layer 47, per sample 96 + data_size. The PCM for a sample sits in the data_size bytes immediately after its 96-byte header — there is no separate audio region..KRZ or an E-mu .E4B, both of which are big-endian 68k machines.The 129-byte file header. It opens with a 12-byte magic carrying the version, a 10-byte internal id, then a 60-byte ASCII description (the factory copyright line), and finally the small block of counts that drive the walk: how many instruments follow, and the total waveform (sample) count. The two byte maps below are the signature block and the counts block; the description between them is plain text.
Example: ALTOSAX.PAT. Hover the magic for the version split.
The header fields at offset 82–92 that size the nest.
"GF1PATCH110" are the format version — 1.10 here, 1.00 in the oldest patches. The first 8 bytes ("GF1PATCH") identify the format; the full 12 give the exact version. The 10-byte "ID#000002" that follows is a fixed internal structure id, not a per-file value.instruments (here 1) counts the top-level instruments; waveforms (here 3) is the total number of samples across all layers — a cross-check for the walk. The data_size word is the summed PCM byte total. voices and channels are card-mixing hints, not structural, and carry fixed quirk values in most factory patches.Between the patch header and the sample headers sit two thin framing records. An instrument (63 bytes) carries a numeric id, a 16-char name, its total size, and a layer count. A layer (47 bytes) is a velocity or key split: it carries a sample count and little else. Both are mostly reserved padding — their job is only to carry the next count down the nest. The maps are the fronts of the Instrument and Layer records from ALTOSAX.PAT.
Example: Instrument #0, "Alto Sax". The remaining 40 bytes are reserved.
Example: Layer 0. Hover samples — it is the count a reader loops on.
samples byte in the layer is the innermost count of the nest.The sample header is where the format earns its keep: 96 bytes describing one waveform, then its raw PCM inline. It gives the data size, the loop points, the playback rate, three frequency words that set the key range and recorded pitch, an on-card 6-stage envelope, tremolo/vibrato, and the crucial modes byte whose eight bits pick 16- vs 8-bit, signed vs unsigned, and the loop behaviour. The map draws the first 60 meaningful bytes (the last 36 are reserved).
Example: sample "NoName" from ALTOSAX.PAT — 16-bit, looped, 22321 Hz. Hover modes for the bit flags.
0x01 16-bit, 0x02 unsigned, 0x04 loop-enable, 0x08 ping-pong (bidirectional loop), 0x10 reverse, 0x20 sustain, 0x40 envelope, 0x80 clamped-release. Here 0x67 = 16-bit + unsigned + loop + sustain + envelope. Bits 0 and 1 set the PCM width and sign; getting either wrong turns the audio to noise.low_frequency, high_frequency and root_frequency are fixed-point Hz × 1000. Here root = 164813 = 164.813 Hz (~E3, the pitch the sample was recorded at), spanning 26.986 Hz (~A0) to 399.765 Hz (~G4) — the key range this sample covers before the next one takes over. The GF1 pitches each key by ratio from root_frequency, not from a MIDI note number.loop_start and loop_end are offsets into this sample's PCM in bytes, with the fractions byte giving a sub-byte remainder for fine loop tuning — not sample indices. For a 16-bit sample the reader rounds them to even byte boundaries. Loop is only honoured when modes & 0x04 is set; here it is, so playback loops over [5998, 7082].