Csound Basics: Simple Granular

This basic level of understanding can result in a lot more interesting sounds when we use a more complex signal generating opcode and use individual envelope generators to dynamically alter the parameters during the course of the note - to "tweak" them. Figure 5 is a block diagram for a simple granular synthesis instrument in which the grain parameters, (pitch, grain density, grain duration, etc.), are dynamically modified by linear and exponential envelopes.


[index] [prev] [next]


[+] Home
[+] Tutorials

Figure 5: Morphing granular synthesis instrument with
envelope control of many parameters.

In the Csound .orc file, this instrument would be defined as follows:

Figure 6: Granular synthesizer with k2-k6 envelope controls of grain parameters.

In our simple granular instrument, see how the amplitude of the grain opcode is set to a constant by p4 and its audio output is "patched" into the amplitude argument of an a-rate linen where it is shaped by the attack and release settings in p7 and p8. This is an example of just another way that we could apply an envelope to a signal - we could modify the amplitude argument of a parameter or we could modify the output of an opcode. Both would have the same result. The score file for our dynamic granular synthesis instrument is show in figure 7.

Figure 7: Score file for a simple morphing granular synthesizer.

In our design we use line and expon opcodes to move from one level to another during the note. In the first note we move from a grain density of 12000 per second to 4000 per second (p10 -> p11). In the second note we sweep the same parameters from 5 to 200. In the first note we alter the grain duration from 100ms to 10ms (p16 -> p17) and in the second from 1 second to 10ms duration. The result is two evolving "clouds" that are quite different in "shape" and character.

  [next] Csound Basics: MIDI Granular