Skip to content

Conversation

@Rolandjg
Copy link

@Rolandjg Rolandjg commented Nov 28, 2025

Note duplication

Ctrl-D

duplication.mp4

Note flipping

flipping.mp4

Key bind zooming

Ctrl- and Ctrl=

zooming.mp4

}
break;

case Qt::Key_Equal:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not do these as a QAction too?

Copy link
Author

Choose a reason for hiding this comment

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

We can do that, this just seemed like a more straight forward approach.

Copy link
Contributor

Choose a reason for hiding this comment

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

Use QKeySequence::ZoomIn and ZoomOut. That solves the issue with different keyboard layouts and platforms. For example, on my keyboard 0=} is the same key, and ?+\ is another key

Copy link
Author

Choose a reason for hiding this comment

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

I experimented with the QKeySequence it does work for zooming out, but doesn't perform how you'd expect for zooming in. Ctrl + = is standard, but QKeySequence::ZoomIn expects Ctrl+Shift + =. Also no QKeySequence for Alt + = and Alt + -

Copy link
Contributor

@allejok96 allejok96 Dec 21, 2025

Choose a reason for hiding this comment

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

Hm, ok so QKeySequence::ZoomIn doesn't use Ctrl+= on English keyboards...? That's annoying. Check out how Wireshark handles the situation:

https://github.com/wireshark/wireshark/blob/9ff63cab38388920df8f170cf19b61604bb39db6/ui/qt/print_dialog.cpp#L210

@regulus79
Copy link
Member

regulus79 commented Nov 28, 2025

#7873 may be related, at least for the note duplication shortcut.

I am curious, reading the code, it appears that duplicateNotes creates a copy of the selected notes in place, right where they are. If I understand correctly, is that the same thing that shift-dragging on a selection does? I could see how that would be useful for keyboard users.

I am also interested what the use-cases are for vertically flipping a selection of notes. Given how scales are usually not evenly spaced, flipping a set of notes would easily create some off-scale notes. Actually, maybe that would be kind of cool sometimes.

The key bind zooming sounds cool for keyboard users. I think we have something similar with a mouse shortcut, but having a purely keyboard one is probably a good idea too.

@sqrvrt
Copy link
Contributor

sqrvrt commented Nov 28, 2025

some thoughts:

  • It's usually also a nice QoL to provide Ctrl-0, which in many programs sets zoom to 100%
  • Vertical zoom could also be done with e.g. Alt prefix when applicable

@Rolandjg
Copy link
Author

some thoughts:

* It's usually also a nice QoL to provide `Ctrl-0`, which in many programs sets zoom to 100%

* Vertical zoom could also be done with e.g. Alt prefix when applicable

Great ideas.

@Rolandjg
Copy link
Author

#7873 may be related, at least for the note duplication shortcut.

I am curious, reading the code, it appears that duplicateNotes creates a copy of the selected notes in place, right where they are. If I understand correctly, is that the same thing that shift-dragging on a selection does? I could see how that would be useful for keyboard users.

I am also interested what the use-cases are for vertically flipping a selection of notes. Given how scales are usually not evenly spaced, flipping a set of notes would easily create some off-scale notes. Actually, maybe that would be kind of cool sometimes.

The key bind zooming sounds cool for keyboard users. I think we have something similar with a mouse shortcut, but having a purely keyboard one is probably a good idea too.

Yes, duplicate notes does act like shift dragging.
I find vertical flipping for make quick call response melodies, just flipping a few notes can make a nice change.
I work primarily on my laptop with a track pad, so having binds for zooming are very nice. Scrolling up and down while holding control is way too fast on a track pad so having binds makes tiny adjustments easy.

Ctrl+0 and alt+0 are already used for setting quantization and note durations, maybe this can be revised later
@allejok96
Copy link
Contributor

Flipping a melody vertically turns major into minor and vice versa, it's pretty cool that it even works

@rdrpenguin04
Copy link
Contributor

I'd almost want to request horizontal flipping; I find myself doing that fairly often

@allejok96
Copy link
Contributor

Shift+R

bild

const NoteVector selectedNotes = getSelectedNotes();
const auto& notes = selectedNotes.empty() ? m_midiClip->notes() : selectedNotes;

m_midiClip->flipNotes(notes);
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand that having Clip::flipNotes is neat, but I don't like that you can pass notes from any clip to it (yeah reverseNotes does it too). I'd rather see that the selection happens inside Clip::flipNotes. It's not a deal breaker though... I need a second opinion on this...

m_midiClip->flipNotes(notes);

update();
getGUI()->songEditor()->update();
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these update calls needed? Try without. At least the first one should not be needed since the editor connects to Clip::dataChanged

Comment on lines 314 to 324
int min = notes.at(0)->key();
int max = notes.at(0)->key();

for (auto note : notes)
{
int key = note->key();
if (key > max) { max = key; }
if (key < min) { min = key; }
}

int sum = min + max;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
int min = notes.at(0)->key();
int max = notes.at(0)->key();
for (auto note : notes)
{
int key = note->key();
if (key > max) { max = key; }
if (key < min) { min = key; }
}
int sum = min + max;
auto bounds = boundsForNotes(notes)
int sum = bounds->lowest + bounds->highest;

}
}

void PianoRoll::duplicateNotes()
Copy link
Contributor

Choose a reason for hiding this comment

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

Like regulus said, there's no need for duplicate since #7873 does that better

Copy link
Author

Choose a reason for hiding this comment

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

I agree, duplicateNotes should be removed in place for #7873

@allejok96
Copy link
Contributor

Scrolling up and down while holding control is way too fast on a track pad

#7941 (just nagging people)

@messmerd messmerd changed the title Add quality of life features. Duplication (ctrl-d), zooming with ctrl - and ctrl =, vertical flipping of notes in piano roll. Add quality of life features to the piano roll Dec 3, 2025
@Rolandjg
Copy link
Author

I removed note duplication in favor of #7873 (which should really be merged btw). Keyboard zooming still needs work, but should be a feature in my opinion. Vertical flipping is cool, I think it has a place, nice for easily changing from major to minor.

Copy link
Contributor

@allejok96 allejok96 left a comment

Choose a reason for hiding this comment

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

I just saw you're using spaces for indentation. You should be using tabs only

}

rearrangeAllNotes();
emit dataChanged();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
emit dataChanged();
emit dataChanged();
Engine::getSong()->setModified();

int value = m_zoomingXModel.value();
m_zoomingXModel.setValue(value + 1);
}
if (ke->modifiers() & Qt::AltModifier)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be else if otherwise ctrl+alt will zoom both

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.

5 participants