18. 5 different example using argument with Mix and Array

//1
(
a={|freq = 1000, decaytime = 0.5, mul = 0.5|

        {Ringz.ar(WhiteNoise.ar(0.05),freq.rand,decaytime,mul)
        }!4
        }
)
{a.value}.scope
{a.value(500)}.scope
{a.value(freq:500, mul:0.5.rand)}.scope

//2
(
b={|size = 2, density=100, freq=1,decaytime = 2, mul=0.1, mul2=0.5|
                        Mix.fill(size,{Ringz.ar(Dust.ar(density,mul/size)
                                                 +
                                                SinOsc.ar(freq,0,mul2/size))
                                                }
                                        )!4
        }
)
{b.value}.scope
{b.value(density:10)}.scope                
{b.value(freq:1000.0.rand,mul2:0.005)}.scope

//3        
(
c={|size = 2, density=100, freq=1,min=100,max=4000, mul=0.05|
                        Mix.fill(size,
                                                {Saw.ar(exprand(min,max)
                                                 +
                                                SinOsc.kr(freq,0,mul)*(0.1/size))
                                                })
        }
)

(
c={|size = 2, density=100, freq=1,min=100,max=4000, mul=0.05|
                        Mix.fill(size,
                                                {Saw.ar(exprand(min,max))
                                                 +
                                                SinOsc.ar(freq,0,mul)
                                                *(0.1/size)
                                                })!8
        }
)
{c.value}.scope
{c.value(freq:5,mul:0.3)}.scope
{c.value(min:100,max:5000.0.rand,mul:0.05)}.scope

//4-correct
(
d={| size=2,den=0.005, freq=100, sinmul=1000,sinadd=1100|
                Mix.fill(size,{WhiteNoise.ar(den)
                                                +
                                                Saw.ar(
                                                Array.fill(5,{SinOsc.kr(freq.rand,0,sinmul,sinadd)
                                                })*0.1/5)                        
                                                }*0.1/size)!2
                                                }
)
//correct
(
d={| size=2,den=0.005, freq=100, sinmul=500,sinadd=1000|
                Mix.fill(size,{WhiteNoise.ar(den)
                                                +
                                        Saw.ar(Array.fill(
                                                                          5,{
                                                                        Saw.ar(freq.rand,sinmul.rand,sinadd)
                                                                                }*0.1/5
                                                                          )
                                                        )*0.1/size
                                                }
                                )!2
        }
)
(
a={Array.fill(3,{SinOsc.ar([220,440,660].choose,0,[0.1,0.3,0.2].choose)})}
)
{a.value}.scope
{d.value}.scope
{d.value(freq:20)}.scope
{d.value(den:0.001,sinmul:500.rand,sinadd:exprand(510,2000))}.scope

//5-correct
(
e={| size=2, den=10, freq=1000|
                Mix.fill(size,{Dust.ar(den,0.2)
                                                +
                                                SinOsc.ar(Array.fill(8,
                                                                                {SinOsc.kr(freq,0,100,1000)}
                                                ))}*0.1/size)!2
                                                }
)
{e.value}.scope
{e.value(den:1000.0.rand, freq:10.0.rand)}.scope
//6
(
f={|den=0.5, freq=1000, ffreq=1000,mul=0.5|
                Mix([WhiteNoise.ar(den),
                     Resonz.ar(Saw.ar(SinOsc.kr(freq,0,0.5)),
                                                ffreq,exprand(0.1,1.0),mul)
                                                ])!2
                                                }
)
{f.value}.scope
{f.value(den:0.1,ffreq:4000.0.rand)}.scope

//——————————————
http://csound.x-y.net
Ji Youn Kang,
Csound Max Community

Leave a Comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.