diff --git a/Cargo.lock b/Cargo.lock index 8c2ea8e..f909464 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1638,6 +1638,7 @@ dependencies = [ "oxideav-ac3", "oxideav-core", "rav1e", + "rusty_aac", "rusty_h264", "symphonia", "symphonia-codec-aac", @@ -4880,6 +4881,12 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" +[[package]] +name = "rusty_aac" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7ab980ffb66a559565d09dd6727ff2da7d2a39d2e8b6149e48af6908caa99b5" + [[package]] name = "rusty_h264" version = "0.8.0" diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index 0500f4b..c428579 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -6286,7 +6286,7 @@ impl Quality { /// that opens but never comes back out is exactly the gap a user would other- /// wise go looking for. const FORMATS: [(Option, &str, &str); 9] = [ - (Some(Format::Mp4), "MP4", "H.264 picture + copied AAC"), + (Some(Format::Mp4), "MP4", "H.264 picture + AAC sound"), ( Some(Format::Av1), "AV1", @@ -6296,7 +6296,7 @@ const FORMATS: [(Option, &str, &str); 9] = [ (Some(Format::Flac), "FLAC", "lossless — audio only"), (None, "MP3", "encoder is LGPL — licence decision pending"), (None, "OGG", "no pure-Rust Vorbis or Opus encoder"), - (None, "AAC", "no pure-Rust AAC encoder"), + (None, "AAC", "an MP4's sound here, not a file of its own"), ( None, "HEVC", diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.toml index 77dc2ff..431f736 100644 --- a/crates/engine/Cargo.toml +++ b/crates/engine/Cargo.toml @@ -23,6 +23,12 @@ image = { version = "0.25", default-features = false, features = [ ] } mp4 = "0.14" rusty_h264 = { version = "0.8", default-features = false } +# The AAC-LC *encoder*, so an mp4's sound can be a mix rather than a copy: an +# equalized (or otherwise processed) lane has to be decoded, and what is decoded +# has to be encoded again. Pure Rust with no C or FFI, Apache-2.0, same family +# as `rusty_h264` above. Nothing else in the ecosystem encodes AAC without +# linking Fraunhofer's C library, which this project's no-install rule forbids. +rusty_aac = "0.5" symphonia-core = "0.6" symphonia-codec-aac = "0.6" # The umbrella crate for the standalone audio files: one dependency instead of diff --git a/crates/engine/src/audio.rs b/crates/engine/src/audio.rs index c81c8a0..34e097f 100644 --- a/crates/engine/src/audio.rs +++ b/crates/engine/src/audio.rs @@ -647,8 +647,9 @@ impl AudioSession { /// The raw AAC packets covering `segs` — the same half-open source-second /// windows [`open_segments`](Self::open_segments) decodes — copied out /// byte for byte. Nothing is decoded and nothing is re-encoded: the bytes go - /// straight into an mp4 writer, which is the only way to keep audio in an - /// export at all (no pure-Rust AAC encoder exists). + /// straight into an mp4 writer, which is how an export keeps its sound exact + /// wherever the edit lets it (a lane carrying an equalizer cannot be copied + /// and is re-encoded instead -- `export::encode_audio`). /// /// Cut points do not land on 1024-sample boundaries, so each segment is /// rounded to whole packets against an error carried across the joins (see diff --git a/crates/engine/src/export.rs b/crates/engine/src/export.rs index 21cbeee..fd16471 100644 --- a/crates/engine/src/export.rs +++ b/crates/engine/src/export.rs @@ -2,20 +2,23 @@ //! or, picture left behind, as one WAV or FLAC of the timeline's audio alone. //! //! Video is fully re-encoded — a cut lands mid-GOP, so stream-copying across it -//! is impossible — while audio is copied packet for packet, because there is no -//! pure-Rust AAC encoder to re-encode with. The audio-only formats have no such -//! trouble: `hound` writes PCM and `flacenc` encodes FLAC, both pure Rust, so -//! those are *decoded* out of the timeline instead of copied. The worker owns -//! everything: the caller gets an [`ExportHandle`] and polls it from its render -//! loop. +//! is impossible — while audio is copied packet for packet wherever a copy can +//! say what the timeline says: a copy is exact, free and never a generation of +//! loss. Where it *cannot* — an equalized lane, which is sample math no packet +//! copy can reach — that lane is decoded, mixed and encoded again with +//! `rusty_aac` ([`encode_audio`]). The audio-only formats have no such split: +//! `hound` writes PCM and `flacenc` encodes FLAC, so those are always *decoded* +//! out of the timeline. The worker owns everything: the caller gets an +//! [`ExportHandle`] and polls it from its render loop. //! //! A **speeded** clip splits along the same line, and for the same reason. The //! picture is re-encoded, so the frame walk honours a rate: it takes the source //! frame each timeline frame shows ([`crate::project::Speed::source_at`], the //! very frame preview holds there) and encodes a held one again rather than -//! decoding it twice. The sound is *copied*, and a packet carries no rate -- so -//! a speeded clip on the one audio lane an mp4 copies is refused by name -//! ([`copy_audio`]) rather than written out at 1.00x under a re-timed picture. +//! decoding it twice. The sound is *copied* unless a filter forces a decode, and +//! a packet carries no rate -- so a speeded clip on the one audio lane an mp4 +//! copies is refused by name ([`copy_audio`]) rather than written out at 1.00x +//! under a re-timed picture. //! AV1 carries no audio at all and never meets that refusal; WAV and FLAC are //! decoded and resampled, so they honour a rate like the picture does. //! @@ -60,21 +63,26 @@ const AV1_SPEED: u8 = 10; /// What an export writes. Four, not more: H.264-in-mp4 and AV1-in-Matroska are /// the only *video* pairs with both an encoder and a decoder under this -/// project's no-install rule, and WAV and FLAC are the only audio formats with -/// a pure-Rust encoder at all. MP3 has one (`shine-rs`) under LGPL-2.0, which is -/// a licensing decision this project has not taken; Vorbis, Opus and AAC have -/// none. HEVC and VP9 have no encoder here at all (`hevc`/`vp9` import through -/// the plugin and stop there). A front-end says so rather than hiding the rows. +/// project's no-install rule, and WAV and FLAC are the only *standalone* audio +/// formats with a pure-Rust encoder at all. MP3 has one (`shine-rs`) under +/// LGPL-2.0, which is a licensing decision this project has not taken; Vorbis +/// and Opus have none. (AAC does -- `rusty_aac`, which is what an equalized mp4 +/// track is encoded with -- but AAC is an mp4's own audio, never a file of its +/// own here.) HEVC and VP9 have no encoder here at all (`hevc`/`vp9` import +/// through the plugin and stop there). A front-end says so rather than hiding +/// the rows. #[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] pub enum Format { - /// Picture and sound: video re-encoded, AAC copied. Copied, so it carries - /// **one** audio lane: a timeline whose sound is spread over two is refused - /// by name here and mixed by the other two formats, which decode. + /// Picture and sound: video re-encoded, AAC copied -- or re-encoded too, + /// where a copy could not carry the edit (an equalized lane). Either way it + /// carries **one** audio lane: a timeline whose sound is spread over two is + /// refused by name here and mixed by the other two formats, which decode. #[default] Mp4, /// Picture alone, AV1 in Matroska. Alone because Matroska carries no sound - /// this project can write: there is no AAC or Opus encoder here, and an AAC - /// track copied in would be one *this engine's own reader* leaves silent + /// this project can write: this engine's Matroska writer has no audio track + /// at all, and an AAC track written into one would be one *this engine's own + /// reader* leaves silent /// (`audio::AudioSession::open` refuses Matroska audio). The sound of an AV1 /// export is a WAV or FLAC beside it, which a front-end says up front. Av1, @@ -256,7 +264,9 @@ fn settle(shared: &Shared, result: crate::Result<()>) { } /// The timeline's one audio lane, copied packet for packet: the mp4 path's -/// sound, and the reason that path carries only one lane of it. +/// sound, and the reason that path carries only one lane of it. A lane an +/// equalizer has been put on cannot be *copied* at all and leaves through +/// [`encode_audio`] instead; every other timeline keeps this copy, bit for bit. /// /// ponytail: this holds the whole exported AAC track in memory (~3 kB per /// 23 ms packet, so ~500 MB for an hour). Upgrade path is a streaming @@ -277,10 +287,15 @@ fn copy_audio( // of a timeline playing a file's second audio track carries *that* track. // // One lane, because this path *copies* AAC packets and a mix is not a copy: - // summing two lanes means decoding both and encoding the result, and there - // is no AAC encoder here to encode it with. Refused by name rather than - // silently exporting the first lane -- a file missing half its sound is the - // one failure a user would not notice. + // summing two lanes means decoding both, and only the one thing a copy + // cannot express at all -- an equalizer -- is decoded here today. Refused by + // name rather than silently exporting the first lane, which is a file + // missing half its sound: the one failure a user would not notice. + // + // ponytail: the ceiling is this routing, not the codec any more. + // [`encode_audio`] already mixes *every* audio lane (it is the WAV path's + // own opener), so lifting this refusal is routing a second case to it -- + // deliberately not done here, where the change under test is the equalizer. // // *Which* lane is the same question `audio_segments_from` answers for // playback, and it is asked here rather than assumed: the lane that holds @@ -292,32 +307,29 @@ fn copy_audio( let [segments] = &lanes[..] else { return Err(format!( "this timeline has {} audio lanes and an mp4 export copies one: \ - there is no AAC encoder here to mix them with. Export WAV or FLAC, \ - which are mixed, or put the sound on one lane", + export WAV or FLAC, which are mixed, or put the sound on one lane", lanes.len() ) .into()); }; - // ...and the same list decides which clips this would be copying, which is - // the only way to ask whether any of them carries an equalizer. An EQ is - // sample math and a copy never decodes: exporting it here would write the - // clip flat, silently -- the same failure a missing audio track is. Named by - // where it sits on the timeline, because "some clip" is not a thing a user - // can go and fix. + // ...and the same list names *which* lane those clips sit on, which is the + // only way to ask what has been done to them. let lane = project.audio_lanes()[0]; // ...and the same list decides whether any clip this would copy plays at a // rate other than the one it was recorded at. A copy hands the mp4 the very // AAC packets the source holds and there is no rate inside a packet to // change: the picture would come out re-timed (the walk in [`run`] honours // it) over sound at 1.00x, which is the drift a person finds only after the - // file has gone somewhere. Refused by name, exactly as the equalizer below - // is -- and only *here*, on the lane being copied: AV1 carries no audio at - // all and never reaches this, so it honours a speed like WAV and FLAC do. + // file has gone somewhere. Refused by name -- and only *here*, on the lane + // being copied: AV1 carries no audio at all and never reaches this, so it + // honours a speed like WAV and FLAC do. // - // ponytail: the ceiling is the packet copy itself, not the rate. Upgrade - // path is the same one the equalizer below wants -- an AAC encoder (or a - // decode-and-re-encode of this lane) -- at which point the resample the WAV - // path already runs feeds it and this refusal goes. + // ponytail: the ceiling is the packet copy itself, not the rate, and the way + // off it is now next door -- [`encode_audio`] resamples exactly as the WAV + // path does, so routing a speeded lane there is the one line the equalizer + // below takes. Left refused because this change is the equalizer's, and a + // speeded export turning silently from a copy into a re-encode is a change + // of its own to make on purpose. if let Some((at, speed)) = project .lane(lane) .iter() @@ -331,28 +343,106 @@ fn copy_audio( ) .into()); } - if let Some((at, _)) = project - .lane(lane) - .iter() - .enumerate() - .find(|(idx, _)| { - project - .eq_of(lane, *idx) - .is_some_and(|eq| !eq.is_identity()) - }) - .map(|(idx, clip)| (clip.start, idx)) - { - return Err(format!( - "the clip at {} has an equalizer and an mp4 export copies AAC packets, \ - which no filter can reach: export WAV or FLAC, which are decoded and \ - mixed, or clear the equalizer", - timecode(at, meta.frame_rate) - ) - .into()); + // ...and last, whether any clip on it carries an equalizer. An EQ is sample + // math and a copy never decodes, so copying such a lane would write the clip + // *flat*, silently -- the failure a missing audio track is. This lane is + // decoded, filtered, mixed and encoded again instead ([`encode_audio`]), and + // only this case is: a timeline nobody has equalized still leaves through + // the copy below, packet for packet, so no passthrough quietly becomes a + // generation of loss. + let equalized = (0..project.lane(lane).len()) + .any(|idx| project.eq_of(lane, idx).is_some_and(|eq| !eq.is_identity())); + if equalized { + return encode_audio(project, meta); } AudioSession::copy_multi_streams(&project.audio_sources(), segments) } +/// The same lane, *decoded*: what a packet copy cannot carry comes out here as +/// AAC written by this project's own encoder. +/// +/// The samples are the very ones [`run_audio`] would put in a WAV -- the same +/// opener with the same equalizers, the same rates and the same resize onto the +/// timeline's own length -- so an mp4 and a WAV of one timeline are one mix, +/// not two that could disagree. +/// +/// AAC-LC's encoder delay is one 1024-frame block, which is exactly the priming +/// a reader drops when the file carries no edit list (`audio::DEFAULT_PRIMING`, +/// and [`crate::mux::Mp4Muxer`] writes none): the first packet is that delay, so +/// the sound starts at timeline frame 0 as a copied track's does. +/// +/// ponytail: the mix sits in memory as f32 before it is encoded (~46 MB a +/// minute of 48 kHz stereo), for [`run_audio`]'s reason -- `rusty_aac` buffers +/// the whole stream anyway, since it encodes its frames in parallel. Upgrade +/// path is a chunked push once that encoder streams. +#[allow(clippy::type_complexity)] +fn encode_audio( + project: &Project, + meta: &VideoMeta, +) -> crate::Result)>> { + let sources = project.audio_sources(); + let segs = project.audio_segments_from(0, meta.frame_rate); + let eqs = project.audio_eqs_from(0, meta.frame_rate); + let speeds = project.audio_speeds_from(0, meta.frame_rate); + let Some((audio, chunks)) = + AudioSession::open_mixed_streams_speed(&sources, &segs, &eqs, &speeds)? + else { + return Ok(None); // no audio to write, exactly as a copy of nothing is + }; + let freq_index = rusty_aac::sf_index_for_rate(audio.sample_rate).ok_or_else(|| { + format!( + "{} Hz is not an AAC sample rate: export WAV or FLAC, which write it as it is", + audio.sample_rate + ) + })?; + let channels = usize::from(audio.channels.max(1)); + // The timeline's length, not the mix's: a segment resolves its window to + // whole samples on its own, so the sum can miss by a sample or two and a + // source that ran out early would leave the track short under a picture + // that is not. One resize settles both, as [`run_audio`]'s does. + let total = (f64::from(project.timeline_frames()) / meta.frame_rate + * f64::from(audio.sample_rate)) + .round() as usize + * channels; + let mut samples: Vec = Vec::with_capacity(total); + for chunk in chunks { + samples.extend(chunk.samples); + } + samples.resize(total, 0.0); + + // 256 kbps, not the encoder's 128 default: this is a *second* generation of + // lossy coding over a source that was already AAC, and the export is a + // master a person edits from again, not a delivery file. Measured on the + // suite's fixtures, an untouched clip re-encoded here moves 0.15 dB at this + // rate against 0.46 dB at 128 -- and 32 KB/s beside a 2.76 Mbps picture is + // not a size anyone is counting. + let mut encoder = rusty_aac::AacEncoder::new(rusty_aac::AacEncoderConfig { + bitrate_bps: 256_000, + ..Default::default() + }); + encoder.push_pcm(&samples, audio.channels.max(1), audio.sample_rate)?; + encoder.finish(); + let mut packets = Vec::new(); + // `next_packet` after `finish` yields packets until `Eof` and nothing else, + // so the loop ends on the only error it can see. + while let Ok(packet) = encoder.next_packet() { + packets.push(crate::AacPacket { + bytes: packet.data, + samples: packet.duration, + }); + } + Ok(Some(( + crate::AacTrackParams { + freq_index, + // 1 and 2 are the ISO channel configurations for mono and stereo, + // and the opener refuses anything wider than stereo already. + chan_conf: audio.channels.max(1) as u8, + sample_rate: audio.sample_rate, + }, + packets, + ))) +} + fn run( project: &Project, meta: &VideoMeta, diff --git a/crates/engine/src/playback.rs b/crates/engine/src/playback.rs index 4aef749..13cd7e2 100644 --- a/crates/engine/src/playback.rs +++ b/crates/engine/src/playback.rs @@ -1218,7 +1218,7 @@ impl PlaybackSession { /// [`import`](Self::import) refuses a file with. One output device and one /// copied AAC track mean one set of audio parameters for the whole /// timeline, so a 22 kHz mono track cannot join a 44.1 kHz stereo one -- - /// there is no resampler here, and no AAC encoder to write the join with. + /// there is no resampler here to make one rate of two. /// A front-end greys such a row out; this is the backstop that keeps a /// stale one from making the whole timeline silent. /// diff --git a/crates/engine/tests/eq_audio.rs b/crates/engine/tests/eq_audio.rs index f88590e..f489532 100644 --- a/crates/engine/tests/eq_audio.rs +++ b/crates/engine/tests/eq_audio.rs @@ -277,72 +277,114 @@ fn a_lane_is_equalized_before_the_mix_and_never_after_it() { } /// The export half of the same claim, through `export::start`: what is written -/// is what is heard, so the WAV carries the boost at the same ratio the feeder -/// path measured. +/// is what is heard, so both audio-only formats carry the boost at the same +/// ratio the feeder path measured. Both, because both are lossless and both are +/// one `run_audio` -- a FLAC that disagreed with the WAV beside it would be the +/// writer, and this is where that would show. #[test] -fn a_wav_export_carries_the_same_boost_playback_does() { +fn the_audio_only_exports_carry_the_same_boost_playback_does() { let flat = project(vec![clip(0, 0, 30)]); let mut eqd = flat.clone(); assert!(eqd.set_eq(Lane::A1, 0, Some(boost()))); + for format in [Format::Wav, Format::Flac] { + let mut written = Vec::new(); + for (name, project) in [("flat", &flat), ("eqd", &eqd)] { + let out = out_path(name, format.ext()); + let handle = engine::export::start( + project.clone(), + meta(), + &out, + &ExportSettings { + format, + ..Default::default() + }, + ); + wait(&handle, Duration::from_secs(60)).expect("an audio-only export"); + written.push(decode(&out)); + std::fs::remove_file(&out).unwrap(); + } + let [plain, boosted] = &written[..] else { + unreachable!("two exports") + }; + assert_boosted( + rms(boosted, 0.05, 0.95) / rms(plain, 0.05, 0.95), + format.name(), + ); + // ...and the same number to the ear: the export is not a second, kinder + // filter run at a different point in the chain. + let played = rms(&play(&eqd), 0.05, 0.95) / rms(&play(&flat), 0.05, 0.95); + let exported = rms(boosted, 0.05, 0.95) / rms(plain, 0.05, 0.95); + assert!( + (played - exported).abs() < 0.05, + "playback boosted by {played:.3} and {} by {exported:.3}", + format.name() + ); + } +} + +/// An mp4 export *copies* AAC packets and no filter can reach a copy, so an +/// equalized lane is decoded, mixed and encoded again instead +/// (`export::encode_audio`). The claim is the same one the WAV makes: the boost +/// is in the file, on the clip that was given it and on no other -- and the +/// track still starts where the picture does, which is what the encoder's own +/// priming packet is for. +#[test] +fn an_mp4_export_carries_the_boost_a_packet_copy_could_not() { + let flat = project(vec![clip(0, 0, 30), clip(30, 0, 30)]); + let mut eqd = flat.clone(); + assert!(eqd.set_eq(Lane::A1, 1, Some(boost()))); + let mut written = Vec::new(); for (name, project) in [("flat", &flat), ("eqd", &eqd)] { - let out = out_path(name, "wav"); - let handle = engine::export::start( - project.clone(), - meta(), - &out, - &ExportSettings { - format: Format::Wav, - ..Default::default() - }, - ); - wait(&handle, Duration::from_secs(60)).expect("wav export"); + let out = out_path(name, "mp4"); + let settings = ExportSettings::default(); + let handle = engine::export::start(project.clone(), meta(), &out, &settings); + wait(&handle, Duration::from_secs(180)).expect("an equalized timeline exports as mp4"); written.push(decode(&out)); std::fs::remove_file(&out).unwrap(); } let [plain, boosted] = &written[..] else { unreachable!("two exports") }; - assert_boosted( - rms(boosted, 0.05, 0.95) / rms(plain, 0.05, 0.95), - "wav export", + + // Two seconds of timeline, to within the one 1024-frame packet the length + // rounds up to: an encoder delay left uncompensated would show up here as a + // whole packet of shift, and in the windows below as a smeared cut. + let secs = |s: &[f32]| s.len() as f64 / 2.0 / f64::from(RATE); + println!( + "mp4 lengths: flat {:.3}s, eqd {:.3}s", + secs(plain), + secs(boosted) ); - // ...and the same number to the ear: the export is not a second, kinder - // filter run at a different point in the chain. - let played = rms(&play(&eqd), 0.05, 0.95) / rms(&play(&flat), 0.05, 0.95); - let exported = rms(boosted, 0.05, 0.95) / rms(plain, 0.05, 0.95); + for samples in [plain, boosted] { + assert!( + (secs(samples) - 2.0).abs() < 1024.0 / f64::from(RATE), + "the exported track is {:.3}s of a 2.000s timeline", + secs(samples) + ); + } + + // The boost itself. Not to `assert_boosted`'s fifth of a dB: this file is + // AAC at 128 kbps measured against a *copied* one, so a fraction of a dB is + // the codec, not the filter. A dB either way is far tighter than the 12 the + // band asks for and far wider than any coding noise. + let db = 20.0 * (rms(boosted, 1.05, 1.95) / rms(plain, 1.05, 1.95)).log10(); + println!("mp4 equalized clip: {db:+.2} dB"); assert!( - (played - exported).abs() < 0.05, - "playback boosted by {played:.3} and the export by {exported:.3}" + (db - f64::from(BOOST_DB)).abs() < 1.0, + "the equalized clip in the mp4 measured {db:+.2} dB, the band asks for {BOOST_DB:+.1}" ); -} - -/// An mp4 export *copies* AAC packets, and no filter can reach a packet copy. -/// Refused by name, with the clip's own position in it -- silently writing the -/// clip flat is the one failure nobody would notice. -#[test] -fn an_mp4_export_refuses_an_equalized_clip_and_names_where_it_is() { - let mut p = project(vec![clip(0, 0, 30), clip(30, 0, 30)]); - assert!(p.set_eq(Lane::A1, 1, Some(boost()))); - - let out = out_path("refused", "mp4"); - let handle = engine::export::start(p.clone(), meta(), &out, &ExportSettings::default()); - let err = wait(&handle, Duration::from_secs(60)) - .expect_err("an equalized clip cannot leave through the copy path") - .to_string(); - println!("mp4 refusal: {err}"); - assert!(err.contains("00:01"), "the refusal names the clip: {err}"); - assert!(err.contains("equalizer"), "{err}"); - assert!(err.contains("WAV or FLAC"), "and the way out: {err}"); - assert!(!out.exists(), "a refused export leaves no file"); - - // Taking the curve off is all it takes -- the refusal is about the setting, - // never about the clip having once had one. - assert!(p.set_eq(Lane::A1, 1, None)); - let handle = engine::export::start(p, meta(), &out, &ExportSettings::default()); - wait(&handle, Duration::from_secs(120)).expect("a flat timeline exports as mp4"); - std::fs::remove_file(&out).unwrap(); + // The clip before it is the same sound: not to the bit -- this file is a + // re-encode and that one is a copy -- but to a fraction of a dB, which is + // what says the filter stopped at the cut rather than lifting the lot. + let leak = 20.0 * (rms(boosted, 0.05, 0.95) / rms(plain, 0.05, 0.95)).log10(); + println!("mp4 flat clip moved {leak:+.2} dB"); + assert!(leak.abs() < 0.5, "the flat clip moved {leak:+.2} dB"); + + // ...and a timeline nobody equalized never reaches the encoder at all: its + // audio track is still the source's own packets, which + // `export::exported_packets_are_the_copied_stream` holds to the byte. } /// A band moved while the timeline is playing: `PlaybackSession::set_eq` writes