ws-audio2: music/ptm (PolyTracker): it family, MOD letters with S3M fine slides, note slides, delta 8 / 16-bit samples; engine flags.panLaw = ft2 (square-root panning)
ops/MusicOps: accept modules of the other tracker formats by their engine family (Tracker.family), a one-line backward-compatible change.
This commit is contained in:
1 parent
48b4b4cc4e
commit
60544a3a77
9 files changed
+409
-4
No files matched your search
@@ -221,6 +221,7 @@ function Player.new(m: any, sampleRate: number, opts: any): any
|
||||
autoReset = flags.autoReset or false,
|
||||
st2Tempo = flags.st2Tempo or false,
|
||||
oktSlides = flags.oktSlides or false,
|
||||
ft2Pan = flags.panLaw == "ft2",
|
||||
ord = 0,
|
||||
row = 0,
|
||||
tick = 0,
|
||||
@@ -1905,6 +1906,10 @@ local function updateVoice(st: any, v: any)
|
||||
local g = vol * st.master
|
||||
if v.surround then
|
||||
v.tl, v.tr = g * 0.5, -g * 0.5
|
||||
elseif st.ft2Pan then
|
||||
-- FT2's square-root pan law (OpenMPT's CompatibleFT2 mix levels), pan at most 255
|
||||
local p = min(pan, 255)
|
||||
v.tl, v.tr = g * math.sqrt((256 - p) / 256), g * math.sqrt(p / 256)
|
||||
else
|
||||
v.tl, v.tr = g * (256 - pan) / 256, g * pan / 256
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user