Skip to content

Swing Grid Support - #2487

Open
maiko3tattun wants to merge 5 commits into
openutau:masterfrom
maiko3tattun:261002_swing
Open

maiko3tattun wants to merge 5 commits into
openutau:masterfrom
maiko3tattun:261002_swing

Conversation

@maiko3tattun

@maiko3tattun maiko3tattun commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor
image image

New Feature:

  • Added support for swing as a grid size option.
  • Swing amount can be selected in 10% increments from 10% to 100%.

Changes:

  • Changed triplet notation from "1/6" to "1/4 T" to make it more familiar and conventional.
  • Swing is not only a visual change; it affects the overall rhythm of the song, so it is saved as part of the project. However, to avoid polluting the undo history, changes to grid size and swing amount are not recorded in the undo history.
  • Consolidated snap-related calculations into MusicMath.cs.
  • Fixed an issue where the numeric text in the slider dialog could be cut off.

Notes:

  • At the most precise swing grid setting (1/16 Sw), 10% corresponds to 4 ticks, so the tick value never becomes fractional.
  • The following snap-related operations were tested:
    • Note creation, resizing, moving, and splitting
    • Playhead movement
    • Curve selection
    • Quantization
    • Keyboard shortcuts for note movement and resizing, playhead movement
    • Note pasting

@maiko3tattun
maiko3tattun requested a review from a team October 3, 2026 13:16
@stakira
stakira requested a balanced review from Copilot October 4, 2026 01:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Swing snapping currently has persisted-state, coordinate-space, split-boundary, keyboard, and zoomed-rendering correctness issues.

Review effort: Balanced
Findings: 11 Medium severity

Open (11)
What changed in this PR

Adds persisted swing-grid support across piano-roll rendering and editing.

Changes:

  • Adds straight, triplet, and swing grid options with configurable swing amount.
  • Centralizes snapping calculations in MusicMath.
  • Applies swing snapping to editing, quantization, paste, and playhead operations.
File Description
OpenUtau/​Views/​SliderDialog.axaml Widens numeric value display.
OpenUtau/​Views/​NoteEditStates.cs Uses swing-aware snapping in edit states.
OpenUtau/​ViewModels/​NotesViewModel.cs Manages swing settings and snapping operations.
OpenUtau/​Strings/​Strings.axaml Adds swing menu text.
OpenUtau/​Controls/​TickBackground.cs Renders swing grid lines.
OpenUtau/​Controls/​PianoRoll.axaml.cs Updates quantization and keyboard controls.
OpenUtau/​Controls/​PianoRoll.axaml Binds swing to grid controls.
OpenUtau.Core/​Util/​MusicMath.cs Implements centralized swing calculations.
OpenUtau.Core/​Ustx/​UProject.cs Persists grid and swing settings.
OpenUtau.Core/​Editing/​NoteBatchEdits.cs Adds swing-aware quantization.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread OpenUtau/Controls/PianoRoll.axaml.cs Outdated
Comment thread OpenUtau/Controls/TickBackground.cs Outdated
Comment thread OpenUtau/ViewModels/NotesViewModel.cs
Comment thread OpenUtau/ViewModels/NotesViewModel.cs Outdated
Comment thread OpenUtau/ViewModels/NotesViewModel.cs
Comment thread OpenUtau/ViewModels/NotesViewModel.cs
Comment thread OpenUtau/ViewModels/NotesViewModel.cs
Comment thread OpenUtau/ViewModels/NotesViewModel.cs Outdated
Comment thread OpenUtau/Views/NoteEditStates.cs
Comment thread OpenUtau/Views/NoteEditStates.cs
@maiko3tattun

Copy link
Copy Markdown
Contributor Author

All issues have been resolved.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants