Skip to content

Pan each sound - #116

Merged
kixelated merged 4 commits into
mainfrom
quest/m0/audio-pan
Nov 8, 2026
Merged

kixelated merged 4 commits into
mainfrom
quest/m0/audio-pan

Conversation

@kixelated

@kixelated kixelated commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Finishes quest/m0/audio-pan.md: each sound gets a pan beside its fader.

Changes

  • moq_scene::Audio has a new pan: f32 field, from -1.0 (hard left) to 1.0 (hard right). It is saved as pan in [audio.<source>] and left out of the file when centered. Collection::validate refuses a value outside that range, or NaN.
  • Sources::sync passes it to Strip::set_pan along with gain, mute, and delay, so it applies in every audio scene holding the sound. The studio's bus is always stereo, the one layout that never refuses a pan, so a failed set_pan panics. moq-audio ramps the change across a block.
  • strip_controls has a pan slider labeled L50 / C / R50. Double-clicking it re-centers. Because both panels draw from strip_controls, the slider shows on the Audio panel strip and on the Graph node, and its edits go into History as a gesture, as gain edits do.
  • README: the Audio panel, the Graph panel, the scene-file example, and the [audio.<source>] reference all describe pan.
  • Tests: sync_restarts_only_what_changed checks that pan reaches the strip without a restart, and the collection round trip carries a pan.
  • The quest file and its README link are deleted.

Public API

moq_scene::Audio gained a public field, so struct literals without ..Default::default() will no longer compile. The scene file is backward compatible because pan defaults to center. No wire impact.

Choices made without asking

  • The slider is linear over -1..1 and uses the L/C/R label convention common in DAWs. It snaps to center only on double-click; there is no detent.
  • moq_scene::Audio gains a public pan field without a ! title: only this repo constructs it, and scene files stay compatible.

Verification

just check passes. just test: 275/276 pass. The one failure is publish::tests::a_media_file_is_published_on_one_timeline (a repeated 10550ms timestamp). It is pre-existing and unrelated; moq-dev/studio#113, which is queued, fixes it.

Models

  • Claude Opus 5.5

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

Review

Rewritten by quest review after each round.

  • Reviewer: Codex, gpt-6.1-sol, medium effort
  • Session: 01a1bc6d-7cc5-7fe0-91e4-86dfe270cb00, round 2
  • Head: df89e6e
  • Base: origin/main at f15536f
  • Score: 10/10, Both reported issues are fixed at the head, and the changes since the last review introduce no additional findings.
  • Findings: none
  • The last round's findings, at 3ff3528:
    • Fixed: high, rs/moq-studio/src/ui.rs:3667: Add the pan column to the Audio panel's grid; The Audio grid now includes a Pan header and a corresponding empty cell in each audio-scene row, aligning Delay and routing checkboxes.
    • Fixed: medium, rs/moq-studio/src/ui.rs:3670: Pair the pan formatter with a matching input parser; The shared pan control now has a custom parser accepting case-insensitive C, L<n>, and R<n> notation plus bare numeric values.

Quest-Claim: 1314fadc90271a72
@pullfrog

pullfrog Bot commented Nov 8, 2026

Copy link
Copy Markdown

Pullfrog  | Review this ➔

kixelated and others added 2 commits November 8, 2026 10:29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 8, 2026 18:35
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2f3e8238-a7a3-4ef1-90df-f2b5592e87a8
Commits

Reviewing files that changed from the base of the PR and between 0cc4c65 and d101a34.

Files selected for processing: 7

  • README.md
  • quest/m0/README.md
  • quest/m0/audio-pan.md
  • rs/moq-scene/src/collection.rs
  • rs/moq-scene/src/edit.rs
  • rs/moq-scene/src/source.rs
  • rs/moq-studio/src/ui.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@kixelated kixelated left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed head: df89e6e

  1. [P2] Preserve mono layout until the bus applies pan — rs/moq-scene/src/source.rs:357.

The newly exposed pan does not use the agreed mono constant-power law for mono broadcasts, media files, or replays. Those paths force decoder output to the stereo bus layout (source.rs:1219,1828) and register a stereo channel (1836), so the bus classifies them as stereo and balances them. Pinned moq's remix duplicates a mono sample onto both channels (resample.rs:427-431), and its bus selects the pan law from the channel's input layout (bus.rs:368,632-646). For a decoded mono sample of 0.5, the settled output is therefore (0.5, 0.5) at center and (0, 0.5) hard right: panning reduces total power by half, rather than maintaining it as a captured mono microphone does. Preserve mono through decode/channel registration, use the resulting channel count for writer strides and durations, and let the bus perform the remix and pan. Add a bus-output test for a mono decoded source, not only a strip.pan() assertion. This implements the law already chosen in the base audio-pan quest; it does not require new studio-side DSP.

  1. [P2] Make the pan rail recognize double-clicks — rs/moq-studio/src/ui.rs:3691-3693.

Double-clicking the slider rail or handle away from center leaves pan at the clicked position instead of centering it as the tooltip promises. Pinned egui 0.36.2 allocates the rail with Sense::drag() (slider.rs:650-655); it sets the clicked flag only for click-sensitive widgets (context.rs:1524-1527), and double_clicked() requires that flag (response.rs:247-252). Combining the value editor's response does not make a rail click an editor click. Add a click-capable interaction that preserves dragging and numeric editing, or an explicit center control, and verify the reset through both Audio and Graph panels.

Direction: keep pan on the shared upstream strip and the existing Audio/history path; address the mono integration and reset interaction before treating the quest as complete. The previously reported grid-column and input-parser issues are fixed. No other actionable findings after reading all changed files, following persistence/undo/routing and both UI callers, and checking the pinned upstream pan implementation and tests.

Verification limits: GitHub-only static review. I could not run quest context, builds, tests, audio playback, or UI interactions. The returned Check run for this exact head was skipped, so no passing CI result was established. The PR's reported local checks and unrelated timestamp failure were not independently reproduced.

@kixelated
kixelated enabled auto-merge (squash) November 8, 2026 19:49
@kixelated
kixelated merged commit 629757f into main Nov 8, 2026
3 checks passed
@kixelated
kixelated deleted the quest/m0/audio-pan branch November 8, 2026 20:07
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