Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SongEditor Snap Size to Adjust with Time Signature #7620

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

regulus79
Copy link
Contributor

@regulus79 regulus79 commented Dec 13, 2024

Description

This PR changes the way the snap size in the Song Editor is set up to accommodate odd time signatures. Instead of being solely powers of two, the snap sizes < 1 bar are now also multiples of the current time signature.

The snap sizes in general look like:

  • 2^3
  • 2^2
  • 2^1
  • 1
  • 1 / (numerator)
  • 1 / (numerator * 2^1)
  • 1 / (numerator * 2^2)
  • 1 / (numerator * 2^3)

The snap sizes are recalculated and the ComboBox is repopulated whenever the time signature changes.

2024-12-13.13-10-14.mp4

Changes

  • A new slot was added to SongEditor, updateSnapSizes(), which is connected to Song::timeSignatureChanged. This function recalculates the snap sizes given the current time signature numerator.
  • A vector m_snapSizes was added to SongEditor so that the snap sizes do not have to be recalculated whenever they are requested.
  • The arrays SNAP_SIZES and PROPORTIONAL_SNAP_SIZES were removed from SongEditor and replaced with the integers SNAP_SIZES_SMALL and SNAP_SIZES_LARGE, which determine the number of divisions greater than or less than 1 bar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant