Skip to content

audio: a routing matrix of every port against the sound card - #2333

Draft
edumeneses wants to merge 3 commits into
feature/mixerfrom
edu/audio-routing-matrix
Draft

edumeneses wants to merge 3 commits into
feature/mixerfrom
edu/audio-routing-matrix

Conversation

@edumeneses

Copy link
Copy Markdown
Contributor

This is Edu's Claude assistant, opening this on Edu's behalf.

Stacked on #2302 (base feature/mixer): it builds on the mixer's port strips and the in-place port edits. I'll retarget it to master once #2302 is merged.

What changes

A mapped port's routing could only be edited one port at a time, in its address dialog: a table of radio buttons where every channel had to go somewhere, and where a virtual port showed an empty table.

  • Audio routing window. Every input port and every output port against the sound card's channels, in two matrices, laid out like Dante Controller. It opens from three places:

    • the new ▦ button under the mixer's Mapped section;
    • Audio routing... in the context menu of the mixer's section tabs;
    • Audio routing... on a mapped port's strip.

    The window has buttons to add an input or output port, and to disconnect everything. Every gesture is one undo step.

  • Gestures, in both the window and the port dialog:

    • click connects or disconnects a channel;
    • Ctrl+click connects diagonally from that cell to the end of the port;
    • Ctrl+Shift+click connects diagonally to the end of the list;
    • Space, Enter and Ctrl+Space do the same from the keyboard, and Delete disconnects a channel;
    • the context menu also disconnects a port, or everything.
  • A channel can go nowhere. It is stored as -1 in audio-mapping. The engine gets an index past every channel instead, which libossia already treats as silence; a negative index would have read before its buffers. Rows of unconnected channels are dimmed. So are channels routed past the card's last channel, for example a dome session opened on a stereo laptop, and their tooltip says why.

  • Port dialog:

    • it uses the same matrix;
    • a new output port maps channel by channel, instead of sending every channel to output 1;
    • for a virtual port it explains what one is for, instead of showing an empty table;
    • it keeps the attributes it does not show. Before, editing a port dropped its gain from what the document saves, so the gain was lost at the next load or reconnection.

Part of #1409: the toggled tiles that replace the radio buttons. Sending one channel to several card channels would need a libossia change, because audio_mapping holds one card channel per port channel; that part is not done here. Related to #1073, for score's own ports only.

Tests

test_unit_audio_routing (58 assertions) checks:

  • the matrix gestures;
  • that an unconnected channel reaches the engine as an index past every channel;
  • that a gesture spanning two ports is one undo step;
  • that the dialog keeps a port's gain and its unconnected channels.

test_unit_audio_port_edit still passes, and so do the mixer, audio, port and telemetry tests. The two that fail in this group fail on this branch's base too, in the same environment: explorer_editor_look and scriptable_dynamic_ports.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lc7tYGHRn6TmaxMEfBTswW

edumeneses and others added 3 commits October 11, 2026 13:43
A mapped port's routing could only be edited one port at a time, in its
address dialog: a table of radio buttons where every channel had to go
somewhere, and where a virtual port showed an empty table.

- Audio::RoutingMatrix puts the channels of some ports in rows and the
  sound card's channels in columns. A click connects or disconnects a
  channel. Ctrl+click connects diagonally from that cell to the end of
  the port, and Ctrl+Shift+click to the end of the list, as in Dante
  Controller. From the keyboard, Space or Enter toggles the current cell,
  Ctrl+Space and Ctrl+Shift+Space connect diagonally, and Delete
  disconnects a channel. The context menu also disconnects a whole port,
  or everything. A channel that goes nowhere, or past the card's last
  channel, has its row dimmed and its tooltip says why. Connections use
  the colour of audio ports.
- An "Audio routing" window shows every input port and every output port
  against the card, in two matrices. It has buttons to add a port and to
  disconnect everything. It opens from the button under the mixer's
  Mapped section, from the context menu of the mixer's section tabs, and
  from a mapped port's strip. Every gesture is one undo step
  (Audio::ChangeRouting, made of UpdateAddressSettings).
- The port dialog uses the same matrix:
  - A channel can now go nowhere: -1 in "audio-mapping". The engine gets
    an index past every channel instead, which libossia already treats
    as silence. A negative index would have read before its buffers.
  - A new output port now maps channel by channel to the card, instead of
    sending every channel to the card's first output.
  - For a virtual port, the dialog explains what it is for instead of
    showing an empty table.
  - The dialog keeps the attributes it does not show, such as the port's
    gain. Before, editing a port dropped the gain from what the document
    saves, so the gain was lost at the next load or reconnection.
- addAudioPort moves from the mixer to the audio plugin, so the window
  can use it too.

test_unit_audio_routing checks:
- the matrix gestures;
- that an unconnected channel reaches the engine as an index past every
  channel;
- that a routing gesture spanning two ports is one undo step;
- that the dialog keeps a port's gain and its unconnected channels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lc7tYGHRn6TmaxMEfBTswW
A click, a Ctrl+click and a Ctrl+Shift+click sent to the viewport pick the
toggle, the diagonal within the port and the diagonal across the ports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lc7tYGHRn6TmaxMEfBTswW
With the sound card set to fewer channels than a port is routed to, e.g.
64 outputs down to 2, the dialog disconnected those channels when it was
confirmed, even to only rename the port. They now stay routed: the matrix
shows them dimmed, as going nowhere, and they play again once the card has
the channels back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lc7tYGHRn6TmaxMEfBTswW

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant