I am trying to figure out a way to do a fairly simple idea: I have two PNGs which are draggable across the canvas and I want each of them to trigger a loop. Beyond that, I want the position of the image to dictate the pan() and rate() of the looping audio file.
I broke this down into smaller sketches, as ya do, and I have been able to get draggable images using found code, and I have been able to get a loop to trigger by hitting the canvas which is live processed via the mouse position (X: pan, Y: rate) cobbled together from examples.
I am running into an issue with making the images buttons that each call different samples. Pointers for that would be sick.
I also had the thought that I could get something to spit out the coordinates of each image – that is, on a mouse release the x, y position could be fed into the pan and rate parameters; or the pan and rate is dynamically related to the position of each image. Maybe each loop’s pan and rate read the mouse positions but only when clicking the respective images.
Any suggestions are welcome, particularly p5 references or examples of concepts that I may be unaware of. I have a working understanding of the language at best, but am still very green.