TITLE:: SinGrain
summary:: Granular synthesis with sinusoidal grains
categories:: Libraries>JoshUGens, UGens>GranularSynthesis
related:: Classes/SinGrainI, Classes/SinGrainB, Classes/SinGrainBF, Classes/SinGrainBBF, Classes/SinGrainIBF
DESCRIPTION::


CLASSMETHODS::

METHOD:: ar

ARGUMENT:: trigger
A kr or ar trigger to start a new grain. If ar, grains after the start of the synth are sample accurate.

ARGUMENT:: dur
Size of the grain. Polled at creation time.

ARGUMENT:: freq
The freq of the grain generators internal oscillator. Polled at creation time.

ARGUMENT:: mul

ARGUMENT:: add

INSTANCEMETHODS::


EXAMPLES::

code::
s.boot;

(
	SynthDef(\sin_grain_test, {arg gate = 1, amp = 1;
	Out.ar(0,
		SinGrain.ar(Impulse.kr(10), 0.2, WhiteNoise.kr.range(440, 880),
			EnvGen.kr(
				Env([0, 1, 0], [1, 1], \sin, 1),
				gate,
				levelScale: amp,
				doneAction: 2)
			)
		)
	}).add;
)

s.sendMsg(\s_new, \sin_grain_test, a=s.nextNodeID, 0, 1, \amp, 0.2);
s.sendMsg(\n_set, a, \gate, 0);
::
