20 lines
878 B
Luau
20 lines
878 B
Luau
-- music/stm tests: generated Scream Tracker 2 modules (tools/fixtures/stm.py) 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 Stm = require("@formats/music/stm")
|
|
local Cases = require("@tests/gen/stm_cases")
|
|
|
|
local t = T.suite("stm")
|
|
|
|
t:eq(Stm.name, "stm", "name")
|
|
t:eq(Stm.category, "music", "category")
|
|
t:check(Stm.caps.decode and not Stm.caps.encode, "caps")
|
|
|
|
local mods = S.against(t, Stm, Cases, { gainDb = 0.5, envErr = 1.0, spectral = 0.95, balance = 0.04, duration = 0.01 }, "s3m")
|
|
t:check(mods[1] and mods[1].meta.source.tracker == "!Scream!", "tracker name")
|
|
|
|
t:fuzz("decode", S.fuzzer(Stm), S.samples(Cases), { mutations = 30 })
|
|
t:done()
|