ws-music: music/it read + render (IT 2.14/2.15 decompression, NNA, filters, pitch-pan, OpenMPT note-fade coding), tracker tests tightened, MOD->XM + API checks, tracker bench lines, NOTICE
This commit is contained in:
1 parent
8b8b64885f
commit
7754646a86
14 files changed
+964
-28
No files matched your search
@@ -70,6 +70,7 @@ export type Envelope = {
|
||||
susEnd: number,
|
||||
carry: boolean?,
|
||||
filter: boolean?,
|
||||
raw: any?, -- format-specific fields kept for a faithful re-save (XM)
|
||||
}
|
||||
|
||||
export type Pattern = { rows: number, data: buffer }
|
||||
@@ -262,12 +263,14 @@ local function fixEnvelope(e: any): (any, string?)
|
||||
return e
|
||||
end
|
||||
|
||||
local function fixLoop(s: number, e: number, t: number, len: number): (number, number, number)
|
||||
if not num(t, 0, 2) or t == 0 then
|
||||
local function fixLoop(s0: any, e0: any, t0: any, len: number): (number, number, number)
|
||||
if not num(t0, 0, 2) or t0 == 0 or not num(s0, -2 ^ 52, 2 ^ 52) or not num(e0, -2 ^ 52, 2 ^ 52) then
|
||||
return 0, 0, 0
|
||||
end
|
||||
s, e = math.floor(math.clamp(s, 0, len)), math.floor(math.clamp(e, 0, len))
|
||||
if e - s < 1 then
|
||||
local s: number = math.floor(math.clamp(s0, 0, len))
|
||||
local e: number = math.floor(math.clamp(e0, 0, len))
|
||||
local t: number = math.floor(t0)
|
||||
if e - s < 1 or t == 0 then
|
||||
return 0, 0, 0
|
||||
end
|
||||
if t == 2 and e - s < 2 then
|
||||
@@ -378,7 +381,7 @@ function Tracker.validate(m: any): (boolean?, Err.Err?)
|
||||
ins.resonance = nil
|
||||
end
|
||||
end
|
||||
return true
|
||||
return true, nil
|
||||
end
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------ rendering
|
||||
@@ -402,7 +405,7 @@ function Tracker.duration(m: any, opts: RenderOptions?): (number?, Err.Err?)
|
||||
end
|
||||
frames += f
|
||||
end
|
||||
return math.min(frames, maxFrames) / sr
|
||||
return math.min(frames, maxFrames) / sr, nil
|
||||
end
|
||||
|
||||
local function newPlayer(self: any)
|
||||
|
||||
Reference in new issue
Block a user