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

Bulldozer in Piano roll #6497

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Bulldozer in Piano roll #6497

wants to merge 4 commits into from

Conversation

allejok96
Copy link
Contributor

New edit mode to quickly scale and move things around. Stems from #6140. Forgive the bad English.

bulldozer.mp4

Didn't want to wait for piano roll rewrite any more. Needed this feature.

New stuff

  • Scrollable edit mode button in the toolbar
  • Edit mode button and note actions button remembers last used
  • Bulldozer move:
    • Selects all notes to the right if no notes are selected
    • Stretches the notes that touches or overlaps the left side
  • Bulldozer resize:
    • Proportional, like shift-resize
    • All notes are proportionally resized between the red lines (the edges of the selection)
    • Moved note snaps to grid
    • Notes in between are not quantized - proportions kept intact (applies to ordinary shift-resize too)
    • Moves posterior notes
  • Hold shift to temporarily disable bulldozer and move or resize a single note

Bugs fixed

  • Disable quantization when moving notes in grid snap mode by holding alt
  • Resize in grid snap mode snaps to closest line correctly
  • Length of new note after resizing is taken from the last clicked note, not the rightmost note
  • Knife mode always exits to draw mode when right clicking (not a bug)

Needs testing

  • Drawing
  • Moving / resizing
  • Modifiers
  • Hitting the top/bottom
  • Hitting other notes in bulldozer mode
  • Switching between modes (knife mode in particular)
  • Messing with drum notes
  • Minimum note lengths when resizing
  • Grid snapping vs nudge

Beware of bugs

I know there's a ton in the old code. I didn't want to fix them to keep the PR clean, but some of them just had to go. Hope I didn't introduce that many new though.

ActionChangeNoteProperty,
ActionResizeNoteEditArea,
ActionKnife
ActionNone = 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@sakertooth sakertooth left a comment

Choose a reason for hiding this comment

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

Very nice. I don't have much to say but basically use auto and make variables immutable where applicable. I'm not sure how the surrounding code uses the variables I made const however, so if necessary, you can remove const (or any other needed change) to make the code compile.

include/Note.h Show resolved Hide resolved
src/gui/editors/PianoRoll.cpp Outdated Show resolved Hide resolved
src/gui/editors/PianoRoll.cpp Outdated Show resolved Hide resolved
src/gui/editors/PianoRoll.cpp Outdated Show resolved Hide resolved
src/gui/editors/PianoRoll.cpp Outdated Show resolved Hide resolved
src/gui/editors/PianoRoll.cpp Outdated Show resolved Hide resolved
src/gui/editors/PianoRoll.cpp Outdated Show resolved Hide resolved
src/gui/editors/PianoRoll.cpp Outdated Show resolved Hide resolved
src/gui/editors/PianoRoll.cpp Show resolved Hide resolved
src/gui/editors/PianoRoll.cpp Outdated Show resolved Hide resolved
@allejok96 allejok96 marked this pull request as draft August 31, 2022 19:44
@allejok96
Copy link
Contributor Author

Made it draft since dragNotes needs some more work with note boundaries etc

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.

None yet

3 participants