-- music/med tests: generated MED / OctaMED modules vs openmpt123's render. -- Fixtures: tools/fixtures/med.py. local T = require("@tests/T") local S = require("@tests/music/_similar") local Med = require("@rosetta/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()