GrainDelay - A sub-sample accurate granular feedback Delay

hey thanks for your reply :slight_smile:
Our scheduling mechanism with busy check and dynamic distribution differs from how other grain ugens implement smart polyphony. The model i have chosen is normally good for an average size of polyphony (i think 16-32 is a good choice here) for very dense grains (like 200-500 and above) the model should be switched.

But the reason i have chosen what we have right now, has some history to it:
For the last years i have been trying to modularize granulation, so the user has acces to all of its parts and can set it up themselves on the server.
The initial reason for that was, that i wanted to have FM/PM per grain which is not possible via the existing Grain Ugens. I have additionally learned about phasor based scheduling for sub-sample accurate granulation to prevent aliasing caused by high trigger rates, which is also not part of the existing grain ugens and many more things along the way.

Phasor based scheduling uses continuous, linear ramps between 0 and 1, from which you can derive all sorts of useful information like slopes, triggers, durations and sub-sample offsets. These ramps can be subdivided by non-integer ratios and can be modulated without truncation or distortion of your grain windows, if you make sure your phases stay linear and between 0 and 1 while beeing modulated (e.g trigger rate modulation).
If you setup your basic building blocks like that, you are also free to use an arbitrary carrier oscillator (as soon as it has a phase reset, granulation starts from hard sync) of your liking for example the recent OscOS or my DualOscOS implementation with dynamic mipmapping, sinc interpolation and possibility for oversampling.

In my NOTAM talk which i have held this spring i have presented phasor based scheduling and granulation based on two libraries i have created with some useful tools to manually setup granulation on the server:

Additionally I have created two extended guides for that talk, one for sub-sample accurate phasor based event scheduling and the other how to use these techniques for granulation.

sub-sample accurate phasor based scheduling
phasor based sub-sample accurate granulation

The main challenge when you manually set up granulation on the server is polyphony. The only model available without single-sample feedback or sample based for loops is the round-robin method, which increments a counter by 1 for each trigger it receives and distributes the next grain to be scheduled to the next channel (for example by using PulseDivider). This method works if all your grains have the same durations, but if we want to modulate the trigger rate (e.g. grain of unequal durations) this method does not work because the maximum possible overlap differs per channel. The round-robin method doesnt know about the state of its channels (e.g. busy or not) it just distributes the grain to the next channel and it can be the case, that this channel is still active scheduling a grain. The first extension beyond the round-robin method is to implement a busy check and distribute the next grain to a free channel (thats what we have here).

With all what im doing im trying make this whole thing as modular as possible with all the documentation necessary to get past that granular synthesis mystery for everybody.
Im currently trying to build all the necessary bits and pieces in C++ to make it even more easy for the user to setup granulation themselves (e.g. GrainScheduler Ugen from above) and have all the freedom for extensive modulation. But have just started learning c++.

I hope this does make sense. So i think for this specific model chosen for event distribution we should limit the possible number of channels to 32.
I will write a helpfle for the ugen. Currently i have no idea where to place my guides to be accessable and not be lost in the depth of a thread.

2 Likes