-- debug: voice states at a time local Bytes = require("@formats/core/Bytes") local Cases = require("@tests/gen/probe_cases") local name, at = ... local F = { s3m = require("@formats/music/s3m"), mod = require("@formats/music/mod") } for _, c in Cases do if c.name == name then local m = F[c.fmt].decode(Bytes.reader(buffer.fromstring(c.data))) local dec = m:render() local n = math.floor(tonumber(at) * 44100) while n > 0 do local _, got = dec:read(math.min(n, 4096)) n -= got if got == 0 then break end end local st = dec.st print("ord", st.ord, "row", st.row, "tick", st.tick, "speed", st.speed, "tempo", st.tempo, "gvol", st.gvol) for i, v in st.voices do if v.chan > 0 then print("voice", v.active, i, "chan", v.chan, "smp", v.smpIdx, "p", v.p, "inc", v.inc, "vol", v.vol, "g", v.gl, v.gr, "t", v.tl, v.tr, "len", v.len, v.loopS, v.loopE, v.loopT) end end local out = dec:read(8) print(buffer.readf32(out, 0), buffer.readf32(out, 4), buffer.readf32(out, 8)) end end