TGrains2:
Filter:
sc3-plugins/Classes (extension) | UGens > Buffer | UGens > Generators > Granular

TGrains2
ExtensionExtension

buffer granulator with linear att/dec

Description

Triggers generate grains from a buffer. Each grain has a linear and is panned between two channels of multiple outputs.

Class Methods

.ar

Arguments:

numChannels

number of output channels.

trigger

at each trigger, the following arguments are sampled and used as the arguments of a new grain. A trigger occurs when a signal changes from <= 0 to > 0. If the trigger is audio rate then the grains will start with sample accuracy.

bufnum

the index of the buffer to use. It must be a one channel (mono) buffer.

rate

1.0 is normal, 2.0 is one octave up, 0.5 is one octave down. -1.0 is backwards normal rate ... etc. Unlike PlayBuf, the rate is multiplied by BufRate, so you needn't do that yourself.

centerPos

the position in the buffer in seconds at which the grain envelope will reach maximum amplitude.

dur

duration of the grain in seconds.

pan

determines where to pan the output.

  • If numChannels = 1, the pan argument is ignored.
  • If numChannels = 2, panning is similar to Pan2.
  • If numChannels > 2, panning is the same as PanAz.
amp

amplitude of the grain.

att

attack time of grain in seconds.

dec

decay time of grain in seconds.

interp

1, 2, or 4. Determines whether the grain uses (1) no interpolation, (2) linear interpolation, or (4) cubic interpolation.

Examples