Creating a granular synthesis

Em Oness's icon

Hey guys,

First off, I'm very new to max and trying to learn through the reference section and youtube videos, but I can't seem to wrap my head around granular synthesis. There are many different ways to implement it, but I want to take apart a project I saw on 1000 projects.

Max Patch
Copy patch and select New From Clipboard in Max.

I'm trying to figure out how Kecapi II implements a random granular synthesis. https://cycling74.com/project/kecapi-ii/#.ViUehbRVhHw
I attempted to recreate his patch based on the link (the original patch isn't posted), and I want to know if I'm on the right track or if there's a link that would better explain the process. Any help would be greatly appreciated!

Jean-Francois Charles's icon

Hi, welcome to Max world. If you're new to the environment, have a look at the MSP tutorials, of course.
For granular synthesis, you might be interested in the MSP example "granularized" (not a beginner's patch if you want to understand everything).
A very different, and widely used, audio engine is given by Nobuyasu Sakonda: http://formantbros.jp/sako/download.html

brendan mccloskey's icon

Hi
yes, the link to the Kecapi II patch seems to have expired. Jean Francois provides two excellent examples of granular synthesis in Max (the built-in "granularized", and Sakonda's evergreen algorithm); to that list I would respectfully add "sugar synth", "grainstretch", "grain mill", and my own "granary". Youtube is hit and miss as we know, but if you search for "Max granular" you'll be spoiled for choice. How important is the randomise element to you? This would be fairly simple to add to someone else's grain patch. And then you can build your own, while learning, woot woot!

[EDIT] whether beginner or advanced, essential listening/hacking/learning here:
https://cycling74.com/tools/charles-spectral-tutorials/#.ViVXJyuLH9I
Not granular, but time-stretching pitch-shifting Nirvana!

Brendan

brendan mccloskey's icon

. . . .

Max Patch
Copy patch and select New From Clipboard in Max.

here's a descriptive example patch, with annotations, which illustrates the simplest way to generate a single grain from an audio file. Basically, it's just a looper that's really good at playing tiny loops, or grains. It's monophonic so you might have to think about how to make it play multiple grains ;) It allows user control of grain size, pitch and offset/scrub. HTH

Em Oness's icon

Thanks so much for all your help/ links/ tips! I can't wait to get started :D

dystetic's icon

A bit late to the party but....
Brendan's patch is very useful. I am also a beginner on Max and I want to develop a granular synth that can process from a real time audio feed. In other words I want to be able to granulate audio coming from microphones in a performance. I guess the trick must be done somewhere around the buffer~ object? Thank you :)

vichug's icon

@dystetic : you could try building that from scratch, but you could also check out the excellent petra package which does just that :)

and to answer your question : to process granular audio from a real time feed, a buffer~ is ok, but you can also try to use tapin~ tapout~, which are a ringbuffer so it may be more practical. Using buffer~s woud mean that you need a lot of them (one for each grain at a given time) and manage the timing to record in it, with windowing and stuff. It is complicated...but probably rewarding ?... If you are a beginner i strongly recommand using petra though, even if you are not a beginner actually...this library will let you do a lot of cool sounds.

dystetic's icon

I will check that out, maybe with a bit more time I can develop something myself too. Thank you :)