Skip to content

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

Open
alexandra-russell wants to merge 1 commit into
LMMS:masterfrom
alexandra-russell:fix/7675-pitchbend-gui-update
Open

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

Conversation

@alexandra-russell

Copy link
Copy Markdown

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.

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

Labels

bug gui needs testing This pull request needs more testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Piano roll pitch bend doesn't cause gui update

4 participants