Repository navigation
Split stereo audio to mono tracks - #767
Merged
derekmwright merged 16 commits intoNov 24, 2026
Merged
Conversation
Collaborator
|
Thanks for this. The split itself is solid: it never overwrites a file, it picks free names, and it cleans up only what it created. I want One thing has to change before it merges: no automatic split on import. Import keeps the source's channel configuration. Splitting a stereo file into independent mono tracks is something the user asks for, not something that happens to them. So, please:
The other behavior changes are fine with two conditions:
Once it's updated I'll check those and run the tests again. Nothing else is in the way. |
…y mono tracks below it splits across them, one mono source per channel (<name>.L, <name>.R), in one undo step; fewer mono tracks below and it lands whole as before
… each channel of the selected stereo or wider clips on a new mono track below its track, the originals muted, one undo step; a take played from its file gets a mono WAV per channel beside it Refutation review of the import split (ADR 0009): a frozen mono track below, or one holding a clip where the file goes, is never edited (the file lands whole as before); each split source keeps the peaks the import built; channels past stereo are numbered, not named as a surround layout
… a browser drag does: on the audio track lane or header under the pointer (at the pointer's time on a lane), or on a new track below the tracks; anywhere else at the cursor as before. A stereo file on a mono lane with a mono track below now splits there instead of making a new stereo track
…a failure on a later take removes every file the split wrote; the new tracks sit right below the clip's track with a Master above it; a split take's sources name the files written and keep its BWF stamp; duplicate clip ids split once; at most 64 channels; a write refusal says why; the import split keeps disk-backed audio whole
…(ADR 0009): a drop that also opens a session lands none of its files by the pointer, so none reaches a track of the new session by an old track's id; several files dropped on a track follow each other there instead of each erasing the last; file.import_audio refuses a track that is not an audio track (as file.commit_import does), and a drop at the cursor uses the cursor's track only when it holds audio; K113 notes that the drop position now picks the track
…sion opens it alone and the status line says what was left out, so no file lands by a pointer or cursor that names the closing session's tracks; files dropped at the cursor follow each other there too; the split's file writing, opening and removal move to io/split_files.rs behind the checked file access (the file_access gate)
…pped at a cursor before bar 1 chain from 0, where the engine puts the first, instead of each erasing the last; a session that fails to open keeps its own reason on the status line
…at a dropped session failing to open keeps its own reason on the status line
…le's channels (the automatic split on import is removed; Split to Mono Tracks is the way to split); a file-manager drop lands by the browser drag's rules (import_files: the track under the pointer at its time, or below the tracks, else at the cursor; a track that takes no audio or a file that is not audio is refused with the reason on the status line; queued like a browser drag); a dropped session asks to save unsaved changes as File > Open does (tested); the known-issues index regenerated
…09): whether a dropped file is audio is the engine's call again (import_files leaves out only Maschine/Kontakt files, so WAV data named .rf64 or with no extension imports from a file-manager drop, as on main, and a text file is never called a Maschine/Kontakt file); a file that fails to decode keeps its reason on its drop's last line; a split opens a take's reader anew, so a take whose file is back splits again; the guide says a session drop counts what it left out
…9): a drop at the cursor lands on the cursor's audio track, as on main, not the focused one; when a drop's last file fails, its line names every file of the drop that failed; a drop on a track deleted since its frame says so instead of importing nothing unannounced
…): the mixer's Main strip of a session with no Master track is no drop target (its track id is 0, no track's), so a drop there lands at the cursor instead of being refused as a deleted track; a drop whose last file fails ends on the same "Imported …" line as one whose failure comes first
…9): a drop whose last file fails ends on its "Imported …" line only while the drop's track is still there, never naming a track deleted or undone in between; a test that a real Master track's strip still takes a drop (and refuses audio with the reason)
…): a drop whose last file fails ends on a line that names its failures and the Maschine/Kontakt files left out, never a track (one deleted, undone or reused by id since), so commit_front's "Imported …" line is main's again; the tests go through the real import queue
…): a drop whose last file fails ends on that file's own reason, then the Maschine/Kontakt files left out, then its earlier failures with the first reason, each its own part, so no reason main showed is lost and no file reads as a Maschine/Kontakt file
BlueJayLouche
force-pushed
the
import-split-mono
branch
from
November 22, 2026 23:13
8948e6c to
d851acc
Compare
Contributor
Author
|
Thanks for the review. Updated:
The PR description is updated to match. |
7 of 12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split stereo audio to mono tracks
Two microphones recorded onto one stereo track (or any stereo or wider clip) can become mono tracks, one channel each, when you ask for it.
What changes
clip.split_to_mono):<track> Land<track> R, numbered past stereo.Audio Fileson save.main: nothing splits on import.import_files, the browser drag's own import path. It lands on the track under the pointer (at the pointer's snapped time on its lane, or on its header, mixer strip or device chain), on a new track when dropped below the tracks, and anywhere else at the cursor, on the cursor's track as onmain(a new track when it takes no audio). The mixer's Main strip of a session with no Master track is the main bus, not a track, so a drop there lands at the cursor.main. A file it can't use is named on the status line with the reason, even when other files of the same drop import. A file that fails to decode keeps its reason for its drop's last line. When the last file fails, that line gives its own reason, then the Maschine/Kontakt files left out, then the drop's earlier failures. This queue is shared with browser drags, which gain the same..transitor.dawprojectopens it alone throughrun_or_ask, which asks to save unsaved changes as File > Open does. The status line says which other files were left out.file.import_audiorefuses a track that is not an audio track, asfile.commit_importalready did. The command-line open uses the cursor's track only when it is an audio track.Changes since the review
io.rsismain's plus thesplit_filesmodule). A test checks that a stereo file on a mono track with a free mono track below lands whole.clip.split_to_monois kept; the stray comment is gone.drops.rs.main, andcargo xtask indexeswas run.drop_targetgives for the pointer.run_or_ask.Evidence
crates/engine/tests/split_to_mono.rs: in memory with save and reopen and undo, a disk-backed take, cleanup when a later take fails, placement with a Master above, duplicate ids, import keeps channels, audio refused on a MIDI track.crates/engine/tests/split_to_mono.rsalso covers a take whose file is back after a failed read.crates/ui-studio/src/sampler_panel/drop_routing_tests.rs: a stereo drop on a mono lane lands whole at the pointer; several files on a lane, at the cursor, and at a cursor before bar 1; a MIDI lane refuses with the reason; WAV data named.rf64or with no extension imports; a text file in a drop is named with its reason, and a drop whose last file fails keeps every reason; a drop at the cursor lands on the cursor's track, not the focused one; a drop on a deleted track says so; a drop on the Main strip lands at the cursor; a dropped session asks to save first, opens alone, and shows why when it fails to open.cargo test --workspace, and the xtask gates. Three test binaries SIGSEGV at exit aftertest result: ok; that comes from a locally installed plug-in's static destructors and also happens onmain..rf64,.opus, extensionless files), because the browser's extension list is narrower than the decoders. A drop on the mixer's Main strip with no Master track was refused as a deleted track.Follow-ups (non-blocking review notes)
-2names.sanitize_name's 100-character cut can drop the.Lor.Rfrom a very long name.main. That covers the mixer background, the keys pane, and the Main strip of a session with no Master track. A browser drag imports nothing there. A real Master track's strip refuses audio with the reason, so the Main bus could refuse too if you'd prefer.main: a Sampler window claims a drop that also holds a session file, and drops are routed while the Save Changes question is open.main: a drop's last status line is replaced at once when another drop is queued behind it, and a remembered decode failure is not named when its drop ends by cancellation, a deleted track, a commit error or expiry.