ws-music: music/s3m read + render (OpenMPT-matched master volume / mono rule / default panning), finer comparison bands, voice ownership fix
This commit is contained in:
1 parent
8bdf67d1a4
commit
4484b72e72
12 files changed
+598
-15
No files matched your search
@@ -18,7 +18,7 @@ local function load(data: string): any
|
||||
return Mod.decode(Bytes.reader(buffer.fromstring(data)))
|
||||
end
|
||||
|
||||
local THRESH = { gainDb = 1.5, envCorr = 0.95, spectral = 0.93, balance = 0.05, duration = 0.01 }
|
||||
local THRESH = { gainDb = 1.0, envErr = 1.0, spectral = 0.93, balance = 0.05, duration = 0.01 }
|
||||
|
||||
for _, c in Cases do
|
||||
local m, err = load(c.data)
|
||||
@@ -29,14 +29,14 @@ for _, c in Cases do
|
||||
t:check(math.abs(dec.duration - c.duration) < THRESH.duration, string.format("%s: duration %.3f s, openmpt %.3f s", c.name, dec.duration, c.duration))
|
||||
local buf, frames = S.renderAll(dec, math.floor(c.duration * S.SR))
|
||||
local r = S.compare(S.features(buf, frames), c.ref)
|
||||
t:note("%-6s gain %+.2f dB, envelope r %.3f, spectrum %.3f, balance %.3f, %.2f s", c.name, r.gainDb, r.envCorr, r.spectral, r.balance, dec.duration)
|
||||
if r.spectral < THRESH.spectral or r.envCorr < THRESH.envCorr then
|
||||
t:note("%-7s gain %+.2f dB, loudness error %.2f dB, spectrum %.3f, balance %.3f, %.2f s", c.name, r.gainDb, r.envErr, r.spectral, r.balance, dec.duration)
|
||||
if r.spectral < THRESH.spectral or r.envErr > THRESH.envErr then
|
||||
for _, w in S.worst(S.features(buf, frames), c.ref, 6) do
|
||||
t:note(" block %d (%.2f s): spectrum %.3f, ours %.1f dB, ref %.1f dB", w[1], (w[1] - 1) * 2048 / S.SR, w[2], w[3], w[4])
|
||||
end
|
||||
end
|
||||
t:check(math.abs(r.gainDb) < THRESH.gainDb, c.name .. ": loudness")
|
||||
t:check(r.envCorr > THRESH.envCorr, c.name .. ": loudness envelope")
|
||||
t:check(r.envErr < THRESH.envErr, c.name .. ": loudness envelope")
|
||||
t:check(r.spectral > THRESH.spectral, c.name .. ": spectrum")
|
||||
t:check(r.balance < THRESH.balance, c.name .. ": stereo balance")
|
||||
-- the writer: MOD -> MOD gives the same bytes back (the fixtures are canonical ProTracker files)
|
||||
|
||||
Reference in new issue
Block a user