Onset detection for SonicPi like automatic beat generation?
SonicPi has this feature where you can drop in a sample of audio, it recognizes the onsets, and you can have it randomly choose a specific onset to play. E.g. if you have a drum beat recording, you can have it randomly select a point to play every 100 ms lets say.
I want to create something similar to this in Max for Live (as a total Max beginner). I have experience in programming Python, but don't think that'll help.
Here's what I want it to look like:
1. You drop an audio sample (I'm thinking live.drop ..?)
2. The device shows you a waveform of it, and visualizes lines where the onsets are (So it's not detecting the onsets in realtime, it goes through a recognition process, and then after its done, it stores the onsets somewhere)
3. You create a midi clip, and add arrangement of notes
4. Every time a midi note is played, it plays a different onset point (with a specified amount (say 250 ms), and an envelope of some sort added onto it, so you can control the attack, sustain, decay, release.)
5. There's the option to either have it play randomly, or random once, where it doesn't play the same note again (for really long samples)
The part that stumps me the most is the onset detection. I've seen some patches here by some people but it's confusing to me how to integrate it into something like this because they were realtime onset detection which isn't what I want.