Automation, markers and the rest
Track::automation: Vec<AutoLane>; each lane has anAutoParam(Volume,Pan,Mute,Send(slot), orPlugin { uid, param, name }) and sortedAutoPoint { pos, value, curve }. Values are in native units: dB for volume and sends (-96..+6), -1..1 for pan, 0/1 for mute, 0..1 normalized for plug-in parameters.automation::value_atinterpolates between points, holds the first value before the first point and the last after the last; two points at one position make a step. A point’scurve(-1..1, 0 straight, saved only when set) bends the segment after it:automation::shapeist^(2^(-3·curve)). A straight segment takes exactly the old arithmetic, so projects without curves play bit for bit as before. The frontend’sautoLanes.tsmirrors it for drawing.Track::auto_modeis Logic’s Off / Read / Touch / Latch / Write (AutoMode).- The engine gets lanes as
Arc<Vec<LaneDsp>>(empty lanes left out) and compares targets with the cheapAutoTarget(no names). - Stereo Out has lanes too (
Master::automation,auto_mode): every automation command andCmdtakesMASTER_IDfor it (session/auto_lanes.rshasstrip_lanes), and the engine plays them indsp/auto.rs(volume and plug-ins, readpdc.totalback). - Folder stacks automate their volume and mute. A track whose nearest folder
(
TrackParams::folder) has automation playing works out the folder’sFoldState(fold_at, through the folders above it) at its own fader time, so the lanes line up with its delay-compensated audio, and rebuilds its volume and mute fromown_gain,own_mute,bus_muteand its VCA’svca_gainandvca_mutewith the folder’s gain and mute. Without folder automation the session’s static stack values apply as before. - Which lanes the UI shows: the main lane’s parameter is UI state (
autoLanein the store); the extra lanes below a track areTrack::auto_lanes(Master::auto_lanesfor the Output track), set withset_auto_lanes(one undo step).layout.tsgives themautoRowsafter the track’sheights, and the Output track anoutputrow belowtotal. - Writing is in
session/auto_write.rs: a pass collects points while a control moves (and about 30 times a second fromidle), and goes into its lane in one undo step when it ends (on release in Touch, at Stop otherwise).automation::spliceinserts it andthinremoves points within a per-parameter tolerance (Ramer-Douglas-Peucker on the vertical error).
Markers and Autopunch
Section titled “Markers and Autopunch”Project::markersis the Marker track, sorted by position (session/markers.rs). Markers are pure project data; the engine never sees them.Marker::lengthis a marker’s own length; None means it reaches the next marker (markerEndinmarkers.ts).Project::arrangementis the Arrangement track:ArrangementMarker { id, name, start, length, color }sections, sorted and tiling the timeline (each starts where the one before ends), in samples like markers (they don’t follow tempo changes).arrangement.rsholds the pure arithmetic: tiling, resize (ripples the later sections only), and the plans for moving, copying and deleting a section with its content. A plan is a time map (see Time maps for section edits): time before the arrangement stays, time after it shifts by the change in length, and neighbouring pieces that stay together are merged, so content is only cut where it comes apart.remap_pointsadds the old curve’s value at each piece’s first and last sample (pruning those the curve doesn’t need, asauto_movedoes).session/arrangement.rsapplies a plan in one step: a looping region cut at a piece edge first becomes real copies, the first piece of a cut region keeps its id, and markers in a copied section are copied too.Project::punch: Punch { enabled, start, end }is the Autopunch range. While recording,Cmd::Autopunchtells the engine where armed tracks stay silent and where input is captured.
Freeze
Section titled “Freeze”Track::frozen: Option<FreezeInfo { clip, start }> (session/freeze.rs):
- While set,
regions_dspreturns just the freeze file,eq_coeffsreturns a flat EQ, the plug-ins are unloaded from the engine, and their settings are kept inPluginSlot::state. - Freezing has two steps:
render_freeze(an isolated render, may run on a worker thread) andplace_freeze(main thread, one undo step capturing plug-ins). - Edits to a frozen track’s regions, plug-ins or Channel EQ are refused twice over:
check_unfrozenerrors before the edit where it can, andfrozen_guard(called by everyeditwrapper) puts back anything that slipped through and reports why. - Freeze files live in the project’s
Freeze Files/folder. Unfreezing deletes the file but keeps the clip in memory, so undo can freeze again;ensure_freeze_fileswrites a missing file back before saving.
Track alternatives
Section titled “Track alternatives”Track::alternatives: Vec<TrackAlternative { name, regions }> holds a track’s inactive region
sets and Track::alternative the active one’s name (empty means “A”); Track::regions is
always the active set, so nothing else in the engine or the UI needs to know about
alternatives (session/track_alternatives.rs). Switching swaps the sets and resends the
regions; every operation is an ordinary undoable edit, and restore resends regions that
differ. Frozen tracks refuse these edits up front, since frozen_guard only puts regions back.
Project::for_ui sends only the inactive alternatives’ names. Region ids in inactive sets stay
allocated, and their clips stay in Project::clips.
Other project fields
Section titled “Other project fields”name, sample_rate, tempo (5..990 BPM), sig_num/sig_den, key (a string such as
“C major”), master (Stereo Out: volume, inserts, EQ), cycle, metronome, count_in,
clips (id to path, relative to the project folder unless outside it), groups, click
(metronome settings), bit_depth (per-project recording format override), notes and
alternative (the project alternative’s name, see Persistence; restore
keeps the current one, since renaming isn’t an undo step).