FMGrainBF granular synthesis with FM grains and Ambisonic panning


 *ar(trigger, dur, carfreq, modfreq, index,  azimuth, elevation, rho, mul, add) 


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.

carfreq - the carrier freq of the grain generators internal oscillator

modfreq - the modulating freq of the grain generators internal oscillator

index - the index of modulation

azimuth -  in radians, -pi to pi

elevation -  in radians, -0.5pi to +0.5pi

rho - the speaker radius (1 places shound at the radius, <1 within the radius, >1 is outside the radius)

beyond the radius, nothing happens.

Examples:


s.boot;


SynthDef(\fm_grain_test, {arg gate = 1, amp = 1;

var w, x, y, z;

#w, x, y, z = FMGrainBF.ar(Impulse.kr(10), 0.2, WhiteNoise.kr.range(440, 880), 200, 

LFNoise1.kr(1).range(1, 10), WhiteNoise.kr.range(-0.25pi, 0.25pi), 0, 1,

EnvGen.kr(

Env([0, 1, 0], [1, 1], \sin, 1),

gate,

levelScale: amp,

doneAction: 2));

Out.ar(0, DecodeB2.ar(4, w, x, y));

}).load(s);

s.sendMsg(\s_new, \fm_grain_test, a=s.nextNodeID, 0, 1, \amp, 0.2);

s.sendMsg(\n_set, a, \gate, 0);