Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

About This Guide

This Application Note explains the use of the Granular Synthesis modules Audio Weaver Application.

What is Granular Synthesis used for?

Granular Synthesis or Granulation is a flexible method for creating animated sonic textures. Sounds produced by granular synthesis have an organic quality sometimes reminiscent of sounds heard in nature: the sound of a babbling brook, or leaves rustling in a tree. Forms of granular processing involving sampled sound may be used to create time stretching, time freezing, time smearing, pitch shifting and pitch smearing effects. Perceptual continua for granular sounds include gritty / smooth and dense / sparse. The metaphor of “sonic clouds” has been used to describe sounds generated using Granular Synthesis. By varying synthesis parameters over time, gestures evocative of accumulation / dispersal, and condensation / evaporation may be created.

How Does Granular Synthesis Work?

The output of a Granular Synthesizer or Granulator is a mixture of many individual grains of sound. The sonic quality of a granular texture is a result of the distribution of grains in time and of the parameters selected for the synthesis of each grain. Typically, grains are quite short in duration and are often distributed densely in time so that the resultant sound is perceived as a fused texture. Algorithmic means are usually employed to determine when grains occur in time and to select their synthesis parameters, which often include duration, amplitude, panning, pitch, and envelope shape.

...

For real-time operation, where it is necessary to schedule grains in time-sequential order, a useful concept is interonset time: the time between the onset of successive grains. When implementing Asynchronous Granular Synthesis, it is possible to generate interonset times as a function of grain density. In Pitch Synchronous Granular Synthesis, the interonset time is directly related to the period of the resultant sound.

Common Terms

Grain Length

...

Figure 2. Grain Length

  • Grains are typically between 10 and 100 msec in length.

  • In order to be heard as a pitched event, the minimum length is 13 msec for high frequencies and 45 msec for low frequencies.

  • Lengths greater than 50 msec create the impression of separate sound events.

Grain Period or interonset time

...

Figure 3. Grain Period

Grain period is typically randomized in order to avoiding any periodicity. Because grain duration and grain period are varied independently, the period may occasionally be shorter than the duration causing consecutive grains to overlap and produce a smoother texture.

Sample Offset or Play Position

...

Figure 4. Sample offset

Start point of the grain, located within the sample (aka “Position”)

Grain Pitch

Grains can also be up- or down-sampled to change their pitch.

Time Stretching or Compressing

Grains can be extracted from sound file every N samples to reconstruct the original signal (N depends on windowing function).

...

Figure 7. Time Stretching

Granular Pitch Shifting

If grains are extracted from sound file with a pitch shift factor of P, stretching the grain window to P*N and reconstructing every N samples will allow for pitch shift without change of duration.

...

Figure 8. Granular pitch shifting

Granular Synthesis Modules

Three different variations can be found in the Sound Design/Granular Synthesis folder of the Module Browser.

...

GranularSynthesisWaveFFS: Similar to the GranularSynthesisWaveRAM module except it extracts wave samples from an AWE Flash File System container.

Module variables (run time)

Common to all modules:

Grain Size

Sets the length of each grain, denoted in milliseconds

Grain Density

Sets the number of grain samples per second

PlayDir

Playback direction

0=Forward

1=Backward

2=Auto (derived from fRatio input pin)

Gain

The peak level of the window

Smoothing Time

Time constant of the pitch smoothing process

Module arguments (build time)

Common to all modules:

Max Grain Size

Max grain size in milliseconds

Max Density

Max density in grains per sec

Window Type

Selects the windowing function from these options:

If using a custom window, you can load it into Array:window_coeffs.

Image RemovedImage Added

Window Length

Defines the length of the window in samples

panModPin

Does the module display a pan mod pin?

...

Max Delay Time

Maximum delay time in msec

Mem Heap

Heap in which to allocate delay buffer memory.

Example Layouts

Scanning sections of a voice WAV file

View file
nameGranSynthWave_Scanning.zip

...

Figure 12. Wave file scanning

Tempo Changes using the Granular Synthesis Delay

View file
nameGranSynthDelay_Test_Audio_DynamicFilePos.zip

...

Figure 14. Wave Scanning Example layout

WAV loop player details

...

Figure 15. Wave Loop Player

The WAV loop player consists of a WAV file source, which outputs a fract32 to a typeConversion to float. The FIRInterp module converts the sample from 24 kHz to 48 kHz sampling rate. The DeInterleave separates the left and right channels which are added together to create a mono signal that goes on to the Granular Delay.

Tempo Shifter

The apparent shift in tempo is created by slowly changing the start point of grain playback using a slow triangle WAV LFO (Low Frequency Oscillator) that goes between 0 and 1, corresponding to the full length of the delay.

...

Figure 17. Part of the triangle LFO cycle

Pitch Control

While this layout allows you to change the apparent tempo of a sample without changing its pitch, a separate control for pitch is also available.

...

Figure 18. Pitch control

Dual Panner

...

Figure 19. Panner LFO

PeriodFuncGen2 is outputting a triangle wave that nominally goes from –1.0 to 1.0. The first ScaleOffset shifts this to 0.0 to 1.0, while the second ScaleOffset inverts that to 1.0 to 0.0, so that the two granular delay lines pan opposite each other. The rate and width of the panning can be adjusted using PeriodicFuncGen2’s inspector.

...

Figure 20. Panner LFO controls

Bypass

Each Granular Delay module has a bypass multiplexor so you can compare its output easily to the original WAV file. Unselect the “index” in the Multiplexor’s inspector to enable bypass.

...

Figure 21. Bypass multiplexor

Visualizing the granulation process

View file
nameGranSynthWave_Test_Triangle_DC.zip

...

By using a WAV file that just includes a fixed level, you can see the grain envelopes at the module’s output. Open the layout file, then open Sink2 and GranularSynthesisWaveRAM1’s inspector. Change the Grain Size, Grain Density, and gain to observe the grain shape and distribution. The pitch and filePos controls do not have any effect.

Changing grain size

With a small grain size, the grains do not overlap and you see the full window shape. As the grain size increases, so does overlap and the level goes up. Depending on the window type used, other interesting overlap effects can be seen.

...

The Rect(angular) window, on the other hand, does not overlap smoothly and goes up by a series of jumps. Note the use of the gain control to set the maximum amplitude of a grain envelope including overlap effects.

Changing grain density

...

Changing grain density using Blackman-Harris window

...

Changing grain density using Rect window

Changing gain

The gain scales each grain so that you can avoid overloading when the grains start to overlap. It does not change the shape of the grain envelope, only its level.

...

Changing the gain

Selecting a different window type

This can only be done in Design mode. Access the windowType on the Arguments tab.

...

Arguments

...

Windows Type options

References

1. Ross Bencina , “Implementing Real-Time Granular Synthesis”, 2001.

...