LMMS/lmms

Piano Roll playhead not shown during Record-Play

Opened this issue · 3 comments

System Information

Linux Mint 21

LMMS Version(s)

9a0db6a

Most Recent Working Version

1.2.2

Bug Summary

When playing a midi clip using Record-Play (either the button in the Song Editor or the Piano Roll), the playhead in the Piano Roll no longer follows along when the Song Editor's global playhead is playing within the same time frame as the clip.

Expected Behaviour

The Piano Roll's playhead should follow the global playhead during Record-Play. That would restore the previous behavior.

Related design questions:

  • Should we extend this behavior to the normal Play button as well, or keep it to just Record-Play?
  • Should the Piano Roll's view continue to follow the Piano Roll playhead when playing from the Song Editor?
  • ...

Steps To Reproduce

  • Open new project
  • Create a midi clip at time=0
  • Open the piano roll and place a few notes
  • Press the Record-Play button from either the Song Editor or the Piano Roll
  • The Piano Roll's playhead does not move while the Song Editor's playhead passes through the clip (Regression!)

Logs

Click to expand
  

Screenshots / Minimum Reproducible Project

No response

Please search the issue tracker for existing bug reports before submitting your own.

  • I have searched all existing issues and confirmed that this is not a duplicate.

@DomClark This regression was probably introduced by #7004

My guess (not tested) would be that this line should use Engine::getSong()->getTimeline(Song::PlayMode::Song), not m_timeLine:

connect(m_timeLine, &TimeLineWidget::positionChanged, this, &PianoRoll::updatePositionAccompany);

Unfortunately, Engine::getSong()->getTimeline(Song::PlayMode::Song) alone does not work because getTimeline returns a Timeline object, while m_timeline is a TimeLineWidget. This matters because Timeline does not have a positionChanged signal.

However, I was able to fix it by adding positionChanged as a signal for Timeline, and having it triggered byTimeLineWidget at the same time as it's own positionChanged signal.

I plan to make a pr for this, but unfortunately it revealed another problem. When I press stop after doing Record-Play, the PianoRoll's playhead doesn't return to the start. I may have to do some more digging.