ws-audio2: music/med (MED / OctaMED MMD0..MMD3): xm family with ProTracker periods, MED effects and tempo modes, play sequences, hold / decay envelopes, IFF multi-octave keymaps; engine: EXT tempo > 255, flags.envRowHold

Synthetic / hybrid / MIDI instruments are silent (listed in meta.unsupported).
This commit is contained in:
4DBug committed 2026-10-31 14:51:33 -05:00
1 parent d418458e2a
commit 3d5cf3130e
8 files changed
+935 -5

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
-- music/med tests: generated MED / OctaMED modules (tools/fixtures/med.py: MMD0, MMD1 with hold / decay and finetune,
-- MMD2 with a play sequence, an IFF 3-octave sample) parsed, rendered through codecs/audio/Tracker and compared with openmpt123's render
-- (loudness envelope, band spectrum, stereo balance, song length), the contract, and the fuzz no-throw pass.
local T = require("@tests/T")
local S = require("@tests/music/_similar")
local Med = require("@formats/music/med")
local Cases = require("@tests/gen/med_cases")
local t = T.suite("med")
t:eq(Med.name, "med", "name")
t:eq(Med.category, "music", "category")
t:check(Med.caps.decode and not Med.caps.encode, "caps")
local mods = S.against(t, Med, Cases, { gainDb = 0.5, envErr = 1.0, spectral = 0.95, balance = 0.04, duration = 0.01 }, "xm")
t:check(mods[2] and mods[2].instrumentMode and mods[2].instruments[1].volEnv ~= nil, "MMD1 hold / decay: an instrument envelope")
t:check(mods[2] and mods[2].title == "med test", "song name")
t:check(mods[3] and mods[3].channels == 6 and mods[3].meta.source.version == "MMD2", "MMD2")
t:check(mods[4] and mods[4].instrumentMode and #mods[4].samples == 4 and mods[4].samples[3].length == 128, "IFF 3-octave sample")
t:fuzz("decode", S.fuzzer(Med), S.samples(Cases), { mutations = 30 })
t:done()