Procedural Generation Plugin (HELP!)

Hi all, new to Juce. I am currently creating a procedural generation plugin for my dissertation, the idea is to input an audio file, break it down into grains (1/10th of a second audio clip) and rearrange them & alter the pitch, frequency duration ETC to get a completely different sounding audio file. The only thing I’m struggling with is actually breaking them down and mixing them up!

For example, I’m inputting a 30-second audio clip and I want to break it down into 300 1/10th of a second audio clips, and then randomise them, I’ve had a look through the juce API although nothing is jumping out at me, any help is seriously appreciated.

Thanks in Advance, Guy

Lot of different ways to do this, depending on your method for altering the contents you may need to use an fft and handle all the windowing etc, but for a basic crude one you could just use the audioformatmanager, register basics types, create a reader for the file, read into a buffer and split the buffer by sampleRate * 0.1 into either mini buffers or vectors, then do whatever you want with the data.

first of all i’d like to ask you what kind of “procedural generation” method you are using, because i also find that topic super exciting! i once tried to make a procedural randomizer, so that on any given point in the DAW project it will always pick the same number, but from a random generator. it was pretty cool, unless you were playing a loop. then it was really crappy because of the discontinuous modulation xD so i’d really love to read about other approaches to get procedural generation into an audio plugin. only if it doesn’t spill too many secrets ofc :3

now back to your question: yeah grains. the question is basically: have you build a delay plugin yet? i made this tutorial yesterday: Code a Delay - YouTube
It explains different ways to make a delay. Because what you need for granular effects is a ringbuffer, just like in a delay, so that you can make crazy stuff with the readhead, like playing it at different speeds to alter playback speed and pitch (resampling) or by just jumping around in the buffer in discontinuous way to get that granular-typical grainy re-arranging thingie effect. idk if there’s a term for that.

i’d suggest to you that you really just start by making a normal and boring delay, because once you got that running fine you can go with that into all kinds of granular directions