forge
Explore
Log in

Don't you dare go Hollow

✨ Pitch takes fractional semitones (v58 when one is set), a speed ramp holds up to 64 keys, a given audio_kbps re-encodes the sound rather than being refused, and EDITH_FONTS_DIR adds font folders ahead of the system's

Browse files at this commit

5d650d9a2fd9fd0f5103e9ed51ad7feba08d4e70Ahmet Kaan GümüşParent: fd05fc7
MCP.mdmodified+5 -3
@@ -334,12 +334,12 @@ prints it live, and `help {topic:"<op>"}` gives one op's entry. The recipes and
334 | place | `place {source, at, lane?, in?, out?, length?, stretch?, audio?, audio_lane?, audio_track?, overwrite?}` (no lane: linked V1+A1; with lane: overwrites it; `at:"end"` is the timeline end, not the lane's, so it can leave a hole on a lane that ends sooner; a `length` past the source is refused ("runs past the source end") unless `stretch:true`; `audio_track:N` picks the sound track of a multi-audio file, 0-based as `media_probe` numbers them, and a track other than the source's own is placed as a source of its own, `src:N` with the same file name) · `append {source, in?, out?}` (to the end of its lane; not the timeline end) · `keep {source, ranges:[[in,out]…], lane?, at?}` (ranges back to back, the rough-cut workhorse) · `assemble {items:[{source,in?,out?}…], lane?, at?, gap?}` (keep across sources) |334 | place | `place {source, at, lane?, in?, out?, length?, stretch?, audio?, audio_lane?, audio_track?, overwrite?}` (no lane: linked V1+A1; with lane: overwrites it; `at:"end"` is the timeline end, not the lane's, so it can leave a hole on a lane that ends sooner; a `length` past the source is refused ("runs past the source end") unless `stretch:true`; `audio_track:N` picks the sound track of a multi-audio file, 0-based as `media_probe` numbers them, and a track other than the source's own is placed as a source of its own, `src:N` with the same file name) · `append {source, in?, out?}` (to the end of its lane; not the timeline end) · `keep {source, ranges:[[in,out]…], lane?, at?}` (ranges back to back, the rough-cut workhorse) · `assemble {items:[{source,in?,out?}…], lane?, at?, gap?}` (keep across sources) |
335 | three-point | `insert {source, in?, out?, at, to?, length?, lanes?}` · `overwrite {source, in?, out?, at, to?, length?, lanes?}` (`src` also spells `source`; the source range `in..out`, else the whole file, goes at `at`; `to` is a timeline out mark and `length` a duration, either sets the length from `in` instead of `out`; the take lands on `lanes`, at most one V and one A, else the first unlocked V and A lanes the source has, linked as one take; a still takes a V lane and `length` (default 5 s), a song an A lane. `insert` cuts the clip `at` falls inside and ripples what follows on those lanes only; it never moves or splits a lane outside the take, and refuses by name when that would pull a linked take apart. `overwrite` replaces what is there, trimming or splitting it, and nothing moves. Captions and titles keep their time; a locked lane refuses; one undo step each) |335 | three-point | `insert {source, in?, out?, at, to?, length?, lanes?}` · `overwrite {source, in?, out?, at, to?, length?, lanes?}` (`src` also spells `source`; the source range `in..out`, else the whole file, goes at `at`; `to` is a timeline out mark and `length` a duration, either sets the length from `in` instead of `out`; the take lands on `lanes`, at most one V and one A, else the first unlocked V and A lanes the source has, linked as one take; a still takes a V lane and `length` (default 5 s), a song an A lane. `insert` cuts the clip `at` falls inside and ripples what follows on those lanes only; it never moves or splits a lane outside the take, and refuses by name when that would pull a linked take apart. `overwrite` replaces what is there, trimming or splitting it, and nothing moves. Captions and titles keep their time; a locked lane refuses; one undo step each) |
336 | cut | `split {at, lanes?}` · `trim {clip, edge: in\|out, to, scope?}` [group] · `roll {clip, by\|to, edge?}` [group] (move the cut between two clips) · `slip {clip, by}` [group] (shift the source in/out, same slot) · `slide {clip, by}` [group] (move the clip between its neighbours) · `move {clip, at, to_lane?, insert?, titles?, split_captions?}` [group] (`insert:true` is a ripple move) · `delete {clip}` [group] · `lift {clip}` · `ripple_delete {clip}` · `close_gaps {lane}` · `cut_regions {regions:[[from,to]…], lanes?}` (accepts `silence` output verbatim) · `insert_time {at, duration, lanes?}` (ripples empty time in; a clip `at` falls inside is cut first) · `remove_time {at, duration, lanes?}` (the `cut_regions` cut for one span; a title wholly inside the span is removed, and one straddling an edge is trimmed to the part outside; the reply names both) · `swap {a, b}` (two clips on one lane trade places; a clip in a linked take is refused until the take is ungrouped) |336 | cut | `split {at, lanes?}` · `trim {clip, edge: in\|out, to, scope?}` [group] · `roll {clip, by\|to, edge?}` [group] (move the cut between two clips) · `slip {clip, by}` [group] (shift the source in/out, same slot) · `slide {clip, by}` [group] (move the clip between its neighbours) · `move {clip, at, to_lane?, insert?, titles?, split_captions?}` [group] (`insert:true` is a ripple move) · `delete {clip}` [group] · `lift {clip}` · `ripple_delete {clip}` · `close_gaps {lane}` · `cut_regions {regions:[[from,to]…], lanes?}` (accepts `silence` output verbatim) · `insert_time {at, duration, lanes?}` (ripples empty time in; a clip `at` falls inside is cut first) · `remove_time {at, duration, lanes?}` (the `cut_regions` cut for one span; a title wholly inside the span is removed, and one straddling an edge is trimmed to the part outside; the reply names both) · `swap {a, b}` (two clips on one lane trade places; a clip in a linked take is refused until the take is ungrouped) |
337-| time | `speed {clip, x}` 0.25–4 [group] (x is the absolute rate, not a multiplier: re-sending 0.5 on a clip already at 0.5 changes nothing) · `reverse {clip, on?}` [group] (plays the clip backward, picture and sound, or forward again; `on` omitted toggles; composes with speed and ramps; a still refuses; `clip_info` and `timeline` say `reversed`) · `speed_ramp {clip, keys:[{at, speed}…], ripple?, lanes?}` [group] (up to 8 keys at clip-relative times, speed 0.25–4 linear between them and held outside them; `keys:[]` clears the ramp) · `fade {clip, in?, out?}` (int = frames, `"0.5s"` = time) · `dissolve {clip, frames}` (video transition into the next clip) · `transition {clip, kind?=dissolve, length?, direction?}` (the same overlap with a look: `dissolve`, `dip-black`, `dip-white`, `wipe`, `slide`, `push` or `zoom`; `wipe`/`slide`/`push` move `left` (default), `right`, `up` or `down`, the way things move, so `wipe-left` shows the next clip from the right edge; `length` or `frames` is the overlap, kept when omitted; `dissolve` accepts `kind` too; the picture changes with the kind, the sound is always the crossfade; `timeline` flags and `clip_info.transition_kind` show it) · `crossfade {clip, frames}` (audio) · `freeze {at, duration, lane?=V1, insert?=true}` (holds the composed frame at `at` as a still; needs a project path, saved or not; see below) |337+| time | `speed {clip, x}` 0.25–4 [group] (x is the absolute rate, not a multiplier: re-sending 0.5 on a clip already at 0.5 changes nothing) · `reverse {clip, on?}` [group] (plays the clip backward, picture and sound, or forward again; `on` omitted toggles; composes with speed and ramps; a still refuses; `clip_info` and `timeline` say `reversed`) · `speed_ramp {clip, keys:[{at, speed}…], ripple?, lanes?}` [group] (up to 64 keys at clip-relative times, speed 0.25–4 linear between them and held outside them; `keys:[]` clears the ramp) · `fade {clip, in?, out?}` (int = frames, `"0.5s"` = time) · `dissolve {clip, frames}` (video transition into the next clip) · `transition {clip, kind?=dissolve, length?, direction?}` (the same overlap with a look: `dissolve`, `dip-black`, `dip-white`, `wipe`, `slide`, `push` or `zoom`; `wipe`/`slide`/`push` move `left` (default), `right`, `up` or `down`, the way things move, so `wipe-left` shows the next clip from the right edge; `length` or `frames` is the overlap, kept when omitted; `dissolve` accepts `kind` too; the picture changes with the kind, the sound is always the crossfade; `timeline` flags and `clip_info.transition_kind` show it) · `crossfade {clip, frames}` (audio) · `freeze {at, duration, lane?=V1, insert?=true}` (holds the composed frame at `at` as a still; needs a project path, saved or not; see below) |
338 | look | `color {clip, brightness?, contrast?, saturation?, tint?, reset?}` · `transform {clip, x?, y?, corner?, margin?, scale?, rotate?, crop?:[l,r,t,b], opacity?, reset?}` (`corner` is centre, top-left, top-right, bottom-left or bottom-right: the engine sets x and y from the picture's own size (after crop and quarter turn), the scale given and a `margin` in pixels (default 32) from the two edges it touches; giving x or y with corner is refused, and so is margin without corner; picture in picture is `corner:"bottom-right", scale:0.3`) · `transform_keys {clip, keys?:[{at, x?, y?, scale?, rotate?, opacity?, ease?}…], clear?}` (animates the transform over the clip's own time) · `opacity_keys {clip, keys?:[{at, opacity, ease?}…], clear?}` (opacity 0..1 over the clip's own time, fades multiply on top) · `color_keys {clip, keys?:[{at, brightness?, contrast?, saturation?, tint?, ease?}…], clear?}` (the grade over the clip's own time, interpolated per frame) · `look {clip, name}` (the whole grade becomes a look, one undo step: a built-in `Warm`, `Cool`, `Teal & orange`, `Bleach bypass`, `Black & white`, `Faded film`, `High contrast` or `Vintage`, or a saved one from the colour card's "Save current as look" (`$XDG_DATA_HOME/edith/looks/<name>.look`); an unknown name is refused with the list; `help {topic:"looks"}` lists them) · `look {clip, save:"<name>"}` (the reverse: the clip's grade is saved as a look of that name, as the grading card's "Save current as look" does; the project does not change, so no undo step; a built-in's name is refused) · `auto_color {clip}` (reads the clip's middle frame as shot: grey-world white balance into the wheels' channel gains, then brightness and contrast so the 0.5 % and 99.5 % luma percentiles land near 0.02 and 0.98; saturation, tint, curves and LUT kept; the reply gives the values set; one undo step) · · `wheels {clip, lift?, gamma?, gain?, reset?}` (each `[master, red, green, blue]`, -1..1, or one number for the master) · `curves {clip, master?, red?, green?, blue?, reset?}` (each up to 16 `[input, output]` points in 0..1, monotone cubic; `[]` straightens one) · `lut {clip, path?, mix?, clear?}` / `lut {relink, path}` (a `.cube` file, 1D or 3D up to 65, tetrahedral, mix 0..1; a broken file is refused; relink moves every clip naming a file, one undo step). The grade runs wheels → curves → LUT → the four sliders, in Rec. 709 R'G'B' for the first three; colour keys animate the sliders and the look holds under them; saved as v43 `wheels`/`curve`/`lut` lines. Recipe: `edit {ops:[{op:"lut", clip:"V1@0", path:"~/luts/warm.cube", mix:0.8}]}`, then `scopes {at:"2s"}` to read the shift · `copy_look {from, to | to_lane, what?}` (copies colour, transform, fit, effects, EQ, gain or speed onto other clips, one undo step) · `replace {clip, source, in?}` (the replace edit: overwrite the clip and its linked half with another source, same place and length) · `nudge {clips, by}` [group] (move clips by a signed distance, all or nothing) · `fit {clip, policy: fit\|fill\|stretch\|center}` · `deinterlace {clip, mode: frame\|field\|off\|ivtc-auto\|ivtc}` (how a video clip's interlaced source is made progressive, frame by default; only matters for an interlaced source, which `media_probe` reports; field and off are stored, the render acts on frame for now; `ivtc` removes 3:2 pulldown from telecined 29.97i H.264 and MPEG-2, giving the 23.976p film frames (best cadence found in the first 60 pictures, one cadence for the whole file), `ivtc-auto` does so only when that cadence is clear and otherwise deinterlaces as frame; put the project on 23.976 (`set_frame_rate`) for one timeline frame per film frame; soft pulldown (MPEG-2 repeat_first_field, H.264 pic_struct) in a transport stream is always presented as 23.976p; saved as v46 `deint` lines) · `visualizer {clip, on?, style?, fast?}` (the clip becomes a sound picture: style fill\|ribbon\|ring\|wave, fill by default; `fast` paints from a 0.2 s window; `on:false` turns it off, from the waveform picture or from the sound clip). On a sound clip, `on:true` places a waveform picture on the next free top picture lane (V2 or V3), grouped with the sound and covering the picture under it where they overlap; place it with `transform` (x, y move its centre, -1 to 1; scale; opacity). A picture address (`V1@…`) is mapped to its linked sound clip, which gets the picture; a picture with no linked sound is refused · `reframe {clip, aspect?=fit, smoothness?=0.5}` (auto reframe: a cheap saliency per sampled frame -- what moved since the last sample, local contrast, a pull to the middle, no models -- gives the subject's path, which is smoothed (`0.25 + 1.75 × smoothness` s), held still inside a dead zone and thinned to the keys where it turns; the keys scale the clip to cover the canvas and pan the subject to the middle, clamped so no edge ever shows; sets `fit` to fit and replaces the clip's `transform_keys` in one undo step, so no format change; it analyses before it answers; `aspect` is a guard that the project canvas has that shape; `engine::reframe`) · `stabilize {clip, on?, strength?=0.5, crop?=zoom, off?, cancel?}` (takes the camera shake out of a video clip: corners tracked frame to frame by pyramidal Lucas-Kanade, a shift-turn-zoom fitted by RANSAC, the camera path smoothed by a Gaussian of strength × 2 s (a steady pan is kept), each frame moved to the smoothed path before the clip's transform; `crop` `zoom` enlarges just enough that no frame shows an edge (≤1.5×), `full` keeps the frame and shows black edges; the analysis runs in the background, is cached per source and file-frame range under `~/.cache/edith/stabilise`, follows the footage through trims, speed, ramps and reverse; an export measures a missing analysis itself, which `export_status` shows as its `Measuring shake` stage with its own percent, while `frame` and `contact_sheet` never wait: they start it, draw the clip unstabilised and say the analysis is pending; `engine::stabilise`, format v44) |338 | look | `color {clip, brightness?, contrast?, saturation?, tint?, reset?}` · `transform {clip, x?, y?, corner?, margin?, scale?, rotate?, crop?:[l,r,t,b], opacity?, reset?}` (`corner` is centre, top-left, top-right, bottom-left or bottom-right: the engine sets x and y from the picture's own size (after crop and quarter turn), the scale given and a `margin` in pixels (default 32) from the two edges it touches; giving x or y with corner is refused, and so is margin without corner; picture in picture is `corner:"bottom-right", scale:0.3`) · `transform_keys {clip, keys?:[{at, x?, y?, scale?, rotate?, opacity?, ease?}…], clear?}` (animates the transform over the clip's own time) · `opacity_keys {clip, keys?:[{at, opacity, ease?}…], clear?}` (opacity 0..1 over the clip's own time, fades multiply on top) · `color_keys {clip, keys?:[{at, brightness?, contrast?, saturation?, tint?, ease?}…], clear?}` (the grade over the clip's own time, interpolated per frame) · `look {clip, name}` (the whole grade becomes a look, one undo step: a built-in `Warm`, `Cool`, `Teal & orange`, `Bleach bypass`, `Black & white`, `Faded film`, `High contrast` or `Vintage`, or a saved one from the colour card's "Save current as look" (`$XDG_DATA_HOME/edith/looks/<name>.look`); an unknown name is refused with the list; `help {topic:"looks"}` lists them) · `look {clip, save:"<name>"}` (the reverse: the clip's grade is saved as a look of that name, as the grading card's "Save current as look" does; the project does not change, so no undo step; a built-in's name is refused) · `auto_color {clip}` (reads the clip's middle frame as shot: grey-world white balance into the wheels' channel gains, then brightness and contrast so the 0.5 % and 99.5 % luma percentiles land near 0.02 and 0.98; saturation, tint, curves and LUT kept; the reply gives the values set; one undo step) · · `wheels {clip, lift?, gamma?, gain?, reset?}` (each `[master, red, green, blue]`, -1..1, or one number for the master) · `curves {clip, master?, red?, green?, blue?, reset?}` (each up to 16 `[input, output]` points in 0..1, monotone cubic; `[]` straightens one) · `lut {clip, path?, mix?, clear?}` / `lut {relink, path}` (a `.cube` file, 1D or 3D up to 65, tetrahedral, mix 0..1; a broken file is refused; relink moves every clip naming a file, one undo step). The grade runs wheels → curves → LUT → the four sliders, in Rec. 709 R'G'B' for the first three; colour keys animate the sliders and the look holds under them; saved as v43 `wheels`/`curve`/`lut` lines. Recipe: `edit {ops:[{op:"lut", clip:"V1@0", path:"~/luts/warm.cube", mix:0.8}]}`, then `scopes {at:"2s"}` to read the shift · `copy_look {from, to | to_lane, what?}` (copies colour, transform, fit, effects, EQ, gain or speed onto other clips, one undo step) · `replace {clip, source, in?}` (the replace edit: overwrite the clip and its linked half with another source, same place and length) · `nudge {clips, by}` [group] (move clips by a signed distance, all or nothing) · `fit {clip, policy: fit\|fill\|stretch\|center}` · `deinterlace {clip, mode: frame\|field\|off\|ivtc-auto\|ivtc}` (how a video clip's interlaced source is made progressive, frame by default; only matters for an interlaced source, which `media_probe` reports; field and off are stored, the render acts on frame for now; `ivtc` removes 3:2 pulldown from telecined 29.97i H.264 and MPEG-2, giving the 23.976p film frames (best cadence found in the first 60 pictures, one cadence for the whole file), `ivtc-auto` does so only when that cadence is clear and otherwise deinterlaces as frame; put the project on 23.976 (`set_frame_rate`) for one timeline frame per film frame; soft pulldown (MPEG-2 repeat_first_field, H.264 pic_struct) in a transport stream is always presented as 23.976p; saved as v46 `deint` lines) · `visualizer {clip, on?, style?, fast?}` (the clip becomes a sound picture: style fill\|ribbon\|ring\|wave, fill by default; `fast` paints from a 0.2 s window; `on:false` turns it off, from the waveform picture or from the sound clip). On a sound clip, `on:true` places a waveform picture on the next free top picture lane (V2 or V3), grouped with the sound and covering the picture under it where they overlap; place it with `transform` (x, y move its centre, -1 to 1; scale; opacity). A picture address (`V1@…`) is mapped to its linked sound clip, which gets the picture; a picture with no linked sound is refused · `reframe {clip, aspect?=fit, smoothness?=0.5}` (auto reframe: a cheap saliency per sampled frame -- what moved since the last sample, local contrast, a pull to the middle, no models -- gives the subject's path, which is smoothed (`0.25 + 1.75 × smoothness` s), held still inside a dead zone and thinned to the keys where it turns; the keys scale the clip to cover the canvas and pan the subject to the middle, clamped so no edge ever shows; sets `fit` to fit and replaces the clip's `transform_keys` in one undo step, so no format change; it analyses before it answers; `aspect` is a guard that the project canvas has that shape; `engine::reframe`) · `stabilize {clip, on?, strength?=0.5, crop?=zoom, off?, cancel?}` (takes the camera shake out of a video clip: corners tracked frame to frame by pyramidal Lucas-Kanade, a shift-turn-zoom fitted by RANSAC, the camera path smoothed by a Gaussian of strength × 2 s (a steady pan is kept), each frame moved to the smoothed path before the clip's transform; `crop` `zoom` enlarges just enough that no frame shows an edge (≤1.5×), `full` keeps the frame and shows black edges; the analysis runs in the background, is cached per source and file-frame range under `~/.cache/edith/stabilise`, follows the footage through trims, speed, ramps and reverse; an export measures a missing analysis itself, which `export_status` shows as its `Measuring shake` stage with its own percent, while `frame` and `contact_sheet` never wait: they start it, draw the clip unstabilised and say the analysis is pending; `engine::stabilise`, format v44) |
339 | generated | `generator_add {kind: solid\|gradient\|countdown\|bars\|rectangle\|ellipse\|line\|arrow, color?, color2?, angle?, from?, fill?, stroke?, width?, radius?, lane?=V1, at?, duration?=5s}` (shapes `rectangle`, `ellipse`, `line` and `arrow` draw on a transparent canvas and composite over the lanes below: `fill` and `stroke` are `"#rrggbb"` or `"none"`, `width` the stroke in pixels 0..400, `radius` rounds a rectangle 0..2000; a line and an arrow are all stroke, a line runs left to right and an arrow points right; a shape lands at 40% scale and its size and place are the clip's `transform`; a clip made from numbers instead of a file: `color` is `"#ff3366"`, `angle` 0..359 degrees with 0 left to right and 90 top to bottom, `from` the countdown's whole seconds 1..3600, which is also its default duration; `at` defaults to the end of the lane; the lane must exist; a param the kind does not take, an unknown kind or a bad colour is refused by name; it overwrites what it lands on like a still, and is an ordinary clip afterwards, so trim, move, split, `color`, `transform` and effects all work) · `generator_set {clip, color?, color2?, angle?, from?, fill?, stroke?, width?, radius?}` (params merged onto a generator clip, place and length kept; a clip that plays a file is refused) · `adjustment_add {lane?=V2, at?, duration?=5s}` (a clip with no picture whose grade and effects reach everything composed beneath it; with no lane, V2, added when there is only V1; a transform on it moves the whole composite below, so uncovered area goes black, while crop only limits where it reaches and cropped-away areas keep the untouched picture; adjacent layers hard-cut) · `label {clip \| clips, value}` (a name from the label palette in any case, 1..8, or `none`) · `enable {clip \| clips, on}` (`on:false` keeps the clip but skips its picture and sound; an off adjustment layer stops adjusting). One undo step each; `timeline` and `clip_info` show `generator solid #ff3366`, `adjustment layer`, `label Rose` and `disabled`, and `media_list` does not call a generator an offline file. A generator's source is a pseudo-path `/edith-gen/<spec>.gen` (`engine::generate`), so the library, trims and saves treat it as a still. Format v48 (older formats still load): written only when a project has a generator, a label or a switched-off clip, so other projects keep their older version |339 | generated | `generator_add {kind: solid\|gradient\|countdown\|bars\|rectangle\|ellipse\|line\|arrow, color?, color2?, angle?, from?, fill?, stroke?, width?, radius?, lane?=V1, at?, duration?=5s}` (shapes `rectangle`, `ellipse`, `line` and `arrow` draw on a transparent canvas and composite over the lanes below: `fill` and `stroke` are `"#rrggbb"` or `"none"`, `width` the stroke in pixels 0..400, `radius` rounds a rectangle 0..2000; a line and an arrow are all stroke, a line runs left to right and an arrow points right; a shape lands at 40% scale and its size and place are the clip's `transform`; a clip made from numbers instead of a file: `color` is `"#ff3366"`, `angle` 0..359 degrees with 0 left to right and 90 top to bottom, `from` the countdown's whole seconds 1..3600, which is also its default duration; `at` defaults to the end of the lane; the lane must exist; a param the kind does not take, an unknown kind or a bad colour is refused by name; it overwrites what it lands on like a still, and is an ordinary clip afterwards, so trim, move, split, `color`, `transform` and effects all work) · `generator_set {clip, color?, color2?, angle?, from?, fill?, stroke?, width?, radius?}` (params merged onto a generator clip, place and length kept; a clip that plays a file is refused) · `adjustment_add {lane?=V2, at?, duration?=5s}` (a clip with no picture whose grade and effects reach everything composed beneath it; with no lane, V2, added when there is only V1; a transform on it moves the whole composite below, so uncovered area goes black, while crop only limits where it reaches and cropped-away areas keep the untouched picture; adjacent layers hard-cut) · `label {clip \| clips, value}` (a name from the label palette in any case, 1..8, or `none`) · `enable {clip \| clips, on}` (`on:false` keeps the clip but skips its picture and sound; an off adjustment layer stops adjusting). One undo step each; `timeline` and `clip_info` show `generator solid #ff3366`, `adjustment layer`, `label Rose` and `disabled`, and `media_list` does not call a generator an offline file. A generator's source is a pseudo-path `/edith-gen/<spec>.gen` (`engine::generate`), so the library, trims and saves treat it as a still. Format v48 (older formats still load): written only when a project has a generator, a label or a switched-off clip, so other projects keep their older version |
340 | sequences | `nest {clips:[addr…], name?}` (folds the picked clips and their linked partners into a new sequence and leaves one compound clip, on the lowest picked video and sound lanes, linked; refuses when an unpicked clip sits between picked ones; one undo step) · `break_apart {clips}` (puts a compound clip's contents back, trimmed to the stretch it played, one undo step) · `place_sequence {sequence, at, lane?=V1}` (a sequence as a compound clip; a cycle is refused). A compound clip's source is `1<<30 + sequence id`; the render inlines it into the flat timeline, so a nested render equals the flat one; it has no speed, ramp or reverse (refused) and its own colour/effects/transform are not applied. Format v45 (`MAGIC_V44` still loads): the active sequence is the body as before, then `seqactive <id> <name>`, `seqorder <ids>` and one `seq <id> <name>` … `endseq` block per parked sequence holding a complete document; only written when there is more than one sequence or a compound clip, so other projects stay v44 or older. The frame rate is locked then |340 | sequences | `nest {clips:[addr…], name?}` (folds the picked clips and their linked partners into a new sequence and leaves one compound clip, on the lowest picked video and sound lanes, linked; refuses when an unpicked clip sits between picked ones; one undo step) · `break_apart {clips}` (puts a compound clip's contents back, trimmed to the stretch it played, one undo step) · `place_sequence {sequence, at, lane?=V1}` (a sequence as a compound clip; a cycle is refused). A compound clip's source is `1<<30 + sequence id`; the render inlines it into the flat timeline, so a nested render equals the flat one; it has no speed, ramp or reverse (refused) and its own colour/effects/transform are not applied. Format v45 (`MAGIC_V44` still loads): the active sequence is the body as before, then `seqactive <id> <name>`, `seqorder <ids>` and one `seq <id> <name>` … `endseq` block per parked sequence holding a complete document; only written when there is more than one sequence or a compound clip, so other projects stay v44 or older. The frame rate is locked then |
341 | multicam | `angle {clip, at?, angle?, audio?}` (switches a multicam clip's angle from `at` on: the clip is cut there when `at` is inside it, and the right part shows `angle`, a number from 1 or a name; the sound follows the picture unless `audio` is `"follow"` or an angle, which keeps it there; `clip` may be the picture or its linked sound clip; one undo step; refused for a clip that is not multicam, an angle that does not exist, or no change). A multicam clip is a compound clip (`source = 1<<30 + id`) with an `Angle {video, audio?}` on the clip; the sequence it plays is flagged multicam and holds angle `n` as its `n`th video lane and `n`th audio lane, so the render inlines exactly that angle's lane (`expand`), `break_apart` and `multicam_flatten` do the same. `timeline` rows read `multicam "Name" angle 2 "cam_b"`. Format v47 (`MAGIC_V46` and older still load; the version lives in `edith.rs` `MAGIC`/`NEWEST_VERSION`): `mcam <sequence id> <angle name>` lines in angle order after `seqorder`, and `angle <video|audio> <ord> <index> <picture> <sound|->` per clip that is not on angle 1 (angles counted from 1); written only when a project has a multicam source or a switched clip, so other projects keep their older version |341 | multicam | `angle {clip, at?, angle?, audio?}` (switches a multicam clip's angle from `at` on: the clip is cut there when `at` is inside it, and the right part shows `angle`, a number from 1 or a name; the sound follows the picture unless `audio` is `"follow"` or an angle, which keeps it there; `clip` may be the picture or its linked sound clip; one undo step; refused for a clip that is not multicam, an angle that does not exist, or no change). A multicam clip is a compound clip (`source = 1<<30 + id`) with an `Angle {video, audio?}` on the clip; the sequence it plays is flagged multicam and holds angle `n` as its `n`th video lane and `n`th audio lane, so the render inlines exactly that angle's lane (`expand`), `break_apart` and `multicam_flatten` do the same. `timeline` rows read `multicam "Name" angle 2 "cam_b"`. Format v47 (`MAGIC_V46` and older still load; the version lives in `edith.rs` `MAGIC`/`NEWEST_VERSION`): `mcam <sequence id> <angle name>` lines in angle order after `seqorder`, and `angle <video|audio> <ord> <index> <picture> <sound|->` per clip that is not on angle 1 (angles counted from 1); written only when a project has a multicam source or a switched clip, so other projects keep their older version |
342-| sound | `eq {clip, bands:[{f,db,q,kind}] (max 10), reset?}` (f 20–20000 Hz, db ±12, q 0.3–12 default 0.707; kind peak (default), low_shelf, high_shelf, low_cut, high_cut) · `gain {clip, db (-60..24) \| add_db}` (one audio clip's own volume, on top of its lane's; relative steps clamp to the range) · `gain_keys {clip, keys:[[time, db]…]}` (the clip's volume envelope, audio only: replaces all points, `[]` clears, max 256; times are timeline times inside the clip) · `gain_key {clip, at, db}` (one point; the same frame is replaced) · `gain_key_remove {clip, at}` (the point within a frame of `at`; a miss lists the points) · `gain_ramp {clip, from, to, to_db, from_db?}` (straight dB ramp; `from_db` defaults to the envelope's level at `from`) · `gain_dip {clip, from, to, db, ramp?="0.5s"}` (dips over `from..to` with ramps in and out, starting from the level there now and clamped to the clip). The ramp and dip ops replace the points inside their span. · `lane_gain {lane, db}` (-60..12) · `pan {clip, pan}` (-1 left .. 1 right, 0 the middle; an audio clip's balance, format v50 `clippan` line) · `pitch {clip, semitones}` (-12..12 whole semitones, 0 the original; an audio clip's pitch with its speed kept, format v52 `pitch` line) · `lane_pan {lane, pan}` (the same for an audio lane, on top of the clips' `lanepan` line) · `limiter {on?, ceiling_db?}` (ceiling -24..0 dB) · `duck {lane, under, depth_db?=-12, threshold_db?=-40, attack_ms?=80, release_ms?=400, off?}` (the lane dips while the key lane speaks) |· `dynamics {lane, gate?, nr?, compressor?, deesser?, reset?}` (an audio lane's voice processors, run gate, noise reduction, compressor, de-esser after the clips' own EQ and before the limiter; each is true, false (bypass) or an object of settings; `engine::voice`, format v41) |342+| sound | `eq {clip, bands:[{f,db,q,kind}] (max 10), reset?}` (f 20–20000 Hz, db ±12, q 0.3–12 default 0.707; kind peak (default), low_shelf, high_shelf, low_cut, high_cut) · `gain {clip, db (-60..24) \| add_db}` (one audio clip's own volume, on top of its lane's; relative steps clamp to the range) · `gain_keys {clip, keys:[[time, db]…]}` (the clip's volume envelope, audio only: replaces all points, `[]` clears, max 256; times are timeline times inside the clip) · `gain_key {clip, at, db}` (one point; the same frame is replaced) · `gain_key_remove {clip, at}` (the point within a frame of `at`; a miss lists the points) · `gain_ramp {clip, from, to, to_db, from_db?}` (straight dB ramp; `from_db` defaults to the envelope's level at `from`) · `gain_dip {clip, from, to, db, ramp?="0.5s"}` (dips over `from..to` with ramps in and out, starting from the level there now and clamped to the clip). The ramp and dip ops replace the points inside their span. · `lane_gain {lane, db}` (-60..12) · `pan {clip, pan}` (-1 left .. 1 right, 0 the middle; an audio clip's balance, format v50 `clippan` line) · `pitch {clip, semitones}` (-12..12 semitones, fractions too, 0.37; 0 the original; an audio clip's pitch with its speed kept, format v55 `pitch` line, v58 when fractional) · `lane_pan {lane, pan}` (the same for an audio lane, on top of the clips' `lanepan` line) · `limiter {on?, ceiling_db?}` (ceiling -24..0 dB) · `duck {lane, under, depth_db?=-12, threshold_db?=-40, attack_ms?=80, release_ms?=400, off?}` (the lane dips while the key lane speaks) |· `dynamics {lane, gate?, nr?, compressor?, deesser?, reset?}` (an audio lane's voice processors, run gate, noise reduction, compressor, de-esser after the clips' own EQ and before the limiter; each is true, false (bypass) or an object of settings; `engine::voice`, format v41) |
343 | lanes | `lane_add {kind}` · `lane_remove {lane}` · `lane_move {lane, to}` · `lane_flags {lane, hidden?, muted?, locked?}` · `lane_name {lane, name}` (the lane's display label, like a track name, at most 40 characters, `""` clears it; the address V1/A2 is unchanged and still what every op takes; `timeline` shows the name on the lane header and as `name` in its structured lanes; one undo step; saved as v46 `lanename` lines) |343 | lanes | `lane_add {kind}` · `lane_remove {lane}` · `lane_move {lane, to}` · `lane_flags {lane, hidden?, muted?, locked?}` · `lane_name {lane, name}` (the lane's display label, like a track name, at most 40 characters, `""` clears it; the address V1/A2 is unchanged and still what every op takes; `timeline` shows the name on the lane header and as `name` in its structured lanes; one undo step; saved as v46 `lanename` lines) |
344 | group | `group {clips:[addr…]}` · `ungroup {clip}` |344 | group | `group {clips:[addr…]}` · `ungroup {clip}` |
345 | captions | edit ops, not tools: `subtitles_import {path}` (tracks, no lane yet) · `captions_place {track, lane?, at?}` · `sub_move {clip, at, to_lane?}` [group] · `sub_trim {clip, edge:in|out, to}` · `sub_delete {clip}` · `captions_remove {track, force?}` · `cue_add {track, at, to, text, overwrite?}` · `cue_text {track, index, text}` (`\n` = line break) · `cue_delete {track, index}` · `cue_time {track, index, at?, to?}` (timeline times: trim or move one cue inside its neighbours, 0.1 s minimum) · `cue_merge {track, index}` (with the next cue) · `cue_split {track, index, at}` · `cue_replace {track?, find, replace, case_sensitive?}` (every cue of one track, or all tracks; case-insensitive unless `case_sensitive`; reports occurrences and cues). Written as `edit {ops:[{op:"cue_text", …}]}`; `captions` (the tool) lists the cues as `track T cue C` |345 | captions | edit ops, not tools: `subtitles_import {path}` (tracks, no lane yet) · `captions_place {track, lane?, at?}` · `sub_move {clip, at, to_lane?}` [group] · `sub_trim {clip, edge:in|out, to}` · `sub_delete {clip}` · `captions_remove {track, force?}` · `cue_add {track, at, to, text, overwrite?}` · `cue_text {track, index, text}` (`\n` = line break) · `cue_delete {track, index}` · `cue_time {track, index, at?, to?}` (timeline times: trim or move one cue inside its neighbours, 0.1 s minimum) · `cue_merge {track, index}` (with the next cue) · `cue_split {track, index, at}` · `cue_replace {track?, find, replace, case_sensitive?}` (every cue of one track, or all tracks; case-insensitive unless `case_sensitive`; reports occurrences and cues). Written as `edit {ops:[{op:"cue_text", …}]}`; `captions` (the tool) lists the cues as `track T cue C` |
@@ -402,11 +402,13 @@ flag turns that off; the server does not pass it.
402 Voice needs piper (`EDITH_PIPER`, or `~/.local/share/piper-venv/bin/piper`).402 Voice needs piper (`EDITH_PIPER`, or `~/.local/share/piper-venv/bin/piper`).
403 Piper's stderr is reported on failure.403 Piper's stderr is reported on failure.
404 404
405+Subtitle fonts: `EDITH_FONTS_DIR` (directories separated by `:`) adds font files that win over system fonts.
406+
405 ### 4.7 Export407 ### 4.7 Export
406 408
407 | tool | args | does |409 | tool | args | does |
408 |---|---|---|410 |---|---|---|
409-| `export_start` | **out**, preset (an `export_presets` id; explicit args override it), loudness (-30 to -5 LUFS, the integrated target; the true peak holds at the preset's ceiling or -1 dBTP, the gain is cut back and never a limiter), format (mp4, av1, av1-mp4, hevc, hevc-mp4, webm, wav, flac, mp3, ogg, m4a, opus, prores, png_sequence, still, gif), gif_width (320/480/640/720, default 480), gif_fps (1-60, default 15), gif_loop (default true), range, size, fit, bitrate_kbps, qp (0-51, a constant quantiser instead of a bitrate: the hardware seat for H.264, HEVC and AV1, and software HEVC; software H.264 and AV1 refuse it; not with bitrate_kbps), keyframe_s (0.1-10 seconds between key frames of the picture, default the encoder's two; not with intra_only), faststart (true lays an mp4, hevc-mp4, av1-mp4 or m4a out moov-first so it plays before it is fully read; other formats refused), audio_kbps (128/192/256/320, and 384 for AAC only: mp4, av1, av1-mp4, hevc, hevc-mp4, m4a), bit_depth (8\|10; 10 is AV1 and HEVC only), prores_profile (proxy\|lt\|standard\|hq\|4444\|4444xq; format `prores`, a `.mov`), hdr (off\|pq\|hlg; HEVC only, implies 10-bit), hevc_speed (default\|fast\|faster; HEVC only: fast is about 1.2-1.6x quicker for 0-3% more bits, faster about 1.5-2x quicker for up to 27% more), audio_bit_depth (16\|24; ProRes sound), chapters (default true; `"markers"` writes the comment markers as the chapters), intra_only, seat (auto\|hardware\|software), subtitles, burn_captions, overwrite | starts an export; returns `job:<n>` at once. The reply counts the chapters written (`3 chapters`) and, for an AV1 or HEVC file, its depth (`output 10-bit, from the source`) · `queue` (true: line the export up behind the others -- it keeps its own copy of the timeline as it is now, so later edits do not change it, and starts when every earlier export has finished, one encode at a time, polled or not; `export_status` shows it as `waiting`; default false starts at once beside any others) |411+| `export_start` | **out**, preset (an `export_presets` id; explicit args override it), loudness (-30 to -5 LUFS, the integrated target; the true peak holds at the preset's ceiling or -1 dBTP, the gain is cut back and never a limiter), format (mp4, av1, av1-mp4, hevc, hevc-mp4, webm, wav, flac, mp3, ogg, m4a, opus, prores, png_sequence, still, gif), gif_width (320/480/640/720, default 480), gif_fps (1-60, default 15), gif_loop (default true), range, size, fit, bitrate_kbps, qp (0-51, a constant quantiser instead of a bitrate: the hardware seat for H.264, HEVC and AV1, and software HEVC; software H.264 and AV1 refuse it; not with bitrate_kbps), keyframe_s (0.1-10 seconds between key frames of the picture, default the encoder's two; not with intra_only), faststart (true lays an mp4, hevc-mp4, av1-mp4 or m4a out moov-first so it plays before it is fully read; other formats refused), audio_kbps (128/192/256/320, and 384 for AAC only: mp4, av1, av1-mp4, hevc, hevc-mp4, m4a; given, the sound is re-encoded at it rather than copied, a preset's counts too), bit_depth (8\|10; 10 is AV1 and HEVC only), prores_profile (proxy\|lt\|standard\|hq\|4444\|4444xq; format `prores`, a `.mov`), hdr (off\|pq\|hlg; HEVC only, implies 10-bit), hevc_speed (default\|fast\|faster; HEVC only: fast is about 1.2-1.6x quicker for 0-3% more bits, faster about 1.5-2x quicker for up to 27% more), audio_bit_depth (16\|24; ProRes sound), chapters (default true; `"markers"` writes the comment markers as the chapters), intra_only, seat (auto\|hardware\|software), subtitles, burn_captions, overwrite | starts an export; returns `job:<n>` at once. The reply counts the chapters written (`3 chapters`) and, for an AV1 or HEVC file, its depth (`output 10-bit, from the source`) · `queue` (true: line the export up behind the others -- it keeps its own copy of the timeline as it is now, so later edits do not change it, and starts when every earlier export has finished, one encode at a time, polled or not; `export_status` shows it as `waiting`; default false starts at once beside any others) |
410 | `export_presets` | – | lists the export presets (id, label, format, bitrate_kbps, audio_kbps, size, bit_depth, prores_profile, hdr, loudness): youtube_1080p/1080p60/1080p_hevc/4k/4k60/4k_hevc, shorts_reels, podcast, podcast_ogg and podcast_opus (-16 LUFS, -1 dBTP), archive (10-bit AV1 mkv), archive_prores (ProRes 422 HQ .mov), hdr10_hevc (10-bit HEVC mp4 tagged PQ), archive_flac, archive_wav |412 | `export_presets` | – | lists the export presets (id, label, format, bitrate_kbps, audio_kbps, size, bit_depth, prores_profile, hdr, loudness): youtube_1080p/1080p60/1080p_hevc/4k/4k60/4k_hevc, shorts_reels, podcast, podcast_ogg and podcast_opus (-16 LUFS, -1 dBTP), archive (10-bit AV1 mkv), archive_prores (ProRes 422 HQ .mov), hdr10_hevc (10-bit HEVC mp4 tagged PQ), archive_flac, archive_wav |
411 | `export_captions` | format (`srt` or `vtt`, required unless chapters), path, overwrite, chapters | writes the timeline's captions (every cue on the subtitle lanes, in start order) as SRT or WebVTT; picture and empty cues are left out. Without `path`: `<first source> edit.<format>` in the Videos folder. Refuses an existing file unless `overwrite` is true, and writes nothing when there are no captions. `chapters: true` writes nothing and returns the chapter markers as the YouTube description listing (`00:00 Intro`, one line each), the text File > Copy chapters copies, as the reply text and as JSON (`chapters` lines, `text`, `warnings`) |413 | `export_captions` | format (`srt` or `vtt`, required unless chapters), path, overwrite, chapters | writes the timeline's captions (every cue on the subtitle lanes, in start order) as SRT or WebVTT; picture and empty cues are left out. Without `path`: `<first source> edit.<format>` in the Videos folder. Refuses an existing file unless `overwrite` is true, and writes nothing when there are no captions. `chapters: true` writes nothing and returns the chapter markers as the YouTube description listing (`00:00 Intro`, one line each), the text File > Copy chapters copies, as the reply text and as JSON (`chapters` lines, `text`, `warnings`) |
412 | `proxies` | action (`status`, the default, `make`, `cancel` or `delete`), source (`src:<n>`, a list or `"all"`) | the editing copies (proxies) of sources. `status` shows each source's state (ready, making with its percent, off, not needed for a sound or still, or why a stand-in failed). `make` starts one in the background and turns that film's switch back on; a film that plays at speed on this machine needs none, and says so. `cancel` stops one being made and leaves the film off, as the Proxies switch on a library row does. `delete` removes the stand-in and keeps the film off. With `auto_proxies` on, each `media_import` starts its stand-ins the same way |414 | `proxies` | action (`status`, the default, `make`, `cancel` or `delete`), source (`src:<n>`, a list or `"all"`) | the editing copies (proxies) of sources. `status` shows each source's state (ready, making with its percent, off, not needed for a sound or still, or why a stand-in failed). `make` starts one in the background and turns that film's switch back on; a film that plays at speed on this machine needs none, and says so. `cancel` stops one being made and leaves the film off, as the Proxies switch on a library row does. `delete` removes the stand-in and keeps the film off. With `auto_proxies` on, each `media_import` starts its stand-ins the same way |
crates/app/src/export_ui.rsmodified+1 -0
@@ -753,6 +753,7 @@ pub(crate) fn export_settings(
753 // free function cannot see; an empty list means "use the project's chapters".753 // free function cannot see; an empty list means "use the project's chapters".
754 chapters: Vec::new(),754 chapters: Vec::new(),
755 audio_kbps: Some(audio_kbps),755 audio_kbps: Some(audio_kbps),
756+ reencode_audio: false,
756 audio_bit_depth: None,757 audio_bit_depth: None,
757 bitrate: Some(bitrate),758 bitrate: Some(bitrate),
758 // The copy path (the old `Quality::Exact`) is off this surface: the759 // The copy path (the old `Quality::Exact`) is off this surface: the
crates/app/src/player/cards.rsmodified+3 -3
@@ -2656,8 +2656,8 @@ impl Player {
2656 ),2656 ),
2657 MixDrag::Pitch(..) => (2657 MixDrag::Pitch(..) => (
2658 self.mix_panel.borrow().pitch_bar.clone(),2658 self.mix_panel.borrow().pitch_bar.clone(),
2659- f32::from(engine::project::MIN_CLIP_PITCH),2659+ engine::project::MIN_CLIP_PITCH,
2660- f32::from(engine::project::MAX_CLIP_PITCH),2660+ engine::project::MAX_CLIP_PITCH,
2661 ),2661 ),
2662 MixDrag::Ceiling => (2662 MixDrag::Ceiling => (
2663 self.mix_panel.borrow().ceiling_bar.clone(),2663 self.mix_panel.borrow().ceiling_bar.clone(),
@@ -2717,7 +2717,7 @@ impl Player {
2717 /// Sets the selected clip's pitch in semitones; `true` when it moved.2717 /// Sets the selected clip's pitch in semitones; `true` when it moved.
2718 pub(crate) fn set_clip_pitch_mix(&mut self, lane: Lane, idx: usize, semitones: i32) -> bool {2718 pub(crate) fn set_clip_pitch_mix(&mut self, lane: Lane, idx: usize, semitones: i32) -> bool {
2719 match self.session.as_mut() {2719 match self.session.as_mut() {
2720- Some(session) => session.set_clip_pitch(lane, idx, semitones),2720+ Some(session) => session.set_clip_pitch(lane, idx, semitones as f32),
2721 None => false,2721 None => false,
2722 }2722 }
2723 }2723 }
crates/app/src/player/export.rsmodified+1 -1
@@ -579,7 +579,7 @@ impl Player {
579 /// sound: there is nothing to write either way.579 /// sound: there is nothing to write either way.
580 pub(crate) fn audio_rate_refusal(&self) -> Option<&'static str> {580 pub(crate) fn audio_rate_refusal(&self) -> Option<&'static str> {
581 match &self.session {581 match &self.session {
582- Some(session) => session.audio_rate_refusal(self.format, self.export_span().is_some()),582+ Some(session) => session.audio_rate_refusal(self.format, self.export_span().is_some(), false),
583 None => Some("no sound to write"),583 None => Some("no sound to write"),
584 }584 }
585 }585 }
crates/app/src/player/sections.rsmodified+1 -1
@@ -187,7 +187,7 @@ impl Player {
187 }187 }
188 Section::Effects => !clip.effects.is_empty(),188 Section::Effects => !clip.effects.is_empty(),
189 Section::Eq => session.eq_of(lane, idx).is_some_and(|e| !e.is_identity()),189 Section::Eq => session.eq_of(lane, idx).is_some_and(|e| !e.is_identity()),
190- Section::Mix => clip.gain_db != 0. || clip.pan != 0 || clip.pitch != 0 || !clip.gain_keys.is_empty() || clip.fade_in != 0 || clip.fade_out != 0,190+ Section::Mix => clip.gain_db != 0. || clip.pan != 0 || clip.pitch != 0.0 || !clip.gain_keys.is_empty() || clip.fade_in != 0 || clip.fade_out != 0,
191 }191 }
192 }192 }
193 }193 }
crates/app/src/tests/cards.rsmodified+2 -2
@@ -2060,7 +2060,7 @@ fn a_duration_row_shows_only_for_a_transition_and_its_room_is_the_successors() {
2060 gain_db: 0.0,2060 gain_db: 0.0,
2061 gain_keys: Vec::new(),2061 gain_keys: Vec::new(),
2062 pan: 0,2062 pan: 0,
2063- pitch: 0,2063+ pitch: 0.0,
2064 transform_keys: Vec::new(),2064 transform_keys: Vec::new(),
2065 opacity_keys: Vec::new(),2065 opacity_keys: Vec::new(),
2066 color_keys: Vec::new(),2066 color_keys: Vec::new(),
@@ -2163,7 +2163,7 @@ fn the_transition_kinds_are_palette_actions_and_set_through_a_gated_door() {
2163 gain_db: 0.0,2163 gain_db: 0.0,
2164 gain_keys: Vec::new(),2164 gain_keys: Vec::new(),
2165 pan: 0,2165 pan: 0,
2166- pitch: 0,2166+ pitch: 0.0,
2167 transform_keys: Vec::new(),2167 transform_keys: Vec::new(),
2168 };2168 };
2169 let mut b = a.clone();2169 let mut b = a.clone();
crates/app/src/tests/editing.rsmodified+4 -4
@@ -715,7 +715,7 @@ fn the_clip_menu_dims_what_the_playhead_is_not_on_and_stays_in_the_window() {
715 gain_db: 0.0,715 gain_db: 0.0,
716 gain_keys: Vec::new(),716 gain_keys: Vec::new(),
717 pan: 0,717 pan: 0,
718- pitch: 0,718+ pitch: 0.0,
719 transform_keys: Vec::new(),719 transform_keys: Vec::new(),
720 opacity_keys: Vec::new(),720 opacity_keys: Vec::new(),
721 color_keys: Vec::new(),721 color_keys: Vec::new(),
@@ -1205,7 +1205,7 @@ fn a_menu_offers_only_what_applies_and_is_drawn_inside_the_window() {
1205 gain_db: 0.0,1205 gain_db: 0.0,
1206 gain_keys: Vec::new(),1206 gain_keys: Vec::new(),
1207 pan: 0,1207 pan: 0,
1208- pitch: 0,1208+ pitch: 0.0,
1209 transform_keys: Vec::new(),1209 transform_keys: Vec::new(),
1210 opacity_keys: Vec::new(),1210 opacity_keys: Vec::new(),
1211 color_keys: Vec::new(),1211 color_keys: Vec::new(),
@@ -2001,7 +2001,7 @@ fn a_copied_clip_is_renumbered_or_dropped_when_a_row_leaves_the_library() {
2001 gain_db: 0.0,2001 gain_db: 0.0,
2002 gain_keys: Vec::new(),2002 gain_keys: Vec::new(),
2003 pan: 0,2003 pan: 0,
2004- pitch: 0,2004+ pitch: 0.0,
2005 transform_keys: Vec::new(),2005 transform_keys: Vec::new(),
2006 opacity_keys: Vec::new(),2006 opacity_keys: Vec::new(),
2007 color_keys: Vec::new(),2007 color_keys: Vec::new(),
@@ -2373,7 +2373,7 @@ fn trim_to_playhead_needs_a_subject_cut_with_the_playhead_on_it() {
2373 gain_db: 0.0,2373 gain_db: 0.0,
2374 gain_keys: Vec::new(),2374 gain_keys: Vec::new(),
2375 pan: 0,2375 pan: 0,
2376- pitch: 0,2376+ pitch: 0.0,
2377 transform_keys: Vec::new(),2377 transform_keys: Vec::new(),
2378 opacity_keys: Vec::new(),2378 opacity_keys: Vec::new(),
2379 color_keys: Vec::new(),2379 color_keys: Vec::new(),
crates/app/src/tests/layout.rsmodified+1 -1
@@ -742,7 +742,7 @@ fn a_drop_moves_the_clip_that_was_picked_up_not_its_old_index() {
742 gain_db: 0.0,742 gain_db: 0.0,
743 gain_keys: Vec::new(),743 gain_keys: Vec::new(),
744 pan: 0,744 pan: 0,
745- pitch: 0,745+ pitch: 0.0,
746 transform_keys: Vec::new(),746 transform_keys: Vec::new(),
747 opacity_keys: Vec::new(),747 opacity_keys: Vec::new(),
748 color_keys: Vec::new(),748 color_keys: Vec::new(),
crates/app/src/tests/menu_wire.rsmodified+1 -1
@@ -26,7 +26,7 @@ fn clip() -> Clip {
26 gain_db: 0.0,26 gain_db: 0.0,
27 gain_keys: Vec::new(),27 gain_keys: Vec::new(),
28 pan: 0,28 pan: 0,
29- pitch: 0,29+ pitch: 0.0,
30 transform_keys: Vec::new(),30 transform_keys: Vec::new(),
31 opacity_keys: Vec::new(),31 opacity_keys: Vec::new(),
32 color_keys: Vec::new(),32 color_keys: Vec::new(),
crates/app/src/tests/view.rsmodified+1 -1
@@ -224,7 +224,7 @@ fn the_marks_are_every_lane_the_playhead_and_the_start() {
224 gain_db: 0.0,224 gain_db: 0.0,
225 gain_keys: Vec::new(),225 gain_keys: Vec::new(),
226 pan: 0,226 pan: 0,
227- pitch: 0,227+ pitch: 0.0,
228 transform_keys: Vec::new(),228 transform_keys: Vec::new(),
229 opacity_keys: Vec::new(),229 opacity_keys: Vec::new(),
230 color_keys: Vec::new(),230 color_keys: Vec::new(),
crates/app/src/timeline_math.rsmodified+1 -1
@@ -1108,7 +1108,7 @@ mod drop_landing_tests {
1108 gain_db: 0.0,1108 gain_db: 0.0,
1109 gain_keys: Vec::new(),1109 gain_keys: Vec::new(),
1110 pan: 0,1110 pan: 0,
1111- pitch: 0,1111+ pitch: 0.0,
1112 transform_keys: Vec::new(),1112 transform_keys: Vec::new(),
1113 opacity_keys: Vec::new(),1113 opacity_keys: Vec::new(),
1114 color_keys: Vec::new(),1114 color_keys: Vec::new(),
crates/app/src/ui/cards/mix.rsmodified+9 -8
@@ -17,10 +17,11 @@ use crate::*;
17 /// What the dynamics section has switched on, in plain words and kept short: one line17 /// What the dynamics section has switched on, in plain words and kept short: one line
18 /// under the section, so it never wraps into the rows below.18 /// under the section, so it never wraps into the rows below.
19 /// A clip's pitch as the row reads it: `0 semitones`, `+3 semitones`, `-12 semitones`.19 /// A clip's pitch as the row reads it: `0 semitones`, `+3 semitones`, `-12 semitones`.
20-fn pitch_text(semitones: i32) -> String {20+fn pitch_text(semitones: f32) -> String {
21- match semitones {21+ if semitones == 0.0 {
22- 0 => "0 semitones".into(),22+ "0 semitones".into()
23- n => format!("{n:+} semitones"),23+ } else {
24+ format!("{semitones:+} semitones")
24 }25 }
25 }26 }
26 27
@@ -372,9 +373,9 @@ impl Player {
372 let t = tokens();373 let t = tokens();
373 let semis = target374 let semis = target
374 .and_then(|(lane, idx)| self.session.as_ref()?.clip_pitch_of(lane, idx))375 .and_then(|(lane, idx)| self.session.as_ref()?.clip_pitch_of(lane, idx))
375- .unwrap_or(0);376+ .unwrap_or(0.0);
376- let value = pitch_text(i32::from(semis));377+ let value = pitch_text(semis);
377- let changed = semis != 0;378+ let changed = semis != 0.0;
378 let bar = self.mix_panel.borrow().pitch_bar.clone();379 let bar = self.mix_panel.borrow().pitch_bar.clone();
379 let me = cx.entity();380 let me = cx.entity();
380 let typed = target.map(|(lane, idx)| SliderTyped {381 let typed = target.map(|(lane, idx)| SliderTyped {
@@ -409,7 +410,7 @@ impl Player {
409 );410 );
410 let track = centred_track(411 let track = centred_track(
411 "mix-clip-pitch",412 "mix-clip-pitch",
412- (f32::from(semis) + 12.) / 24.,413+ (semis + 12.) / 24.,
413 bar,414 bar,
414 move |this: &mut Player, x: Pixels, cx: &mut Context<Player>| {415 move |this: &mut Player, x: Pixels, cx: &mut Context<Player>| {
415 if let Some((lane, idx)) = target {416 if let Some((lane, idx)) = target {
crates/engine/examples/bench.rsmodified+1 -1
@@ -900,7 +900,7 @@ fn export_bench(path: &Path, seat: &str, out_dir: &Path) {
900 fit: engine::scale::FitPolicy::default(),900 fit: engine::scale::FitPolicy::default(),
901 speed: Speed::NORMAL,901 speed: Speed::NORMAL,
902 transform: None,902 transform: None,
903- pitch: 0,903+ pitch: 0.0,
904 };904 };
905 // The sound, where it was asked for, is the same clip on an audio lane:905 // The sound, where it was asked for, is the same clip on an audio lane:
906 // the very window the picture covers, so the two passes measure one export.906 // the very window the picture covers, so the two passes measure one export.
crates/engine/src/audio.rsmodified+1 -1
@@ -5576,7 +5576,7 @@ mod tests {
5576 fit: FitPolicy::default(),5576 fit: FitPolicy::default(),
5577 speed: Speed::NORMAL,5577 speed: Speed::NORMAL,
5578 transform: None,5578 transform: None,
5579- pitch: 0,5579+ pitch: 0.0,
5580 };5580 };
5581 // One second of the mono source, then one second of the stereo one.5581 // One second of the mono source, then one second of the stereo one.
5582 let project = Project::from_parts(5582 let project = Project::from_parts(
crates/engine/src/beats.rsmodified+1 -1
@@ -446,7 +446,7 @@ mod tests {
446 transform: None,446 transform: None,
447 fit: FitPolicy::default(),447 fit: FitPolicy::default(),
448 speed: Speed::default(),448 speed: Speed::default(),
449- pitch: 0,449+ pitch: 0.0,
450 };450 };
451 // 0.5 s is source frame 62.5, rounded to 63 -> timeline 113; 1.0 s is 75 -> 125.451 // 0.5 s is source frame 62.5, rounded to 63 -> timeline 113; 1.0 s is 75 -> 125.
452 // 20 s is past the clip's end and is dropped.452 // 20 s is past the clip's end and is dropped.
crates/engine/src/edith.rsmodified+35 -25
@@ -248,9 +248,11 @@
248 //! with none is the bytes a v28 one was bar the version line.248 //! with none is the bytes a v28 one was bar the version line.
249 //!249 //!
250 //! A `pitch` line is `pitch audio <ord> <index> <semitones>`: an audio clip's pitch250 //! A `pitch` line is `pitch audio <ord> <index> <semitones>`: an audio clip's pitch
251-//! shift in whole semitones, `-12` to `12`, written for each clip that is not at `0`,251+//! shift in semitones, `-12` to `12`, written for each clip that is not at `0`,
252-//! after the lanes it names (as `clippan` is). **Version 52** is the first dialect252+//! after the lanes it names (as `clippan` is). **Version 55** is the first dialect
253-//! with one; a project with none is the bytes a v51 one was bar the version line.253+//! with one, whole semitones only. **Version 58** allows a fraction (`0.37`), which a
254+//! pre-v58 reader would refuse; a project whose shifts are all whole keeps the header
255+//! it needed before. A project with none is the bytes a v54 one was bar the version line.
254 //!256 //!
255 //! The `resolution` line is the **project's** picture size, which is a257 //! The `resolution` line is the **project's** picture size, which is a
256 //! different thing from any source's: media of other sizes are placed on it.258 //! different thing from any source's: media of other sizes are placed on it.
@@ -444,11 +446,12 @@ use crate::transform::{KeyEase, MAX_TRANSFORM_KEYS, OpacityKey, TransformKey, Tr
444 /// The newest project format version: the `N` in the `edith N` first line that446 /// The newest project format version: the `N` in the `edith N` first line that
445 /// [`save`] writes for a project that uses the newest features. A reader refuses any447 /// [`save`] writes for a project that uses the newest features. A reader refuses any
446 /// higher version by name.448 /// higher version by name.
447-pub const NEWEST_VERSION: u32 = 57;449+pub const NEWEST_VERSION: u32 = 58;
448 450
449 /// What [`save`] writes. Read support goes back to `edith 1`; see the module451 /// What [`save`] writes. Read support goes back to `edith 1`; see the module
450 /// docs for what those dialects looked like. Kept at [`NEWEST_VERSION`].452 /// docs for what those dialects looked like. Kept at [`NEWEST_VERSION`].
451-const MAGIC: &[u8] = b"edith 57";453+const MAGIC: &[u8] = b"edith 58";
454+const MAGIC_V57: &[u8] = b"edith 57";
452 const MAGIC_V56: &[u8] = b"edith 56";455 const MAGIC_V56: &[u8] = b"edith 56";
453 const MAGIC_V55: &[u8] = b"edith 55";456 const MAGIC_V55: &[u8] = b"edith 55";
454 const MAGIC_V54: &[u8] = b"edith 54";457 const MAGIC_V54: &[u8] = b"edith 54";
@@ -830,13 +833,17 @@ pub fn encode_flagged(
830 // ...and one with an effect's keys is v56 (`ekeys`), as is one with a custom bezier key easing.833 // ...and one with an effect's keys is v56 (`ekeys`), as is one with a custom bezier key easing.
831 let keyed = lanes.iter().any(|(_, clips)| clips.iter().any(|c| c.effects.iter().any(|e| !e.keys.is_empty())));834 let keyed = lanes.iter().any(|(_, clips)| clips.iter().any(|c| c.effects.iter().any(|e| !e.keys.is_empty())));
832 // ...and one with a clip's pitch shift is v55.835 // ...and one with a clip's pitch shift is v55.
833- let pitched = lanes.iter().any(|(_, clips)| clips.iter().any(|c| c.pitch != 0));836+ let pitched = lanes.iter().any(|(_, clips)| clips.iter().any(|c| c.pitch != 0.0));
837+ // ...and one with a fractional pitch shift is v58.
838+ let fractional = lanes.iter().any(|(_, clips)| clips.iter().any(|c| c.pitch.fract() != 0.0));
834 // ...and one with a title's own keys is v56 (`ttkeys`).839 // ...and one with a title's own keys is v56 (`ttkeys`).
835 let title_keyed = titles.iter().any(|t| !t.keys.is_empty());840 let title_keyed = titles.iter().any(|t| !t.keys.is_empty());
836 let curved = keyed || title_keyed || lanes.iter().any(|(_, clips)| clips.iter().any(has_bezier));841 let curved = keyed || title_keyed || lanes.iter().any(|(_, clips)| clips.iter().any(has_bezier));
837 if curved || pitched || titled || panned || styled || marked || angled || named || deinterlaced || steadied || looked || effected || voiced || captioned || animated || reversed || transitioned || ramped || !chapters.is_empty() || !markers.is_empty() {842 if curved || pitched || titled || panned || styled || marked || angled || named || deinterlaced || steadied || looked || effected || voiced || captioned || animated || reversed || transitioned || ramped || !chapters.is_empty() || !markers.is_empty() {
838 let first_end = bytes.iter().position(|&b| b == b'\n').unwrap_or(bytes.len());843 let first_end = bytes.iter().position(|&b| b == b'\n').unwrap_or(bytes.len());
839- let header = if curved {844+ let header = if fractional {
845+ MAGIC
846+ } else if curved {
840 MAGIC_V56847 MAGIC_V56
841 } else if pitched {848 } else if pitched {
842 MAGIC_V55849 MAGIC_V55
@@ -971,7 +978,7 @@ pub fn noted(mut main: Vec<u8>, notes: &str, still_secs: f64, speech_model: Opti
971 return main;978 return main;
972 }979 }
973 let first_end = main.iter().position(|&b| b == b'\n').unwrap_or(main.len());980 let first_end = main.iter().position(|&b| b == b'\n').unwrap_or(main.len());
974- let header = raise_header(&main[..first_end], if speech { MAGIC } else { MAGIC_V52 });981+ let header = raise_header(&main[..first_end], if speech { MAGIC_V57 } else { MAGIC_V52 });
975 main.splice(..first_end, header);982 main.splice(..first_end, header);
976 if main.last() != Some(&b'\n') {983 if main.last() != Some(&b'\n') {
977 main.push(b'\n');984 main.push(b'\n');
@@ -1064,7 +1071,8 @@ pub fn sequenced(main: Vec<u8>, active: (u32, &str), order: &[u32], blocks: &[Se
1064 // v47 only when something in the file needs it (a multicam source or an angle somewhere), v461071 // v47 only when something in the file needs it (a multicam source or an angle somewhere), v46
1065 // when a part is v46; a newer-only line under an older header is refused.1072 // when a part is v46; a newer-only line under an older header is refused.
1066 let is = |b: &[u8], m: &[u8]| b.starts_with(m) && b.get(m.len()) == Some(&b'\n');1073 let is = |b: &[u8], m: &[u8]| b.starts_with(m) && b.get(m.len()) == Some(&b'\n');
1067- let v57 = is(&bytes, MAGIC) || blocks.iter().any(|b| is(&b.bytes, MAGIC));1074+ let v58 = is(&bytes, MAGIC) || blocks.iter().any(|b| is(&b.bytes, MAGIC));
1075+ let v57 = v58 || is(&bytes, MAGIC_V57) || blocks.iter().any(|b| is(&b.bytes, MAGIC_V57));
1068 let v56 = v57 || is(&bytes, MAGIC_V56) || blocks.iter().any(|b| is(&b.bytes, MAGIC_V56));1076 let v56 = v57 || is(&bytes, MAGIC_V56) || blocks.iter().any(|b| is(&b.bytes, MAGIC_V56));
1069 let v55 = v56 || is(&bytes, MAGIC_V55) || blocks.iter().any(|b| is(&b.bytes, MAGIC_V55));1077 let v55 = v56 || is(&bytes, MAGIC_V55) || blocks.iter().any(|b| is(&b.bytes, MAGIC_V55));
1070 let v54 = v55 || is(&bytes, MAGIC_V54) || blocks.iter().any(|b| is(&b.bytes, MAGIC_V54));1078 let v54 = v55 || is(&bytes, MAGIC_V54) || blocks.iter().any(|b| is(&b.bytes, MAGIC_V54));
@@ -1076,7 +1084,7 @@ pub fn sequenced(main: Vec<u8>, active: (u32, &str), order: &[u32], blocks: &[Se
1076 let v48 = v49 || is(&bytes, MAGIC_V48) || blocks.iter().any(|b| is(&b.bytes, MAGIC_V48));1084 let v48 = v49 || is(&bytes, MAGIC_V48) || blocks.iter().any(|b| is(&b.bytes, MAGIC_V48));
1077 let v47 = !mcam.is_empty() || is(&bytes, MAGIC_V47) || blocks.iter().any(|b| is(&b.bytes, MAGIC_V47));1085 let v47 = !mcam.is_empty() || is(&bytes, MAGIC_V47) || blocks.iter().any(|b| is(&b.bytes, MAGIC_V47));
1078 let v46 = is(&bytes, MAGIC_V46) || blocks.iter().any(|b| is(&b.bytes, MAGIC_V46));1086 let v46 = is(&bytes, MAGIC_V46) || blocks.iter().any(|b| is(&b.bytes, MAGIC_V46));
1079- let header = if v57 { MAGIC } else if v56 { MAGIC_V56 } else if v55 { MAGIC_V55 } else if v54 { MAGIC_V54 } else if v53 { MAGIC_V53 } else if v52 { MAGIC_V52 } else if v51 { MAGIC_V51 } else if v50 { MAGIC_V50 } else if v49 { MAGIC_V49 } else if v48 { MAGIC_V48 } else if v47 { MAGIC_V47 } else if v46 { MAGIC_V46 } else { MAGIC_V45 };1087+ let header = if v58 { MAGIC } else if v57 { MAGIC_V57 } else if v56 { MAGIC_V56 } else if v55 { MAGIC_V55 } else if v54 { MAGIC_V54 } else if v53 { MAGIC_V53 } else if v52 { MAGIC_V52 } else if v51 { MAGIC_V51 } else if v50 { MAGIC_V50 } else if v49 { MAGIC_V49 } else if v48 { MAGIC_V48 } else if v47 { MAGIC_V47 } else if v46 { MAGIC_V46 } else { MAGIC_V45 };
1080 bytes.splice(..first_end, header.iter().copied());1088 bytes.splice(..first_end, header.iter().copied());
1081 bytes.extend_from_slice(format!("seqactive {} ", active.0).as_bytes());1089 bytes.extend_from_slice(format!("seqactive {} ", active.0).as_bytes());
1082 escape_text(active.1, &mut bytes);1090 escape_text(active.1, &mut bytes);
@@ -1316,7 +1324,7 @@ fn pitch_lines(lanes: &[(LaneKind, Vec<Clip>)]) -> Vec<u8> {
1316 }1324 }
1317 audio += 1;1325 audio += 1;
1318 for (idx, c) in clips.iter().enumerate() {1326 for (idx, c) in clips.iter().enumerate() {
1319- if c.pitch != 0 {1327+ if c.pitch != 0.0 {
1320 out.extend_from_slice(format!("pitch audio {audio} {idx} {}\n", c.pitch).as_bytes());1328 out.extend_from_slice(format!("pitch audio {audio} {idx} {}\n", c.pitch).as_bytes());
1321 }1329 }
1322 }1330 }
@@ -2313,7 +2321,8 @@ fn parse(data: &[u8], dir: &Path) -> crate::Result<Document> {
2313 // The one that carries a clip's placement animation, as `tkeys` lines...2321 // The one that carries a clip's placement animation, as `tkeys` lines...
2314 // The one that carries a clip's stabilisation, as `stab` lines...2322 // The one that carries a clip's stabilisation, as `stab` lines...
2315 // The one that carries a clip's pitch shift, as `pitch` lines...2323 // The one that carries a clip's pitch shift, as `pitch` lines...
2316- let v57 = first == MAGIC;2324+ let v58 = first == MAGIC;
2325+ let v57 = v58 || first == MAGIC_V57;
2317 let v56 = v57 || first == MAGIC_V56;2326 let v56 = v57 || first == MAGIC_V56;
2318 let v55 = v56 || first == MAGIC_V55;2327 let v55 = v56 || first == MAGIC_V55;
2319 let v54 = v55 || first == MAGIC_V54;2328 let v54 = v55 || first == MAGIC_V54;
@@ -2797,9 +2806,9 @@ fn parse(data: &[u8], dir: &Path) -> crate::Result<Document> {
2797 .map(|(at, _)| at)2806 .map(|(at, _)| at)
2798 .ok_or_else(|| format!("line {n}: pitch names a lane that is not there"))?;2807 .ok_or_else(|| format!("line {n}: pitch names a lane that is not there"))?;
2799 let idx = number(f[2], n)? as usize;2808 let idx = number(f[2], n)? as usize;
2800- let semitones = std::str::from_utf8(f[3]).ok().and_then(|s| s.parse::<i8>().ok());2809+ let semitones = std::str::from_utf8(f[3]).ok().and_then(|s| s.parse::<f32>().ok());
2801 let semitones = match semitones {2810 let semitones = match semitones {
2802- Some(v) if (crate::project::MIN_CLIP_PITCH..=crate::project::MAX_CLIP_PITCH).contains(&v) => v,2811+ Some(v) if (crate::project::MIN_CLIP_PITCH..=crate::project::MAX_CLIP_PITCH).contains(&v) && (v58 || v.fract() == 0.0) => v,
2803 _ => return Err(format!("line {n}: pitch has a number out of its range").into()),2812 _ => return Err(format!("line {n}: pitch has a number out of its range").into()),
2804 };2813 };
2805 doc.lanes[at]2814 doc.lanes[at]
@@ -4060,7 +4069,7 @@ fn parse(data: &[u8], dir: &Path) -> crate::Result<Document> {
4060 transform: None,4069 transform: None,
4061 fit: FitPolicy::default(),4070 fit: FitPolicy::default(),
4062 speed: Speed::NORMAL,4071 speed: Speed::NORMAL,
4063- pitch: 0,4072+ pitch: 0.0,
4064 },4073 },
4065 &doc,4074 &doc,
4066 n,4075 n,
@@ -4258,7 +4267,7 @@ fn parse(data: &[u8], dir: &Path) -> crate::Result<Document> {
4258 )?,4267 )?,
4259 fit: fit_policy(f.get(7).copied(), n)?,4268 fit: fit_policy(f.get(7).copied(), n)?,
4260 speed,4269 speed,
4261- pitch: 0,4270+ pitch: 0.0,
4262 },4271 },
4263 &doc,4272 &doc,
4264 n,4273 n,
@@ -5533,7 +5542,7 @@ mod tests {
5533 transform: None,5542 transform: None,
5534 fit: FitPolicy::default(),5543 fit: FitPolicy::default(),
5535 speed: Speed::NORMAL,5544 speed: Speed::NORMAL,
5536- pitch: 0,5545+ pitch: 0.0,
5537 }5546 }
5538 }5547 }
5539 5548
@@ -5998,7 +6007,7 @@ mod tests {
5998 transform: None,6007 transform: None,
5999 fit: FitPolicy::default(),6008 fit: FitPolicy::default(),
6000 speed: Speed::from_permille(permille),6009 speed: Speed::from_permille(permille),
6001- pitch: 0,6010+ pitch: 0.0,
6002 };6011 };
6003 // 30 source frames at 2x is 15 timeline frames, which is where the6012 // 30 source frames at 2x is 15 timeline frames, which is where the
6004 // second clip starts -- the file writes the source range and the rate,6013 // second clip starts -- the file writes the source range and the rate,
@@ -6100,7 +6109,7 @@ mod tests {
6100 transform: None,6109 transform: None,
6101 fit: FitPolicy::default(),6110 fit: FitPolicy::default(),
6102 speed: Speed::NORMAL,6111 speed: Speed::NORMAL,
6103- pitch: 0,6112+ pitch: 0.0,
6104 };6113 };
6105 let lanes = vec![(LaneKind::Video, vec![faded])];6114 let lanes = vec![(LaneKind::Video, vec![faded])];
6106 let bytes = emit(&dir, &sources, &lanes, &[], &[], (1280, 720), 0);6115 let bytes = emit(&dir, &sources, &lanes, &[], &[], (1280, 720), 0);
@@ -6169,7 +6178,7 @@ mod tests {
6169 transform: None,6178 transform: None,
6170 fit: FitPolicy::default(),6179 fit: FitPolicy::default(),
6171 speed: Speed::NORMAL,6180 speed: Speed::NORMAL,
6172- pitch: 0,6181+ pitch: 0.0,
6173 };6182 };
6174 let lanes = vec![(LaneKind::Video, vec![dissolving])];6183 let lanes = vec![(LaneKind::Video, vec![dissolving])];
6175 let bytes = emit(&dir, &sources, &lanes, &[], &[], (1280, 720), 0);6184 let bytes = emit(&dir, &sources, &lanes, &[], &[], (1280, 720), 0);
@@ -7184,13 +7193,13 @@ mod tests {
7184 assert!(!before.contains("pitch"), "{before}");7193 assert!(!before.contains("pitch"), "{before}");
7185 assert!(!before.starts_with("edith 55"), "{before}");7194 assert!(!before.starts_with("edith 55"), "{before}");
7186 let mut lanes = plain.clone();7195 let mut lanes = plain.clone();
7187- lanes[1].1[1].pitch = -7;7196+ lanes[1].1[1].pitch = -7.0;
7188 let text = save(&lanes);7197 let text = save(&lanes);
7189 assert!(text.starts_with("edith 55\n"), "{text}");7198 assert!(text.starts_with("edith 55\n"), "{text}");
7190 assert!(text.contains("\npitch audio 1 1 -7\n"), "{text}");7199 assert!(text.contains("\npitch audio 1 1 -7\n"), "{text}");
7191 let back = load(&path).expect("v55 loads");7200 let back = load(&path).expect("v55 loads");
7192- assert_eq!(back.lanes[1].1[1].pitch, -7);7201+ assert_eq!(back.lanes[1].1[1].pitch, -7.0);
7193- assert_eq!(back.lanes[1].1[0].pitch, 0);7202+ assert_eq!(back.lanes[1].1[0].pitch, 0.0);
7194 assert_eq!(save(&back.lanes), text, "saved again: the same bytes");7203 assert_eq!(save(&back.lanes), text, "saved again: the same bytes");
7195 let dirp = PathBuf::from("/proj");7204 let dirp = PathBuf::from("/proj");
7196 let head = "edith 55\nplayhead 0\nresolution 1280 720\nsource 0 a.mp4\n\7205 let head = "edith 55\nplayhead 0\nresolution 1280 720\nsource 0 a.mp4\n\
@@ -8052,7 +8061,7 @@ mod clip_gain_tests {
8052 visualizer: 0,8061 visualizer: 0,
8053 viz_paint: 0,8062 viz_paint: 0,
8054 gain_db,8063 gain_db,
8055- pitch: 0,8064+ pitch: 0.0,
8056 };8065 };
8057 let lanes = vec![8066 let lanes = vec![
8058 (LaneKind::Video, vec![clip(0.0)]),8067 (LaneKind::Video, vec![clip(0.0)]),
@@ -8423,11 +8432,12 @@ mod gain_key_tests {
8423 let err = parse(v34.as_bytes(), &dir).unwrap_err().to_string();8432 let err = parse(v34.as_bytes(), &dir).unwrap_err().to_string();
8424 assert!(err.contains("speedkeys"), "{err}");8433 assert!(err.contains("speedkeys"), "{err}");
8425 let head = format!("edith 35\n{HEAD}");8434 let head = format!("edith 35\n{HEAD}");
8435+ let too_many: String = (0..65).map(|i| format!(" {i}:1000")).collect();
8426 for line in [8436 for line in [
8437+ &format!("speedkeys audio 1 0{too_many}\n")[..],
8427 "speedkeys audio 1 0 0:9000\n",8438 "speedkeys audio 1 0 0:9000\n",
8428 "speedkeys audio 1 0 30:1000 0:1000\n",8439 "speedkeys audio 1 0 30:1000 0:1000\n",
8429 "speedkeys audio 1 0 0\n",8440 "speedkeys audio 1 0 0\n",
8430- "speedkeys audio 1 0 0:1000 1:1000 2:1000 3:1000 4:1000 5:1000 6:1000 7:1000 8:1000\n",
8431 ] {8441 ] {
8432 let err = parse(format!("{head}{line}").as_bytes(), &dir).unwrap_err().to_string();8442 let err = parse(format!("{head}{line}").as_bytes(), &dir).unwrap_err().to_string();
8433 assert!(err.contains("line 6"), "{line}: {err}");8443 assert!(err.contains("line 6"), "{line}: {err}");
crates/engine/src/export.rsmodified+20 -11
@@ -583,6 +583,8 @@ pub struct ExportSettings {
583 /// it used to. Means nothing to WAV and FLAC, which code no rate, and583 /// it used to. Means nothing to WAV and FLAC, which code no rate, and
584 /// nothing to a *copied* AAC track, which carries its source's.584 /// nothing to a *copied* AAC track, which carries its source's.
585 pub audio_kbps: Option<u32>,585 pub audio_kbps: Option<u32>,
586+ /// Code the sound at [`ExportSettings::audio_kbps`] even where its packets could be copied.
587+ pub reencode_audio: bool,
586 /// Bits per sample of the PCM sound in a ProRes `.mov`: 16 or 24. `None` (and588 /// Bits per sample of the PCM sound in a ProRes `.mov`: 16 or 24. `None` (and
587 /// anything else) is 24. No other format reads it.589 /// anything else) is 24. No other format reads it.
588 pub audio_bit_depth: Option<u8>,590 pub audio_bit_depth: Option<u8>,
@@ -1453,6 +1455,7 @@ fn audio_label(
1453 sound: bool,1455 sound: bool,
1454 copied: Option<bool>,1456 copied: Option<bool>,
1455 ranged: bool,1457 ranged: bool,
1458+ reencode: bool,
1456 ) -> &'static str {1459 ) -> &'static str {
1457 if !sound {1460 if !sound {
1458 return "no sound to write";1461 return "no sound to write";
@@ -1467,7 +1470,7 @@ fn audio_label(
1467 // Never a copy: WebM carries Opus, and the sound is mixed and encoded1470 // Never a copy: WebM carries Opus, and the sound is mixed and encoded
1468 // for it at 48 kHz ([`start`], [`encode_audio`]).1471 // for it at 48 kHz ([`start`], [`encode_audio`]).
1469 Format::Webm => "Opus · SW encode (ec-opus)",1472 Format::Webm => "Opus · SW encode (ec-opus)",
1470- _ => match copied.unwrap_or(!forces_encode(project, ranged)) {1473+ _ => match copied.unwrap_or(!(reencode || forces_encode(project, ranged))) {
1471 true => "AAC copy",1474 true => "AAC copy",
1472 // A Matroska file gets Opus where the mix allows it -- 48 kHz and1475 // A Matroska file gets Opus where the mix allows it -- 48 kHz and
1473 // stereo, which is every Opus source and most of everything else --1476 // stereo, which is every Opus source and most of everything else --
@@ -1511,7 +1514,7 @@ fn measured_audio_label(
1511 (Some(false), false) if format.is_mkv() => "AAC · SW encode (ec-aac)",1514 (Some(false), false) if format.is_mkv() => "AAC · SW encode (ec-aac)",
1512 // `sound` is already what happened, not a prediction, so `copied` is1515 // `sound` is already what happened, not a prediction, so `copied` is
1513 // filled in and `ranged` never reaches the branch that reads it.1516 // filled in and `ranged` never reaches the branch that reads it.
1514- _ => audio_label(project, format, sound.is_some(), sound, false),1517+ _ => audio_label(project, format, sound.is_some(), sound, false, false),
1515 }1518 }
1516 }1519 }
1517 1520
@@ -1521,7 +1524,7 @@ fn measured_audio_label(
1521 /// a marked range -- a copy needs the source's own packets to *be* the file,1524 /// a marked range -- a copy needs the source's own packets to *be* the file,
1522 /// which a range's exact offset and length rule out ([`copy_audio`]).1525 /// which a range's exact offset and length rule out ([`copy_audio`]).
1523 pub fn planned_audio(project: &Project, format: Format, ranged: bool) -> &'static str {1526 pub fn planned_audio(project: &Project, format: Format, ranged: bool) -> &'static str {
1524- audio_label(project, format, has_sound(project), None, ranged)1527+ audio_label(project, format, has_sound(project), None, ranged, false)
1525 }1528 }
1526 1529
1527 /// Why the sound's rate is nothing this timeline can be asked about in this1530 /// Why the sound's rate is nothing this timeline can be asked about in this
@@ -1533,7 +1536,7 @@ pub fn planned_audio(project: &Project, format: Format, ranged: bool) -> &'stati
1533 /// [`ExportSettings::audio_kbps`] like every other encode. So the value travels1536 /// [`ExportSettings::audio_kbps`] like every other encode. So the value travels
1534 /// even where this refuses; what it cannot do is silently write a rate nobody1537 /// even where this refuses; what it cannot do is silently write a rate nobody
1535 /// picked.1538 /// picked.
1536-pub fn audio_rate_refusal(project: &Project, format: Format, ranged: bool) -> Option<&'static str> {1539+pub fn audio_rate_refusal(project: &Project, format: Format, ranged: bool, reencode: bool) -> Option<&'static str> {
1537 match format {1540 match format {
1538 _ if !has_sound(project) => Some("no sound to write"),1541 _ if !has_sound(project) => Some("no sound to write"),
1539 Format::Wav | Format::Flac | Format::ProRes => Some("lossless — the samples themselves, at no rate"),1542 Format::Wav | Format::Flac | Format::ProRes => Some("lossless — the samples themselves, at no rate"),
@@ -1546,7 +1549,7 @@ pub fn audio_rate_refusal(project: &Project, format: Format, ranged: bool) -> Op
1546 Format::Ogg => Some("quality-coded — Vorbis holds no rate to pick"),1549 Format::Ogg => Some("quality-coded — Vorbis holds no rate to pick"),
1547 // The bitrate is the one choice WebM leaves: Opus at the rate picked.1550 // The bitrate is the one choice WebM leaves: Opus at the rate picked.
1548 Format::Mp3 | Format::Webm | Format::Opus => None,1551 Format::Mp3 | Format::Webm | Format::Opus => None,
1549- _ if forces_encode(project, ranged) => None,1552+ _ if reencode || forces_encode(project, ranged) => None,
1550 _ => Some("the source's own packets are copied — at the rate they hold"),1553 _ => Some("the source's own packets are copied — at the rate they hold"),
1551 }1554 }
1552 }1555 }
@@ -1951,7 +1954,7 @@ fn export_spans(project: &Project, range: Option<(u32, u32)>) -> Vec<crate::proj
1951 from: None,1954 from: None,
1952 speed: Speed::NORMAL,1955 speed: Speed::NORMAL,
1953 reverse: false,1956 reverse: false,
1954- pitch: 0,1957+ pitch: 0.0,
1955 });1958 });
1956 }1959 }
1957 let Some((r_start, r_end)) = range else {1960 let Some((r_start, r_end)) = range else {
@@ -2091,7 +2094,7 @@ pub(crate) fn stack_span_at(project: &Project, frame: u32) -> Option<crate::proj
2091 speed,2094 speed,
2092 ramp,2095 ramp,
2093 reverse,2096 reverse,
2094- pitch: 0,2097+ pitch: 0.0,
2095 })2098 })
2096 }2099 }
2097 2100
@@ -3629,7 +3632,8 @@ pub fn planned_seats(
3629 // reads, so this costs nothing beyond what is already open. A standalone3632 // reads, so this costs nothing beyond what is already open. A standalone
3630 // audio file (mp3, wav, flac...) has no sample table either: its sound is3633 // audio file (mp3, wav, flac...) has no sample table either: its sound is
3631 // decoded and encoded again, as [`copy_multi_streams`] refusing it sends it.3634 // decoded and encoded again, as [`copy_multi_streams`] refusing it sends it.
3632- let copyable = !forces_encode(project, settings.range.is_some())3635+ let copyable = !settings.reencode_audio
3636+ && !forces_encode(project, settings.range.is_some())
3633 && !project.sources().iter().any(|source|3637 && !project.sources().iter().any(|source|
3634 {3638 {
3635 crate::demux::is_matroska(&source.path)3639 crate::demux::is_matroska(&source.path)
@@ -3656,6 +3660,7 @@ pub fn planned_seats(
3656 has_sound(project),3660 has_sound(project),
3657 Some(copyable),3661 Some(copyable),
3658 settings.range.is_some(),3662 settings.range.is_some(),
3663+ settings.reencode_audio,
3659 ),3664 ),
3660 };3665 };
3661 (video, sound)3666 (video, sound)
@@ -3803,13 +3808,14 @@ fn copy_audio(
3803 kbps: u32,3808 kbps: u32,
3804 mkv: bool,3809 mkv: bool,
3805 webm: bool,3810 webm: bool,
3811+ reencode: bool,
3806 shared: &Shared,3812 shared: &Shared,
3807 sample_rate: Option<u32>,3813 sample_rate: Option<u32>,
3808 range: Option<(u32, u32)>,3814 range: Option<(u32, u32)>,
3809 ) -> crate::Result<Option<ExportAudio>> {3815 ) -> crate::Result<Option<ExportAudio>> {
3810 // WebM's sound is Opus, which no source's packets are: always the mix. A loudness target is a3816 // WebM's sound is Opus, which no source's packets are: always the mix. A loudness target is a
3811- // gain over the mix, which a copied packet cannot carry.3817+ // gain over the mix, which a copied packet cannot carry. A rate the caller chose is a re-encode.
3812- if webm || shared.loudness.is_some() {3818+ if webm || reencode || shared.loudness.is_some() {
3813 return encode_audio(project, meta, kbps, mkv, webm, shared, sample_rate, range);3819 return encode_audio(project, meta, kbps, mkv, webm, shared, sample_rate, range);
3814 }3820 }
3815 // A ranged export needs an exact offset and an exact length, which a3821 // A ranged export needs an exact offset and an exact length, which a
@@ -5244,6 +5250,7 @@ fn run(
5244 audio_kbps_of(&settings),5250 audio_kbps_of(&settings),
5245 settings.format.is_mkv(),5251 settings.format.is_mkv(),
5246 settings.format == Format::Webm,5252 settings.format == Format::Webm,
5253+ settings.reencode_audio,
5247 &shared,5254 &shared,
5248 // WebM's sound is mixed at the rate Opus codes at, so the5255 // WebM's sound is mixed at the rate Opus codes at, so the
5249 // one encoder path it takes is the one that resamples.5256 // one encoder path it takes is the one that resamples.
@@ -7514,7 +7521,7 @@ fn mix_pcm(
7514 // publishes its own.7521 // publishes its own.
7515 if !format.has_video() {7522 if !format.has_video() {
7516 *shared.encoders.lock().unwrap() =7523 *shared.encoders.lock().unwrap() =
7517- Some(audio_label(project, format, true, None, settings.range.is_some()).to_string());7524+ Some(audio_label(project, format, true, None, settings.range.is_some(), settings.reencode_audio).to_string());
7518 }7525 }
7519 let channels = usize::from(audio.channels);7526 let channels = usize::from(audio.channels);
7520 let out_frames = settings.range.map_or(project.media_frames(), |(s, e)| {7527 let out_frames = settings.range.map_or(project.media_frames(), |(s, e)| {
@@ -7594,6 +7601,7 @@ fn run_aac(
7594 audio_kbps_of(settings),7601 audio_kbps_of(settings),
7595 false,7602 false,
7596 false,7603 false,
7604+ settings.reencode_audio,
7597 shared,7605 shared,
7598 sample_rate,7606 sample_rate,
7599 settings.range,7607 settings.range,
@@ -7610,6 +7618,7 @@ fn run_aac(
7610 true,7618 true,
7611 Some(track.copied),7619 Some(track.copied),
7612 settings.range.is_some(),7620 settings.range.is_some(),
7621+ settings.reencode_audio,
7613 )7622 )
7614 .to_string(),7623 .to_string(),
7615 );7624 );
crates/engine/src/playback.rsmodified+8 -7
@@ -1185,7 +1185,7 @@ impl PlaybackSession {
1185 transform: None,1185 transform: None,
1186 fit: FitPolicy::default(),1186 fit: FitPolicy::default(),
1187 speed: Speed::NORMAL,1187 speed: Speed::NORMAL,
1188- pitch: 0,1188+ pitch: 0.0,
1189 };1189 };
1190 let project = Project::from_parts(1190 let project = Project::from_parts(
1191 vec![Source::new(path, 0)],1191 vec![Source::new(path, 0)],
@@ -1311,7 +1311,7 @@ impl PlaybackSession {
1311 transform: None,1311 transform: None,
1312 fit: FitPolicy::default(),1312 fit: FitPolicy::default(),
1313 speed: Speed::NORMAL,1313 speed: Speed::NORMAL,
1314- pitch: 0,1314+ pitch: 0.0,
1315 };1315 };
1316 // No group and no audio clip: a still is silent, and a clip on `A1`1316 // No group and no audio clip: a still is silent, and a clip on `A1`
1317 // playing from a PNG is a source the audio worker cannot open.1317 // playing from a PNG is a source the audio worker cannot open.
@@ -2002,8 +2002,9 @@ impl PlaybackSession {
2002 &self,2002 &self,
2003 format: crate::export::Format,2003 format: crate::export::Format,
2004 ranged: bool,2004 ranged: bool,
2005+ reencode: bool,
2005 ) -> Option<&'static str> {2006 ) -> Option<&'static str> {
2006- crate::export::audio_rate_refusal(&self.project.render_view(), format, ranged)2007+ crate::export::audio_rate_refusal(&self.project.render_view(), format, ranged, reencode)
2007 }2008 }
2008 2009
2009 /// Why this session plays silent although the file has sound -- an audio2010 /// Why this session plays silent although the file has sound -- an audio
@@ -3985,14 +3986,14 @@ impl PlaybackSession {
3985 }3986 }
3986 3987
3987 /// The clip's pitch shift in semitones at `idx` of `lane` ([`Project::clip_pitch`]).3988 /// The clip's pitch shift in semitones at `idx` of `lane` ([`Project::clip_pitch`]).
3988- pub fn clip_pitch_of(&self, lane: Lane, idx: usize) -> Option<i8> {3989+ pub fn clip_pitch_of(&self, lane: Lane, idx: usize) -> Option<f32> {
3989 self.project.clip_pitch(lane, idx)3990 self.project.clip_pitch(lane, idx)
3990 }3991 }
3991 3992
3992 /// Sets that clip's pitch in semitones, clamped to `-12..=12`. One undo step; the3993 /// Sets that clip's pitch in semitones, clamped to `-12..=12`. One undo step; the
3993 /// sound is rebuilt where the playhead is, as for [`set_clip_gain`](Self::set_clip_gain).3994 /// sound is rebuilt where the playhead is, as for [`set_clip_gain`](Self::set_clip_gain).
3994 /// `false` for a video lane, a bad index, or a value already set.3995 /// `false` for a video lane, a bad index, or a value already set.
3995- pub fn set_clip_pitch(&mut self, lane: Lane, idx: usize, semitones: i32) -> bool {3996+ pub fn set_clip_pitch(&mut self, lane: Lane, idx: usize, semitones: f32) -> bool {
3996 self.edit(Dirty::Sound, |p| p.set_clip_pitch(lane, idx, semitones))3997 self.edit(Dirty::Sound, |p| p.set_clip_pitch(lane, idx, semitones))
3997 }3998 }
3998 3999
@@ -5927,7 +5928,7 @@ impl PlaybackSession {
5927 transform: None,5928 transform: None,
5928 fit: FitPolicy::default(),5929 fit: FitPolicy::default(),
5929 speed: Speed::NORMAL,5930 speed: Speed::NORMAL,
5930- pitch: 0,5931+ pitch: 0.0,
5931 };5932 };
5932 // Which lane a source may land on is decided here and only here, so a5933 // Which lane a source may land on is decided here and only here, so a
5933 // front-end never has to make the same call twice: a file with no5934 // front-end never has to make the same call twice: a file with no
@@ -6255,7 +6256,7 @@ impl PlaybackSession {
6255 transform: None,6256 transform: None,
6256 fit: FitPolicy::default(),6257 fit: FitPolicy::default(),
6257 speed: Speed::NORMAL,6258 speed: Speed::NORMAL,
6258- pitch: 0,6259+ pitch: 0.0,
6259 };6260 };
6260 let end = start + clip.frames();6261 let end = start + clip.frames();
6261 let overlaps = |lane: Lane| {6262 let overlaps = |lane: Lane| {
crates/engine/src/project.rsmodified+45 -45
@@ -329,7 +329,7 @@ impl Speed {
329 329
330 /// Most keys a speed ramp may hold ([`Clip::speed_keys`]). A fixed cap, so that a330 /// Most keys a speed ramp may hold ([`Clip::speed_keys`]). A fixed cap, so that a
331 /// [`Span`] carrying a ramp stays `Copy`.331 /// [`Span`] carrying a ramp stays `Copy`.
332-pub const MAX_SPEED_KEYS: usize = 8;332+pub const MAX_SPEED_KEYS: usize = 64;
333 333
334 /// How long a still image is placed for when the project does not say (the 5 s every project had334 /// How long a still image is placed for when the project does not say (the 5 s every project had
335 /// before v52), and the shortest and longest length a project may set for one.335 /// before v52), and the shortest and longest length a project may set for one.
@@ -895,12 +895,12 @@ pub struct Clip {
895 /// gain. Audio clips only ([`Project::set_clip_pan`]); [`Clip::pan_value`] reads it as895 /// gain. Audio clips only ([`Project::set_clip_pan`]); [`Clip::pan_value`] reads it as
896 /// `-1.0..=1.0`.896 /// `-1.0..=1.0`.
897 pub pan: i8,897 pub pan: i8,
898- /// The clip's pitch in whole semitones, `-12` (an octave down) to `12` (up), `0` the898+ /// The clip's pitch in semitones, `-12.0` (an octave down) to `12.0` (up), `0.0` the
899 /// default and the original sound. Changes the pitch and keeps the speed: the899 /// default and the original sound. Changes the pitch and keeps the speed: the
900 /// stretch and the resample that make it are built by [`Project::lane_speeds_from`],900 /// stretch and the resample that make it are built by [`Project::lane_speeds_from`],
901 /// so playback and export hear the same thing. Audio clips only901 /// so playback and export hear the same thing. Audio clips only
902- /// ([`Project::set_clip_pitch`]). One byte, in the same padding as [`Clip::pan`].902+ /// ([`Project::set_clip_pitch`]).
903- pub pitch: i8,903+ pub pitch: f32,
904 /// The clip's placement animation: whole [`TransformParams`] at SOURCE904 /// The clip's placement animation: whole [`TransformParams`] at SOURCE
905 /// frames, sorted by [`TransformKey::at`] with no two alike. Empty is the905 /// frames, sorted by [`TransformKey::at`] with no two alike. Empty is the
906 /// single [`Clip::transform`] for the whole clip. Video lanes only906 /// single [`Clip::transform`] for the whole clip. Video lanes only
@@ -1080,9 +1080,9 @@ pub const MIN_CLIP_GAIN_DB: f32 = -60.0;
1080 pub const MAX_CLIP_GAIN_DB: f32 = 24.0;1080 pub const MAX_CLIP_GAIN_DB: f32 = 24.0;
1081 1081
1082 /// The widest a clip's pitch shift may be, in semitones either way ([`Clip::pitch`]).1082 /// The widest a clip's pitch shift may be, in semitones either way ([`Clip::pitch`]).
1083-pub const MAX_CLIP_PITCH: i8 = 12;1083+pub const MAX_CLIP_PITCH: f32 = 12.0;
1084 /// The lowest a clip's pitch shift may be ([`Clip::pitch`]).1084 /// The lowest a clip's pitch shift may be ([`Clip::pitch`]).
1085-pub const MIN_CLIP_PITCH: i8 = -12;1085+pub const MIN_CLIP_PITCH: f32 = -12.0;
1086 /// The most points a clip's gain envelope may hold ([`Clip::gain_keys`]).1086 /// The most points a clip's gain envelope may hold ([`Clip::gain_keys`]).
1087 pub const MAX_GAIN_KEYS: usize = 256;1087 pub const MAX_GAIN_KEYS: usize = 256;
1088 1088
@@ -1289,7 +1289,7 @@ impl Clip {
1289 gain_db: 0.0,1289 gain_db: 0.0,
1290 gain_keys: Vec::new(),1290 gain_keys: Vec::new(),
1291 pan: 0,1291 pan: 0,
1292- pitch: 0,1292+ pitch: 0.0,
1293 }1293 }
1294 }1294 }
1295 1295
@@ -2026,7 +2026,7 @@ impl<'a> SourceWalls<'a> {
2026 /// What a lane holds over one stretch of the timeline: either a placed clip or2026 /// What a lane holds over one stretch of the timeline: either a placed clip or
2027 /// a gap. Returned already trimmed to the position it was asked about, so a2027 /// a gap. Returned already trimmed to the position it was asked about, so a
2028 /// caller can hand `len` straight to a decoder (or to a black-frame generator).2028 /// caller can hand `len` straight to a decoder (or to a black-frame generator).
2029-#[derive(Clone, Copy, PartialEq, Eq, Debug)]2029+#[derive(Clone, Copy, PartialEq, Debug)]
2030 pub struct Span {2030 pub struct Span {
2031 /// Timeline frame the span starts at.2031 /// Timeline frame the span starts at.
2032 pub start: u32,2032 pub start: u32,
@@ -2055,8 +2055,8 @@ pub struct Span {
2055 /// [`timeline_at`](Span::timeline_at) count distance walked, as they do forwards.2055 /// [`timeline_at`](Span::timeline_at) count distance walked, as they do forwards.
2056 /// `false` for a gap.2056 /// `false` for a gap.
2057 pub reverse: bool,2057 pub reverse: bool,
2058- /// The pitch in semitones of the clip this came off ([`Clip::pitch`]); `0` for a gap.2058+ /// The pitch in semitones of the clip this came off ([`Clip::pitch`]); `0.0` for a gap.
2059- pub pitch: i8,2059+ pub pitch: f32,
2060 }2060 }
2061 2061
2062 impl Span {2062 impl Span {
@@ -2152,14 +2152,14 @@ pub struct Stretch {
2152 /// The pitch in semitones the segment is shifted by ([`Clip::pitch`]), `0` for none.2152 /// The pitch in semitones the segment is shifted by ([`Clip::pitch`]), `0` for none.
2153 /// The stretch then runs at `step / 2^(pitch/12)` and the resample at the same ratio2153 /// The stretch then runs at `step / 2^(pitch/12)` and the resample at the same ratio
2154 /// up: the pitch moves, the length does not.2154 /// up: the pitch moves, the length does not.
2155- pub pitch: i8,2155+ pub pitch: f32,
2156 }2156 }
2157 2157
2158 impl Stretch {2158 impl Stretch {
2159 /// Whether the segment is only played backwards, at the rate it was recorded:2159 /// Whether the segment is only played backwards, at the rate it was recorded:
2160 /// no change of time, so no stretch is built for it.2160 /// no change of time, so no stretch is built for it.
2161 pub fn is_straight(&self) -> bool {2161 pub fn is_straight(&self) -> bool {
2162- self.reverse && self.step == 1.0 && self.ramp.is_none() && self.pitch == 02162+ self.reverse && self.step == 1.0 && self.ramp.is_none() && self.pitch == 0.0
2163 }2163 }
2164 2164
2165 /// The frequency ratio the segment's pitch shift is: `2^(pitch/12)`, `1.0` for none.2165 /// The frequency ratio the segment's pitch shift is: `2^(pitch/12)`, `1.0` for none.
@@ -2169,7 +2169,7 @@ impl Stretch {
2169 }2169 }
2170 2170
2171 /// The frequency ratio of a shift of `semitones`: `2^(semitones/12)`, so `12` is an octave up.2171 /// The frequency ratio of a shift of `semitones`: `2^(semitones/12)`, so `12` is an octave up.
2172-pub fn pitch_ratio(semitones: i8) -> f64 {2172+pub fn pitch_ratio(semitones: f32) -> f64 {
2173 (f64::from(semitones) / 12.0).exp2()2173 (f64::from(semitones) / 12.0).exp2()
2174 }2174 }
2175 2175
@@ -2887,7 +2887,7 @@ impl Project {
2887 gain_db: 0.0,2887 gain_db: 0.0,
2888 gain_keys: Vec::new(),2888 gain_keys: Vec::new(),
2889 pan: 0,2889 pan: 0,
2890- pitch: 0,2890+ pitch: 0.0,
2891 transform_keys: Vec::new(),2891 transform_keys: Vec::new(),
2892 opacity_keys: Vec::new(),2892 opacity_keys: Vec::new(),
2893 color_keys: Vec::new(),2893 color_keys: Vec::new(),
@@ -3508,7 +3508,7 @@ impl Project {
3508 gain_db: 0.0,3508 gain_db: 0.0,
3509 gain_keys: Vec::new(),3509 gain_keys: Vec::new(),
3510 pan: 0,3510 pan: 0,
3511- pitch: 0,3511+ pitch: 0.0,
3512 transform_keys: Vec::new(),3512 transform_keys: Vec::new(),
3513 opacity_keys: Vec::new(),3513 opacity_keys: Vec::new(),
3514 color_keys: Vec::new(),3514 color_keys: Vec::new(),
@@ -6021,14 +6021,14 @@ impl Project {
6021 /// Give the clip at `idx` of `lane` this pitch in semitones, clamped to `-12..=12`.6021 /// Give the clip at `idx` of `lane` this pitch in semitones, clamped to `-12..=12`.
6022 /// One undo step. `false` -- and no history -- for an index that is not there, a6022 /// One undo step. `false` -- and no history -- for an index that is not there, a
6023 /// non-audio lane, or a value already set.6023 /// non-audio lane, or a value already set.
6024- pub fn set_clip_pitch(&mut self, lane: Lane, idx: usize, semitones: i32) -> bool {6024+ pub fn set_clip_pitch(&mut self, lane: Lane, idx: usize, semitones: f32) -> bool {
6025 if lane.kind != LaneKind::Audio {6025 if lane.kind != LaneKind::Audio {
6026 return false;6026 return false;
6027 }6027 }
6028 let Some(current) = self.lane(lane).get(idx).map(|c| c.pitch) else {6028 let Some(current) = self.lane(lane).get(idx).map(|c| c.pitch) else {
6029 return false;6029 return false;
6030 };6030 };
6031- let semitones = semitones.clamp(i32::from(MIN_CLIP_PITCH), i32::from(MAX_CLIP_PITCH)) as i8;6031+ let semitones = semitones.clamp(MIN_CLIP_PITCH, MAX_CLIP_PITCH);
6032 if current == semitones {6032 if current == semitones {
6033 return false;6033 return false;
6034 }6034 }
@@ -6039,7 +6039,7 @@ impl Project {
6039 6039
6040 /// The pitch in semitones of the clip at `idx` of `lane`, or `None` for an index that6040 /// The pitch in semitones of the clip at `idx` of `lane`, or `None` for an index that
6041 /// is not there.6041 /// is not there.
6042- pub fn clip_pitch(&self, lane: Lane, idx: usize) -> Option<i8> {6042+ pub fn clip_pitch(&self, lane: Lane, idx: usize) -> Option<f32> {
6043 self.lane(lane).get(idx).map(|c| c.pitch)6043 self.lane(lane).get(idx).map(|c| c.pitch)
6044 }6044 }
6045 6045
@@ -6824,7 +6824,7 @@ impl Project {
6824 /// refused, and the caller is told how far it would have run.6824 /// refused, and the caller is told how far it would have run.
6825 pub fn set_speed_ramp(&mut self, lane: Lane, idx: usize, keys: &[SpeedKey]) -> crate::Result<()> {6825 pub fn set_speed_ramp(&mut self, lane: Lane, idx: usize, keys: &[SpeedKey]) -> crate::Result<()> {
6826 if !keys.is_empty() && !valid_speed_keys(keys) {6826 if !keys.is_empty() && !valid_speed_keys(keys) {
6827- return Err("a speed ramp takes 1 to 8 keys, in strictly increasing frames".into());6827+ return Err(format!("a speed ramp takes 1 to {MAX_SPEED_KEYS} keys, in strictly increasing frames").into());
6828 }6828 }
6829 let Some(members) = self.group_of(lane, idx) else {6829 let Some(members) = self.group_of(lane, idx) else {
6830 return Err(format!("there is no clip {idx} on {}", lane.label()).into());6830 return Err(format!("there is no clip {idx} on {}", lane.label()).into());
@@ -7575,7 +7575,7 @@ impl Project {
7575 speed: Speed::NORMAL,7575 speed: Speed::NORMAL,
7576 ramp: None,7576 ramp: None,
7577 reverse: false,7577 reverse: false,
7578- pitch: 0,7578+ pitch: 0.0,
7579 // The next placement, or the end of the timeline: a gap is7579 // The next placement, or the end of the timeline: a gap is
7580 // bounded by what comes after it, never by its own bookkeeping.7580 // bounded by what comes after it, never by its own bookkeeping.
7581 len: clips7581 len: clips
@@ -7658,7 +7658,7 @@ impl Project {
7658 speed,7658 speed,
7659 ramp,7659 ramp,
7660 reverse,7660 reverse,
7661- pitch: 0,7661+ pitch: 0.0,
7662 })7662 })
7663 }7663 }
7664 7664
@@ -11034,7 +11034,7 @@ impl Project {
11034 Some(_) => f64::from(span.source_len()) / f64::from(span.len),11034 Some(_) => f64::from(span.source_len()) / f64::from(span.len),
11035 None => span.speed.as_f64(),11035 None => span.speed.as_f64(),
11036 };11036 };
11037- (ramped || !span.speed.is_normal() || span.reverse || span.pitch != 0).then(|| Stretch {11037+ (ramped || !span.speed.is_normal() || span.reverse || span.pitch != 0.0).then(|| Stretch {
11038 step,11038 step,
11039 timeline_secs: f64::from(span.len) / fps,11039 timeline_secs: f64::from(span.len) / fps,
11040 reverse: span.reverse,11040 reverse: span.reverse,
@@ -12365,7 +12365,7 @@ mod tests {
12365 gain_db: 0.0,12365 gain_db: 0.0,
12366 gain_keys: Vec::new(),12366 gain_keys: Vec::new(),
12367 pan: 0,12367 pan: 0,
12368- pitch: 0,12368+ pitch: 0.0,
12369 transform_keys: Vec::new(),12369 transform_keys: Vec::new(),
12370 opacity_keys: Vec::new(),12370 opacity_keys: Vec::new(),
12371 color_keys: Vec::new(),12371 color_keys: Vec::new(),
@@ -15089,7 +15089,7 @@ mod tests {
15089 len: 3,15089 len: 3,
15090 from: Some((0, 6)),15090 from: Some((0, 6)),
15091 speed: Speed::NORMAL,15091 speed: Speed::NORMAL,
15092- pitch: 0,15092+ pitch: 0.0,
15093 })15093 })
15094 );15094 );
15095 assert_eq!(p.span_at(Lane::V1, 9), None);15095 assert_eq!(p.span_at(Lane::V1, 9), None);
@@ -15126,7 +15126,7 @@ mod tests {
15126 assert_eq!(std::mem::size_of::<FitPolicy>(), 1);15126 assert_eq!(std::mem::size_of::<FitPolicy>(), 1);
15127 assert_eq!(15127 assert_eq!(
15128 std::mem::size_of::<Clip>(),15128 std::mem::size_of::<Clip>(),
15129- 224,15129+ 232,
15130 "Clip changed size: {} bytes",15130 "Clip changed size: {} bytes",
15131 std::mem::size_of::<Clip>()15131 std::mem::size_of::<Clip>()
15132 );15132 );
@@ -15162,7 +15162,7 @@ mod tests {
15162 transform: None,15162 transform: None,
15163 fit: FitPolicy::Fit,15163 fit: FitPolicy::Fit,
15164 speed: Speed::NORMAL,15164 speed: Speed::NORMAL,
15165- pitch: 0,15165+ pitch: 0.0,
15166 };15166 };
15167 15167
15168 #[test]15168 #[test]
@@ -15387,7 +15387,7 @@ mod tests {
15387 len: 2,15387 len: 2,
15388 from: None,15388 from: None,
15389 speed: Speed::NORMAL,15389 speed: Speed::NORMAL,
15390- pitch: 0,15390+ pitch: 0.0,
15391 })15391 })
15392 );15392 );
15393 assert_eq!(p.map(Lane::V1, 4), Some((1, 4)), "video plays on");15393 assert_eq!(p.map(Lane::V1, 4), Some((1, 4)), "video plays on");
@@ -15409,7 +15409,7 @@ mod tests {
15409 len: 4,15409 len: 4,
15410 from: None,15410 from: None,
15411 speed: Speed::NORMAL,15411 speed: Speed::NORMAL,
15412- pitch: 0,15412+ pitch: 0.0,
15413 }),15413 }),
15414 "the audio lane holds silence to the end of the picture"15414 "the audio lane holds silence to the end of the picture"
15415 );15415 );
@@ -15509,7 +15509,7 @@ mod tests {
15509 len: 11,15509 len: 11,
15510 from: None,15510 from: None,
15511 speed: Speed::NORMAL,15511 speed: Speed::NORMAL,
15512- pitch: 0,15512+ pitch: 0.0,
15513 })15513 })
15514 );15514 );
15515 assert!(!p.place(Lane::V1, 0, clip(0, 7, 7, 0)), "empty clip");15515 assert!(!p.place(Lane::V1, 0, clip(0, 7, 7, 0)), "empty clip");
@@ -16449,7 +16449,7 @@ mod tests {
16449 gain_db: 0.0,16449 gain_db: 0.0,
16450 gain_keys: Vec::new(),16450 gain_keys: Vec::new(),
16451 pan: 0,16451 pan: 0,
16452- pitch: 0,16452+ pitch: 0.0,
16453 transform_keys: Vec::new(),16453 transform_keys: Vec::new(),
16454 opacity_keys: Vec::new(),16454 opacity_keys: Vec::new(),
16455 color_keys: Vec::new(),16455 color_keys: Vec::new(),
@@ -17972,13 +17972,13 @@ mod tests {
17972 /// (the visualizer `u64` and six `Vec`s, the volume, placement, speed17972 /// (the visualizer `u64` and six `Vec`s, the volume, placement, speed
17973 /// ramp, opacity and colour keys and the effects stack, are the wide fields; the placement keys raised it from 96 by one17973 /// ramp, opacity and colour keys and the effects stack, are the wide fields; the placement keys raised it from 96 by one
17974 /// `Vec`, the speed ramp raised it from 120 by another, the opacity and17974 /// `Vec`, the speed ramp raised it from 120 by another, the opacity and
17975- /// colour keys took it from 144 to 192, and the effects stack to 216, the multicam angle to 224). The17975+ /// colour keys took it from 144 to 192, and the effects stack to 216, the multicam angle to 224, the fractional pitch to 232). The
17976 /// bound is `<=` rather than `==` so a field that shrinks the clip does not17976 /// bound is `<=` rather than `==` so a field that shrinks the clip does not
17977 /// trip it; growing past it is the thing to notice.17977 /// trip it; growing past it is the thing to notice.
17978 #[test]17978 #[test]
17979- fn a_clip_stays_within_224_bytes() {17979+ fn a_clip_stays_within_232_bytes() {
17980 assert!(17980 assert!(
17981- std::mem::size_of::<Clip>() <= 224,17981+ std::mem::size_of::<Clip>() <= 232,
17982 "Clip grew to {} bytes -- every undo snapshot and clone pays for it",17982 "Clip grew to {} bytes -- every undo snapshot and clone pays for it",
17983 std::mem::size_of::<Clip>()17983 std::mem::size_of::<Clip>()
17984 );17984 );
@@ -18210,7 +18210,7 @@ mod tests {
18210 gain_db: 0.0,18210 gain_db: 0.0,
18211 gain_keys: Vec::new(),18211 gain_keys: Vec::new(),
18212 pan: 0,18212 pan: 0,
18213- pitch: 0,18213+ pitch: 0.0,
18214 transform_keys: Vec::new(),18214 transform_keys: Vec::new(),
18215 opacity_keys: Vec::new(),18215 opacity_keys: Vec::new(),
18216 color_keys: Vec::new(),18216 color_keys: Vec::new(),
@@ -18797,7 +18797,7 @@ mod tests {
18797 len: 4,18797 len: 4,
18798 from: None,18798 from: None,
18799 speed: Speed::NORMAL,18799 speed: Speed::NORMAL,
18800- pitch: 0,18800+ pitch: 0.0,
18801 })18801 })
18802 );18802 );
18803 // Every lane still covers the whole timeline, gaps included.18803 // Every lane still covers the whole timeline, gaps included.
@@ -19296,7 +19296,7 @@ mod tests {
19296 gain_db: 0.0,19296 gain_db: 0.0,
19297 gain_keys: Vec::new(),19297 gain_keys: Vec::new(),
19298 pan: 0,19298 pan: 0,
19299- pitch: 0,19299+ pitch: 0.0,
19300 transform_keys: Vec::new(),19300 transform_keys: Vec::new(),
19301 opacity_keys: Vec::new(),19301 opacity_keys: Vec::new(),
19302 color_keys: Vec::new(),19302 color_keys: Vec::new(),
@@ -19480,7 +19480,7 @@ mod tests {
19480 len: 10,19480 len: 10,
19481 from: Some((0, 0)),19481 from: Some((0, 0)),
19482 speed: Speed::NORMAL,19482 speed: Speed::NORMAL,
19483- pitch: 0,19483+ pitch: 0.0,
19484 },19484 },
19485 Span {19485 Span {
19486 reverse: false,19486 reverse: false,
@@ -19489,7 +19489,7 @@ mod tests {
19489 len: 10,19489 len: 10,
19490 from: Some((1, 5)),19490 from: Some((1, 5)),
19491 speed: Speed::NORMAL,19491 speed: Speed::NORMAL,
19492- pitch: 0,19492+ pitch: 0.0,
19493 },19493 },
19494 Span {19494 Span {
19495 reverse: false,19495 reverse: false,
@@ -19498,7 +19498,7 @@ mod tests {
19498 len: 10,19498 len: 10,
19499 from: Some((0, 20)),19499 from: Some((0, 20)),
19500 speed: Speed::NORMAL,19500 speed: Speed::NORMAL,
19501- pitch: 0,19501+ pitch: 0.0,
19502 },19502 },
19503 ],19503 ],
19504 "V2 takes over for its own span and hands V1 back"19504 "V2 takes over for its own span and hands V1 back"
@@ -19513,7 +19513,7 @@ mod tests {
19513 len: 5,19513 len: 5,
19514 from: Some((1, 10)),19514 from: Some((1, 10)),
19515 speed: Speed::NORMAL,19515 speed: Speed::NORMAL,
19516- pitch: 0,19516+ pitch: 0.0,
19517 })19517 })
19518 );19518 );
19519 assert_eq!(p.composite_span_at(30), None, "past the end");19519 assert_eq!(p.composite_span_at(30), None, "past the end");
@@ -19538,7 +19538,7 @@ mod tests {
19538 len: 5,19538 len: 5,
19539 from: Some((0, 0)),19539 from: Some((0, 0)),
19540 speed: Speed::NORMAL,19540 speed: Speed::NORMAL,
19541- pitch: 0,19541+ pitch: 0.0,
19542 },19542 },
19543 Span {19543 Span {
19544 reverse: false,19544 reverse: false,
@@ -19547,7 +19547,7 @@ mod tests {
19547 len: 5,19547 len: 5,
19548 from: None,19548 from: None,
19549 speed: Speed::NORMAL,19549 speed: Speed::NORMAL,
19550- pitch: 0,19550+ pitch: 0.0,
19551 },19551 },
19552 Span {19552 Span {
19553 reverse: false,19553 reverse: false,
@@ -19556,7 +19556,7 @@ mod tests {
19556 len: 10,19556 len: 10,
19557 from: Some((1, 0)),19557 from: Some((1, 0)),
19558 speed: Speed::NORMAL,19558 speed: Speed::NORMAL,
19559- pitch: 0,19559+ pitch: 0.0,
19560 },19560 },
19561 Span {19561 Span {
19562 reverse: false,19562 reverse: false,
@@ -19565,7 +19565,7 @@ mod tests {
19565 len: 10,19565 len: 10,
19566 from: None,19566 from: None,
19567 speed: Speed::NORMAL,19567 speed: Speed::NORMAL,
19568- pitch: 0,19568+ pitch: 0.0,
19569 },19569 },
19570 ]19570 ]
19571 );19571 );
@@ -20702,7 +20702,7 @@ mod pro_trim_tests {
20702 gain_db: 0.0,20702 gain_db: 0.0,
20703 gain_keys: Vec::new(),20703 gain_keys: Vec::new(),
20704 pan: 0,20704 pan: 0,
20705- pitch: 0,20705+ pitch: 0.0,
20706 transform_keys: Vec::new(),20706 transform_keys: Vec::new(),
20707 start,20707 start,
20708 in_frame,20708 in_frame,
crates/engine/src/proxy.rsmodified+1 -1
@@ -606,7 +606,7 @@ fn started(
606 transform: None,606 transform: None,
607 fit: FitPolicy::default(),607 fit: FitPolicy::default(),
608 speed: Speed::NORMAL,608 speed: Speed::NORMAL,
609- pitch: 0,609+ pitch: 0.0,
610 };610 };
611 let project = Project::from_parts(611 let project = Project::from_parts(
612 vec![Source::new(source, 0)],612 vec![Source::new(source, 0)],
crates/engine/src/silence.rsmodified+1 -1
@@ -338,7 +338,7 @@ mod tests {
338 transform: None,338 transform: None,
339 fit: FitPolicy::default(),339 fit: FitPolicy::default(),
340 speed,340 speed,
341- pitch: 0,341+ pitch: 0.0,
342 }342 }
343 }343 }
344 344
crates/engine/src/sweep.rsmodified+1 -1
@@ -93,7 +93,7 @@ fn clip(start: u32, in_frame: u32, out_frame: u32) -> Clip {
93 transform: None,93 transform: None,
94 fit: FitPolicy::Fit,94 fit: FitPolicy::Fit,
95 speed: Speed::NORMAL,95 speed: Speed::NORMAL,
96- pitch: 0,96+ pitch: 0.0,
97 }97 }
98 }98 }
99 99
crates/engine/src/text.rsmodified+15 -3
@@ -183,9 +183,11 @@ fn family_k(font: &FontRef<'_>, data: &[u8], index: u32) -> f32 {
183 183
184 /// The system face `name` names, or None when the system has no such family or its face does not184 /// The system face `name` names, or None when the system has no such family or its face does not
185 /// parse. Each name is looked up once; the database is read on first use. A face's bytes live for185 /// parse. Each name is looked up once; the database is read on first use. A face's bytes live for
186-/// the rest of the process, as the bundled faces do.186+/// the rest of the process, as the bundled faces do. Faces in the `EDITH_FONTS_DIR` directories win
187+/// over system faces of the same family.
187 pub(crate) fn family_face(name: &str) -> Option<Family> {188 pub(crate) fn family_face(name: &str) -> Option<Family> {
188 static DB: OnceLock<fontdb::Database> = OnceLock::new();189 static DB: OnceLock<fontdb::Database> = OnceLock::new();
190+ static ENV_DB: OnceLock<fontdb::Database> = OnceLock::new();
189 static FOUND: Mutex<BTreeMap<String, Option<Family>>> = Mutex::new(BTreeMap::new());191 static FOUND: Mutex<BTreeMap<String, Option<Family>>> = Mutex::new(BTreeMap::new());
190 let mut found = FOUND.lock().ok()?;192 let mut found = FOUND.lock().ok()?;
191 if let Some(known) = found.get(name) {193 if let Some(known) = found.get(name) {
@@ -196,8 +198,16 @@ pub(crate) fn family_face(name: &str) -> Option<Family> {
196 db.load_system_fonts();198 db.load_system_fonts();
197 db199 db
198 });200 });
201+ let env_db = ENV_DB.get_or_init(|| {
202+ let mut db = fontdb::Database::new();
203+ for dir in crate::envcfg::var("EDITH_FONTS_DIR").unwrap_or_default().split(':').filter(|dir| !dir.is_empty()) {
204+ db.load_fonts_dir(dir);
205+ }
206+ db
207+ });
199 let query = fontdb::Query { families: &[fontdb::Family::Name(name)], ..fontdb::Query::default() };208 let query = fontdb::Query { families: &[fontdb::Family::Name(name)], ..fontdb::Query::default() };
200- let family = db.query(&query).and_then(|id| {209+ let face = |db: &fontdb::Database| {
210+ db.query(&query).and_then(|id| {
201 db.with_face_data(id, |data, index| {211 db.with_face_data(id, |data, index| {
202 let data: &'static [u8] = Box::leak(data.to_vec().into_boxed_slice());212 let data: &'static [u8] = Box::leak(data.to_vec().into_boxed_slice());
203 let font = FontRef::try_from_slice_and_index(data, index).ok()?;213 let font = FontRef::try_from_slice_and_index(data, index).ok()?;
@@ -205,7 +215,9 @@ pub(crate) fn family_face(name: &str) -> Option<Family> {
205 Some(Family { font: Box::leak(Box::new(font)), k })215 Some(Family { font: Box::leak(Box::new(font)), k })
206 })216 })
207 .flatten()217 .flatten()
208- });218+ })
219+ };
220+ let family = face(env_db).or_else(|| face(db));
209 found.insert(name.to_string(), family);221 found.insert(name.to_string(), family);
210 family222 family
211 }223 }
crates/engine/tests/audio_mix_rates.rsmodified+1 -1
@@ -175,7 +175,7 @@ fn clip(start: u32, frames: u32, source: usize) -> Clip {
175 gain_db: 0.0,175 gain_db: 0.0,
176 gain_keys: Vec::new(),176 gain_keys: Vec::new(),
177 pan: 0,177 pan: 0,
178- pitch: 0,178+ pitch: 0.0,
179 transform_keys: Vec::new(),179 transform_keys: Vec::new(),
180 opacity_keys: Vec::new(),180 opacity_keys: Vec::new(),
181 color_keys: Vec::new(),181 color_keys: Vec::new(),
crates/engine/tests/export.rsmodified+4 -4
@@ -276,7 +276,7 @@ fn exports_at_the_project_resolution_with_the_watched_geometry() {
276 gain_db: 0.0,276 gain_db: 0.0,
277 gain_keys: Vec::new(),277 gain_keys: Vec::new(),
278 pan: 0,278 pan: 0,
279- pitch: 0,279+ pitch: 0.0,
280 transform_keys: Vec::new(),280 transform_keys: Vec::new(),
281 opacity_keys: Vec::new(),281 opacity_keys: Vec::new(),
282 color_keys: Vec::new(),282 color_keys: Vec::new(),
@@ -385,7 +385,7 @@ fn exports_the_audio_stream_the_timeline_plays() {
385 gain_db: 0.0,385 gain_db: 0.0,
386 gain_keys: Vec::new(),386 gain_keys: Vec::new(),
387 pan: 0,387 pan: 0,
388- pitch: 0,388+ pitch: 0.0,
389 transform_keys: Vec::new(),389 transform_keys: Vec::new(),
390 opacity_keys: Vec::new(),390 opacity_keys: Vec::new(),
391 color_keys: Vec::new(),391 color_keys: Vec::new(),
@@ -2102,7 +2102,7 @@ fn one_source_clip(source: &Path, fade_in: u32, out_frame: u32) -> (Project, eng
2102 gain_db: 0.0,2102 gain_db: 0.0,
2103 gain_keys: Vec::new(),2103 gain_keys: Vec::new(),
2104 pan: 0,2104 pan: 0,
2105- pitch: 0,2105+ pitch: 0.0,
2106 transform_keys: Vec::new(),2106 transform_keys: Vec::new(),
2107 opacity_keys: Vec::new(),2107 opacity_keys: Vec::new(),
2108 color_keys: Vec::new(),2108 color_keys: Vec::new(),
@@ -2248,7 +2248,7 @@ fn two_clip_edit(source: &Path, first: u32, second: u32) -> (Project, engine::Vi
2248 gain_db: 0.0,2248 gain_db: 0.0,
2249 gain_keys: Vec::new(),2249 gain_keys: Vec::new(),
2250 pan: 0,2250 pan: 0,
2251- pitch: 0,2251+ pitch: 0.0,
2252 transform_keys: Vec::new(),2252 transform_keys: Vec::new(),
2253 opacity_keys: Vec::new(),2253 opacity_keys: Vec::new(),
2254 color_keys: Vec::new(),2254 color_keys: Vec::new(),
crates/engine/tests/it/audio_export.rsmodified+12 -12
@@ -74,7 +74,7 @@ fn mixed_project() -> Project {
74 gain_db: 0.0,74 gain_db: 0.0,
75 gain_keys: Vec::new(),75 gain_keys: Vec::new(),
76 pan: 0,76 pan: 0,
77- pitch: 0,77+ pitch: 0.0,
78 transform_keys: Vec::new(),78 transform_keys: Vec::new(),
79 opacity_keys: Vec::new(),79 opacity_keys: Vec::new(),
80 color_keys: Vec::new(),80 color_keys: Vec::new(),
@@ -115,7 +115,7 @@ fn mixed_project() -> Project {
115 gain_db: 0.0,115 gain_db: 0.0,
116 gain_keys: Vec::new(),116 gain_keys: Vec::new(),
117 pan: 0,117 pan: 0,
118- pitch: 0,118+ pitch: 0.0,
119 transform_keys: Vec::new(),119 transform_keys: Vec::new(),
120 opacity_keys: Vec::new(),120 opacity_keys: Vec::new(),
121 color_keys: Vec::new(),121 color_keys: Vec::new(),
@@ -484,7 +484,7 @@ fn a_still_and_a_song_export_as_an_mp4_with_sound() {
484 gain_db: 0.0,484 gain_db: 0.0,
485 gain_keys: Vec::new(),485 gain_keys: Vec::new(),
486 pan: 0,486 pan: 0,
487- pitch: 0,487+ pitch: 0.0,
488 transform_keys: Vec::new(),488 transform_keys: Vec::new(),
489 opacity_keys: Vec::new(),489 opacity_keys: Vec::new(),
490 color_keys: Vec::new(),490 color_keys: Vec::new(),
@@ -575,7 +575,7 @@ fn a_fader_is_one_tracks_own_and_the_limiter_holds_the_sum() {
575 gain_db: 0.0,575 gain_db: 0.0,
576 gain_keys: Vec::new(),576 gain_keys: Vec::new(),
577 pan: 0,577 pan: 0,
578- pitch: 0,578+ pitch: 0.0,
579 transform_keys: Vec::new(),579 transform_keys: Vec::new(),
580 opacity_keys: Vec::new(),580 opacity_keys: Vec::new(),
581 color_keys: Vec::new(),581 color_keys: Vec::new(),
@@ -829,7 +829,7 @@ fn the_sound_is_written_at_the_rate_that_was_asked_for() {
829 gain_db: 0.0,829 gain_db: 0.0,
830 gain_keys: Vec::new(),830 gain_keys: Vec::new(),
831 pan: 0,831 pan: 0,
832- pitch: 0,832+ pitch: 0.0,
833 transform_keys: Vec::new(),833 transform_keys: Vec::new(),
834 opacity_keys: Vec::new(),834 opacity_keys: Vec::new(),
835 color_keys: Vec::new(),835 color_keys: Vec::new(),
@@ -862,7 +862,7 @@ fn the_sound_is_written_at_the_rate_that_was_asked_for() {
862 gain_db: 0.0,862 gain_db: 0.0,
863 gain_keys: Vec::new(),863 gain_keys: Vec::new(),
864 pan: 0,864 pan: 0,
865- pitch: 0,865+ pitch: 0.0,
866 transform_keys: Vec::new(),866 transform_keys: Vec::new(),
867 opacity_keys: Vec::new(),867 opacity_keys: Vec::new(),
868 color_keys: Vec::new(),868 color_keys: Vec::new(),
@@ -944,7 +944,7 @@ fn a_silent_clip_exports_as_silence_over_its_own_span() {
944 gain_db: 0.0,944 gain_db: 0.0,
945 gain_keys: Vec::new(),945 gain_keys: Vec::new(),
946 pan: 0,946 pan: 0,
947- pitch: 0,947+ pitch: 0.0,
948 transform_keys: Vec::new(),948 transform_keys: Vec::new(),
949 opacity_keys: Vec::new(),949 opacity_keys: Vec::new(),
950 color_keys: Vec::new(),950 color_keys: Vec::new(),
@@ -1056,7 +1056,7 @@ fn a_51_ac3_source_round_trips_through_a_wav() {
1056 gain_db: 0.0,1056 gain_db: 0.0,
1057 gain_keys: Vec::new(),1057 gain_keys: Vec::new(),
1058 pan: 0,1058 pan: 0,
1059- pitch: 0,1059+ pitch: 0.0,
1060 transform_keys: Vec::new(),1060 transform_keys: Vec::new(),
1061 opacity_keys: Vec::new(),1061 opacity_keys: Vec::new(),
1062 color_keys: Vec::new(),1062 color_keys: Vec::new(),
@@ -1215,7 +1215,7 @@ fn a_fade_in_reaches_the_exported_audio() {
1215 gain_db: 0.0,1215 gain_db: 0.0,
1216 gain_keys: Vec::new(),1216 gain_keys: Vec::new(),
1217 pan: 0,1217 pan: 0,
1218- pitch: 0,1218+ pitch: 0.0,
1219 transform_keys: Vec::new(),1219 transform_keys: Vec::new(),
1220 opacity_keys: Vec::new(),1220 opacity_keys: Vec::new(),
1221 color_keys: Vec::new(),1221 color_keys: Vec::new(),
@@ -1325,7 +1325,7 @@ fn a_split_and_crossfaded_clip_has_no_muted_interior() {
1325 gain_db: 0.0,1325 gain_db: 0.0,
1326 gain_keys: Vec::new(),1326 gain_keys: Vec::new(),
1327 pan: 0,1327 pan: 0,
1328- pitch: 0,1328+ pitch: 0.0,
1329 transform_keys: Vec::new(),1329 transform_keys: Vec::new(),
1330 opacity_keys: Vec::new(),1330 opacity_keys: Vec::new(),
1331 color_keys: Vec::new(),1331 color_keys: Vec::new(),
@@ -1450,7 +1450,7 @@ fn a_mono_timeline_exports_as_dual_mono_ogg() {
1450 gain_db: 0.0,1450 gain_db: 0.0,
1451 gain_keys: Vec::new(),1451 gain_keys: Vec::new(),
1452 pan: 0,1452 pan: 0,
1453- pitch: 0,1453+ pitch: 0.0,
1454 transform_keys: Vec::new(),1454 transform_keys: Vec::new(),
1455 opacity_keys: Vec::new(),1455 opacity_keys: Vec::new(),
1456 color_keys: Vec::new(),1456 color_keys: Vec::new(),
@@ -1559,7 +1559,7 @@ fn plain_clip(source: usize, out_frame: u32) -> Clip {
1559 gain_db: 0.0,1559 gain_db: 0.0,
1560 gain_keys: Vec::new(),1560 gain_keys: Vec::new(),
1561 pan: 0,1561 pan: 0,
1562- pitch: 0,1562+ pitch: 0.0,
1563 transform_keys: Vec::new(),1563 transform_keys: Vec::new(),
1564 opacity_keys: Vec::new(),1564 opacity_keys: Vec::new(),
1565 color_keys: Vec::new(),1565 color_keys: Vec::new(),
crates/engine/tests/it/audio_files.rsmodified+1 -1
@@ -431,7 +431,7 @@ fn a_silent_first_source_does_not_stop_the_scan_for_one_with_sound() {
431 gain_db: 0.0,431 gain_db: 0.0,
432 gain_keys: Vec::new(),432 gain_keys: Vec::new(),
433 pan: 0,433 pan: 0,
434- pitch: 0,434+ pitch: 0.0,
435 transform_keys: Vec::new(),435 transform_keys: Vec::new(),
436 opacity_keys: Vec::new(),436 opacity_keys: Vec::new(),
437 color_keys: Vec::new(),437 color_keys: Vec::new(),
crates/engine/tests/it/av1_software_export.rsmodified+1 -1
@@ -182,7 +182,7 @@ fn a_mid_clip_av1_frame_composes_with_a_start_and_an_in_point() {
182 gain_db: 0.0,182 gain_db: 0.0,
183 gain_keys: Vec::new(),183 gain_keys: Vec::new(),
184 pan: 0,184 pan: 0,
185- pitch: 0,185+ pitch: 0.0,
186 transform_keys: Vec::new(),186 transform_keys: Vec::new(),
187 opacity_keys: Vec::new(),187 opacity_keys: Vec::new(),
188 color_keys: Vec::new(),188 color_keys: Vec::new(),
crates/engine/tests/it/av_sync.rsmodified+1 -1
@@ -87,7 +87,7 @@ fn clip(shot: Shot) -> Clip {
87 gain_db: 0.0,87 gain_db: 0.0,
88 gain_keys: Vec::new(),88 gain_keys: Vec::new(),
89 pan: 0,89 pan: 0,
90- pitch: 0,90+ pitch: 0.0,
91 transform_keys: Vec::new(),91 transform_keys: Vec::new(),
92 start: shot.start,92 start: shot.start,
93 in_frame: shot.in_frame,93 in_frame: shot.in_frame,
crates/engine/tests/it/clip_gain.rsmodified+1 -1
@@ -38,7 +38,7 @@ fn clip(frames: u32, gain_db: f32) -> Clip {
38 gain_db,38 gain_db,
39 gain_keys: Vec::new(),39 gain_keys: Vec::new(),
40 pan: 0,40 pan: 0,
41- pitch: 0,41+ pitch: 0.0,
42 transform_keys: Vec::new(),42 transform_keys: Vec::new(),
43 opacity_keys: Vec::new(),43 opacity_keys: Vec::new(),
44 color_keys: Vec::new(),44 color_keys: Vec::new(),
crates/engine/tests/it/duck_audio.rsmodified+1 -1
@@ -45,7 +45,7 @@ fn clip(source: usize, frames: u32) -> Clip {
45 gain_db: 0.0,45 gain_db: 0.0,
46 gain_keys: Vec::new(),46 gain_keys: Vec::new(),
47 pan: 0,47 pan: 0,
48- pitch: 0,48+ pitch: 0.0,
49 transform_keys: Vec::new(),49 transform_keys: Vec::new(),
50 opacity_keys: Vec::new(),50 opacity_keys: Vec::new(),
51 color_keys: Vec::new(),51 color_keys: Vec::new(),
crates/engine/tests/it/eq_audio.rsmodified+1 -1
@@ -67,7 +67,7 @@ fn clip(start: u32, source: usize, frames: u32) -> Clip {
67 gain_db: 0.0,67 gain_db: 0.0,
68 gain_keys: Vec::new(),68 gain_keys: Vec::new(),
69 pan: 0,69 pan: 0,
70- pitch: 0,70+ pitch: 0.0,
71 transform_keys: Vec::new(),71 transform_keys: Vec::new(),
72 opacity_keys: Vec::new(),72 opacity_keys: Vec::new(),
73 color_keys: Vec::new(),73 color_keys: Vec::new(),
crates/engine/tests/it/pan.rsmodified+1 -1
@@ -37,7 +37,7 @@ fn clip(frames: u32, gain_db: f32) -> Clip {
37 gain_db,37 gain_db,
38 gain_keys: Vec::new(),38 gain_keys: Vec::new(),
39 pan: 0,39 pan: 0,
40- pitch: 0,40+ pitch: 0.0,
41 transform_keys: Vec::new(),41 transform_keys: Vec::new(),
42 opacity_keys: Vec::new(),42 opacity_keys: Vec::new(),
43 color_keys: Vec::new(),43 color_keys: Vec::new(),
crates/engine/tests/it/placement_walls.rsmodified+1 -1
@@ -49,7 +49,7 @@ fn clip(source: usize, in_frame: u32, out_frame: u32) -> Clip {
49 gain_db: 0.0,49 gain_db: 0.0,
50 gain_keys: Vec::new(),50 gain_keys: Vec::new(),
51 pan: 0,51 pan: 0,
52- pitch: 0,52+ pitch: 0.0,
53 transform_keys: Vec::new(),53 transform_keys: Vec::new(),
54 opacity_keys: Vec::new(),54 opacity_keys: Vec::new(),
55 color_keys: Vec::new(),55 color_keys: Vec::new(),
crates/engine/tests/it/project_fuzz.rsmodified+2 -2
@@ -311,7 +311,7 @@ fn random_project(rng: &mut Rng, dir: &Path) -> Project {
311 },311 },
312 gain_keys: random_gain_keys(rng, frames),312 gain_keys: random_gain_keys(rng, frames),
313 pan: 0,313 pan: 0,
314- pitch: 0,314+ pitch: 0.0,
315 transform_keys: if kind == LaneKind::Video {315 transform_keys: if kind == LaneKind::Video {
316 random_transform_keys(rng, frames)316 random_transform_keys(rng, frames)
317 } else {317 } else {
@@ -1095,7 +1095,7 @@ fn plain_clip(start: u32) -> Clip {
1095 gain_db: 0.0,1095 gain_db: 0.0,
1096 gain_keys: Vec::new(),1096 gain_keys: Vec::new(),
1097 pan: 0,1097 pan: 0,
1098- pitch: 0,1098+ pitch: 0.0,
1099 transform_keys: Vec::new(),1099 transform_keys: Vec::new(),
1100 opacity_keys: Vec::new(),1100 opacity_keys: Vec::new(),
1101 color_keys: Vec::new(),1101 color_keys: Vec::new(),
crates/engine/tests/it/reverse.rsmodified+1 -1
@@ -150,7 +150,7 @@ fn audio_clip(in_frame: u32, out_frame: u32, speed: u16, reversed: bool) -> Clip
150 gain_db: 0.0,150 gain_db: 0.0,
151 gain_keys: Vec::new(),151 gain_keys: Vec::new(),
152 pan: 0,152 pan: 0,
153- pitch: 0,153+ pitch: 0.0,
154 transform_keys: Vec::new(),154 transform_keys: Vec::new(),
155 start: 0,155 start: 0,
156 in_frame,156 in_frame,
crates/engine/tests/it/silence.rsmodified+2 -2
@@ -154,7 +154,7 @@ fn speed_mode_refuses_a_clip_that_laps_over_a_silence() {
154 gain_db: 0.0,154 gain_db: 0.0,
155 gain_keys: Vec::new(),155 gain_keys: Vec::new(),
156 pan: 0,156 pan: 0,
157- pitch: 0,157+ pitch: 0.0,
158 transform_keys: Vec::new(),158 transform_keys: Vec::new(),
159 opacity_keys: Vec::new(),159 opacity_keys: Vec::new(),
160 color_keys: Vec::new(),160 color_keys: Vec::new(),
@@ -208,7 +208,7 @@ fn whole(source: usize, frames: u32) -> Clip {
208 gain_db: 0.0,208 gain_db: 0.0,
209 gain_keys: Vec::new(),209 gain_keys: Vec::new(),
210 pan: 0,210 pan: 0,
211- pitch: 0,211+ pitch: 0.0,
212 transform_keys: Vec::new(),212 transform_keys: Vec::new(),
213 opacity_keys: Vec::new(),213 opacity_keys: Vec::new(),
214 color_keys: Vec::new(),214 color_keys: Vec::new(),
crates/engine/tests/it/transform_keys.rsmodified+1 -1
@@ -180,7 +180,7 @@ fn a_still_keeps_its_keys_at_the_same_timeline_times_after_a_head_trim() {
180 gain_db: 0.0,180 gain_db: 0.0,
181 gain_keys: Vec::new(),181 gain_keys: Vec::new(),
182 pan: 0,182 pan: 0,
183- pitch: 0,183+ pitch: 0.0,
184 transform_keys: Vec::new(),184 transform_keys: Vec::new(),
185 opacity_keys: Vec::new(),185 opacity_keys: Vec::new(),
186 color_keys: Vec::new(),186 color_keys: Vec::new(),
crates/engine/tests/it/trim_walls.rsmodified+1 -1
@@ -40,7 +40,7 @@ fn clip(source: usize, in_frame: u32, out_frame: u32) -> Clip {
40 gain_db: 0.0,40 gain_db: 0.0,
41 gain_keys: Vec::new(),41 gain_keys: Vec::new(),
42 pan: 0,42 pan: 0,
43- pitch: 0,43+ pitch: 0.0,
44 transform_keys: Vec::new(),44 transform_keys: Vec::new(),
45 opacity_keys: Vec::new(),45 opacity_keys: Vec::new(),
46 color_keys: Vec::new(),46 color_keys: Vec::new(),
crates/engine/tests/it/undo_stress.rsmodified+1 -1
@@ -155,7 +155,7 @@ fn random_clip(rng: &mut Rng) -> Clip {
155 gain_db: 0.0,155 gain_db: 0.0,
156 gain_keys: Vec::new(),156 gain_keys: Vec::new(),
157 pan: 0,157 pan: 0,
158- pitch: 0,158+ pitch: 0.0,
159 transform_keys: Vec::new(),159 transform_keys: Vec::new(),
160 opacity_keys: Vec::new(),160 opacity_keys: Vec::new(),
161 color_keys: Vec::new(),161 color_keys: Vec::new(),
crates/engine/tests/it/voice_audio.rsmodified+1 -1
@@ -29,7 +29,7 @@ fn clip(source: usize, frames: u32) -> Clip {
29 gain_db: 0.0,29 gain_db: 0.0,
30 gain_keys: Vec::new(),30 gain_keys: Vec::new(),
31 pan: 0,31 pan: 0,
32- pitch: 0,32+ pitch: 0.0,
33 transform_keys: Vec::new(),33 transform_keys: Vec::new(),
34 start: 0,34 start: 0,
35 in_frame: 0,35 in_frame: 0,
crates/engine/tests/it/voice_early_stop.rsmodified+1 -1
@@ -31,7 +31,7 @@ fn clip(frames: u32) -> Clip {
31 gain_db: 0.0,31 gain_db: 0.0,
32 gain_keys: Vec::new(),32 gain_keys: Vec::new(),
33 pan: 0,33 pan: 0,
34- pitch: 0,34+ pitch: 0.0,
35 transform_keys: Vec::new(),35 transform_keys: Vec::new(),
36 start: 0,36 start: 0,
37 in_frame: 0,37 in_frame: 0,
crates/engine/tests/lanes.rsmodified+2 -2
@@ -247,7 +247,7 @@ fn the_mp4_copy_follows_the_lane_that_holds_the_sound() {
247 gain_db: 0.0,247 gain_db: 0.0,
248 gain_keys: Vec::new(),248 gain_keys: Vec::new(),
249 pan: 0,249 pan: 0,
250- pitch: 0,250+ pitch: 0.0,
251 transform_keys: Vec::new(),251 transform_keys: Vec::new(),
252 opacity_keys: Vec::new(),252 opacity_keys: Vec::new(),
253 color_keys: Vec::new(),253 color_keys: Vec::new(),
@@ -329,7 +329,7 @@ fn two_audio_lanes_are_summed() {
329 gain_db: 0.0,329 gain_db: 0.0,
330 gain_keys: Vec::new(),330 gain_keys: Vec::new(),
331 pan: 0,331 pan: 0,
332- pitch: 0,332+ pitch: 0.0,
333 transform_keys: Vec::new(),333 transform_keys: Vec::new(),
334 opacity_keys: Vec::new(),334 opacity_keys: Vec::new(),
335 color_keys: Vec::new(),335 color_keys: Vec::new(),
crates/engine/tests/opus_export.rsmodified+2 -2
@@ -95,7 +95,7 @@ fn project(video: &Path, sound: &Path, sound_in: u32) -> Project {
95 gain_db: 0.0,95 gain_db: 0.0,
96 gain_keys: Vec::new(),96 gain_keys: Vec::new(),
97 pan: 0,97 pan: 0,
98- pitch: 0,98+ pitch: 0.0,
99 transform_keys: Vec::new(),99 transform_keys: Vec::new(),
100 opacity_keys: Vec::new(),100 opacity_keys: Vec::new(),
101 color_keys: Vec::new(),101 color_keys: Vec::new(),
@@ -494,7 +494,7 @@ fn a_copied_picture_names_the_sound_it_was_written_with() {
494 gain_db: 0.0,494 gain_db: 0.0,
495 gain_keys: Vec::new(),495 gain_keys: Vec::new(),
496 pan: 0,496 pan: 0,
497- pitch: 0,497+ pitch: 0.0,
498 transform_keys: Vec::new(),498 transform_keys: Vec::new(),
499 opacity_keys: Vec::new(),499 opacity_keys: Vec::new(),
500 color_keys: Vec::new(),500 color_keys: Vec::new(),
crates/mcp/src/help.rsmodified+2 -2
@@ -214,7 +214,7 @@ LANES
214 lane_gain {lane, db} sets a lane's level, -60..12 dB. Each clip's own gain adds on top.214 lane_gain {lane, db} sets a lane's level, -60..12 dB. Each clip's own gain adds on top.
215 pan {clip, pan} and lane_pan {lane, pan} place sound between the speakers, -1 (left) to 1 (right), 0 the middle; a balance, so215 pan {clip, pan} and lane_pan {lane, pan} place sound between the speakers, -1 (left) to 1 (right), 0 the middle; a balance, so
216 the far side is turned down and the near one stays. A clip's pan and its lane's stack. Stereo mixes only. edit {ops:[{op:\"pan\", clip:\"A1@0\", pan:-0.5}]}216 the far side is turned down and the near one stays. A clip's pan and its lane's stack. Stereo mixes only. edit {ops:[{op:\"pan\", clip:\"A1@0\", pan:-0.5}]}
217- pitch {clip, semitones (-12..12)} shifts an audio clip's pitch in whole semitones and keeps its length (12 an octave up). edit {ops:[{op:\"pitch\", clip:\"A1@0\", semitones:12}]}217+ pitch {clip, semitones (-12..12)} shifts an audio clip's pitch in semitones, fractions too (0.37), and keeps its length (12 an octave up). edit {ops:[{op:\"pitch\", clip:\"A1@0\", semitones:12}]}
218 Ducks stack: a lane can carry one duck per key lane (`under`), so several keys can pull it down. edit {ops:[{op:\"duck\", lane, under, off:true}]}218 Ducks stack: a lane can carry one duck per key lane (`under`), so several keys can pull it down. edit {ops:[{op:\"duck\", lane, under, off:true}]}
219 removes that one; edit {ops:[{op:\"duck\", lane, off:true}]} with no under clears every duck on the lane.219 removes that one; edit {ops:[{op:\"duck\", lane, off:true}]} with no under clears every duck on the lane.
220 Not supported (help {topic:\"unsupported\"}): custom transition shapes.220 Not supported (help {topic:\"unsupported\"}): custom transition shapes.
@@ -622,7 +622,7 @@ const OP_TEXTS: &[(&str, &str)] = &[
622 ),622 ),
623 (623 (
624 "pitch",624 "pitch",
625- "pitch {clip, semitones (-12..12)} — the audio clip's pitch in whole semitones: 12 an octave up, -12 an octave down, 0 the original (the default). The speed does not change, so the clip is the same length. Playback and export hear it. Audio clips only.",625+ "pitch {clip, semitones (-12..12)} — the audio clip's pitch in semitones, fractions allowed (0.37): 12 an octave up, -12 an octave down, 0 the original (the default). The speed does not change, so the clip is the same length. Playback and export hear it. Audio clips only.",
626 ),626 ),
627 (627 (
628 "lane_pan",628 "lane_pan",
crates/mcp/src/tools/edit.rsmodified+3 -3
@@ -96,7 +96,7 @@ insert_time {at, duration, lanes?} — ripple empty time in at `at`: clips, capt
96 remove_time {at, duration, lanes?} — ripple a span out of the unlocked lanes (or `lanes`): the cut_regions cut for one span. Titles after it move back; a title wholly inside the span is removed and one straddling an edge is trimmed to the part outside (both named in the reply).96 remove_time {at, duration, lanes?} — ripple a span out of the unlocked lanes (or `lanes`): the cut_regions cut for one span. Titles after it move back; a title wholly inside the span is removed and one straddling an edge is trimmed to the part outside (both named in the reply).
97 TIME97 TIME
98 speed {clip, x, ripple?, lanes?} — rate 0.25..4. [group] Its length changes, so a neighbour in its way refuses; ripple:true moves the later items in the RIPPLE RULE scope (titles too) by the length change: slower pushes them later, faster closes the gap. A clip on another lane that spans the change is never cut: outside the scope it is left in place and the reply names it; a scope lane (named in lanes) that holds one refuses, naming it. One undo step.98 speed {clip, x, ripple?, lanes?} — rate 0.25..4. [group] Its length changes, so a neighbour in its way refuses; ripple:true moves the later items in the RIPPLE RULE scope (titles too) by the length change: slower pushes them later, faster closes the gap. A clip on another lane that spans the change is never cut: outside the scope it is left in place and the reply names it; a scope lane (named in lanes) that holds one refuses, naming it. One undo step.
99-speed_ramp {clip, keys:[{at, speed}...], ripple?, lanes?} [group] — a speed that changes over the clip: each key sets a speed 0.25–4 at a clip-relative time `at` ("0s", "2s", "end" or frames), linear between keys and held before the first and after the last. Keys must be in increasing `at`, at most 8, and keys:[] clears the ramp back to the clip's constant speed. The clip's length follows the ramp, and ripple:true moves the later items as speed does. preset:"speed_up"|"slow_down"|"fast_middle"|"slow_middle" lays one of the speed card's shapes across the clip's length instead of keys (speed_up: 1x to 2x; slow_down: 2x to 1x; fast_middle: slow–fast–slow; slow_middle: fast–slow–fast); not with keys.99+speed_ramp {clip, keys:[{at, speed}...], ripple?, lanes?} [group] — a speed that changes over the clip: each key sets a speed 0.25–4 at a clip-relative time `at` ("0s", "2s", "end" or frames), linear between keys and held before the first and after the last. Keys must be in increasing `at`, at most 64, and keys:[] clears the ramp back to the clip's constant speed. The clip's length follows the ramp, and ripple:true moves the later items as speed does. preset:"speed_up"|"slow_down"|"fast_middle"|"slow_middle" lays one of the speed card's shapes across the clip's length instead of keys (speed_up: 1x to 2x; slow_down: 2x to 1x; fast_middle: slow–fast–slow; slow_middle: fast–slow–fast); not with keys.
100 regroup {at} — rejoins the clips that meet at `at` in every lane and puts them back in one group: the inverse of split (metadata only, one undo step; refused when no cut sits there).100 regroup {at} — rejoins the clips that meet at `at` in every lane and puts them back in one group: the inverse of split (metadata only, one undo step; refused when no cut sits there).
101 copy_paste {clips:[addr,...], at, lane?} — pastes copies of the named clips at `at`, with their effects, keys and volume, keeping their spacing. A paste past the end appends at the end, and the reply says where the copies landed. One clip splits and ripples the room open as the GUI's paste does; several (or any with `lane`) land as one set on their own lanes, refused whole when a landing would overlap. `lane` puts every copy on that lane (the same kind, V or A, as each copy). Links come back among the copies: copied clips that were one take (a picture and its sound, say) land as one new take, while a clip whose partner was not copied comes back unlinked. A set with a `lane` override keeps a take only where its members land on different lanes.101 copy_paste {clips:[addr,...], at, lane?} — pastes copies of the named clips at `at`, with their effects, keys and volume, keeping their spacing. A paste past the end appends at the end, and the reply says where the copies landed. One clip splits and ripples the room open as the GUI's paste does; several (or any with `lane`) land as one set on their own lanes, refused whole when a landing would overlap. `lane` puts every copy on that lane (the same kind, V or A, as each copy). Links come back among the copies: copied clips that were one take (a picture and its sound, say) land as one new take, while a clip whose partner was not copied comes back unlinked. A set with a `lane` override keeps a take only where its members land on different lanes.
102 close_gap {lane, at} — closes the one gap on `lane` that `at` stands in (the GUI's Close gap): a gap that borders a linked take closes with the take's other lane too; nothing else moves. Refused for a clip at `at`, the time past the lane's last clip, and the empty lead-in before its first clip. Captions use close_gaps.102 close_gap {lane, at} — closes the one gap on `lane` that `at` stands in (the GUI's Close gap): a gap that borders a linked take closes with the take's other lane too; nothing else moves. Refused for a clip at `at`, the time past the lane's last clip, and the empty lead-in before its first clip. Captions use close_gaps.
@@ -135,7 +135,7 @@ gain_keys {clip, keys:[[time, db, ease?],...]} — the clip's volume envelope (a
135 gain_key {clip, at, db, ease?} — one point (a point at that frame is replaced) · gain_key_remove {clip, at} — takes out the point within a frame of at135 gain_key {clip, at, db, ease?} — one point (a point at that frame is replaced) · gain_key_remove {clip, at} — takes out the point within a frame of at
136 gain_ramp {clip, from, to, to_db, from_db?} — a straight dB ramp from from to to; from_db defaults to the envelope's level at from. Points inside from..to are replaced.136 gain_ramp {clip, from, to, to_db, from_db?} — a straight dB ramp from from to to; from_db defaults to the envelope's level at from. Points inside from..to are replaced.
137 gain_dip {clip, from, to, db, ramp?=0.5s} — dips to db over from..to with ramps in and out; the ramps start from the level there now and clamp to the clip. Points inside the dip are replaced. For a dip that follows speech by itself, use duck.137 gain_dip {clip, from, to, db, ramp?=0.5s} — dips to db over from..to with ramps in and out; the ramps start from the level there now and clamp to the clip. Points inside the dip are replaced. For a dip that follows speech by itself, use duck.
138-pan {clip, pan (-1..1)} — the audio clip's place between the speakers, -1 left, 0 middle, 1 right (a balance: the far side is turned down) · pitch {clip, semitones (-12..12)} — the audio clip's pitch in whole semitones, 12 an octave up, -12 down, 0 the original; its length and speed are kept · lane_pan {lane, pan (-1..1)} — the same for a whole audio lane, on top of the clips' own138+pan {clip, pan (-1..1)} — the audio clip's place between the speakers, -1 left, 0 middle, 1 right (a balance: the far side is turned down) · pitch {clip, semitones (-12..12)} — the audio clip's pitch in semitones, fractions allowed (0.37), 12 an octave up, -12 down, 0 the original; its length and speed are kept · lane_pan {lane, pan (-1..1)} — the same for a whole audio lane, on top of the clips' own
139 lane_gain {lane, db (-60..12)} — level · limiter {on, ceiling_db?} — the master limiter on the output: ceiling_db -24..0 dB, the highest level the output may reach (default -1 dB)139 lane_gain {lane, db (-60..12)} — level · limiter {on, ceiling_db?} — the master limiter on the output: ceiling_db -24..0 dB, the highest level the output may reach (default -1 dB)
140 duck {lane, under, depth_db?=-12, threshold_db?=-40, attack_ms?=80, release_ms?=400, off?} — music lane dips while the key lane speaks140 duck {lane, under, depth_db?=-12, threshold_db?=-40, attack_ms?=80, release_ms?=400, off?} — music lane dips while the key lane speaks
141 dynamics {lane, gate?, nr?, compressor?, deesser?, reset?} — an audio lane's voice processors: each of gate, nr, compressor, deesser is true, false (bypass) or an object of settings; clean_voice sets the whole chain at once141 dynamics {lane, gate?, nr?, compressor?, deesser?, reset?} — an audio lane's voice processors: each of gate, nr, compressor, deesser is true, false (bypass) or an object of settings; clean_voice sets the whole chain at once
@@ -843,7 +843,7 @@ fn clip_of(source: usize, in_frame: u32, out_frame: u32) -> Clip {
843 gain_db: 0.0,843 gain_db: 0.0,
844 gain_keys: Vec::new(),844 gain_keys: Vec::new(),
845 pan: 0,845 pan: 0,
846- pitch: 0,846+ pitch: 0.0,
847 }847 }
848 }848 }
849 849
crates/mcp/src/tools/edit_fx.rsmodified+10 -10
@@ -1756,7 +1756,7 @@ fn pan(s: &mut PlaybackSession, op: &Value) -> Result<Applied, String> {
1756 Ok(done(format!("{who} → {pan:+.2}"), vec![(lane, start)]))1756 Ok(done(format!("{who} → {pan:+.2}"), vec![(lane, start)]))
1757 }1757 }
1758 1758
1759-/// `pitch {clip, semitones}`, -12 (an octave down) to 12 (up), whole semitones. The speed is kept.1759+/// `pitch {clip, semitones}`, -12 (an octave down) to 12 (up), fractions allowed. The speed is kept.
1760 fn pitch(s: &mut PlaybackSession, op: &Value) -> Result<Applied, String> {1760 fn pitch(s: &mut PlaybackSession, op: &Value) -> Result<Applied, String> {
1761 let (lane, idx, raw, start) = clip_arg(s, op)?;1761 let (lane, idx, raw, start) = clip_arg(s, op)?;
1762 let who = format!("pitch {raw}");1762 let who = format!("pitch {raw}");
@@ -1764,11 +1764,8 @@ fn pitch(s: &mut PlaybackSession, op: &Value) -> Result<Applied, String> {
1764 return Err(format!("{who}: {raw} is on a video lane, and a clip's pitch is set on its audio clip; set it on the audio clip split from the same take"));1764 return Err(format!("{who}: {raw} is on a video lane, and a clip's pitch is set on its audio clip; set it on the audio clip split from the same take"));
1765 }1765 }
1766 let v = num(op, "semitones")?.ok_or_else(|| format!("{who}: missing argument `semitones` (-12 an octave down to 12 an octave up, 0 the original)"))?;1766 let v = num(op, "semitones")?.ok_or_else(|| format!("{who}: missing argument `semitones` (-12 an octave down to 12 an octave up, 0 the original)"))?;
1767- if v.fract() != 0.0 {1767+ let semitones = ranged(&who, "semitones", v, -12.0, 12.0)?;
1768- return Err(format!("{who}: semitones {} is not a whole number", fmt(v)));1768+ if s.clip_pitch_of(lane, idx) == Some(semitones) {
1769- }
1770- let semitones = ranged(&who, "semitones", v, -12.0, 12.0)? as i32;
1771- if s.clip_pitch_of(lane, idx) == Some(semitones as i8) {
1772 return Ok(done(format!("{who} → already {semitones:+}"), Vec::new()));1769 return Ok(done(format!("{who} → already {semitones:+}"), Vec::new()));
1773 }1770 }
1774 if !s.set_clip_pitch(lane, idx, semitones) {1771 if !s.set_clip_pitch(lane, idx, semitones) {
@@ -4441,14 +4438,17 @@ mod pitch_op_tests {
4441 let mut s = session();4438 let mut s = session();
4442 let len = s.lane_clips(Lane::A1)[0].len();4439 let len = s.lane_clips(Lane::A1)[0].len();
4443 run(&mut s, json!({"op": "pitch", "clip": "A1#0", "semitones": 12})).expect("pitch up an octave");4440 run(&mut s, json!({"op": "pitch", "clip": "A1#0", "semitones": 12})).expect("pitch up an octave");
4444- assert_eq!(s.clip_pitch_of(Lane::A1, 0), Some(12));4441+ assert_eq!(s.clip_pitch_of(Lane::A1, 0), Some(12.0));
4445 assert_eq!(s.lane_clips(Lane::A1)[0].len(), len, "pitch keeps the clip's length");4442 assert_eq!(s.lane_clips(Lane::A1)[0].len(), len, "pitch keeps the clip's length");
4446 assert!(s.undo(), "pitch is one undo step");4443 assert!(s.undo(), "pitch is one undo step");
4447- assert_eq!(s.clip_pitch_of(Lane::A1, 0), Some(0));4444+ assert_eq!(s.clip_pitch_of(Lane::A1, 0), Some(0.0));
4448- assert!(run(&mut s, json!({"op": "pitch", "clip": "A1#0", "semitones": 1.5})).is_err());4445+ run(&mut s, json!({"op": "pitch", "clip": "A1#0", "semitones": 0.37})).expect("a fraction sets");
4446+ assert_eq!(s.clip_pitch_of(Lane::A1, 0), Some(0.37));
4447+ assert!(s.undo());
4448+ assert!(run(&mut s, json!({"op": "pitch", "clip": "A1#0", "semitones": 12.5})).is_err());
4449 assert!(run(&mut s, json!({"op": "pitch", "clip": "A1#0", "semitones": 13})).is_err());4449 assert!(run(&mut s, json!({"op": "pitch", "clip": "A1#0", "semitones": 13})).is_err());
4450 assert!(run(&mut s, json!({"op": "pitch", "clip": "A1#0"})).is_err());4450 assert!(run(&mut s, json!({"op": "pitch", "clip": "A1#0"})).is_err());
4451 assert!(run(&mut s, json!({"op": "pitch", "clip": "V1#0", "semitones": 2})).is_err());4451 assert!(run(&mut s, json!({"op": "pitch", "clip": "V1#0", "semitones": 2})).is_err());
4452- assert_eq!(s.clip_pitch_of(Lane::A1, 0), Some(0), "refusals change nothing");4452+ assert_eq!(s.clip_pitch_of(Lane::A1, 0), Some(0.0), "refusals change nothing");
4453 }4453 }
4454 }4454 }
crates/mcp/src/tools/export.rsmodified+2 -1
@@ -1607,7 +1607,7 @@ fn export_start(srv: &mut Server, args: &Value) -> Reply {
1607 AUDIO_KBPS.map(|v| v.to_string()).join(", ")1607 AUDIO_KBPS.map(|v| v.to_string()).join(", ")
1608 ));1608 ));
1609 };1609 };
1610- if let Some(why) = s.audio_rate_refusal(format, ranged) {1610+ if let Some(why) = s.audio_rate_refusal(format, ranged, true) {
1611 return Reply::err(format!(1611 return Reply::err(format!(
1612 "audio_kbps can't be chosen for {}: {why}",1612 "audio_kbps can't be chosen for {}: {why}",
1613 format_name(format)1613 format_name(format)
@@ -1763,6 +1763,7 @@ fn export_start(srv: &mut Server, args: &Value) -> Reply {
1763 keyframe_s,1763 keyframe_s,
1764 faststart,1764 faststart,
1765 audio_kbps,1765 audio_kbps,
1766+ reencode_audio: audio_kbps.is_some(),
1766 subtitles,1767 subtitles,
1767 no_soft_subtitles: no_soft,1768 no_soft_subtitles: no_soft,
1768 range,1769 range,
crates/mcp/src/tools/look.rsmodified+5 -5
@@ -677,13 +677,13 @@ fn media_rows(s: &PlaybackSession, lane: Lane, fps: f64, range: Option<(u32, u32
677 // always; brief shows only the ones set off their default.677 // always; brief shows only the ones set off their default.
678 let (pan, pitch, deint) = (678 let (pan, pitch, deint) = (
679 s.clip_pan_of(lane, idx).unwrap_or(0.0),679 s.clip_pan_of(lane, idx).unwrap_or(0.0),
680- s.clip_pitch_of(lane, idx).unwrap_or(0),680+ s.clip_pitch_of(lane, idx).unwrap_or(0.0),
681 s.deinterlace_of(lane, idx),681 s.deinterlace_of(lane, idx),
682 );682 );
683 if lane.kind == LaneKind::Audio && (full || pan != 0.0) {683 if lane.kind == LaneKind::Audio && (full || pan != 0.0) {
684 body.push_str(&format!(" pan {}", num(f64::from(pan))));684 body.push_str(&format!(" pan {}", num(f64::from(pan))));
685 }685 }
686- if lane.kind == LaneKind::Audio && (full || pitch != 0) {686+ if lane.kind == LaneKind::Audio && (full || pitch != 0.0) {
687 body.push_str(&format!(" pitch {pitch:+}"));687 body.push_str(&format!(" pitch {pitch:+}"));
688 }688 }
689 if lane.kind == LaneKind::Video && (full || deint != engine::project::Deinterlace::Frame) {689 if lane.kind == LaneKind::Video && (full || deint != engine::project::Deinterlace::Frame) {
@@ -1390,14 +1390,14 @@ fn media_info(s: &PlaybackSession, lane: Lane, idx: usize, fps: f64) -> Reply {
1390 // Pan, pitch and deinterlace, each shown only when it is off its default.1390 // Pan, pitch and deinterlace, each shown only when it is off its default.
1391 let (pan, pitch, deint) = (1391 let (pan, pitch, deint) = (
1392 s.clip_pan_of(lane, idx).unwrap_or(0.0),1392 s.clip_pan_of(lane, idx).unwrap_or(0.0),
1393- s.clip_pitch_of(lane, idx).unwrap_or(0),1393+ s.clip_pitch_of(lane, idx).unwrap_or(0.0),
1394 s.deinterlace_of(lane, idx),1394 s.deinterlace_of(lane, idx),
1395 );1395 );
1396 let mut tweaks = Vec::new();1396 let mut tweaks = Vec::new();
1397 if pan != 0.0 {1397 if pan != 0.0 {
1398 tweaks.push(format!("pan {}", num(f64::from(pan))));1398 tweaks.push(format!("pan {}", num(f64::from(pan))));
1399 }1399 }
1400- if pitch != 0 {1400+ if pitch != 0.0 {
1401 tweaks.push(format!("pitch {pitch:+} semitones"));1401 tweaks.push(format!("pitch {pitch:+} semitones"));
1402 }1402 }
1403 if deint != engine::project::Deinterlace::Frame {1403 if deint != engine::project::Deinterlace::Frame {
@@ -2324,7 +2324,7 @@ mod tests {
2324 let audio = call(&mut srv, "clip_info", json!({"clip": "A1#0"}));2324 let audio = call(&mut srv, "clip_info", json!({"clip": "A1#0"}));
2325 assert!(audio.text.contains("pan -0.5 · pitch +3 semitones"), "{}", audio.text);2325 assert!(audio.text.contains("pan -0.5 · pitch +3 semitones"), "{}", audio.text);
2326 assert_eq!(audio.structured.as_ref().unwrap()["pan"], -0.5);2326 assert_eq!(audio.structured.as_ref().unwrap()["pan"], -0.5);
2327- assert_eq!(audio.structured.as_ref().unwrap()["pitch"], 3);2327+ assert_eq!(audio.structured.as_ref().unwrap()["pitch"], 3.0);
2328 let video = call(&mut srv, "clip_info", json!({"clip": "V1#0"}));2328 let video = call(&mut srv, "clip_info", json!({"clip": "V1#0"}));
2329 assert!(video.text.contains("deinterlace field"), "{}", video.text);2329 assert!(video.text.contains("deinterlace field"), "{}", video.text);
2330 assert!(video.text.contains("speed keys: 3\n at clip 0.000s speed 1x\n at clip 1.000s speed 1.5x\n at clip 2.000s speed 2x"), "{}", video.text);2330 assert!(video.text.contains("speed keys: 3\n at clip 0.000s speed 1x\n at clip 1.000s speed 1.5x\n at clip 2.000s speed 2x"), "{}", video.text);