Selectable and SelectedItemSet usage

I’m attempting to use a LassoComponent to select multiple notes in a piano roll the way Waveform does. Is templating a SelectedItemSet with a Selectable the right approach for this?

Also what is the intended usuage for SelectedMidiEvents?


SelectedMidiEvents it probably what you want for this. To avoid the overhead of every MidiNote and MidiControllerEvent being a Selectable, the SelectedMidiEvents acts as a Selectable for a collection of events.

This also enables you to change properties of multiple notes at once.

@dave96 I’m struggling with understanding SelectedMidiEvents.

How is this collection of events formed? I noticed MidiClip already uses SelectedMidiEvents . How would I add my events to that or do I?

I would ignore the one in MidiClip. It was a bit of a hack to only render certain notes from a clip and should probably be done in a different way.

For UI operations, just create a SelectedMidiEvents instance in your UI context and add the relevant events to it. You can then delete it when you select another UI object etc.