mirror of
https://github.com/storytold/soundcraft.git
synced 2026-12-02 20:22:27 -05:00
Merge pull request #1205 from ashokram-si/fix/long-takes-888
Recording: a take too long for one file goes on in a new file and lands whole (#888)
This commit is contained in:
13 files changed
+717
-137
No files matched your search
+5
-3
@@ -2,7 +2,7 @@
|
||||
|
||||
**Stage: pre-alpha** · next: alpha, ~5% and ~110–180 h away (the alpha gate's three failing workflows)
|
||||
|
||||
> **Last reviewed:** 2026-11-14 · **Last updated:** 2026-11-18 · **Change:** minor (strict external-WAV AAF import and MIDI input in the progress log; previously trivial: Frequency Shifter plugin, Command-click target priority and cursor, Command-click automation points, plugin editors on Linux/X11, Cancel Zoom Toggle, side panels in dock columns, Auto Pan stereo balance, Alt-click returns a plugin parameter to its default, Clip List Auto Rename, Strip Silence rectangles, Strip Silence Rename, Strip Silence Extract and Separate, Clip Looping dialog, AudioSuite Vari-Fi speed ramps, Auto Pan plugin, Subharmonic plugin, Ring Modulator plugin, Float32 file headroom) · **Target:** Avid Pro Tools Ultimate 2026.4.1
|
||||
> **Last reviewed:** 2026-11-14 · **Last updated:** 2026-11-18 · **Change:** minor (long takes kept whole; previously minor: strict external-WAV AAF import and MIDI input in the progress log; previously trivial: Frequency Shifter plugin, Command-click target priority and cursor, Command-click automation points, plugin editors on Linux/X11, Cancel Zoom Toggle, side panels in dock columns, Auto Pan stereo balance, Alt-click returns a plugin parameter to its default, Clip List Auto Rename, Strip Silence rectangles, Strip Silence Rename, Strip Silence Extract and Separate, Clip Looping dialog, AudioSuite Vari-Fi speed ramps, Auto Pan plugin, Subharmonic plugin, Ring Modulator plugin, Float32 file headroom) · **Target:** Avid Pro Tools Ultimate 2026.4.1
|
||||
|
||||
SoundCraft is a clean-room, pure-Rust digital audio workstation that aims at full parity with
|
||||
Avid Pro Tools, and then beyond it: faster, open, scriptable and agent-controllable. This page is
|
||||
@@ -36,7 +36,7 @@ Detail: [target-app-parity.md](docs/target-app-parity.md#readiness-by-audience).
|
||||
**Why pre-alpha:** the core-workflow gate in [docs/roadmap.md](docs/roadmap.md#alpha-gate) fails.
|
||||
Editing, mixing, bouncing, and saving and reopening work end to end. But a Pro Tools user can't
|
||||
record from a chosen audio interface at a chosen buffer size (only the default devices, a fixed
|
||||
512-sample block, and takes held in RAM). Recording MIDI from a keyboard is built but checked on
|
||||
512-sample block). Recording MIDI from a keyboard is built but checked on
|
||||
Linux only: macOS and Windows are type-checked and have not been tried with a device, and there
|
||||
is no MIDI input on FreeBSD or the web. Session interchange is still incomplete: a strict
|
||||
external-WAV AAF import subset works, but AAF export, OMF and `.ptx` do not.
|
||||
@@ -104,7 +104,7 @@ Other languages shipped: 0 complete. Brazilian Portuguese covers the fixed UI st
|
||||
|
||||
Ranked; the alpha gate, the alpha checklist and the beta plan are in [docs/roadmap.md](docs/roadmap.md).
|
||||
|
||||
1. **Alpha blocker:** audio interfaces: device and buffer-size choice, duplex stream, ASIO; record to disk (G-01, G-06). 35–55 h.
|
||||
1. **Alpha blocker:** audio interfaces: device and buffer-size choice, duplex stream, ASIO (G-01). 35–55 h.
|
||||
2. **Alpha blocker:** MIDI devices: keyboard input, live play and recording are in (checked on Linux only; macOS and Windows type-checked, none on FreeBSD or the web); output, clock and loop/merge recording remain (G-02). 12–22 h.
|
||||
3. **Alpha blocker:** complete AAF/OMF interchange (G-03): strict external-WAV AAF import works; AAF export and OMF import/export remain. 50–90 h.
|
||||
4. macOS plugin entitlement (#153), then AU editors and embedded CLAP editors on macOS (G-05). 1 h for the entitlement (needed for the mix row), then 10–15 h.
|
||||
@@ -129,6 +129,7 @@ mutated and truncated movies. Field reports from the first public week are track
|
||||
- **2026-11-09:** A built-in Frequency Shifter (`freq_shifter`) moves every frequency in the signal by the same number of hertz, from 0.01 Hz to 5 kHz: up, down, both ways at once, or down on the left and up on the right of a stereo track. The unwanted sideband stays at least 100 dB down from 20 Hz to 20 Hz below Nyquist at 44.1 to 96 kHz. Feedback sends the output round again for a trail of further shifts, Mix blends in the dry signal, and every change glides without a click. No readiness percentage change.
|
||||
- **2026-11-08:** Command-click near an existing automation breakpoint keeps that point as the click target with every active tool, and existing fade and clip-gain controls retain their normal priority. Empty automation space shows a crosshair and an insertion hint while Command is held. The active tool's drag gestures stay unchanged. No readiness percentage change.
|
||||
- **2026-11-05:** Command-click in an automation lane adds a point at the clicked time and value with the current editing tool (#1394), using the existing Pencil mapping. Command-click preserves the existing selection and also works on the fallback volume lanes of Master, Aux and VCA tracks. Plain clicks and clip contents stay unchanged, and one Undo removes the new point. No readiness percentage change.
|
||||
- **2026-10-30:** A take too long for one file is recorded into several (`Vox_01.wav`, `Vox_01-2.wav`, …), each small enough to be read back, and all of it lands on the track as clips butted end to end; loop recording and punch-in cut their passes across the files, and crash recovery places every file of an unfinished take. Before, a take past about 1 G samples (46 min of stereo at 192 kHz) stayed on disk but never reached the session (#888). No readiness percentage change.
|
||||
- **2026-10-27 (plugin editors on Linux):** VST3 editors and embedded CLAP editors open in a SoundCraft X11 host window on Linux and the BSDs (XWayland on Wayland desktops), resized on request and closed from its title bar; the host run loop (VST3 `Linux::IRunLoop`, CLAP `timer-support` and `posix-fd-support`) lets X11 editors read their display connection and repaint. Verified with Graillon 3 and Surge XT Effects (JUCE) in both formats (#527). No readiness percentage change.
|
||||
- **2026-10-25:** Alt+Shift+E (`view.zoom_toggle_cancel`) and an Alt-click on the Zoom Toggle button cancel Zoom Toggle and keep the current view: the zoom, the scroll and the track heights stay as they are, and the button is no longer lit. The next Zoom Toggle zooms in from that view and goes back to it. No readiness percentage change.
|
||||
- **2026-10-25:** Tracks and Groups and the Clip List sit in dock columns that run the Edit window's full height at its left and right edges, with the MIDI Editor under the session view between them; Mix docks Tracks and Groups at its left edge. A panel dragged onto a dock group joins it as a tab, stacks above or below it, or makes a new column; one dragged to an empty window edge makes a dock there. A list with no saved place reopens in its dock, and makes the dock again when it is gone. Preferences and window configurations saved with the earlier split-frame layouts load with the new default layouts and keep their other settings. No readiness percentage change.
|
||||
@@ -193,6 +194,7 @@ mutated and truncated movies. Field reports from the first public week are track
|
||||
| 2026-11-08 | trivial | Command-click breakpoint/control priority and insertion affordance; active-tool drags retained; readiness estimates unchanged |
|
||||
| 2026-11-05 | trivial | Progress log: Command-click adds an undoable automation point (#1394); readiness estimates unchanged |
|
||||
| 2026-11-05 | trivial | Languages table: Brazilian Portuguese (pt-BR) near complete for fixed UI strings via PR #1346; needs native review. Estimates unchanged |
|
||||
| 2026-10-30 | minor | Long takes go on in new files and land whole (#888); record to disk dropped from the pre-alpha reasons and the first alpha blocker (done, #84); readiness estimates unchanged |
|
||||
| 2026-10-27 | trivial | VST3 and embedded CLAP editors on Linux/X11 (#527); G-05 estimate down to 10–15 h; readiness estimates unchanged |
|
||||
| 2026-10-25 | trivial | Progress log: Cancel Zoom Toggle; readiness estimates unchanged |
|
||||
| 2026-10-25 | trivial | Progress log: side panels in dock columns; readiness estimates unchanged |
|
||||
|
||||
@@ -73,3 +73,6 @@ sync_github_name = true
|
||||
# Display name explicitly chosen by the contributor on 2026-10-19.
|
||||
[people.vhhr7]
|
||||
display_name = "Vic Herrera (@vhhr)"
|
||||
|
||||
[people.ashokram-si]
|
||||
real_name = "Ashok Ram"
|
||||
@@ -319,6 +319,15 @@ fn gcd(mut a: u32, mut b: u32) -> u32 {
|
||||
a.max(1)
|
||||
}
|
||||
|
||||
/// The number of samples [`resample`] gives for `len` samples converted from `from` to `to` Hz,
|
||||
/// so a caller can lay out converted audio before converting it.
|
||||
pub fn resampled_len(len: usize, from: u32, to: u32) -> usize {
|
||||
if from == 0 || to == 0 || from == to {
|
||||
return len;
|
||||
}
|
||||
((len as f64 * (f64::from(to) / f64::from(from))).round() as usize).min(MAX_OFFLINE_SAMPLES)
|
||||
}
|
||||
|
||||
/// High-quality windowed-sinc sample-rate conversion from `from` Hz to `to` Hz.
|
||||
pub fn resample(ch: &[Vec<f32>], from: u32, to: u32) -> Vec<Vec<f32>> {
|
||||
if from == 0 || to == 0 || from == to {
|
||||
@@ -330,7 +339,7 @@ pub fn resample(ch: &[Vec<f32>], from: u32, to: u32) -> Vec<Vec<f32>> {
|
||||
let bank = Polyphase::new(from, to, &table);
|
||||
ch.iter()
|
||||
.map(|c| {
|
||||
let out_len = ((c.len() as f64 * ratio).round() as usize).min(MAX_OFFLINE_SAMPLES);
|
||||
let out_len = resampled_len(c.len(), from, to);
|
||||
match &bank {
|
||||
Some(b) => b.run(c, out_len),
|
||||
None => resample_channel(c, ratio, out_len, &table),
|
||||
|
||||
+122
-30
@@ -1,7 +1,7 @@
|
||||
//! Crash-recovery copies of open sessions, one folder each, written in the background, and the
|
||||
//! recovery of the ones left behind with unsaved work.
|
||||
|
||||
use crate::io::{Recording, open_session_linked, sanitize_name};
|
||||
use crate::io::{Recording, open_session_linked, sanitize_name, take_part};
|
||||
use crate::{Engine, EngineError, Result};
|
||||
use craft_audio::{BitDepth, EncodeOptions};
|
||||
use soundcraft_model::{Session, SourceAudio, SourceId};
|
||||
@@ -360,8 +360,10 @@ pub fn recover(e: &mut Engine, left: &Leftover) -> Result<Vec<String>> {
|
||||
}
|
||||
|
||||
/// The takes of the recording `left` holds the plan of, repaired, minus those already in `s`.
|
||||
/// A take the plan names that isn't a take file SoundCraft recorded, in a folder it records into,
|
||||
/// is left untouched and added to `skipped`.
|
||||
/// A take that filled its first file goes on in the next ones ([`take_part`]): all of them are
|
||||
/// taken, in order, up to the first that holds nothing. A take file the plan names that isn't a
|
||||
/// take SoundCraft recorded, in a folder it records into, is left untouched and added to
|
||||
/// `skipped`, and ends its take there.
|
||||
fn unfinished_takes(left: &Leftover, s: &Session, skipped: &mut Vec<String>) -> Option<(Recording, Vec<(soundcraft_model::TrackId, PathBuf)>)> {
|
||||
let plan: Recording = serde_json::from_str(&std::fs::read_to_string(left.dir.join(RECORDING)).ok()?).ok()?;
|
||||
let known: Vec<PathBuf> =
|
||||
@@ -369,15 +371,19 @@ fn unfinished_takes(left: &Leftover, s: &Session, skipped: &mut Vec<String>) ->
|
||||
let folders = take_folders(left);
|
||||
let mut takes = Vec::new();
|
||||
for t in &plan.takes {
|
||||
if std::fs::canonicalize(&t.path).is_ok_and(|p| known.contains(&p)) {
|
||||
continue;
|
||||
}
|
||||
match repair_take(&t.path, &folders, t.channels, plan.rate) {
|
||||
Ok(frames) if frames > 0 => takes.push((t.track, t.path.clone())),
|
||||
Ok(_) => {}
|
||||
Err(err) => {
|
||||
log::warn!("recovery skipped the take {}: {err}", t.path.display());
|
||||
skipped.push(format!("{}: {err}", t.path.display()));
|
||||
let parts = (2..).map(|n| take_part(&t.path, n)).take_while(|p| p.exists());
|
||||
for path in std::iter::once(t.path.clone()).chain(parts) {
|
||||
if std::fs::canonicalize(&path).is_ok_and(|p| known.contains(&p)) {
|
||||
continue;
|
||||
}
|
||||
match repair_take(&path, &folders, t.channels, plan.rate) {
|
||||
Ok(frames) if frames > 0 => takes.push((t.track, path)),
|
||||
Ok(_) => break,
|
||||
Err(err) => {
|
||||
log::warn!("recovery skipped the take {}: {err}", path.display());
|
||||
skipped.push(format!("{}: {err}", path.display()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -404,11 +410,11 @@ fn repair_take(path: &Path, folders: &[PathBuf], channels: usize, rate: u32) ->
|
||||
if !folder.is_some_and(|d| folders.contains(&d)) {
|
||||
return Err(refuse("not in a folder SoundCraft records into"));
|
||||
}
|
||||
let header = |frames| craft_audio::wav_float_header(rate, u16::try_from(channels).unwrap_or(u16::MAX), frames).map_err(std::io::Error::other);
|
||||
let header = |frames| take_header(channels, rate, frames);
|
||||
let expected = header(0)?;
|
||||
let mut f = std::fs::OpenOptions::new().read(true).write(true).open(path)?;
|
||||
let mut head = vec![0u8; expected.len()];
|
||||
if std::io::Read::read_exact(&mut f, &mut head).is_err() || !is_take_header(&head, &expected) {
|
||||
if std::io::Read::read_exact(&mut f, &mut head).is_err() || !is_take_header(&head, channels, rate) {
|
||||
return Err(refuse("not a take SoundCraft recorded"));
|
||||
}
|
||||
let audio = f.metadata()?.len().saturating_sub(expected.len() as u64);
|
||||
@@ -419,22 +425,26 @@ fn repair_take(path: &Path, folders: &[PathBuf], channels: usize, rate: u32) ->
|
||||
Ok(frames)
|
||||
}
|
||||
|
||||
/// `head` is a take header like `expected` (the recorder's header for no frames yet): RIFF or
|
||||
/// RF64 WAVE, the same format chunk at the same place, and the data chunk right after it all.
|
||||
/// Only the sizes and frame counts may differ.
|
||||
fn is_take_header(head: &[u8], expected: &[u8]) -> bool {
|
||||
let magic = matches!(head.get(..4), Some(b"RIFF" | b"RF64")) && head.get(8..12) == Some(b"WAVE");
|
||||
let fmt = expected.windows(4).position(|w| w == b"fmt ");
|
||||
let fmt_len = fmt.and_then(|at| expected.get(at + 4..at + 8)).and_then(|b| b.try_into().ok()).map(u32::from_le_bytes);
|
||||
let same_fmt = match (fmt, fmt_len) {
|
||||
(Some(at), Some(n)) => {
|
||||
let end = at.saturating_add(8).saturating_add(n as usize);
|
||||
expected.get(at..end).is_some_and(|chunk| head.get(at..end) == Some(chunk))
|
||||
/// The WAV header the recorder writes for a take of `channels` at `rate` holding `frames`: 32-bit
|
||||
/// float, RIFF or RF64 by size ([`craft_audio::wav_float_header`]).
|
||||
fn take_header(channels: usize, rate: u32, frames: u64) -> std::io::Result<Vec<u8>> {
|
||||
craft_audio::wav_float_header(rate, u16::try_from(channels).unwrap_or(u16::MAX), frames).map_err(std::io::Error::other)
|
||||
}
|
||||
|
||||
/// `head` is a header the recorder writes for a take of `channels` at `rate`: exactly the one
|
||||
/// for the frame count its data chunk claims, RIFF or RF64. The recorder rewrites only the sizes
|
||||
/// and frame counts as the take grows, so a WAV with anything else in the header (its own
|
||||
/// metadata in the reserved chunk, another chunk, another format) isn't a take.
|
||||
fn is_take_header(head: &[u8], channels: usize, rate: u32) -> bool {
|
||||
let data_len = match head.get(..4) {
|
||||
Some(b"RIFF") => {
|
||||
head.len().checked_sub(4).and_then(|at| head.get(at..)).and_then(|b| b.try_into().ok()).map(u32::from_le_bytes).map(u64::from)
|
||||
}
|
||||
_ => false,
|
||||
Some(b"RF64") => head.get(28..36).and_then(|b| b.try_into().ok()).map(u64::from_le_bytes),
|
||||
_ => None,
|
||||
};
|
||||
let data = expected.len().checked_sub(8).and_then(|at| head.get(at..at + 4)) == Some(b"data");
|
||||
magic && same_fmt && data
|
||||
let block = channels as u64 * 4;
|
||||
data_len.filter(|n| block > 0 && n % block == 0).and_then(|n| take_header(channels, rate, n / block).ok()).is_some_and(|written| written == head)
|
||||
}
|
||||
|
||||
/// Delete a leftover autosave.
|
||||
@@ -740,6 +750,62 @@ mod tests {
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// A take that went on in more files before the crash is placed whole: the full files as they
|
||||
/// are, the last one repaired, end to end.
|
||||
#[test]
|
||||
fn a_take_in_several_files_at_a_crash_is_placed_whole_on_recovery() {
|
||||
use crate::io::Take;
|
||||
let dir = folder("autosave-take-files");
|
||||
let root = dir.join("Autosave");
|
||||
let mut e = Engine::default();
|
||||
let track =
|
||||
soundcraft_model::TrackId(e.execute("track.new", &json!({"name": "Vox", "format": "mono"})).unwrap()["tracks"][0].as_u64().unwrap());
|
||||
let take = root.join(sanitize_name(&e.session().name)).join("Audio Files/Vox_01.wav");
|
||||
std::fs::create_dir_all(take.parent().unwrap()).unwrap();
|
||||
let audio = |n: usize| (0..n).flat_map(|i| (i as f32 / 1000.0).to_le_bytes()).collect::<Vec<u8>>();
|
||||
std::fs::write(&take, [take_header(1, 48_000, 300).unwrap(), audio(300)].concat()).unwrap();
|
||||
std::fs::write(take_part(&take, 2), [take_header(1, 48_000, 300).unwrap(), audio(300)].concat()).unwrap();
|
||||
std::fs::write(take_part(&take, 3), [take_header(1, 48_000, 100).unwrap(), audio(250)].concat()).unwrap();
|
||||
let plan = Recording { start: 48_000, pass: None, punch: None, rate: 48_000, takes: vec![Take { track, path: take, channels: 1 }] };
|
||||
let w = Autosaver::new(root.clone());
|
||||
w.write(e.session_arc(), None, Some(plan));
|
||||
drop(w);
|
||||
let mut r = Engine::default();
|
||||
recover(&mut r, &leftovers(&root)[0]).unwrap();
|
||||
let clips: Vec<_> = r.session().track(track).unwrap().clips().iter().map(|c| (c.name.clone(), c.start, c.length)).collect();
|
||||
assert_eq!(clips, [("Vox_01".into(), 48_000, 300), ("Vox_01-2".into(), 48_300, 300), ("Vox_01-3".into(), 48_600, 250)]);
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// A take's parts after an empty one, or one that isn't a take, are not recovered: the take
|
||||
/// ends there, as where they go depends on what it holds.
|
||||
#[test]
|
||||
fn recovery_stops_a_take_at_a_part_that_holds_nothing() {
|
||||
use crate::io::Take;
|
||||
for (case, second) in [("empty", take_header(1, 48_000, 0).unwrap()), ("not a take", b"not audio".repeat(8))] {
|
||||
let dir = folder(&format!("autosave-take-stops-{}", case.replace(' ', "-")));
|
||||
let root = dir.join("Autosave");
|
||||
let mut e = Engine::default();
|
||||
let track =
|
||||
soundcraft_model::TrackId(e.execute("track.new", &json!({"name": "Vox", "format": "mono"})).unwrap()["tracks"][0].as_u64().unwrap());
|
||||
let take = root.join(sanitize_name(&e.session().name)).join("Audio Files/Vox_01.wav");
|
||||
std::fs::create_dir_all(take.parent().unwrap()).unwrap();
|
||||
let audio = |n: usize| (0..n).flat_map(|i| (i as f32 / 1000.0).to_le_bytes()).collect::<Vec<u8>>();
|
||||
std::fs::write(&take, [take_header(1, 48_000, 300).unwrap(), audio(300)].concat()).unwrap();
|
||||
std::fs::write(take_part(&take, 2), &second).unwrap();
|
||||
std::fs::write(take_part(&take, 3), [take_header(1, 48_000, 200).unwrap(), audio(200)].concat()).unwrap();
|
||||
let plan = Recording { start: 0, pass: None, punch: None, rate: 48_000, takes: vec![Take { track, path: take, channels: 1 }] };
|
||||
let w = Autosaver::new(root.clone());
|
||||
w.write(e.session_arc(), None, Some(plan));
|
||||
drop(w);
|
||||
let mut r = Engine::default();
|
||||
recover(&mut r, &leftovers(&root)[0]).unwrap();
|
||||
let clips: Vec<_> = r.session().track(track).unwrap().clips().iter().map(|c| c.name.clone()).collect();
|
||||
assert_eq!(clips, ["Vox_01"], "part 2 {case}: part 3 isn't placed");
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn recovery_never_writes_a_file_that_isnt_a_take_in_a_take_folder() {
|
||||
use crate::io::Take;
|
||||
@@ -752,8 +818,15 @@ mod tests {
|
||||
std::fs::create_dir_all(&takes).unwrap();
|
||||
let wav = [craft_audio::wav_float_header(48_000, 1, 0).unwrap(), vec![0; 4_000]].concat();
|
||||
let text = b"not audio at all, but long enough to be mistaken for a header if nobody looked at it ......".repeat(4);
|
||||
let files =
|
||||
[(takes.join("notes.wav"), text.clone()), (dir.join("Elsewhere/Vox_01.wav"), wav.clone()), (takes.join("../Vox_02.wav"), wav.clone())];
|
||||
// another app's WAV with its own metadata where the recorder reserves room, chunk sizes unchanged
|
||||
let mut tagged = wav.clone();
|
||||
tagged[12..48].copy_from_slice(b"LIST\x1c\0\0\0INFOISFT\x10\0\0\0another recorder");
|
||||
let files = [
|
||||
(takes.join("notes.wav"), text.clone()),
|
||||
(dir.join("Elsewhere/Vox_01.wav"), wav.clone()),
|
||||
(takes.join("../Vox_02.wav"), wav.clone()),
|
||||
(takes.join("Vox_04.wav"), tagged),
|
||||
];
|
||||
for (path, bytes) in &files {
|
||||
std::fs::create_dir_all(path.parent().unwrap()).unwrap();
|
||||
std::fs::write(path, bytes).unwrap();
|
||||
@@ -851,6 +924,25 @@ mod tests {
|
||||
assert_eq!(saved_name(&dir.0.join("none")), None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_take_header_is_one_the_recorder_writes_for_its_frames() {
|
||||
let header = |frames| take_header(2, 48_000, frames).unwrap();
|
||||
for frames in [0, 1, 48_000, 1 << 31] {
|
||||
assert!(is_take_header(&header(frames), 2, 48_000), "{frames} frames");
|
||||
}
|
||||
assert!(header(1 << 31).starts_with(b"RF64"));
|
||||
assert!(!is_take_header(&header(10), 1, 48_000));
|
||||
assert!(!is_take_header(&header(10), 2, 44_100));
|
||||
let mut odd = header(10);
|
||||
let at = odd.len() - 4;
|
||||
odd[at..].copy_from_slice(&79u32.to_le_bytes());
|
||||
assert!(!is_take_header(&odd, 2, 48_000), "a data size that isn't whole frames");
|
||||
let mut fact = header(10);
|
||||
let at = fact.len() - 12;
|
||||
fact[at..at + 4].copy_from_slice(&11u32.to_le_bytes());
|
||||
assert!(!is_take_header(&fact, 2, 48_000), "a frame count the data doesn't hold");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sessions_started_together_get_folders_of_their_own() {
|
||||
// #579: the folder name has millisecond resolution, so two sessions created back to back
|
||||
|
||||
@@ -28,7 +28,7 @@ pub use midi::{export_midi, import_midi_bytes};
|
||||
pub use midi_take::{
|
||||
MAX_MIDI_TAKE_EVENTS, MidiPass, MidiTake, MidiTakeEvent, add_midi_recording, add_midi_recording_from, midi_record_inputs, records_midi,
|
||||
};
|
||||
pub use record::{Recording, Take, add_recording, live_span, place_recording};
|
||||
pub use record::{Recording, Take, add_recording, live_span, place_recording, take_file_samples, take_part};
|
||||
pub use render::{commit_track, consolidate, refuse_longer, render_clip_gain, render_limit, sanitize_name};
|
||||
pub(crate) use session::{DecodedFiles, decode_file, open_session_linked};
|
||||
pub use session::{open_session, save_copy, save_session, save_session_copy};
|
||||
|
||||
+382
-53
@@ -1,7 +1,7 @@
|
||||
use super::import::add_source;
|
||||
use super::import::{MAX_IMPORT_SAMPLES, add_source};
|
||||
#[cfg(test)]
|
||||
use super::session::{save_copy, save_session};
|
||||
use super::{Clip, Engine, EngineError, FileFormat, OsStr, PathBuf, Range, Samples, TrackId, read_file};
|
||||
use super::{AudioBuffer, Clip, Engine, EngineError, FileFormat, OsStr, Path, PathBuf, Range, Samples, Session, TrackId, read_file};
|
||||
|
||||
/// A recording's plan, made when it starts: each record-enabled track's take file, where the
|
||||
/// takes start on the timeline, the loop length they split into when loop recording, and the
|
||||
@@ -24,14 +24,43 @@ pub struct Take {
|
||||
pub channels: usize,
|
||||
}
|
||||
|
||||
/// The `part`-th file (2, 3, …) of a take whose first file is `first`: a take recorded into
|
||||
/// `Vox_01.wav` goes on in `Vox_01-2.wav`, `Vox_01-3.wav` and so on once a file holds
|
||||
/// [`take_file_samples`]. The name is the first file's stem with `-part` and `.wav`, in its
|
||||
/// folder (a first file without a stem gives `-2.wav`); `part` is taken as given, the recorder
|
||||
/// asks for 2 and up.
|
||||
pub fn take_part(first: &Path, part: usize) -> PathBuf {
|
||||
let mut name = first.file_stem().unwrap_or_default().to_os_string();
|
||||
name.push(format!("-{part}.wav"));
|
||||
first.with_file_name(name)
|
||||
}
|
||||
|
||||
/// The most samples (frames × channels) one take file recorded at `rate` holds in a session at
|
||||
/// `session_rate`, so that each file can be placed and the saved session opened again: no more
|
||||
/// than an import ([`MAX_IMPORT_SAMPLES`]), and, when the take is converted to the session's rate,
|
||||
/// no more than a conversion keeps per channel. The recorder goes on in the take's next file
|
||||
/// ([`take_part`]) before one holds more. A `session_rate` of 0 gives the import limit.
|
||||
pub fn take_file_samples(rate: u32, session_rate: u32) -> u64 {
|
||||
let import = MAX_IMPORT_SAMPLES as u64;
|
||||
if rate == session_rate {
|
||||
return import;
|
||||
}
|
||||
let converted = import.min(soundcraft_dsp::offline::MAX_OFFLINE_SAMPLES as u64);
|
||||
converted.saturating_mul(u64::from(rate)).checked_div(u64::from(session_rate)).map_or(import, |n| n.min(import))
|
||||
}
|
||||
|
||||
/// Place recorded take files as `plan` says, as one undo step ("Record").
|
||||
pub fn place_recording(e: &mut Engine, plan: &Recording, takes: Vec<(TrackId, PathBuf)>) -> Vec<soundcraft_model::ClipId> {
|
||||
add_recording_in(e, plan.start, takes, plan.pass, plan.punch)
|
||||
}
|
||||
|
||||
/// Turn recorded take files into clips at `start`, as one undo step ("Record"); each file is the
|
||||
/// source of its clips. With `pass` (loop recording), a take becomes one clip per pass (at most
|
||||
/// 1000), each pass after the first on a new playlist.
|
||||
/// source of its clips. `takes` are grouped by track; a track's files, in the order given (the
|
||||
/// recorder's order: first file, then [`take_part`] 2, 3, …), are one take that went on in a new
|
||||
/// file when one was full, and its clips are cut where one file ends and the next begins. A file
|
||||
/// that can't be read ends its take there: where the files after it go depends on its length. With
|
||||
/// `pass` (loop recording), a take becomes one clip per pass (at most 1000), each pass after the
|
||||
/// first on a new playlist.
|
||||
pub fn add_recording(e: &mut Engine, start: Samples, takes: Vec<(TrackId, PathBuf)>, pass: Option<Samples>) -> Vec<soundcraft_model::ClipId> {
|
||||
add_recording_in(e, start, takes, pass, None)
|
||||
}
|
||||
@@ -46,58 +75,33 @@ fn add_recording_in(
|
||||
punch: Option<Range>,
|
||||
) -> Vec<soundcraft_model::ClipId> {
|
||||
let before = e.session_arc();
|
||||
let mut out = Vec::new();
|
||||
let hz = e.session().sample_rate.hz();
|
||||
let mut tracks: Vec<(TrackId, Vec<PathBuf>)> = Vec::new();
|
||||
for (tid, path) in takes {
|
||||
let read = read_file(&path).and_then(|b| craft_audio::decode(&b, None).map_err(|err| EngineError::Io(format!("{}: {err}", path.display()))));
|
||||
let Ok((_, buf)) = read.inspect_err(|err| e.message(err.to_string())) else { continue };
|
||||
let s = e.session_mut();
|
||||
if s.track(tid).is_none() {
|
||||
continue;
|
||||
match tracks.iter_mut().find(|(t, _)| *t == tid) {
|
||||
Some((_, files)) => files.push(path),
|
||||
None => tracks.push((tid, vec![path])),
|
||||
}
|
||||
let hz = s.sample_rate.hz();
|
||||
let resampled = buf.sample_rate != hz;
|
||||
let mut buf = buf;
|
||||
if resampled && buf.sample_rate > 0 {
|
||||
buf.channels = soundcraft_dsp::offline::resample(&buf.channels, buf.sample_rate, hz);
|
||||
buf.sample_rate = hz;
|
||||
}
|
||||
// Without a loop or a punch every file is placed whole, so each is decoded once, here. With
|
||||
// one, each file's length is parsed from its header first (the file is read, not decoded); a
|
||||
// file is decoded once the take is laid out and it holds a kept span, one file at a time, so
|
||||
// a punch on a take of several files decodes no more than the files it keeps.
|
||||
let every_file_placed = pass.is_none() && punch.is_none();
|
||||
let mut out = Vec::new();
|
||||
for (tid, paths) in tracks {
|
||||
let mut files = Vec::new();
|
||||
for path in paths {
|
||||
let read = if every_file_placed { read_take_file(&path, hz) } else { measure_take_file(&path, hz) };
|
||||
// Where the files after an unreadable one go depends on its length: the take ends there.
|
||||
let Ok(file) = read.inspect_err(|err| e.message(err.to_string())) else { break };
|
||||
files.push(file);
|
||||
}
|
||||
let name = path.file_stem().and_then(OsStr::to_str).unwrap_or("Take");
|
||||
let len = i64::try_from(buf.frames()).unwrap_or(0);
|
||||
let pass = pass.unwrap_or(len).max(1);
|
||||
// Work out what each pass keeps first, so a take nothing is placed from isn't registered.
|
||||
let mut kept_passes = Vec::new();
|
||||
for offset in (0..len).step_by(usize::try_from(pass).unwrap_or(usize::MAX)).take(1_000) {
|
||||
let n = pass.min(len - offset);
|
||||
if offset > 0 && n < pass / 8 {
|
||||
break;
|
||||
}
|
||||
let (clip_start, cut, clip_len) = match punch {
|
||||
Some(p) => {
|
||||
let Some(kept) = Range::new(start, start.saturating_add(n)).intersect(&p) else { continue };
|
||||
(kept.start, kept.start.saturating_sub(start), kept.len())
|
||||
}
|
||||
None => (start, 0, n),
|
||||
};
|
||||
kept_passes.push((offset, clip_start, cut, clip_len));
|
||||
}
|
||||
if kept_passes.is_empty() {
|
||||
continue;
|
||||
}
|
||||
let src = add_source(s, name, buf, Some(&path.to_string_lossy()), FileFormat::Wav);
|
||||
if let Some(x) = s.sources.last_mut() {
|
||||
x.unsaved = resampled;
|
||||
}
|
||||
for (offset, clip_start, cut, clip_len) in kept_passes {
|
||||
if offset > 0
|
||||
&& let Some(t) = s.track_mut(tid)
|
||||
{
|
||||
t.playlists.push(soundcraft_model::Playlist::new(format!("{}.{:02}", t.name, t.playlists.len() + 1)));
|
||||
t.active_playlist = t.playlists.len() - 1;
|
||||
}
|
||||
let cid = s.new_clip_id();
|
||||
crate::edit::place_clip(s, tid, Clip::audio(cid, name, src, offset.saturating_add(cut), clip_start, clip_len));
|
||||
out.push(cid);
|
||||
let (clips, problems) = place_take(e.session_mut(), tid, files, start, pass, punch);
|
||||
for problem in problems {
|
||||
e.message(problem);
|
||||
}
|
||||
out.extend(clips);
|
||||
}
|
||||
if !out.is_empty() {
|
||||
e.push_undo("Record", before);
|
||||
@@ -105,6 +109,132 @@ fn add_recording_in(
|
||||
out
|
||||
}
|
||||
|
||||
/// One file of a take: its length at the session's rate (`hz`), whether it is recorded at
|
||||
/// another rate, and its audio at the session's rate once read.
|
||||
struct TakeFile {
|
||||
path: PathBuf,
|
||||
len: Samples,
|
||||
resampled: bool,
|
||||
audio: Option<AudioBuffer>,
|
||||
}
|
||||
|
||||
/// A take file's audio at the session's rate `hz`, and whether it was recorded at another rate.
|
||||
fn decode_take(path: &Path, hz: u32) -> Result<(AudioBuffer, bool), EngineError> {
|
||||
let bytes = read_file(path)?;
|
||||
let (_, mut buf) = craft_audio::decode(&bytes, None).map_err(|err| EngineError::Io(format!("{}: {err}", path.display())))?;
|
||||
let resampled = buf.sample_rate != hz && buf.sample_rate > 0;
|
||||
if resampled {
|
||||
buf.channels = soundcraft_dsp::offline::resample(&buf.channels, buf.sample_rate, hz);
|
||||
buf.sample_rate = hz;
|
||||
}
|
||||
Ok((buf, resampled))
|
||||
}
|
||||
|
||||
/// A take file read and decoded, at the session's rate `hz`.
|
||||
fn read_take_file(path: &Path, hz: u32) -> Result<TakeFile, EngineError> {
|
||||
let (buf, resampled) = decode_take(path, hz)?;
|
||||
let len = i64::try_from(buf.frames()).unwrap_or(0);
|
||||
Ok(TakeFile { path: path.to_path_buf(), len, resampled, audio: Some(buf) })
|
||||
}
|
||||
|
||||
/// A take file's length at the session's rate `hz`, parsed from its header, without decoding it.
|
||||
fn measure_take_file(path: &Path, hz: u32) -> Result<TakeFile, EngineError> {
|
||||
let bytes = read_file(path)?;
|
||||
let info = craft_audio::probe(&bytes, None).map_err(|err| EngineError::Io(format!("{}: {err}", path.display())))?;
|
||||
let resampled = info.sample_rate != hz && info.sample_rate > 0;
|
||||
let frames = usize::try_from(info.frames).unwrap_or(usize::MAX);
|
||||
let len = if resampled { soundcraft_dsp::offline::resampled_len(frames, info.sample_rate, hz) } else { frames };
|
||||
Ok(TakeFile { path: path.to_path_buf(), len: i64::try_from(len).unwrap_or(i64::MAX), resampled, audio: None })
|
||||
}
|
||||
|
||||
/// Place one track's take, from its files in order, as [`add_recording_in`] says. A file that
|
||||
/// holds a kept span and isn't decoded yet is decoded now; one that can't be ends the take there,
|
||||
/// as an unreadable file does, and what went wrong is returned beside the clips.
|
||||
fn place_take(
|
||||
s: &mut Session,
|
||||
tid: TrackId,
|
||||
files: Vec<TakeFile>,
|
||||
start: Samples,
|
||||
pass: Option<Samples>,
|
||||
punch: Option<Range>,
|
||||
) -> (Vec<soundcraft_model::ClipId>, Vec<String>) {
|
||||
let mut problems = Vec::new();
|
||||
if s.track(tid).is_none() {
|
||||
return (Vec::new(), problems);
|
||||
}
|
||||
let hz = s.sample_rate.hz();
|
||||
// The span of the take each file holds.
|
||||
let mut len: i64 = 0;
|
||||
let files: Vec<_> = files
|
||||
.into_iter()
|
||||
.map(|f| {
|
||||
let from = len;
|
||||
len = len.saturating_add(f.len);
|
||||
(f, Range::new(from, len))
|
||||
})
|
||||
.collect();
|
||||
let pass = pass.unwrap_or(len).max(1);
|
||||
// Work out what each pass keeps first, so a file nothing is placed from isn't read or registered.
|
||||
let mut kept_passes = Vec::new();
|
||||
for offset in (0..len).step_by(usize::try_from(pass).unwrap_or(usize::MAX)).take(1_000) {
|
||||
let n = pass.min(len - offset);
|
||||
if offset > 0 && n < pass / 8 {
|
||||
break;
|
||||
}
|
||||
let (clip_start, cut, clip_len) = match punch {
|
||||
Some(p) => {
|
||||
let Some(kept) = Range::new(start, start.saturating_add(n)).intersect(&p) else { continue };
|
||||
(kept.start, kept.start.saturating_sub(start), kept.len())
|
||||
}
|
||||
None => (start, 0, n),
|
||||
};
|
||||
// What this pass keeps, as a span of the take, and where that span starts on the timeline.
|
||||
kept_passes.push((offset, Range::new(offset.saturating_add(cut), offset.saturating_add(cut).saturating_add(clip_len)), clip_start));
|
||||
}
|
||||
let mut sources = Vec::new();
|
||||
for (file, span) in files {
|
||||
if !kept_passes.iter().any(|(_, kept, _)| kept.intersect(&span).is_some()) {
|
||||
continue;
|
||||
}
|
||||
let read = match file.audio {
|
||||
Some(buf) => Ok(buf),
|
||||
None => decode_take(&file.path, hz).map(|(buf, _)| buf),
|
||||
};
|
||||
let buf = match read {
|
||||
Ok(buf) => buf,
|
||||
Err(err) => {
|
||||
problems.push(err.to_string());
|
||||
break;
|
||||
}
|
||||
};
|
||||
// (its clips stay within what it holds, should the header have said more)
|
||||
let span = Range::new(span.start, span.start.saturating_add(i64::try_from(buf.frames()).unwrap_or(0).min(span.len())));
|
||||
let name = file.path.file_stem().and_then(OsStr::to_str).unwrap_or("Take").to_string();
|
||||
let src = add_source(s, &name, buf, Some(&file.path.to_string_lossy()), FileFormat::Wav);
|
||||
if let Some(x) = s.sources.last_mut() {
|
||||
x.unsaved = file.resampled;
|
||||
}
|
||||
sources.push((src, name, span));
|
||||
}
|
||||
let mut out = Vec::new();
|
||||
for (offset, kept, clip_start) in kept_passes {
|
||||
if offset > 0
|
||||
&& let Some(t) = s.track_mut(tid)
|
||||
{
|
||||
t.playlists.push(soundcraft_model::Playlist::new(format!("{}.{:02}", t.name, t.playlists.len() + 1)));
|
||||
t.active_playlist = t.playlists.len() - 1;
|
||||
}
|
||||
for (src, name, span) in &sources {
|
||||
let Some(piece) = kept.intersect(span) else { continue };
|
||||
let cid = s.new_clip_id();
|
||||
let at = clip_start.saturating_add(piece.start - kept.start);
|
||||
crate::edit::place_clip(s, tid, Clip::audio(cid, name.as_str(), *src, piece.start - span.start, at, piece.len()));
|
||||
out.push(cid);
|
||||
}
|
||||
}
|
||||
(out, problems)
|
||||
}
|
||||
|
||||
/// Where a take recording from `start` shows while it holds `len` samples, as it will be placed:
|
||||
/// just the pass under way when loop recording in passes of `pass`, within the `punch` range.
|
||||
/// Returns the timeline position of its first sample and the span it covers.
|
||||
@@ -116,7 +246,7 @@ pub fn live_span(start: Samples, pass: Option<Samples>, punch: Option<Range>, le
|
||||
|
||||
#[cfg(test)]
|
||||
mod record_tests {
|
||||
use super::super::{AudioBuffer, Path, plan_takes};
|
||||
use super::super::plan_takes;
|
||||
use super::*;
|
||||
use serde_json::json;
|
||||
|
||||
@@ -235,6 +365,205 @@ mod record_tests {
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// The clips on `vox`'s playlists, by playlist: (source file, start, length, offset in the file).
|
||||
fn passes(e: &Engine, vox: TrackId) -> Vec<Vec<(String, Samples, Samples, Samples)>> {
|
||||
let s = e.session();
|
||||
let file = |c: &Clip| s.sources.iter().find(|x| Some(x.id) == c.source()).map(|x| x.name.clone()).unwrap_or_default();
|
||||
let t = s.track(vox).unwrap();
|
||||
t.playlists.iter().map(|p| p.clips.iter().map(|c| (file(c), c.start, c.length, c.source_offset())).collect()).collect()
|
||||
}
|
||||
|
||||
/// A take the recorder went on with in more files lands end to end, every frame in place; a
|
||||
/// punch keeps the part of each file inside it, and a file it keeps nothing of isn't added.
|
||||
#[test]
|
||||
fn a_take_in_several_files_lands_end_to_end() {
|
||||
let dir = std::env::temp_dir().join(format!("soundcraft-take-files-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
let first = dir.join("Audio Files/Vox_01.wav");
|
||||
let files = [first.clone(), take_part(&first, 2), take_part(&first, 3)];
|
||||
assert_eq!(files[2], dir.join("Audio Files/Vox_01-3.wav"));
|
||||
for (f, frames) in files.iter().zip([1_000, 1_000, 500]) {
|
||||
write_take(f, frames);
|
||||
}
|
||||
let mut e = Engine::default();
|
||||
let vox = armed(&mut e, "Vox", "mono", "In 1");
|
||||
let takes: Vec<_> = files.iter().map(|f| (vox, f.clone())).collect();
|
||||
assert_eq!(add_recording(&mut e, 1_000, takes.clone(), None).len(), 3);
|
||||
let all = |n: &str, start, len| (n.to_string(), start, len, 0);
|
||||
assert_eq!(passes(&e, vox), [vec![all("Vox_01", 1_000, 1_000), all("Vox_01-2", 2_000, 1_000), all("Vox_01-3", 3_000, 500)]]);
|
||||
e.execute("edit.undo", &json!({})).unwrap();
|
||||
|
||||
let sources = e.session().sources.len();
|
||||
let plan = Recording { start: 1_000, pass: None, punch: Some(Range::new(1_800, 2_200)), rate: 48_000, takes: Vec::new() };
|
||||
place_recording(&mut e, &plan, takes);
|
||||
assert_eq!(passes(&e, vox), [vec![("Vox_01".into(), 1_800, 200, 800), ("Vox_01-2".into(), 2_000, 200, 0)]]);
|
||||
assert_eq!(e.session().sources.len(), sources + 2, "the third file holds nothing inside the punch");
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// Loop recording: the passes run on across the take's files, a pass that spans two files
|
||||
/// becomes two clips butted on its playlist.
|
||||
#[test]
|
||||
fn loop_passes_run_on_across_a_takes_files() {
|
||||
let dir = std::env::temp_dir().join(format!("soundcraft-loop-take-files-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
let first = dir.join("Audio Files/Vox_01.wav");
|
||||
let files = [first.clone(), take_part(&first, 2), take_part(&first, 3)];
|
||||
for (f, frames) in files.iter().zip([1_000, 1_000, 500]) {
|
||||
write_take(f, frames);
|
||||
}
|
||||
let mut e = Engine::default();
|
||||
let vox = armed(&mut e, "Vox", "mono", "In 1");
|
||||
add_recording(&mut e, 1_000, files.iter().map(|f| (vox, f.clone())).collect(), Some(800));
|
||||
let clip = |n: &str, start, len, at| (n.to_string(), start, len, at);
|
||||
assert_eq!(
|
||||
passes(&e, vox),
|
||||
[
|
||||
vec![clip("Vox_01", 1_000, 800, 0)],
|
||||
vec![clip("Vox_01", 1_000, 200, 800), clip("Vox_01-2", 1_200, 600, 0)],
|
||||
vec![clip("Vox_01-2", 1_000, 400, 600), clip("Vox_01-3", 1_400, 400, 0)],
|
||||
vec![clip("Vox_01-3", 1_000, 100, 400)],
|
||||
]
|
||||
);
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// A mono take file of `frames` samples that all hold `value`, so a test can tell which file a
|
||||
/// clip plays.
|
||||
fn write_take_of(path: &Path, frames: usize, value: f32) {
|
||||
let mut bytes = craft_audio::wav_float_header(48_000, 1, frames as u64).unwrap();
|
||||
bytes.extend((0..frames).flat_map(|_| value.to_le_bytes()));
|
||||
std::fs::create_dir_all(path.parent().unwrap()).unwrap();
|
||||
std::fs::write(path, bytes).unwrap();
|
||||
}
|
||||
|
||||
/// The value the first sample of each clip on `vox`'s playlists plays, pass by pass.
|
||||
fn heard(e: &Engine, vox: TrackId) -> Vec<Vec<f32>> {
|
||||
let s = e.session();
|
||||
let t = s.track(vox).unwrap();
|
||||
let first = |c: &Clip| {
|
||||
let audio = c.source().and_then(|id| s.pool.get(id)).unwrap();
|
||||
audio.buffer.channels[0][usize::try_from(c.source_offset()).unwrap()]
|
||||
};
|
||||
t.playlists.iter().map(|p| p.clips.iter().map(first).collect()).collect()
|
||||
}
|
||||
|
||||
/// Each clip plays the file it was cut from, at the right place in it, with or without a
|
||||
/// punch: three files of different lengths and contents in order.
|
||||
#[test]
|
||||
fn each_clip_of_a_take_plays_its_own_file() {
|
||||
let dir = std::env::temp_dir().join(format!("soundcraft-take-audio-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
let first = dir.join("Audio Files/Vox_01.wav");
|
||||
let files = [first.clone(), take_part(&first, 2), take_part(&first, 3)];
|
||||
for (f, (frames, v)) in files.iter().zip([(1_000, 0.1), (700, 0.2), (400, 0.3)]) {
|
||||
write_take_of(f, frames, v);
|
||||
}
|
||||
let mut e = Engine::default();
|
||||
let vox = armed(&mut e, "Vox", "mono", "In 1");
|
||||
let takes: Vec<_> = files.iter().map(|f| (vox, f.clone())).collect();
|
||||
add_recording(&mut e, 0, takes.clone(), None);
|
||||
assert_eq!(heard(&e, vox), [vec![0.1, 0.2, 0.3]]);
|
||||
assert_eq!(passes(&e, vox)[0].iter().map(|c| (c.1, c.2)).collect::<Vec<_>>(), [(0, 1_000), (1_000, 700), (1_700, 400)]);
|
||||
e.execute("edit.undo", &json!({})).unwrap();
|
||||
// a punch over the second and third files: only they are read and placed
|
||||
let sources = e.session().sources.len();
|
||||
let plan = Recording { start: 0, pass: None, punch: Some(Range::new(1_500, 1_900)), rate: 48_000, takes: Vec::new() };
|
||||
place_recording(&mut e, &plan, takes);
|
||||
assert_eq!(heard(&e, vox), [vec![0.2, 0.3]]);
|
||||
assert_eq!(passes(&e, vox), [vec![("Vox_01-2".into(), 1_500, 200, 500), ("Vox_01-3".into(), 1_700, 200, 0)]]);
|
||||
assert_eq!(e.session().sources.len(), sources + 2);
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// The take ends at a file that can't be read: the files after it are not placed, since where
|
||||
/// they go depends on its length. So with a punch, where only the files' lengths are read first.
|
||||
#[test]
|
||||
fn a_take_ends_at_a_file_that_cant_be_read() {
|
||||
let dir = std::env::temp_dir().join(format!("soundcraft-take-unreadable-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
let first = dir.join("Audio Files/Vox_01.wav");
|
||||
let files = [first.clone(), take_part(&first, 2), take_part(&first, 3)];
|
||||
write_take_of(&files[0], 1_000, 0.1);
|
||||
std::fs::write(&files[1], b"not a wave file").unwrap();
|
||||
write_take_of(&files[2], 500, 0.3);
|
||||
let mut e = Engine::default();
|
||||
let vox = armed(&mut e, "Vox", "mono", "In 1");
|
||||
let takes: Vec<_> = files.iter().map(|f| (vox, f.clone())).collect();
|
||||
add_recording(&mut e, 0, takes.clone(), None);
|
||||
assert_eq!(heard(&e, vox), [vec![0.1]]);
|
||||
e.execute("edit.undo", &json!({})).unwrap();
|
||||
let plan = Recording { start: 0, pass: None, punch: Some(Range::new(500, 5_000)), rate: 48_000, takes: Vec::new() };
|
||||
place_recording(&mut e, &plan, takes);
|
||||
assert_eq!(passes(&e, vox), [vec![("Vox_01".into(), 500, 500, 500)]]);
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// A loop pass longer than a file runs on across three of them: three clips butted on one
|
||||
/// playlist.
|
||||
#[test]
|
||||
fn a_pass_runs_on_across_three_files() {
|
||||
let dir = std::env::temp_dir().join(format!("soundcraft-take-three-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
let first = dir.join("Audio Files/Vox_01.wav");
|
||||
let files = [first.clone(), take_part(&first, 2), take_part(&first, 3), take_part(&first, 4)];
|
||||
for (f, v) in files.iter().zip([0.1, 0.2, 0.3, 0.4]) {
|
||||
write_take_of(f, 300, v);
|
||||
}
|
||||
let mut e = Engine::default();
|
||||
let vox = armed(&mut e, "Vox", "mono", "In 1");
|
||||
add_recording(&mut e, 0, files.iter().map(|f| (vox, f.clone())).collect(), Some(800));
|
||||
let clip = |n: &str, start, len, at| (n.to_string(), start, len, at);
|
||||
assert_eq!(passes(&e, vox)[0], [clip("Vox_01", 0, 300, 0), clip("Vox_01-2", 300, 300, 0), clip("Vox_01-3", 600, 200, 0)]);
|
||||
assert_eq!(heard(&e, vox)[0], [0.1, 0.2, 0.3]);
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// With a punch, a file is decoded only if the punch keeps some of it: one outside it is never
|
||||
/// read (here it no longer exists, and nothing is reported). One inside it that can't be decoded
|
||||
/// ends the take there, as an unreadable file does, and says why.
|
||||
#[test]
|
||||
fn a_punch_decodes_only_the_files_it_keeps() {
|
||||
let dir = std::env::temp_dir().join(format!("soundcraft-take-lazy-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
let first = dir.join("Audio Files/Vox_01.wav");
|
||||
let files = [first.clone(), take_part(&first, 2), take_part(&first, 3)];
|
||||
for (f, v) in files.iter().zip([0.1, 0.2, 0.3]) {
|
||||
write_take_of(f, 300, v);
|
||||
}
|
||||
let mut e = Engine::default();
|
||||
let vox = armed(&mut e, "Vox", "mono", "In 1");
|
||||
let measured = |f: &PathBuf| measure_take_file(f, 48_000).unwrap();
|
||||
let mut take: Vec<_> = files.iter().map(measured).collect();
|
||||
std::fs::remove_file(&files[2]).unwrap();
|
||||
let (clips, problems) = place_take(e.session_mut(), vox, std::mem::take(&mut take), 0, None, Some(Range::new(100, 500)));
|
||||
assert_eq!((clips.len(), problems), (2, Vec::<String>::new()), "the third file is outside the punch: never read");
|
||||
assert_eq!(heard(&e, vox), [vec![0.1, 0.2]]);
|
||||
|
||||
let mut e = Engine::default();
|
||||
let vox = armed(&mut e, "Vox", "mono", "In 1");
|
||||
write_take_of(&files[2], 300, 0.3);
|
||||
let take: Vec<_> = files.iter().map(measured).collect();
|
||||
std::fs::remove_file(&files[1]).unwrap();
|
||||
let (clips, problems) = place_take(e.session_mut(), vox, take, 0, None, Some(Range::new(100, 800)));
|
||||
assert_eq!(clips.len(), 1, "the take ends at the file that can't be decoded");
|
||||
assert!(problems.len() == 1 && problems[0].contains("Vox_01-2.wav"), "{problems:?}");
|
||||
assert_eq!(heard(&e, vox), [vec![0.1]]);
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// A take file holds what can be placed and opened again: the import limit at the session's
|
||||
/// rate, and at another rate also no more than a conversion keeps per channel.
|
||||
#[test]
|
||||
fn a_take_file_holds_what_the_session_can_read_back() {
|
||||
let (import, converted) = (MAX_IMPORT_SAMPLES as u64, soundcraft_dsp::offline::MAX_OFFLINE_SAMPLES as u64);
|
||||
assert_eq!(take_file_samples(48_000, 48_000), import);
|
||||
assert_eq!(take_file_samples(96_000, 48_000), converted * 2);
|
||||
assert_eq!(take_file_samples(44_100, 48_000), converted * 44_100 / 48_000);
|
||||
assert_eq!(take_file_samples(192_000, 8_000), import);
|
||||
assert_eq!(take_part(Path::new("/s/Audio Files/Gtr_12.wav"), 2), Path::new("/s/Audio Files/Gtr_12-2.wav"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_take_shows_the_pass_under_way_within_the_punch_while_it_records() {
|
||||
assert_eq!(live_span(1_000, None, None, 0), None);
|
||||
|
||||
+163
-29
@@ -3,20 +3,34 @@
|
||||
//! A [`Recorder`] opens the default input device. While armed, the input callback copies each
|
||||
//! block into a preallocated lock-free ring (it never locks or allocates), and a writer thread
|
||||
//! streams the ring into one WAV file per take, rewriting the header every second so a crash leaves
|
||||
//! a playable file.
|
||||
//! a playable file. A take that fills its file goes on in a new one ([`TakeFiles`]).
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::{Seek, SeekFrom, Write};
|
||||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::atomic::{AtomicBool, AtomicU8, AtomicU32, AtomicU64, AtomicUsize, Ordering};
|
||||
use std::sync::{Arc, Mutex, MutexGuard, PoisonError};
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use soundcraft_model::TrackId;
|
||||
|
||||
/// What [`Recorder::finish`] returns: the takes that hold audio and the first problem met.
|
||||
/// What [`Recorder::finish`] returns: the files of the takes that hold audio, a take's files in
|
||||
/// order, and the first problem met.
|
||||
pub type Takes = (Vec<(TrackId, PathBuf)>, Option<String>);
|
||||
|
||||
/// How big a take's files get: each holds at most `samples` samples (frames × channels), so it can
|
||||
/// be read back whole, and a take that fills one goes on in the file `part(first, n)` names, its
|
||||
/// `n`-th (2, 3, …) after `first`.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct TakeFiles {
|
||||
/// The most samples (frames × channels, whole frames) a file holds; at least one frame is
|
||||
/// written to each file, whatever this says.
|
||||
pub samples: u64,
|
||||
/// The path of the take's `n`-th file (`n` = 2, 3, …) after `first`. It has to name a file
|
||||
/// that doesn't exist yet: one that does stops the take there, as any file it can't make.
|
||||
pub part: fn(&Path, usize) -> PathBuf,
|
||||
}
|
||||
|
||||
/// Frames each block of a [`LiveTake`] sums up.
|
||||
pub const LIVE_BLOCK: usize = 128;
|
||||
/// Blocks a live take keeps per channel at most (three hours at 48 kHz); its file records on.
|
||||
@@ -277,13 +291,15 @@ impl Recorder {
|
||||
}
|
||||
|
||||
/// Create each take's file and start recording into them: a track's take records the given
|
||||
/// input channels into a new file.
|
||||
pub fn arm(&mut self, takes: Vec<(TrackId, Vec<usize>, PathBuf)>) -> Result<(), String> {
|
||||
/// input channels into a new file, and into further files as `files` says.
|
||||
pub fn arm(&mut self, takes: Vec<(TrackId, Vec<usize>, PathBuf)>, files: TakeFiles) -> Result<(), String> {
|
||||
if self.writer.is_some() {
|
||||
return Err("already recording".into());
|
||||
}
|
||||
let takes =
|
||||
takes.into_iter().map(|(id, inputs, path)| TakeWriter::create(id, inputs, path, self.sample_rate)).collect::<Result<Vec<_>, _>>()?;
|
||||
let takes = takes
|
||||
.into_iter()
|
||||
.map(|(id, inputs, path)| TakeWriter::create(id, inputs, path, self.sample_rate, files))
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
let live = takes.iter().map(|t| (t.id, Arc::clone(&t.live))).collect();
|
||||
let ring = &self.shared.ring;
|
||||
ring.tail.store(ring.head.load(Ordering::Acquire), Ordering::Release);
|
||||
@@ -373,6 +389,7 @@ fn write_takes(shared: &Shared, mut takes: Vec<TakeWriter>, channels: usize) ->
|
||||
let (mut done, mut problem) = (Vec::new(), None);
|
||||
for mut t in takes {
|
||||
t.write_header();
|
||||
done.extend(t.full.drain(..).map(|path| (t.id, path)));
|
||||
if t.frames == 0 {
|
||||
let _ = std::fs::remove_file(&t.path);
|
||||
} else {
|
||||
@@ -383,51 +400,97 @@ fn write_takes(shared: &Shared, mut takes: Vec<TakeWriter>, channels: usize) ->
|
||||
(done, problem)
|
||||
}
|
||||
|
||||
/// One take's file. After an error it stops writing; its header keeps covering what was written.
|
||||
/// One take's files. After an error it stops writing; the header of its file keeps covering what
|
||||
/// was written.
|
||||
struct TakeWriter {
|
||||
id: TrackId,
|
||||
inputs: Vec<usize>,
|
||||
/// The file it writes now.
|
||||
path: PathBuf,
|
||||
file: File,
|
||||
/// The take's files before `path`, full, in order.
|
||||
full: Vec<PathBuf>,
|
||||
rate: u32,
|
||||
/// Frames in `path`.
|
||||
frames: u64,
|
||||
/// Frames in the files in `full`.
|
||||
before: u64,
|
||||
/// Frames a file holds at most.
|
||||
limit: u64,
|
||||
/// Names the take's next file ([`TakeFiles::part`]).
|
||||
part: fn(&Path, usize) -> PathBuf,
|
||||
error: Option<String>,
|
||||
live: Arc<Mutex<LiveTake>>,
|
||||
}
|
||||
|
||||
/// A new take file at `path`, its folder made if needed; never one that's there already.
|
||||
fn create_take_file(path: &Path) -> Result<File, String> {
|
||||
let file = path.parent().map_or(Ok(()), std::fs::create_dir_all).and_then(|()| File::create_new(path));
|
||||
file.map_err(|e| format!("{}: {e}", path.display()))
|
||||
}
|
||||
|
||||
impl TakeWriter {
|
||||
fn create(id: TrackId, inputs: Vec<usize>, path: PathBuf, rate: u32) -> Result<TakeWriter, String> {
|
||||
let file = path.parent().map_or(Ok(()), std::fs::create_dir_all).and_then(|()| File::create_new(&path));
|
||||
let file = file.map_err(|e| format!("{}: {e}", path.display()))?;
|
||||
fn create(id: TrackId, inputs: Vec<usize>, path: PathBuf, rate: u32, files: TakeFiles) -> Result<TakeWriter, String> {
|
||||
let file = create_take_file(&path)?;
|
||||
let live = Arc::new(Mutex::new(vec![Vec::new(); inputs.len()]));
|
||||
let mut take = TakeWriter { id, inputs, path, file, rate, frames: 0, error: None, live };
|
||||
let limit = (files.samples / inputs.len().max(1) as u64).max(1);
|
||||
let (full, part) = (Vec::new(), files.part);
|
||||
let mut take = TakeWriter { id, inputs, path, file, full, rate, frames: 0, before: 0, limit, part, error: None, live };
|
||||
take.write_header();
|
||||
take.error.take().map_or(Ok(take), Err)
|
||||
}
|
||||
|
||||
/// Append this take's channels of `block` (interleaved, `channels` wide).
|
||||
fn write(&mut self, block: &[f32], channels: usize) {
|
||||
/// Append this take's channels of `block` (interleaved, `channels` wide), going on in a new
|
||||
/// file whenever this one is full.
|
||||
fn write(&mut self, mut block: &[f32], channels: usize) {
|
||||
let channels = channels.max(1);
|
||||
while !block.is_empty() && self.error.is_none() {
|
||||
if self.frames >= self.limit {
|
||||
self.next_file();
|
||||
continue;
|
||||
}
|
||||
let room = usize::try_from(self.limit - self.frames).unwrap_or(usize::MAX).saturating_mul(channels);
|
||||
let (now, rest) = block.split_at(room.min(block.len()));
|
||||
let bytes: Vec<u8> = now
|
||||
.chunks_exact(channels)
|
||||
.flat_map(|f| self.inputs.iter().flat_map(move |&i| f.get(i).copied().unwrap_or(0.0).to_le_bytes()))
|
||||
.collect();
|
||||
match self.file.write_all(&bytes) {
|
||||
Ok(()) => {
|
||||
self.summarize(now, channels);
|
||||
self.frames += (now.len() / channels) as u64;
|
||||
}
|
||||
Err(e) => self.fail(e),
|
||||
}
|
||||
block = rest;
|
||||
}
|
||||
}
|
||||
|
||||
/// Close the full file with its final header and go on in the take's next one.
|
||||
fn next_file(&mut self) {
|
||||
self.write_header();
|
||||
if self.error.is_some() {
|
||||
return;
|
||||
}
|
||||
let bytes: Vec<u8> = block
|
||||
.chunks_exact(channels)
|
||||
.flat_map(|f| self.inputs.iter().flat_map(move |&i| f.get(i).copied().unwrap_or(0.0).to_le_bytes()))
|
||||
.collect();
|
||||
match self.file.write_all(&bytes) {
|
||||
Ok(()) => {
|
||||
self.summarize(block, channels);
|
||||
self.frames += (block.len() / channels) as u64;
|
||||
let first = self.full.first().unwrap_or(&self.path);
|
||||
let next = (self.part)(first, self.full.len() + 2);
|
||||
match create_take_file(&next) {
|
||||
Ok(file) => {
|
||||
self.file = file;
|
||||
self.full.push(std::mem::replace(&mut self.path, next));
|
||||
self.before += std::mem::take(&mut self.frames);
|
||||
self.write_header();
|
||||
}
|
||||
Err(e) => {
|
||||
self.error.get_or_insert(e);
|
||||
}
|
||||
Err(e) => self.fail(e),
|
||||
}
|
||||
}
|
||||
|
||||
/// Add this take's channels of `block` to its live take.
|
||||
fn summarize(&self, block: &[f32], channels: usize) {
|
||||
let mut live = self.live.lock().unwrap_or_else(PoisonError::into_inner);
|
||||
for (f, n) in block.chunks_exact(channels).zip(self.frames..) {
|
||||
for (f, n) in block.chunks_exact(channels).zip(self.before + self.frames..) {
|
||||
let at = (n / LIVE_BLOCK as u64) as usize;
|
||||
for (blocks, &i) in live.iter_mut().zip(&self.inputs) {
|
||||
let v = f.get(i).copied().unwrap_or(0.0);
|
||||
@@ -464,6 +527,14 @@ mod tests {
|
||||
craft_audio::decode(&std::fs::read(path).unwrap(), None).unwrap().1.channels
|
||||
}
|
||||
|
||||
/// The `n`-th file of the take whose first file is `first`, in these tests.
|
||||
fn part(first: &Path, n: usize) -> PathBuf {
|
||||
first.with_file_name(format!("{}-{n}.wav", first.file_stem().unwrap().to_string_lossy()))
|
||||
}
|
||||
|
||||
/// Files no take in these tests fills.
|
||||
const ONE_FILE: TakeFiles = TakeFiles { samples: u64::MAX, part };
|
||||
|
||||
#[test]
|
||||
fn a_full_ring_owes_the_lost_samples_as_silence() {
|
||||
let shared = Shared::new(CaptureRing::new(8));
|
||||
@@ -551,7 +622,7 @@ mod tests {
|
||||
fn a_failed_write_is_trouble_while_still_recording() {
|
||||
let dir = std::env::temp_dir().join(format!("soundcraft-failed-take-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
let mut take = TakeWriter::create(TrackId(1), vec![0], dir.join("Vox_01.wav"), 48_000).unwrap();
|
||||
let mut take = TakeWriter::create(TrackId(1), vec![0], dir.join("Vox_01.wav"), 48_000, ONE_FILE).unwrap();
|
||||
take.file = File::open(&take.path).unwrap();
|
||||
let shared = Arc::new(Shared::new(CaptureRing::new(1 << 12)));
|
||||
shared.armed.store(true, Ordering::Release);
|
||||
@@ -574,9 +645,9 @@ mod tests {
|
||||
fn takes_stream_into_their_files() {
|
||||
let dir = std::env::temp_dir().join(format!("soundcraft-takes-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
let gtr = TakeWriter::create(TrackId(1), vec![1, 2], dir.join("Gtr_01.wav"), 48_000).unwrap();
|
||||
let mut vox = TakeWriter::create(TrackId(2), vec![0], dir.join("Vox_01.wav"), 48_000).unwrap();
|
||||
assert!(TakeWriter::create(TrackId(3), vec![0], dir.join("Vox_01.wav"), 48_000).is_err(), "never overwrites a file");
|
||||
let gtr = TakeWriter::create(TrackId(1), vec![1, 2], dir.join("Gtr_01.wav"), 48_000, ONE_FILE).unwrap();
|
||||
let mut vox = TakeWriter::create(TrackId(2), vec![0], dir.join("Vox_01.wav"), 48_000, ONE_FILE).unwrap();
|
||||
assert!(TakeWriter::create(TrackId(3), vec![0], dir.join("Vox_01.wav"), 48_000, ONE_FILE).is_err(), "never overwrites a file");
|
||||
vox.write(&[0.5; 300], 3);
|
||||
vox.write_header();
|
||||
vox.write(&[0.25; 150], 3);
|
||||
@@ -598,11 +669,74 @@ mod tests {
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// Files of 100 stereo or 200 mono frames: blocks that straddle a file's end are split there.
|
||||
#[test]
|
||||
fn a_take_that_fills_its_file_goes_on_in_the_next() {
|
||||
let dir = std::env::temp_dir().join(format!("soundcraft-take-parts-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
let files = TakeFiles { samples: 200, part };
|
||||
let gtr = TakeWriter::create(TrackId(1), vec![1, 2], dir.join("Gtr_01.wav"), 48_000, files).unwrap();
|
||||
let vox = TakeWriter::create(TrackId(2), vec![0], dir.join("Vox_01.wav"), 48_000, files).unwrap();
|
||||
let live = Arc::clone(>r.live);
|
||||
let shared = Arc::new(Shared::new(CaptureRing::new(1 << 12)));
|
||||
shared.armed.store(true, Ordering::Release);
|
||||
let sh = Arc::clone(&shared);
|
||||
let writer = std::thread::spawn(move || write_takes(&sh, vec![gtr, vox], 3));
|
||||
let input: Vec<f32> = (0..3 * 250).map(|i| i as f32).collect();
|
||||
input.chunks(3 * 45).for_each(|block| shared.capture(block, &mut 0));
|
||||
shared.armed.store(false, Ordering::Release);
|
||||
let (done, problem) = writer.join().unwrap();
|
||||
assert_eq!(problem, None);
|
||||
let names: Vec<_> = done.iter().map(|(id, p)| (id.0, p.file_name().unwrap().to_string_lossy().into_owned())).collect();
|
||||
assert_eq!(
|
||||
names,
|
||||
[(1, "Gtr_01.wav"), (1, "Gtr_01-2.wav"), (1, "Gtr_01-3.wav"), (2, "Vox_01.wav"), (2, "Vox_01-2.wav")].map(|(i, n)| (i, n.into()))
|
||||
);
|
||||
let decoded: Vec<_> = done.iter().map(|(_, p)| decode(p)).collect();
|
||||
assert_eq!(decoded.iter().map(|d| d[0].len()).collect::<Vec<_>>(), [100, 100, 50, 200, 50]);
|
||||
let channel = |c: usize| input.iter().skip(c).step_by(3).copied().collect::<Vec<f32>>();
|
||||
let joined = |files: &[Vec<Vec<f32>>], c: usize| files.iter().flat_map(|d| d[c].clone()).collect::<Vec<f32>>();
|
||||
assert_eq!((joined(&decoded[..3], 0), joined(&decoded[..3], 1)), (channel(1), channel(2)), "every frame, in order");
|
||||
assert_eq!(joined(&decoded[3..], 0), channel(0));
|
||||
let live = live.lock().unwrap().clone();
|
||||
assert_eq!(live[0], [(1.0, 382.0), (385.0, 748.0)], "the live take runs on across the files");
|
||||
|
||||
// A take that ends just as its file fills makes no empty file after it.
|
||||
let mut bass = TakeWriter::create(TrackId(3), vec![0], dir.join("Bass_01.wav"), 48_000, TakeFiles { samples: 100, part }).unwrap();
|
||||
bass.write(&[0.5; 300], 3);
|
||||
assert!(bass.full.is_empty() && !part(&bass.path, 2).exists());
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// A take whose next file can't be made (one is there by that name) stops with the error and
|
||||
/// keeps the full file as it was, header included; the file in the way is left alone.
|
||||
#[test]
|
||||
fn a_take_whose_next_file_cannot_be_made_stops_there() {
|
||||
let dir = std::env::temp_dir().join(format!("soundcraft-take-part-taken-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
let vox = TakeWriter::create(TrackId(1), vec![0], dir.join("Vox_01.wav"), 48_000, TakeFiles { samples: 100, part }).unwrap();
|
||||
std::fs::write(dir.join("Vox_01-2.wav"), b"someone else's").unwrap();
|
||||
let shared = Arc::new(Shared::new(CaptureRing::new(1 << 12)));
|
||||
shared.armed.store(true, Ordering::Release);
|
||||
let sh = Arc::clone(&shared);
|
||||
let writer = std::thread::spawn(move || write_takes(&sh, vec![vox], 1));
|
||||
[[0.25; 150].as_slice(), &[0.5; 10]].into_iter().for_each(|block| shared.capture(block, &mut 0));
|
||||
shared.armed.store(false, Ordering::Release);
|
||||
let (done, problem) = writer.join().unwrap();
|
||||
// the full first file is placed, the problem names the file that couldn't be made
|
||||
assert_eq!(done, [(TrackId(1), dir.join("Vox_01.wav"))]);
|
||||
assert!(problem.as_deref().is_some_and(|e| e.contains("Vox_01-2.wav")), "{problem:?}");
|
||||
assert!(shared.failed.lock().unwrap().as_deref().is_some_and(|e| e.contains("Vox_01-2.wav")), "reported while recording");
|
||||
assert_eq!(decode(&dir.join("Vox_01.wav")), [vec![0.25; 100]]);
|
||||
assert_eq!(std::fs::read(dir.join("Vox_01-2.wav")).unwrap(), b"someone else's");
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_take_sums_itself_up_for_drawing_while_it_records() {
|
||||
let dir = std::env::temp_dir().join(format!("soundcraft-live-take-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
let mut take = TakeWriter::create(TrackId(4), vec![2, 0], dir.join("Gtr_01.wav"), 48_000).unwrap();
|
||||
let mut take = TakeWriter::create(TrackId(4), vec![2, 0], dir.join("Gtr_01.wav"), 48_000, ONE_FILE).unwrap();
|
||||
let input: Vec<f32> = (0..300).flat_map(|f| [f as f32, -1.0, -(f as f32)]).collect();
|
||||
take.write(&input[..3 * 100], 3);
|
||||
take.write(&input[3 * 100..], 3);
|
||||
|
||||
@@ -212,7 +212,12 @@ impl SoundApp {
|
||||
.iter()
|
||||
.map(|(track, inputs, path)| soundcraft_engine::io::Take { track: *track, path: path.clone(), channels: inputs.len() })
|
||||
.collect();
|
||||
r.arm(plan)?;
|
||||
// Each take file holds no more than the session can read back; a longer take goes on in the next.
|
||||
let files = soundcraft_playback::record::TakeFiles {
|
||||
samples: soundcraft_engine::io::take_file_samples(r.sample_rate, self.engine.session().sample_rate.hz()),
|
||||
part: soundcraft_engine::io::take_part,
|
||||
};
|
||||
r.arm(plan, files)?;
|
||||
Ok(takes)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Architecture
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-11 · **Change:** minor (audio file formats come from craft-audio; previously trivial: delay compensation includes the master faders' inserts (#351)) · **Target:** Avid Pro Tools Ultimate 2026.4.1
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-11 · **Change:** trivial (recordings are written to disk as they record (#84, #888); previously minor: audio file formats come from craft-audio; previously trivial: delay compensation includes the master faders' inserts (#351)) · **Target:** Avid Pro Tools Ultimate 2026.4.1
|
||||
|
||||
SoundCraft is a Cargo workspace of small crates with enforced layering (`cargo xtask layers`).
|
||||
Nothing below the UI knows about egui, so the interface can be replaced.
|
||||
@@ -60,7 +60,7 @@ Device I/O today is the system's *default* output and *default* input device, op
|
||||
separate cpal streams; the mix renders 512-sample blocks and resamples to the device rate when
|
||||
they differ. There is no device or buffer-size selection, no ASIO, and no MIDI device layer yet
|
||||
(see [`hardware-parity.md`](hardware-parity.md)). Sources are decoded whole into the `SourcePool`
|
||||
and recordings are captured in memory until stop.
|
||||
while recordings are written to disk as they record, a long take going on in a new file.
|
||||
|
||||
`soundcraft-video` holds our own H.264, ProRes and Motion JPEG decoders and the ISO-BMFF demuxer
|
||||
for the video track. Hosted plugins (`clap-host`, `vst3-host`, `au-host`) are scanned, created and
|
||||
@@ -83,6 +83,7 @@ app as an MCP server. See `control-protocol.md` and `mcp.md`.
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-11 | minor | `audio-io` left the layer diagram: audio file formats come from `craft-audio` in craft-libs |
|
||||
| 2026-10-30 | trivial | Device I/O: recordings are written to disk as they record (#84), long takes in several files (#888) |
|
||||
| 2026-10-13 | trivial | delay compensation includes the master faders' inserts (#351) |
|
||||
| 2026-10-10 | minor | Added video, vst3-host and au-host to the layer diagram; documented device I/O limits and in-memory media |
|
||||
| 2026-10-05 | major | First architecture overview |
|
||||
+8
-6
@@ -1,6 +1,6 @@
|
||||
# Where SoundCraft falls short of Pro Tools
|
||||
|
||||
> **Last reviewed:** 2026-11-14 · **Last updated:** 2026-11-18 · **Change:** minor (G-02 shrunk: MIDI input devices work; G-03: strict external-WAV AAF import; previously minor: G-05: plugin editors on Linux/X11; previously trivial: G-09: the pt-BR catalog now covers helper-passed tooltips, the status bar, the remove-session prompt and engine error text; G-08: Frequency Shifter, 28 processors; G-04: volume automation read at every sample, #1354; G-01: `setup.playback_engine` applies the device buffer in the desktop app; G-04: Clip Looping crossfade and loop count) · **Target:** Avid Pro Tools Ultimate 2026.4.1
|
||||
> **Last reviewed:** 2026-11-14 · **Last updated:** 2026-11-18 · **Change:** minor (G-06: recording to disk is done (#84, long takes #888); streaming sources remain; previously minor: G-02 shrunk: MIDI input devices work; G-03: strict external-WAV AAF import; previously minor: G-05: plugin editors on Linux/X11; previously trivial: G-09: the pt-BR catalog now covers helper-passed tooltips, the status bar, the remove-session prompt and engine error text; G-08: Frequency Shifter, 28 processors; G-04: volume automation read at every sample, #1354; G-01: `setup.playback_engine` applies the device buffer in the desktop app; G-04: Clip Looping crossfade and loop count) · **Target:** Avid Pro Tools Ultimate 2026.4.1
|
||||
|
||||
Every known shortfall, one entry each, ranked by how much it stops a Pro Tools user from doing
|
||||
real work in SoundCraft. This is the work list: pick from the top. Rows marked **alpha blocker**
|
||||
@@ -20,7 +20,7 @@ When you close a gap, delete its entry (or shrink it) in the same PR, and bump t
|
||||
| G-03 | **Alpha blocker.** Session exchange remains incomplete (strict external-WAV AAF import only; no AAF/OMF export, OMF import or `.ptx`) | File formats | [file-format-parity.md](file-format-parity.md) | 50–90 |
|
||||
| G-04 | Open correctness bugs in features counted as done (~25 issues) | Stability | this file | 25–40 |
|
||||
| G-05 | (Entitlement part: alpha blocker for the mix row) Third-party VST3s blocked in the signed macOS build; AU editors missing | Ecosystem | [plugin-parity.md](plugin-parity.md) | 10–15 |
|
||||
| G-06 | (Record-to-disk part: alpha blocker for the tracking row) Sources decoded whole into RAM; recording into RAM | Performance | [hardware-parity.md](hardware-parity.md) | 15–25 |
|
||||
| G-06 | Sources decoded whole into RAM (recording to disk is done: #84, #888) | Performance | [hardware-parity.md](hardware-parity.md) | 15–25 |
|
||||
| G-07 | Nothing is compared against Pro Tools' output (no fidelity harness) | Features | this file | 20–30 |
|
||||
| G-08 | Built-in plugin catalogue thin and unverified | Features | [plugin-parity.md](plugin-parity.md) | 80–120 |
|
||||
| G-09 | English-first UI with a pt-BR catalog (not native-reviewed); all fixed UI strings covered, no CJK/RTL rendering | Localization | [localization-parity.md](localization-parity.md) | 20–40 |
|
||||
@@ -145,10 +145,11 @@ launch #142; Linux #45, #107.
|
||||
|
||||
### G-06. Memory-bound media
|
||||
|
||||
- **Missing:** streaming sources from disk; recording to disk. Every source is decoded whole into
|
||||
the `SourcePool`; takes accumulate in RAM until stop (PR #84 open).
|
||||
- **Impact:** hour-long multitrack sessions and long takes exhaust memory; a crash during a long
|
||||
take loses it.
|
||||
- **Done:** recording to disk: takes are written to disk as they record (#84), and a take that
|
||||
reaches the readable file size goes on in a new file and is placed whole, crash recovery included
|
||||
(#888).
|
||||
- **Missing:** streaming sources from disk. Every source is decoded whole into the `SourcePool`.
|
||||
- **Impact:** hour-long multitrack sessions exhaust memory.
|
||||
- **Estimate:** ≈ 15–25 h.
|
||||
|
||||
### G-07. Fidelity harness against Pro Tools
|
||||
@@ -256,6 +257,7 @@ missing. Out of scope unless the owner decides otherwise.
|
||||
| 2026-11-13 | trivial | G-09: the pt-BR catalog now covers tooltips localized inside buttons and toggles, the Edit-window status bar, the remove-session question, the send help text and engine errors shown in the status line; estimates unchanged |
|
||||
| 2026-11-09 | trivial | G-08: 28 processors + 3 instruments with the Frequency Shifter |
|
||||
| 2026-11-04 | trivial | G-04: track and master volume automation read at every sample, so breakpoints act on their own sample in any block size (#1354); estimates unchanged |
|
||||
| 2026-10-30 | minor | G-06: recording to disk is done (takes written as they record, #84; long takes continue in a new file, #888); only streaming sources from disk remain |
|
||||
| 2026-10-30 | minor | G-05: VST3 and embedded CLAP editors on Linux/X11 (#527) |
|
||||
| 2026-10-25 | trivial | G-04: Clip Looping (#1030) lacks the loop crossfade option, and Number of Loops stops at 512 while length and fill make up to 1000 loops |
|
||||
| 2026-10-25 | trivial | G-01: `setup.playback_engine` and `setup.hardware` apply the device and buffer in the desktop app; headless returns `applied: false` |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Hardware parity
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (MIDI input devices, live play-through with controllers, and MIDI recording) · **Target:** Avid Pro Tools Ultimate 2026.4.1
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (record to disk: done, #84 and #888, previously trivial: bounces of a bus fed by an aux compensate its latency, #246; previously minor: MIDI input devices, live play-through with controllers, and MIDI recording) · **Target:** Avid Pro Tools Ultimate 2026.4.1
|
||||
|
||||
A DAW is judged by how it drives audio interfaces, MIDI gear, control surfaces and sync. This is
|
||||
SoundCraft's weakest dimension. Ours is measured from `crates/playback` (cpal) and the absence of
|
||||
@@ -25,7 +25,7 @@ Legend: ✅ works · 🟡 partial · ❌ missing.
|
||||
| Latency reporting and record offset compensation | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
||||
| Sample rate follows the session; resample when it can't | ✅ (switches device) | 🟡 resamples (input pitch bug fixed, #28) | 🟡 | 🟡 | 🟡 | 🟡 |
|
||||
| Avid HDX / HD Native DSP, Hybrid Engine DSP mode | ✅ | ❌ (out of reach: Avid hardware) | ❌ | ❌ | ❌ | ❌ |
|
||||
| Disk allocation / record to disk | ✅ | ❌ recording into RAM (PR #84) | ❌ | ❌ | ❌ | ❌ |
|
||||
| Disk allocation / record to disk | ✅ | ✅ takes written to disk as they record (#84); a long take goes on in a new file (#888) | 🟡 same recorder (not yet verified on Windows) | 🟡 same recorder (input not yet verified) | ❌ no recording | ❌ |
|
||||
|
||||
## MIDI
|
||||
|
||||
@@ -73,6 +73,7 @@ Legend: ✅ works · 🟡 partial · ❌ missing.
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-18 | minor | MIDI input devices (`midir`): live play-through to record-enabled MIDI and instrument tracks (notes, pedal, controllers, pitch bend, aftertouch), MIDI recording into clips, per-track device and channel, device switches in Playback Engine; guide in `midi-input.md` |
|
||||
| 2026-10-30 | minor | Record to disk: takes are written to disk as they record (#84) and long takes continue in a new file (#888) |
|
||||
| 2026-10-13 | trivial | bounces of a bus fed by an aux compensate its latency (#246) |
|
||||
| 2026-10-12 | minor | Audio device settings: system, output, input, sample rate and buffer size; opt-in ASIO |
|
||||
| 2026-10-10 | major | Created: audit of audio interface, MIDI, control-surface, sync and performance support against Pro Tools 2026.4.1 |
|
||||
+6
-5
@@ -1,6 +1,6 @@
|
||||
# SoundCraft roadmap: milestones and what's next
|
||||
|
||||
> **Last reviewed:** 2026-11-14 · **Last updated:** 2026-11-18 · **Change:** minor (MIDI input landed, the gate row needs checking on macOS and Windows; strict external-WAV AAF import; previously trivial: 28 built-in processors with the Frequency Shifter; G-05 estimate after Linux/X11 plugin editors; M15: partial pt-BR catalog; readiness estimates unchanged) · **Target:** Avid Pro Tools Ultimate 2026.4.1
|
||||
> **Last reviewed:** 2026-11-14 · **Last updated:** 2026-11-18 · **Change:** minor (M6: long takes continue in a new file (#888); previously minor: MIDI input landed, the gate row needs checking on macOS and Windows; strict external-WAV AAF import; previously trivial: 28 built-in processors with the Frequency Shifter; G-05 estimate after Linux/X11 plugin editors; M15: partial pt-BR catalog; readiness estimates unchanged) · **Target:** Avid Pro Tools Ultimate 2026.4.1
|
||||
|
||||
Forward-looking plan. Status and numbers: [`../ROADMAP.md`](../ROADMAP.md) and
|
||||
[`target-app-parity.md`](target-app-parity.md); the ranked work list: [`gaps.md`](gaps.md).
|
||||
@@ -22,7 +22,7 @@ main platform). Any **no** keeps SoundCraft **pre-alpha**, and those rows are th
|
||||
|
||||
| Workflow | Works end to end? | Evidence | Hours to pass |
|
||||
|---|---|---|---:|
|
||||
| Record audio from a chosen interface at a chosen buffer size, monitor, punch, keep the takes | **no** | Device, rate and buffer are chosen in the Playback Engine window and, in the desktop app, by `setup.playback_engine` (headless returns `applied: false`). The mix still runs in fixed 512-sample blocks. Separate input and output streams. Takes held in RAM until stop (PR #84). | 35–55 |
|
||||
| Record audio from a chosen interface at a chosen buffer size, monitor, punch, keep the takes | **no** | Device, rate and buffer are chosen in the Playback Engine window and, in the desktop app, by `setup.playback_engine` (headless returns `applied: false`). The mix still runs in fixed 512-sample blocks. Separate input and output streams. Takes are written to disk as they record (#84; long takes continue in a new file, #888). | 35–55 |
|
||||
| Record MIDI from a controller and play it back through an instrument | **unverified** | Built: keyboards play record-enabled instrument tracks live and are recorded into MIDI clips. On Linux, live play was checked with a hardware keyboard (Akai MPK mini 3) and recording with a virtual one; the row passes once it is checked on macOS and Windows too (G-02). | 2–4 |
|
||||
| Edit: select, trim, fade, comp playlists, Slip/Shuffle/Grid | yes (rough) | Every Edit menu command; property-tested with undo; open bugs #3, #5, #140 don't block the workflow | — |
|
||||
| Mix with built-in and third-party plugins, sends, busses, automation | partial (passes on CLAP/AU) | 28 built-in processors; CLAP and AU host on the signed macOS build, but its missing entitlement blocks third-party VST3 (#153). No AU plugin windows yet; VST3 windows on macOS, Windows and Linux/X11 | 1–2 (entitlement) |
|
||||
@@ -40,14 +40,14 @@ Status: ✅ done · 🟡 in progress · ⬜ not started.
|
||||
|---|---|---|---:|
|
||||
| M0–M4 | Workspace, gates, model, I/O, DSP, mix engine, command engine, Edit/Mix UI, playback, metering, plugins, bounce | ✅ | — |
|
||||
| M5 | Editing depth (tools, modes, playlists, fades, comping, clip groups) | ✅ (bugs open, G-04) | in G-04 |
|
||||
| M6 | Recording, punch, loop record, monitoring | 🟡 first cut; device choice and record-to-disk missing | 40–60 |
|
||||
| M6 | Recording, punch, loop record, monitoring | 🟡 first cut; record to disk done (#84; long takes #888); device choice not yet verified on every platform | 40–60 |
|
||||
| M7 | MIDI and notation editing | 🟡 | 50–80 |
|
||||
| M8 | CLI, control channel, MCP, agent acceptance test | ✅ | 3 |
|
||||
| M9 | AudioSuite breadth ✅, Elastic Audio 🟡, Beat Detective 🟡 | 🟡 | 40–60 |
|
||||
| M10 | Public releases on all platforms | ✅ v0.3.0 (2026-10-08) and v0.4.0 (2026-10-10) released for every platform | — |
|
||||
| M11 | Third-party plugin hosting (CLAP, VST3, AU), video, surround | 🟡 mostly done | 40–60 |
|
||||
| M12 | **Hardware**: audio interfaces, MIDI devices, sync, control surfaces | ⬜ | 110–180 |
|
||||
| M13 | **Interchange**: AAF/OMF import/export, disk streaming, record to disk | 🟡 strict external-WAV AAF import; export, OMF and disk streaming missing | 65–115 |
|
||||
| M13 | **Interchange**: AAF/OMF import/export, disk streaming | 🟡 strict external-WAV AAF import; export, OMF and disk streaming missing | 65–115 |
|
||||
| M14 | **Fidelity harness** against Pro Tools (null tests, plugin responses) | ⬜ | 20–30 |
|
||||
| M15 | **Localization**: catalog, fonts/RTL, the 8 Pro Tools languages first | 🟡 partial (pt-BR catalog; needs native review; PRs #141, #143 open) | 45–80 |
|
||||
| M16 | Built-in plugin depth, sidechain, ARA | ⬜ | 110–170 |
|
||||
@@ -64,7 +64,7 @@ Beta needs ~75 % ready for real work and no blocking gap in session interchange.
|
||||
|---|---|---:|
|
||||
| Correctness backlog and a PR CI | G-04, G-14 | 40–65 |
|
||||
| Audio interfaces, MIDI devices, sync | G-01, G-02, G-11 | 60–100 |
|
||||
| AAF/OMF interchange, disk streaming, record to disk | G-03, G-06 | 65–115 |
|
||||
| AAF/OMF interchange, disk streaming | G-03, G-06 | 65–115 |
|
||||
| Plugin hosting completeness on every OS, sidechain | G-05, G-13 | 35–60 |
|
||||
| Fidelity harness and the fixes it finds | G-07 | 40–60 |
|
||||
| Built-in plugin essentials (EQ/dynamics/reverb/delay depth) | G-08 (half) | 40–60 |
|
||||
@@ -93,6 +93,7 @@ There is no `cargo xtask scorecard` in this repo; the measured number is `cargo
|
||||
| 2026-11-09 | trivial | 28 built-in processors with the Frequency Shifter |
|
||||
| 2026-11-05 | trivial | M15: a pt-BR catalog covers menus and `text`/`localized_format!` strings; remains native review, CJK/RTL and the other languages. Estimates unchanged |
|
||||
| 2026-10-30 | trivial | G-05 down to 10–15 h and the mix row's VST3 windows updated: VST3 and embedded CLAP editors are hosted on Linux/X11 (#527) |
|
||||
| 2026-10-30 | minor | M6: record to disk is done (#84), long takes continue in a new file (#888); dropped from the tracking row and M13. Estimates unchanged: G-06's 15–25 h was always the streaming-sources work |
|
||||
| 2026-10-25 | trivial | Record-workflow evidence: `setup.playback_engine` applies the device and buffer in the desktop app; headless returns `applied: false` |
|
||||
| 2026-10-24 | trivial | 27 built-in processors, as the plugin registry holds; the sampler (#108) is no longer listed under plugin essentials |
|
||||
| 2026-10-14 | trivial | M8: reject oversized MCP batches before execution (#460) |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Target-app parity: SoundCraft vs Avid Pro Tools
|
||||
|
||||
> **Last reviewed:** 2026-11-14 · **Last updated:** 2026-11-14 · **Change:** minor (strict external-WAV AAF import; previously trivial: Frequency Shifter: 28 built-in processors; G-09/localization: pt-BR catalog; readiness estimates unchanged) · **Target:** Avid Pro Tools Ultimate 2026.4.1 (bundle 26.4.1.179, macOS)
|
||||
> **Last reviewed:** 2026-11-14 · **Last updated:** 2026-11-14 · **Change:** minor (Performance row: recording is to disk (#84, #888); scores unchanged; previously minor: strict external-WAV AAF import; previously trivial: Frequency Shifter: 28 built-in processors; G-09/localization: pt-BR catalog; readiness estimates unchanged) · **Target:** Avid Pro Tools Ultimate 2026.4.1 (bundle 26.4.1.179, macOS)
|
||||
|
||||
The authoritative assessment of how close SoundCraft is to Pro Tools. [`ROADMAP.md`](../ROADMAP.md)
|
||||
summarizes it, [`gaps.md`](gaps.md) itemizes every shortfall, and the per-dimension docs go deeper:
|
||||
@@ -84,7 +84,7 @@ post-production, tracking) can switch. "Ready" is depth, correctness and fidelit
|
||||
| File formats | 10 % | **~40 %** | estimated | 70–120 | [file-format-parity.md](file-format-parity.md) | WAV/BWF/RF64/AIFF/FLAC read+write, compressed formats read; strict external-WAV AAF import; no `.ptx`, AAF/OMF export, OMF import, ADM BWF, MP3/AAC export, video export |
|
||||
| Hardware | 10 % | **~12 %** | estimated | 110–180 | [hardware-parity.md](hardware-parity.md) | Default output and default input device only, fixed 512-sample block, no ASIO, no MIDI devices, no control surfaces, no sync |
|
||||
| Stability | 10 % | **~45 %** | estimated | 50–80 | [gaps.md](gaps.md) | Never-crash rules and proptests (random edits, mutated sessions, hostile params); but ~25 open correctness bugs, a launch failure (#142), an X11 llvmpipe failure (#107) |
|
||||
| Performance | 5 % | **~35 %** | estimated (unmeasured) | 40–70 | [hardware-parity.md](hardware-parity.md) | Parallel strip rendering and PDC exist; whole files decoded into RAM, recording into RAM (#84 open), no track-count or latency benchmarks |
|
||||
| Performance | 5 % | **~35 %** | estimated (unmeasured) | 40–70 | [hardware-parity.md](hardware-parity.md) | Parallel strip rendering and PDC exist; whole files decoded into RAM, recording to disk (#84; long takes #888), no track-count or latency benchmarks |
|
||||
| Ecosystem / plugins | 4 % | **~30 %** | estimated | in Features + Hardware | [plugin-parity.md](plugin-parity.md) | CLAP/VST3/AU hosting; no AAX (Pro Tools' only format), no ARA, no sidechain, no control-surface ecosystem, no content library |
|
||||
| Platforms | 3 % | **~65 %** | estimated | 20–40 | [ROADMAP.md](../ROADMAP.md) | Builds for macOS, Windows x64/x86/arm64, Linux, FreeBSD, Web (Pro Tools: macOS, Windows), but only macOS is exercised at runtime; Web lacks file pickers (#63, #64) |
|
||||
| Localization | 2 % | **~12 %** | measured (catalog count) | 70–110 | [localization-parity.md](localization-parity.md) | English plus a pt-BR catalog (not native-reviewed); Pro Tools ships 8 UI languages; FR/ES PR #143 open |
|
||||
@@ -200,8 +200,8 @@ Weights by what Pro Tools users actually spend time on. **Breadth** = the featur
|
||||
platform:
|
||||
|
||||
- Tracking from a chosen interface at a chosen buffer size: **no**. Only the default devices are
|
||||
used, the mix runs in fixed 512-sample blocks, input and output are separate streams, and
|
||||
takes are held in RAM.
|
||||
used, the mix runs in fixed 512-sample blocks, and input and output are separate
|
||||
streams.
|
||||
- MIDI recording: **no**. There is no MIDI device layer.
|
||||
- Session interchange with Pro Tools or picture editors: **no**. Strict external-WAV AAF import works, but AAF export, OMF and `.ptx` do not.
|
||||
|
||||
@@ -248,6 +248,7 @@ serializes more, because it needs hands-on testing.
|
||||
| 2026-11-14 | minor | Strict external-WAV AAF import added to format, interchange and alpha-gate evidence; readiness estimates unchanged |
|
||||
| 2026-11-09 | trivial | Built-in plugin counts: 28 processors + 3 instruments with the Frequency Shifter. Percentages unchanged |
|
||||
| 2026-11-05 | trivial | Localization row: English plus a near-complete pt-BR catalog for fixed UI strings (PR #1346), not native-reviewed. Percentages and hours unchanged |
|
||||
| 2026-10-30 | minor | Performance row and tracking list: recording goes to disk (#84; long takes continue in a new file, #888); scores unchanged |
|
||||
| 2026-10-24 | trivial | Built-in plugin counts: 27 processors + 3 instruments on `main`, and 24 + 2 in the 3bc2d92 code snapshot; the sampler (#108) is no longer listed as missing. Percentages unchanged |
|
||||
| 2026-10-10 | minor | Readiness-by-audience table: hours to ~95 % for full (950–1,450 h), mainstream (380–600 h) and essentials (110–200 h). The full number is already the additive weighted sum over the written dimension table (40.6 %); method unchanged |
|
||||
| 2026-10-10 | minor | Added the mainstream-practitioner (~36 %) and essentials-user (~57 %) numbers with written weights, discounts and user evidence. Checked the full ~40 %: it is the written dimension weights × values (40.6 %), so it doesn't move |
|
||||
|
||||
Reference in new issue
Block a user