Skip to content

Tweaking the curve#2217

Open
rokujyushi wants to merge 5 commits into
openutau:masterfrom
rokujyushi:Pitch-adjustment
Open

Tweaking the curve#2217
rokujyushi wants to merge 5 commits into
openutau:masterfrom
rokujyushi:Pitch-adjustment

Conversation

@rokujyushi

@rokujyushi rokujyushi commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

New curve editing tools have been added to the piano roll.
The following tools have been newly added to the piano roll toolbar:

  • Vertical Stretch Tool
  • Horizontal Stretch Tool
  • Vertical Shift Tool
  • Horizontal Shift Tool

Icons and tooltips for these tools have been added, and the settings in PianoRoll.axaml, Strings.axaml, and PianoRollStyles.axaml have been updated accordingly.

Additionally, the behavior of the new tools has been implemented in PianoRoll.axaml.cs, with extensions to the ExpCanvasPointerPressed and ExpCanvasPointerMoved methods.

In CurveViewModel.cs, logic to support the new tools has been added.
The TryGetSelection method has been implemented to retrieve the selection range.

In NoteEditStates.cs, new state classes have been added, and the editing logic (movement and scaling) for each tool has been implemented.

An option to turn off the default snap function for curve selection has been added to Preferences.cs.

Previously, this could be disabled by turning off the Note snap function. However, since some users may not require snapping during selection, a separate setting has been added to allow it to be turned off individually.
The snap function was originally introduced because the selection feature was designed to snap to the grid, matching the specification where curve pasting operations are performed along the grid.
0620

rokujyushi and others added 2 commits June 20, 2026 05:25
Added the following new tools to the piano roll toolbar:
- Vertical Stretch Tool
- Horizontal Stretch Tool
- Vertical Shift Tool
- Horizontal Shift Tool

Added tooltips and icons corresponding to these tools, and updated the settings in PianoRoll.axaml, Strings.axaml, and PianoRollStyles.axaml.

Implemented the behavior of the new tools in PianoRoll.axaml.cs and extended the ExpCanvasPointerPressed and ExpCanvasPointerMoved methods.

Added logic to CurveViewModel.cs to support the new tools.
Implemented the TryGetSelection method to retrieve the selection range.

Added new state classes to NoteEditStates.cs and implemented editing logic (move, scale) for each tool.
@rokujyushi rokujyushi changed the title Pitch adjustment Tweaking the curve Jun 19, 2026
@nagotown

nagotown commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Would it be possible to add a setting to ignore any values that are 0/default when using the shift tools?
I also noticed that selection strictly adheres to the snap division grid, is this intentional?

@rokujyushi

Copy link
Copy Markdown
Contributor Author

@nagotown
Regarding the setting to ignore values that are 0 or default when using the shift tools, I'm having a hard time imagining how that would behave.

If you don't want to move the default values, I think it's best to simply not select them.

As for the behavior of the selection, I haven't made any specific changes to it, so it remains exactly as it was when the curve selection feature was first added.

@nagotown

nagotown commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

The reason why I wouldn't just select very specific parts is related to the last part of my reply.

It's a bit of a hassle with the grid snapping.
I could just turn off grid snapping, but this means I would have to do it every time I wanted to tweak the pitch.
Drawing pitch doesn't adhere to the grid, so it doesn't make sense to me for it to do that while tweaking the pitch.

By the way, could you check my PR on this branch?
One of the icons is improperly named, causing it to not appear in the expression panel.

@rokujyushi

Copy link
Copy Markdown
Contributor Author

@nagotown
I have confirmed the grid snapping specifications with the developer, Maiko.
She explained that because the pasting behavior aligns with the grid, the selection process is also designed to snap to it.
Since this behavior is logical, I believe that snapping should be the default setting.
In addition, we will proceed with modifications to allow users to change the default snapping settings.

Introduced the DefaultSnapCurve property to allow the Snap Curve to be enabled by default. This setting has been implemented in Preferences.cs, PreferencesViewModel.cs, and NoteEditStates.cs, with a new localization key added to Strings.axaml for the UI.
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