I am planning to make a MIDI-like sequencer piano-roll layout where the user can click on a grid space to create a note there, click again to delete the note, and hopefully be able to drag and manipulate these notes in other ways.
I cannot use any MIDI-centric classes for this because my program is not using MIDI or even a traditional piano key setup. All other sequencer-based tutorials and guides I’ve found for JUCE only reference step sequencers, but I need something that can support dynamic grid sizes and scrolling at the very least to be viable.
So, here are the two approaches I came up with:
-
It is easy to use for loops to generate a nice grid of rectangles, and I could easily just change the drawing parameters and repaint to “fake” a scrolling effect. However, these rectangles, being just drawings, are not interactive in any way, and I don’t know how to make them so. It seems like this would be a more customizable and optimizable solution than I mention in 2, so if there is a way to do this I would love to know it.
-
My next thought was to make a grid of buttons which change color when toggled on and off, but that seems a little silly. Is that really the intended use of buttons? Will the application remain stable even with many hundreds of such buttons displayed at once? Besides, this approach would seem to create a hassle when it comes to having notes longer than a single grid square - would I just extend the button bounds, or…?
Sorry, I know this is a very open-ended questions, but after reading all the tutorials I am still pretty unsure of how to tackle this. Any advice is appreciated.