Mouse selection of Bins

Hi everyone,

i was wondering, if it’s possible to make my beat-tracking program more interactive so i want to make some FFT-Bins clickable. I have some Rectangles (could make them an object maybe?), which are getting drawn based of the Amplitudes of the Frequencybins and i have a slider which currently selects the bin that gets beat-tracked. Now i want to select the bin(s) which get beattracked with the mousePressed function (i guess) - do i have to use an event which occurs when the bins get selected? I don’t know where to start.

thx in advance,

ofRectangle has an inside function which returns true if a point is inside it.

You can also use an “interactive object” addon like

to build things that are more like buttons.