Piano Roll UI Component?
-
@clevername27 My initial reason was a sequencer, but even that has it's limitations (always being tempo synced, for instance). My inquiry was for more general use cases. I imagine the most flexible system might make use of the Keyboard Floating Tile (communicate the Piano Roll panel data to the keyboard to trigger midi events), but this seems fraught with issues as well. The cleanest solution would be a built in UI component (probably under the floating tile), but I doubt @Christoph-Hart would take an interest in implementing this unless there was a general consensus that the HISE community wants it.
-
Perhaps we could just lean on some open framework as well. I am not really sure how to add UI components to the HISE source code but here are a couple MIT licensed JUCE Piano Roll on Github:
GitHub - Sjhunt93/Piano-Roll-Editor: A simple piano roll editor written in c++ using the JUCE framework for graphics
A simple piano roll editor written in c++ using the JUCE framework for graphics - Sjhunt93/Piano-Roll-Editor
GitHub (github.com)
GitHub - johndpope/PianoRoller: This is a piano roll VST that will allow musicians to use a piano roll sequencer inside their DAW to control midi instruments. It supports multiple presets and can be controlled through DAW automation. It was built in the Juce framework.
This is a piano roll VST that will allow musicians to use a piano roll sequencer inside their DAW to control midi instruments. It supports multiple presets and can be controlled through DAW automation. It was built in the Juce framework. - johndpope/PianoRoller
GitHub (github.com)
-
@HISEnberg Is it just the rectangle-editor you want from the piano roll, or do you also want the meta data fields (e.g. velocity) drawn as editable spikes below each note (in the footer)?
-
@clevername27 my immediate objective would be pitch, velocity, note length. Extra MIDI data in the future would be nice but I think this is a pretty reasonable starting place. So in this case there would need to be a footer for the velocity.
-
@HISEnberg Would an Event List work for you?
-
-
@d-healey Oh amazing this looks like exactly what I need. If I pursue this further I will repost here with a piano roll for everyone to use!
-
@HISEnberg The main issue I see is with interaction. Probably the easiest solution is to use child panels, but I'm not sure if you'll hit some issues with potentially 1000s of child panels representing the notes.
I actually started building my own sequencer (notation based) and ran into this issue so put it aside.
-
@d-healey @HISEnberg @clevername27 I wouldn't go with child panels here. I've made an editor ages ago and, to me, just storing the note object in a big object like
{note:x, vel:x, length:x, anything;x...}
and drawing rectangle in the main panel is nice. Then it's a matter of mouse detection in the note area.
The only drawback I have seen since I played a lot with both solutions (child panels and objects) is that the object solution requires you to loop through all notes in the object before deciding if you're hovering one. If you have hundreds of notes, this can add some significant overhead.But child panels can be a nice solution too, we just have to be sure moving it around and changing the length can be handled reliably
-
@d-healey @HISEnberg @clevername27 Actually I am making one with child panels and it works nicely
Still a few things to add and I'll share a basic MIDI editor (to be improved) -
@ustk Do you think there will be any issues with lots of notes?
-
@d-healey It is just that the overhead of the object solution is the fact that it requires you to loop through all notes, while the panel solution can overtask the UI since child panels still are components (and I know from a past experience that too many components can make the interface laggy)
Now, which solution is the less greedy, I don't know... -
Alright so here's a prototype of a MIDI editor using child panels.
- The notes are created in an array of MessageHolders
- Updating the notes doesn't work yet because of an ID tracking issue, if someone as a better idea that'll be nice
- There are still a few bugs and many improvements/additions can be made depending on the use case
As for now, I can't find much more time to finalise it, so, here's the snippet which I hope is a good starting point
HiseSnippet 5641.3oc26jrbiibkjU2z1R1db6H7o4TZEw3fpDKRBRJtTkqoKt.tHwMwEIQ0QGc.BjfDk.AHA.IEkcEy7IL+By7k3y91bZtNm7o4f+C548R.P.PQoRtpxWL6tnHx78d4Ke64B5ZnKRMM0MBE9vAalSCE9WDo+FMqokmJnnEpQkPg+lHsTjTZqaQ4kTr.HKsYtfoIUJT3veUMDpvG70gXe9qeaIAUAMQpWSgBcothHsoxLEKuV69tyUTUqJHQGnLyGzYdWCQcsx5p5KAN5qhjLzbAwaElPaKff8hHgpKXNMT3WFIk7XwTx4Rmmq.WgbYJvwcZ9wYRlRT5zBoSmMsjbp7BYyCH8SrY69VBVTSfnkzk1zep9ZM6A3RESkwpT7AtP8gQ1t4PkmpnJ00U7XFJT3utqmv5qrEV+FlrYa66JzHdX3WnE9EOEKw82.K8BerzO0U+wXIUgMTCFq7OEoUiJMH1svEfQJuzvfpY0mtXIMfV6u9sNcMv.j+9auot9bdMAf8j72LR8w.n8mSC1Q3u5KzbMDNsppnRw4cX2G.nw4HXXTQvRHzK9+95HExjLt1frmmu7kkaN3hZwutT5MipT474UiGWi8+rOr+pIqU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