A basic granular synthesis patch that uses a real-time mic-in signal with tools that pure data is offering. It should contain parameters like Grain starting time, grain length and playback speed which also affects the pitch of the grain.
Circular Buffer
Pure data has a built-in object called delwrite~. This object collects the incoming audio and stores it for a given time in this so-called circular buffer. You can imagine it as a round tape where the new audio from the mic-input is recorded over old audio. In the following example the tape has a length of 5 seconds.
Play Sound from the Buffer
To make use of this circular buffer and play sound that has been stored a play head is needed which is implemented with the vd~ object in PD. This play head needs a given delay time that will later be the starting point of a single grain.