Commit Graph
515 Commits
Author SHA1 Message Date
Dylan M. Taylor 4bdda5ffad Reuse shared XML escaping for score exports 2026-11-15 13:23:47 -05:00
Zinadin Zidan 2688ccac88 io: import a MIDI file with stray bytes after its last track (#1528) (#1540)
* io: import a MIDI file with stray bytes after its last track (#1528)

Importing a MIDI file read it with craft-midi's strict read_smf, which
refuses any damage. The file in #1528 is whole, its one track ending with
End of Track at its declared length, but two line feeds follow it. The
strict reader took them for the start of another chunk and refused the
file with "unexpected end of data at byte 45281".

Read imported files with read_smf_lenient instead, as other MIDI readers
do: it reads a sound file exactly as read_smf does, ignores bytes after
the last chunk, and keeps what makes sense of a damaged track, bounded by
the same event and track limits. Its warnings are logged. Something that
is not a Standard MIDI File is still refused, and the file is still read
in full before the session changes (#911).

Test: a complete file followed by two line feeds imports its note; it
failed with the issue's error before.

* io: a MIDI file past the reader's limits stays refused (#1528)

Read leniently, a file with more events or tracks than craft-midi reads
kept what came before the limit and left the rest out with only a log
warning, where the strict reader refused it. Import now reads a file
strictly first: a sound file reads as before, a file past the event or
track limit is refused as before, and only other damage (stray bytes
after the last track) falls back to the lenient reader.

Test: a file one track past the limit, its last track holding a note and
stray bytes after it, is refused and leaves the session empty.

* io: refuse a MIDI file past the event limit after a damaged track (#1528)

The strict reader stops at the first damage. When a damaged track came
before the one that goes past MAX_EVENTS, the strict error was not a
limit error, the import fell back to the lenient read, and that read
kept what came before the limit and left the rest out with a warning:
the file was imported cut short.

The lenient read now says when a limit left part of the file out
(LenientRead::over_limit, storytold/craft-libs#1308), and the import
refuses such a file before the session changes, warnings full or not.

The six craft-libs crates pinned at 6a86adb move together to that PR's
commit, as craft-scraft-format uses craft-midi's and craft-audio's
types. They move to its merge commit once it merges.

* deps: keep only the craft-libs source changes in Cargo.lock (#1528)

Moving the craft-libs pins also re-resolved several windows-sys edges
(0.61.2 to 0.52.0) and tempfile's getrandom edge (0.4.3 to 0.3.4).
Restore main's resolution for those, so the lockfile only changes the
source of the craft-libs crates.

* deps: pin craft-libs to the merge of craft-libs#1308 (#1528)

Move the six craft-libs crates from the PR's commit 4db60c4 to its merge
into craft-libs main, 45a8e16. None of these crates, nor craft-zip which
craft-scraft-format uses, changed between the two.
2026-11-14 15:55:41 +01:00
Dylan M. Taylor acb547286d Move SoundCraft session format into craft-libs 2026-11-13 04:30:16 +00:00
Ashok Ramandashokram-si 1110e6804a io: a missing movie is offline with its checked path (#923) (#1156)
* io: a missing movie is offline with its checked path (#923)

relink_videos resolved a stored movie path, found no file, and then left
the raw stored string in the session with offline unset. The video
worker opened that string as given, relative to the working directory,
so a session path reached the file system without going through
stored_path.

Store the resolved path in that arm and mark the movie offline, as the
refused-path arm already does; the Video track then shows
"media offline: file not found" instead of trying the path. Test: a
relative stored path that names no file.

* io: keep a missing movie's stored path as it was

Review follow-up: the first commit replaced the stored string with the
resolved absolute path. Saving then wrote this folder's path, and a
session moved together with its movie no longer found it under the same
relative path (relinking only looks beside the session and in
"Video Files").

Marking the movie offline is what keeps the Video track from opening the
stored string, so leave the string as stored. The test now saves the
session into another folder, puts the movie back there under the same
relative path and checks it opens.

* Test: every outcome of relinking a movie

Its file is there; it is gone with a copy next to the session or in Video
Files (relinked); it is gone with no copy (offline, path kept); its stored
path is refused, with or without a copy.

---------

Co-authored-by: ashokram-si <347905169+ashokram-si@users.noreply.github.com>
2026-11-13 01:51:36 +01:00
Ashok Ramandashokram-si 6a87da9cf7 io: check a MIDI file in full before the session changes (#911) (#1157)
* io: check a MIDI file in full before the session changes (#911)

import_midi_bytes wrote the file's tempo and meter changes and added a
track per SMF track as it went, then returned an error for a track
longer than a day. Through execute the session is restored on error,
but the web shell calls the function directly and only pushes its undo
step on success, so a refused file left the earlier tracks and the new
tempo map in place with no way back.

Build the tempo map apart from the session, check every track's length
with it, and only then commit the map and place the clips. Test: a file
whose second track is too long leaves the session equal to before.

* io: a refused MIDI file isn't an edit either

The checks before the import ran after session_mut, which already counts
as an edit: it bumps the revision, marks the engine unsaved and may copy
the session. They now read through session(), and session_mut is taken
only once nothing can fail. The test checks the revision and unsaved
mark too.

---------

Co-authored-by: ashokram-si <347905169+ashokram-si@users.noreply.github.com>
2026-11-13 01:51:06 +01:00
Jonathan Cardoso 2aa342859a mix.volume: say what each track got and when a value was clamped (#1353)
* mix.volume: say what each track got and when a value was clamped

The fader stops at -144 and +12 dB, and mix.volume replied only with a track
count, so +15 dB played at +12 with nothing to show it. The reply now lists
each target's volume and sets clamped when a target or a group member was
held at a stop.

* mix.volume: list every requested track in the reply

A target moved as a group sibling of an earlier one was skipped before it was
added to volumes, so tracks [3, 6] in one group listed only track 3. Build
volumes after the loop from each requested track's final volume.
2026-11-13 01:47:53 +01:00
NetterSilverandClaude Haiku 5.5 f1cf95b354 Support the 1/4t grid in event.quantize (#1453)
Found while testing crates/engine/src/cmd/event.rs:233-248 (grid_ticks, used by quantize)

Co-authored-by: Claude Haiku 5.5 <noreply@anthropic.com>
2026-11-13 01:46:22 +01:00
Javier Brines GarcíaandClaude Opus 5.5 a7030f1d2f docs(engine): say a new mix.send starts at -144 dB (#1410) (#1426)
The help for mix.send said `level_db?: 0`, but a new send has always started
at -144 dB (silent): SendSlot::new sets it, the Mix window relies on it, and
Preferences > Mixing shows "Sends Default to -inf dB". The help now gives the
range and the real default, and a test checks the help and a new send agree.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 01:43:48 +01:00
Dylan M. Taylor 91952090ec Take audio file formats from craft-audio; remove crates/audio-io (#1506)
craft-audio in craft-libs was built from audio-io and FilmCraft's codecs, so
each format has one implementation that every Craft app shares. Call sites use
its API directly: EncodeOptions::new(format).with_*(), EncodeFormat,
DECODE_EXTENSIONS, ENCODE_EXTENSIONS, encode_format_for, AudioInfo's container,
codec and layout.

soundcraft_model::FileFormat stays as the kind of file a session records for
each source: its variant names are part of the session format. It maps from
craft-audio's AudioInfo.

craft-audio and craft-media are pinned to the craft-libs branch of
storytold/craft-libs#824, which adds the extension tables SoundCraft had in
FileFormat and fixes the quadratic WAV chunk scan (#893).

Behaviour that changes: AAC, ALAC, Opus, AC-3/E-AC-3 and MP2 decode with
craft-audio's own decoders; MP4 and Matroska tracks import at their
presentation length; .opus, .ac3, .eac3, .ec3, .mov, .mka and .mpa are
importable names; .aifc is a writable name; FLAC files come from craft-audio's
encoder.
2026-11-11 18:46:56 -05:00
Dylan M. Taylor c25b12ba46 Engine I/O: exclusive output files, read-checked probes, resolved clip-group paths (#1328)
* fix(engine): create output files exclusively and check read access before probing

* address review: canonicalize through the checked io gateway, treat any occupied export name as taken

* address review: read group audio through the validated file handle

* address review: document that a write-only root writes a new numbered WAV per save

* address review: clip-group audio is opened without waiting for a FIFO writer
2026-11-11 16:15:08 -05:00
Dylan M. Taylor 296bfbb2e1 Strip Silence: cut and remove pieces in one pass over the playlist (#1349)
* Strip Silence: cut and remove pieces in one pass over the playlist

* address review: document the sorted-points order and test stretched audio offsets
2026-11-11 16:14:42 -05:00
Dylan M. Taylor f7a5adb474 ui: read-check movie paths, regular files only, private take folder (#1337)
* fix(ui): check movie read access and file type; private take folder without settings

* address review: make the fallback take folder exclusively under an unguessable name; qualify the owner-only claim to Unix

* address review: unique folder prefix must be one name; no fallback take folder for a saved session

* add tests for the take folder and the movie open checks
2026-11-11 16:14:17 -05:00
FredApps d255ca4fe9 Merge pull request #1436 from Silvertree2010/fix/1433-separate-splits-locked-clips-edi
Keep time- and edit-locked clips whole on separate and range edits
2026-11-11 20:37:20 +01:00
FredApps 1fe1d06073 test: cover Event time edits on locked clips 2026-11-11 20:24:33 +01:00
1d696bb3ef Replace hard-linked export destinations (#1360)
* Replace hard-linked export destinations

Fixes #1359

Co-Authored-By: GPT-6-Luna <noreply@openai.com>

* fix(engine): preserve export links and private permissions

* fix(io): preserve export security by refusing hard-linked destinations

* test(automation): require safe hard-link export refusal on Windows and Unix

---------

Co-authored-by: GPT-6-Luna <noreply@openai.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
2026-11-11 20:04:44 +01:00
69af50aac2 fix(engine): trim skips locked clips (#1432) (#1442)
* trim skips locked clips

* docs(engine): add missing docstring on trim_end_to

* test(engine): cover insertion trims beside locked clips

---------

Co-authored-by: rixpsed <183939167+rixpsed@users.noreply.github.com>
Co-authored-by: rixpsed <rixpsed@users.noreply.github.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
2026-11-11 18:18:03 +01:00
FredApps ad34dbf87e Merge pull request #1364 from MMexicann/fix/stem-bounce-output-format
fix(engine): reject unsupported stem bounce formats
2026-11-11 17:43:58 +01:00
Dylan M. Taylor 44e80dcc24 Import: refuse sample-rate conversions that grow audio more than 128-fold (#1327)
* fix(engine): refuse extreme sample-rate expansions before resampling

* address review: widened integer rate-ratio check and a distinct rate-limit error
2026-11-10 17:58:18 -05:00
FredApps ef58a90f4a Merge pull request #1007 from Audiosyncrasy/smart-tool-shortcuts
Edit tools: F6+F7 / F7+F8 and Cmd/Ctrl+7 select the Smart Tool; Cmd/Ctrl+6 selects the Pencil
2026-11-09 11:56:05 +01:00
FredApps 7c6315d999 Naming: descriptive names for Pro Tools product and trademark labels (#1457)
Display labels only; command ids, catalog paths, session tokens and processor ids are unchanged.

- Avid-listed names and bundled plug-in products get our own names (Beat Analysis, Punch Recording, Room Reverb, Compressor/Limiter, Saturator, Bit Crusher, Rendered (High Quality), ...).
- Features we don't have stay in the menu as disabled placeholders with "Not available yet." (Tempo Sync, No ARA plug-ins, Analog Saturation).
- AudioSuite, Elastic Audio, TrackPunch, Pitch Shift Legacy and Time Compression Expansion keep their names until RFC-0029 settles.
- parity_floor and catalog dispatch unchanged; docs/feature-naming.md has the crosswalk.
2026-11-09 04:31:12 +01:00
Mex e1b22258bc test(engine): cover explicit WAV stems and reusable scratch directories
Address the review by clearing stale test scratch directories before setup and exercising an explicit supported WAV format through the real command, including decoded output format, frames and audio.
2026-11-08 13:42:03 +01:00
Mex 61becd52c5 Merge branch 'storytold:main' into fix/stem-bounce-output-format 2026-11-08 13:33:28 +01:00
NetterSilverandClaude Opus 5.5 654deabd54 Keep time- and edit-locked clips whole on separate and range edits
Fixes #1433

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 02:41:54 +00:00
Zinadin Zidan c05dfc0a8e fix(engine): Export Clips names a run of same-named clips in one pass (review)
Each clip looked for its file name from the start again, checking the
disk for every earlier name, so exporting many clips of one name took
time growing with the square of their number. The export now remembers
the next suffix to try for each name. Files already in the folder are
still skipped.
2026-11-07 02:01:24 +06:00
Zinadin Zidan 7d508e2e44 fix(engine): Bounce Stems and Export Clips work in the web build (#1409)
Both made a folder first, which fails in the browser. Making a folder is
now a no-op on wasm32, where each file is delivered by name, and Export
Clips writes through write_file, the path bounce and export already use,
instead of std::fs. Two clips with the same name no longer get the same
file name when nothing is on disk. Native behaviour is unchanged.
2026-11-07 00:27:09 +06:00
SlyLaM e66a5e7c67 feat(ui): add complete Preferences window and live settings (#819)
* feat(ui): add complete Preferences window shell

* fix(ui): refine Preferences layout and live settings

* fix(ui): remove Preferences page scrolling

* fix(ui): keep Preferences window size constant

* feat(ui): add Preferences to the SoundCraft menu

* fix(ui): address Preferences review feedback

* docs(ui): document Preferences behavior

* fix(macOS): add Preferences to the application menu

* fix(ui): make Preferences menu behavior modal

* fix(ui): preserve live Preferences updates

* fix(ui): address latest Preferences review findings

* fix(ui): preserve Preferences button actions
2026-11-06 11:34:43 +01:00
FredApps 87f46cf23b Merge pull request #782 from SlyLaM/fix/transient-record-monitor-states
fix(engine): keep live input states transient
2026-11-06 07:26:56 +01:00
Sly LaMenace d393730b02 Merge upstream/main and adapt transient live input states 2026-11-05 07:51:42 +00:00
Zinadin ZidanandClaude Opus 5.5 4240ffda42 fix(engine): cap sessions at 256 MiB and parse them without a Value tree (#892)
A session was parsed into a serde_json Value and then converted, which takes
many times the file's size in memory, and nothing limited how big a session
file could be.

Session::from_json now reads only format_version first (every other field is
skipped) and then parses the text straight into the session. A missing
format_version and a newer version give the errors they gave before. Other
type errors now end with the place they were found ("at line L column C").
A field of the document given twice in one object, which used to load with
the last value winning, is now refused with "duplicate field `key`" (a
twice-given format_version too, not "missing format_version"): keeping the
old leniency would need the tree this change removes, and no writer repeats
a field. Keys of maps (plugin params, edit values and the like) and unknown
keys still keep the last value given, as before.

A track's height was read through an untagged enum, which buffers the whole
value before it looks at it; a huge array there took about 27 times its size.
It now has its own reader that takes exactly the forms that loaded before
("Micro" to "Extreme", also as {"Micro": null}, {"Custom": n}, {"Fit": n},
and the old bare "Fit" or {"Fit": null}) and refuses anything else at its
first token.

Opening a session (a .scraft file, the browser's bytes, the session in a
bundle) and Import Session Data refuse one over 256 MiB by its size, before
reading it. Save, Save Copy In, Save As Template, autosave and the browser's
bundle refuse to write a session over that size, so SoundCraft never saves
one it then won't open. Save and autosave check before they write any audio,
so a refused save leaves nothing behind and a refused autosave keeps the last
one and its audio copies as they were; the refusal is reported like any
other autosave failure. Save checks against the longest name each new audio
file can get, so it may refuse a session within a few bytes per new file of
the limit. Crash recovery reads only the name of a leftover autosave, and
none from one over the cap. Audio files are read without that cap, as
before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 12:47:13 +06:00
Mex b93a182ef7 test(engine): cover non-string stem output formats
Exercise null, numeric, boolean, array and object format values through Engine::execute and verify the parameter error without creating a destination. The regression fails before the guard; all 363 engine unit tests pass with it.
2026-11-05 00:11:18 +01:00
Mex bf2a6b52de fix(engine): reject non-string stem output formats
Address review r3017244428: only an absent format defaults to WAV; a present non-string value returns a parameter error before creating the output directory.
2026-11-05 00:09:33 +01:00
Sly LaMenace 92e6973640 Merge upstream/main and fix frame-origin grid snapping 2026-11-04 22:54:15 +00:00
Mex b8e1e69134 test(engine): cover unsupported stem output formats 2026-11-04 23:35:04 +01:00
Mex b6946d3a94 fix(engine): reject unsupported stem bounce formats
Refactor file.bounce_stems command to improve format handling.
2026-11-04 23:33:22 +01:00
Dylan M. Taylor fa34e0c182 fix(engine): dedupe clip ids, clamp score bars per system, share autosave copies (#1333) 2026-11-03 23:02:33 -05:00
Brandon Thomas 6492b5f27e Merge pull request #1286 from Silvertree2010/fix/1260-zoom-in-t-doesn-t-use-the-edit-c
Keep the edit cursor as the zoom reference when it is off-screen
2026-11-03 10:04:56 -05:00
Brandon Thomas c15682a088 Merge pull request #1302 from JonRC/fix/1301-audiosuite-hosted-ids
audiosuite.process: say it takes built-in plugin ids, and why hosted ones are refused
2026-11-03 10:04:28 -05:00
Brandon Thomas 0d253b6d8c Merge pull request #1300 from JonRC/fix/1296-bounce-bext
Stamp WAV bounces with their timecode position (BWF bext TimeReference)
2026-11-03 10:04:22 -05:00
Brandon ThomasandClaude Opus 5.5 f86b077cdf Test that an off-screen edit cursor lands on its fixed column
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 09:53:19 -05:00
Dylan M. Taylor aa250cc1d7 Clip gain to volume: index envelope lookups (#1309)
Converting clip gain to volume (and baking volume into clip gain)
evaluated the clip's gain envelope by walking it from the start for
every breakpoint being converted, so a large envelope in an opened or
imported session cost envelope points squared and blocked the engine.

Build a running-maximum index over the envelope once per clip and
binary-search it. It returns exactly what the walk returned, including
for envelopes stored out of order.
2026-11-03 07:44:31 -05:00
Sly LaMenace dbcbcbac00 Merge upstream/main into feat/grid-nudge-time-scales 2026-11-03 11:52:00 +00:00
Dylan M. Taylor da02c19fcc Bundles: refuse entries that share their data (#1303)
Bundle entries are stored, so the files read out of one can only
outgrow the bundle when several entries point at the same bytes. A
small bundle naming one payload thousands of times was copied out once
per name, up to the 1 GiB total limit, in the browser. Check the
archive for overlapping entry data before reading any entry.
2026-11-02 23:33:19 -05:00
JonRC 1403bbc4d3 audiosuite.process: say it takes built-in plugin ids
Its help said `<plugin id>`, but it only runs built-in plugins, and a
hosted id (clap:, vst3:, au:) failed as "unknown process". The help now
says built-in plugin id, and a hosted id gets an error saying AudioSuite
runs built-in plugins only.

Fixes #1301.
2026-11-02 23:42:08 -03:00
JonRC b0793ca875 Stamp WAV bounces with their timecode position (BWF bext)
Bounces passed no bwf to the encoder, so mix and stem WAVs had no bext
chunk and post tools placed them at zero. Bounce::new now stamps them
with TimeReference = the session's timecode start plus the bounce start,
in samples since midnight, as other DAWs do. A caller's own bwf wins;
AIFF and FLAC have no bext and are unchanged.

Fixes #1296.
2026-11-02 23:36:15 -03:00
Sly LaMenace 087978a4a0 fix(edit): preserve overlaps in stationary nudge and quantize 2026-11-02 23:42:44 +00:00
Sly LaMenace 9b5554e312 Merge upstream/main into feat/grid-nudge-time-scales 2026-11-02 23:42:44 +00:00
FredApps 1dbc185e01 Merge pull request #559 from SlyLaM/fix/new-tracks-keyboard-ux
feat(ui): improve the New Tracks creation workflow
2026-11-02 18:23:48 +01:00
NetterSilverandClaude Haiku 5.5 4b06407dae Keep the edit cursor as the zoom reference when it is off-screen
Fixes #1260

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-02 15:57:40 +01:00
Brandon Thomas 98cda6ecaf Merge pull request #1032 from Silvertree2010/fix/h2086-midi-export-writes-notes-that-a
Export only the MIDI notes a trimmed clip still plays
2026-11-01 23:06:40 -05:00
Brandon ThomasandClaude Opus 5.5 5e8898976e Test a grid of 1/16, 1/32 and 1/64 bars in a row
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 23:06:02 -05:00