Classes (extension) |

BufGrainI : JoshGrain : UGen : AbstractFunction : ObjectExtension

Granular synthesis with sound sampled in a buffer and user supplied envelopes

Class Methods

BufGrainI.ar(trigger: 0, dur: 1, sndbuf, rate: 1, pos: 0, envbuf1, envbuf2, ifac: 0.5, interp: 2, mul: 1, add: 0)

Arguments:

 trigger A kr or ar trigger to start a new grain. If ar, grains after the start of the synth are sample accurate. The following args are polled at grain creation time. dur Size of the grain. sndbuf The buffer holding an audio signal. rate The playback rate of the sampled sound. pos The playback position for the grain to start with (0 is beginning, 1 is end of file). envbuf1 A buffer with a stored signal to be used for the envelope of the grain. envbuf2 A buffer with a stored signal to be used for the envelope of the grain. ifac An interpolation factor. interpolates between the two envelopes where 0 is all envbuf1, and 1 is all envbuf2. interp The kind of interpolation for the sampled sound in the grain (1 - none, 2 - linear, 4 - cubic). mul add

Examples

s.boot;

(
SynthDef(\buf_grain_test, {arg gate = 1, sndbuf, amp = 1, envbuf1, envbuf2;
Out.ar(0,
BufGrainI.ar(Impulse.kr(10), 0.2, sndbuf, MouseX.kr(0.5, 8), PinkNoise.kr.range(0, 1),
envbuf1, envbuf2, MouseY.kr(0, 1), 2,
EnvGen.kr(
Env([0, 1, 0], [1, 1], \sin, 1),
gate,
levelScale: amp,
doneAction: 2)
)
)
s.sendMsg(\b_free, x);