1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
class:: VOSIM
summary:: vosim pulse generator
categories:: UGens>Generators
classmethods::
method:: ar
argument:: trig
[ar kr] starts a vosim pulse when a transition from non-positive to positive occurs and no other vosim is still going.
audio rate input will produce sample accurate triggering.
argument:: freq
[ar kr]
the frequency of the squared sinewave.
argument:: nCycles
the number of squared sinewaves to use in one vosim pulse.
nCycles gets checked when VOSIM receives a trigger.
argument:: decay
the decay factor.
examples::
code::
s.boot;
z = {VOSIM.ar(Impulse.ar(100), MouseX.kr(440, 880, 1), 3, 0.99)}.play;
z.free;
(
z = {
var p,t,f,n,d,a,l,x,y,z,x_,y_;
p = TRand.ar(0.0,1.0,Impulse.ar(6.0));
t = Impulse.ar(9*(1+(p>0.95)));
f = TRand.ar([40.0,120.0,220.0],[440.0,990.0,880.0],t);
n = TRand.ar(4.0,[8.0, 16.0, 32.0],t);
d = TRand.ar([0.2,0.4,0.6],[0.6, 0.8, 1.0],t);
a = TRand.ar(0.0,[0.2, 0.6, 1.0],t);
l = TRand.ar(-1.0,1.0,t);
x = MouseX.kr(0.25,2.0);
y = MouseY.kr(0.25,1.5);
z = 9.0;
x_ = x * LFNoise2.kr(z).range(0.25,2.0);
y_ = y * LFNoise2.kr(z).range(0.25,2.0);
Out.ar(0, Pan2.ar(Mix.ar(VOSIM.ar(t, f*x_, n, d*y_) * a),l,1));
}.play;
)
z.free;
::
|