* mix.pan: a stereo track says which channel it pans
A stereo track has a panner per channel. mix.pan defaulted index to 0, so
without it a stereo track moved only its left panner and folded the left
channel into the right. index is now required on stereo tracks, and an index
the track doesn't have (1 on a mono track, a non-number) is an error instead
of a silent no-op or 0.
* mix.pan: refuse a fractional index instead of rounding it
i64_or rounds, so index 1.4 picked the right panner. The number now has to be
whole first; 1.0 still counts as 1. null still means no index, as with slot.
---------
Co-authored-by: FredApps <[email protected]>
* mix.volume: say what each track got and when a value was clamped
The fader stops at -144 and +12 dB, and mix.volume replied only with a track
count, so +15 dB played at +12 with nothing to show it. The reply now lists
each target's volume and sets clamped when a target or a group member was
held at a stop.
* mix.volume: list every requested track in the reply
A target moved as a group sibling of an earlier one was skipped before it was
added to volumes, so tracks [3, 6] in one group listed only track 3. Build
volumes after the loop from each requested track's final volume.
A plugin may ask for another on_main_thread from on_main_thread before it
asks for the restart. idle ran one callback per call, so the restart and
the new latency came an idle later, after the bounce had fixed its head
trim. idle now runs callbacks until none is pending, at most eight, before
it checks for a restart. The CLAP fixture now asks for a second callback
before the restart, so its restart test covers this.
* Read volume automation at every sample, not once per block
Track and master faders read the dB curve at a block's first and last
sample and ramped linearly in gain between them, so a breakpoint acted up
to a block early or late and a short crossfade came out differently
depending on where the block edges fell. Both now take the gain at each
sample: the curve is read at its breakpoints and interpolated in dB in
between, as the lane defines it. Blocks with no change keep one gain.
Fixes#1354.
* docs: volume breakpoints no longer depend on the render block (G-04)
* Step fader ramps by a ratio and scale channels in contiguous runs
Reading the fader at every sample converted dB to gain per sample on
every ramp, and applied it sample by sample across channels, even when
nothing moved. A stretch that is linear in dB is geometric in gain, so
each stretch now converts its two ends exactly and steps the samples in
between by one ratio (in f64, so it does not drift), with the -144 dB
floor and the cap checked per sample. Each channel is scaled over the
whole stretch at once, and a stretch with no change is a plain multiply.
Tests: stepped ramps against db_to_gain sample by sample (floor, cap,
NaN, one or two samples, a 16384-sample ramp), and summed volume, trim
and VCA lanes with a muted track, read from renders that start inside a
ramp or on block edges.
* fix(mix): recover extreme automation ramps from silence
* fix(mix): preserve extreme ramp endpoints and silence NaNs
---------
Co-authored-by: FredApps <[email protected]>
A plugin can settle its latency in more than one step, and the result of
idle after the first block was rendered again was dropped, so a second
change left the head trim short. The render now starts over until no
insert's latency changes, four times at most, with a warning if it never
settles. Instrument latency still does not count: it is not part of
delay compensation, and the doc on idle_plugins now says so. Plugin::idle
also gets a contract for implementors, and the plugin-parity row ends
its sentence.
convert wrote every file with bwf: None, so converting a Broadcast Wave file
dropped its bext: description, originator, dates and the time reference that
places it on a timeline. Pass the decoded bext on. The time reference counts
samples, so with --rate it moves to the output rate.
libloading 0.9 prints only "dlopen failed" ("dlsym failed", "LoadLibraryExW
failed") and keeps the dlerror text or the Windows error as the error's source.
The CLAP and VST3 loaders formatted the error alone, so a plugin built for a
newer glibc was reported as "dlopen failed" with no reason. Append the source.
The CLI installed no logger, so every log::warn! and log::error! was
dropped: a plugin that failed to load just vanished from
engine.clap_plugins with no reason. A small logger now writes warnings
and errors to standard error as `warning: <message>` and
`error: <message>`, like the CLI's own errors. The level is fixed:
RUST_LOG stays a desktop app variable.
Fixes#1304.
Its help said `<plugin id>`, but it only runs built-in plugins, and a
hosted id (clap:, vst3:, au:) failed as "unknown process". The help now
says built-in plugin id, and a hosted id gets an error saying AudioSuite
runs built-in plugins only.
Fixes#1301.
Bounces passed no bwf to the encoder, so mix and stem WAVs had no bext
chunk and post tools placed them at zero. Bounce::new now stamps them
with TimeReference = the session's timecode start plus the bounce start,
in samples since midnight, as other DAWs do. A caller's own bwf wins;
AIFF and FLAC have no bext and are unchanged.
Fixes#1296.
Vst3Plugin::reset only flushes notes, so a VST3 insert on any track kept
what the discarded first pass left in it, a reverb or echo tail for
example. The second pass now prepares the hosted plugins again after the
reset, which deactivates and reactivates them. The comment also says
that the head trim is the first block's: a later latency change moves
the alignment from that block on, as in playback.
Bounces ran VST3 plugins with processMode kRealtime and never set
clap.render, so plugins that work differently offline never could.
Offline renders now create their plugins with Plugin::set_offline(true):
VST3 plugins get kOffline in setupProcessing and in every process call,
and CLAP plugins with clap.render are set to CLAP_RENDER_OFFLINE.
Playback stays realtime.
Fixes#1289.
LSP Limiter reports 0 samples at activate and its 5 ms lookahead once it
has processed, so bounces came out exactly 240 samples late. Offline
renders now give plugins main-thread time between blocks (Plugin::idle):
CLAP plugins get the on_main_thread and the restart they ask for, VST3
plugins are asked for their latency instead of waiting for
restartComponent. When a latency changes on the first block, the render
starts over from the range start, as a locate does.
Fixes#1287.