Sub-sample accurate granulation with random periods

hey,

TL;TR triggers can only happen on a sample frame thats correct, its not about changing the position of the trigger. Its about figuring out the sub-sample offset of the ideal phasors wrap and when you reset your accumulator, then dont reset it to 0 but to the sub-sample offset. I can cleary hear and see a difference on the freqscope. I dont making this up.

sub-sample accurate accumulator used with BufRD:

naive implementation with Impulse and GrainBuf:

For scheduling events with continous waveforms you need a carrier phase which should reset to zero whenever your scheduling phase completes a cycle. An implementation of this naive hard sync causes a jump in the phase of the carrier whenever the scheduler completes a cycle. This jump in phase leads to a hard edge in the carrier waveform and therefore causes harsh aliasing noise. The first step of getting rid of this hard edge whenever the scheduler forces the carrier to wrap around is to fade out the carrier waveform at the moment the sync happens by applying a window function. This is called windowed sync and is the basic concept of granulation.

In the context of granulation you have a grain scheduler, a phasor going from 0 to 1 and you derive triggers from it to schedule your grain events by calculating the delta of your phasors slope to figure out when the absolute delta is above a certain threshold (the moment the grain scheduler wraps) to reset your carrier phase and applying a window function to fade out the carrier waveform at exactly that moment to smooth out the hard edge the reset causes.

The ideal scheduling phasors wrap (green) happens somewhere between one sample frame and the next (red box). Calculating the scheduling phasors slope by taking its sample values from the last sample frame and its current sample frame (purple) and to look if this delta is above a certain threshold derives a trigger from the scheduling phasor (blue) which resets the carrier phase exactly to zero at the actual scheduling phasors wrap (marked by the black arrow) and schedules a window function starting from zero at exactly that moment. But within that sample frame, where the actual scheduling phasor wraps the sample value is slightly above zero, it deviates from zero by a small amount (yellow) and the ideal scheduling phasors wrap happens with a fractional offset from the actual scheduling phasors wrap.

The carrier and the window function should have a value of zero at the ideal scheduling phasors wrap to be perfectly aligned with the ideal phasor (green). The actual phasors wrap (marked with the black arrow) should therefore not reset the carrier and the window function to zero but to the fractional sub-sample offset (yellow).

1 Like