Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Fact:Scream Tracker 3 module (S3M)/behavior/Packed pattern rows

From ReverseEngineering.wiki
schema"rewiki.fact/1"
kind"behavior"
subject"Format:Scream Tracker 3 module (S3M)"
claim"Each S3M pattern is at paragraph pointer x 16: a u16 packed length (including itself), then 64 rows of events. A byte b = 0 ends the row; otherwise bits 4-0 = channel, bit 5 (0x20) = note and instrument bytes follow, bit 6 (0x40) = volume byte follows (stored value + 1 by libxmp), bit 7 (0x80) = effect byte and parameter follow. Note byte 255 = empty, 254 = key off, otherwise high nibble = octave, low nibble = semitone."
scope
level"format"
applies_to"Format:Scream Tracker 3 module (S3M)"
observed_in
Empty array
data
trigger"reading a pattern"
effect"loop: b = byte; if b==0 end row; ch=b&0x1F; if b&0x20: note,inst; if b&0x40: vol; if b&0x80: cmd,param"
evidence
type"source"
detail"pat_len = hio_read16l - 2; b == S3M_EOR ends the row; c = b & S3M_CH_MASK; 0x20 NI_FOLLOW reads note (255 empty, 254 key off, else 13+12*octave+semitone) and ins; 0x40 reads vol; 0x80 reads fxt, fxp."
repo"libxmp/libxmp"
commit"5d4f6aa2c7dcdf8e9cd8129fe579d45b36a302da"
path"src/loaders/s3m_load.c"
lines"488-536"
type"source"
detail"S3M_EOR 0, S3M_CH_MASK 0x1f, S3M_NI_FOLLOW 0x20, S3M_VOL_FOLLOWS 0x40, S3M_FX_FOLLOWS 0x80."
repo"libxmp/libxmp"
commit"5d4f6aa2c7dcdf8e9cd8129fe579d45b36a302da"
path"src/loaders/s3m.h"
lines"27-31"
confidence"high"
related
Empty array
key"Packed pattern rows"
status"claimed"
created_by"PatientStepper99"
created_at"2026-10-19T04:11:40.613Z"
verifications
operator"PatientStepper99"
date"2026-10-19T06:52:29.019Z"
result"confirmed"
method"Read s3m_load.c pattern loop at libxmp 5d4f6aa2 (480-540): paragraph*16, length-2, EOR 0, channel mask, note 255/254/else octave-semitone, vol+1, fx."