Skip to content

Fix piano roll not updating after pitch bend node value change#8414

Merged
rubiefawn merged 1 commit into
LMMS:masterfrom
alexandra-russell:fix/7675-pitchbend-gui-update
Jul 7, 2026
Merged

Fix piano roll not updating after pitch bend node value change#8414
rubiefawn merged 1 commit into
LMMS:masterfrom
alexandra-russell:fix/7675-pitchbend-gui-update

Conversation

@alexandra-russell

Copy link
Copy Markdown
Contributor

Summary

Fixes #7675. When double-clicking a pitch bend node in the Automation Editor to change its value, the Piano Roll did not update until the cursor hovered over it.

Root cause

fineTuneValue() changes node values directly via AutomationNode::setInValue() / setOutValue(). Those methods recalculate tangents but do not emit dataChanged(). The Piano Roll's repaint is wired to AutomationClip::dataChanged() (connected when the detuning curve is created), so it never received a signal to redraw.

By contrast, dragging nodes goes through AutomationClip::putValue(), which does emit dataChanged() -- this is why dragging works but double-click did not.

Fix

Emit dataChanged() on the clip at the end of fineTuneValue(), after the node value is set. AutomationEditor is already a declared friend of AutomationClip, so it has access to the protected signal.

Test plan

  • Open a new project and create a MIDI clip
  • Place a note in the Piano Roll and enter pitch bend mode (Shift+T)
  • Click the note to create a detuning curve, add a couple of nodes
  • Shift-click the note to open the Automation Editor
  • Double-click a node and enter a new value
  • Verify the Piano Roll pitch bend line updates immediately without needing to hover

fineTuneValue() in AutomationEditor directly sets node inValue/outValue
via AutomationNode::setInValue/setOutValue, which recalculate tangents
but do not emit dataChanged(). The piano roll is connected to
dataChanged() on the detuning AutomationClip, so it never received
the repaint signal and showed a stale pitch bend line until hovered.

Fix: emit dataChanged() on the clip after the node value is set.
AutomationEditor is already a declared friend of AutomationClip,
so it has access to the protected signal.

Fixes LMMS#7675

@regulus79 regulus79 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I haven't tested, but the fix looks fine. It seems that when normally editing an automation clip, AutomationClip::setDragValue which called AutomationClip::putValue calls emit dataChanged(), but here when double-clicking and entering a value, it directly edits the value of that node, bypassing those functions, which means dataChanged is never emitted.

@rubiefawn rubiefawn added bug gui needs testing This pull request needs more testing labels May 30, 2026
@extern-stat

Copy link
Copy Markdown
Contributor

Can you reproduce the bug this fixes (#7675) on the latest nightly? I tried reproducing it, but the piano roll updated correctly even when double clicking in the automation editor. It looks like AutomationEditor's mouseDoubleClickEvent() calls update() after calling fineTuneValue(), which then calls PianoRoll's update() function directly when note detuning.

@rubiefawn

rubiefawn commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

I also tried to replicate the issue on current nightly (f4d5957) and could not reproduce the issue.

Recording 2026-07-07 at 14 25 36

I did however notice a similar bug with the normal automation editor that had nothing to do with the piano roll or pitch bend, which I can confirm is fixed by this PR:

(Before, nightly f4d5957)
Recording 2026-07-07 at 14 29 29

(After, this PR 35bf24f)
Recording 2026-07-07 at 14 35 46

@rubiefawn rubiefawn removed the needs testing This pull request needs more testing label Jul 7, 2026
@rubiefawn rubiefawn merged commit 28d55bb into LMMS:master Jul 7, 2026
11 checks passed
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.

Piano roll pitch bend doesn't cause gui update

4 participants