SuperCollider サンプル1 解析
// modulate a sine frequency and a noise amplitude with another sineあれ、今回セミコロンなくてもどうにかなった...ま、いっか。
// whose frequency depends on the horizontal mouse pointer position
{
var x = SinOsc.ar(MouseX.kr(1, 100));
SinOsc.ar(300 * x + 800, 0, 0.1)
+
PinkNoise.ar(0.1 * x + 0.1)
}.play;
http://doc.sccode.org/Classes/SinOsc.html
SinOsc.ar(freq: 440, phase: 0, mul: 1, add: 0)
SinOsc.kr(freq: 440, phase: 0, mul: 1, add: 0)
Arguments:ar krってなんだ?
freq :Frequency in Hertz. Sampled at audio-rate.
phase:Phase in radians. Sampled at audio-rate.
NOTE: phase values should be within the range +-8pi. If your phase values are larger then simply use .mod(2pi) to wrap them.
mul:Output will be multiplied by this value.
add: This value will be added to the output.
http://sound.jp/supako/x/sc2/text/tutorial2.html
よくわからないけど、
ar:オーディオ・レイトで動作するメッセージ
kr:コントロール・レイトで動作するメッセージ
で、ユニットジェネレータを作るらしい
追記:なんで、コントロールはcrじゃないの?とか思ったけど、ひょっとしてドイツ語?Jamesさんがドイツ人とはどこにも書いてないんだけど...
追記:なんで、コントロールはcrじゃないの?とか思ったけど、ひょっとしてドイツ語?Jamesさんがドイツ人とはどこにも書いてないんだけど...
UGen(Unit Generator)クラスのサブクラスとしてユニットジェネレータは定義される
ということになるらしい、arの方が処理が重く、krの方が理論的には1/64くらいとのこと
このページいいなぁ。けど、後回し。
http://doc.sccode.org/Classes/PinkNoise.html
PinkNoise.ar(mul: 1, add: 0)http://doc.sccode.org/Classes/MouseX.html
From superclass: WhiteNoise
PinkNoise.kr(mul: 1, add: 0)
From superclass: WhiteNoise
Arguments:
mul:Output will be multiplied by this value.
add:This value will be added to the output.
MouseX.kr(minval: 0, maxval: 1, warp: 0, lag: 0.2)
Arguments:
minval:Value corresponding to the left edge of the screen.
maxval:Value corresponding to the right edge of the screen.
warp :Mapping curve. 0 is linear, 1 is exponential (e. g. for freq or times). Alternatively you can specify: 'linear' or 'exponential'.
lag:Lag factor to dezipper cursor movement.ってことで、改めて
var x = SinOsc.ar(MouseX.kr(1, 100));
SinOsc.ar(300 * x + 800, 0, 0.1)
+
PinkNoise.ar(0.1 * x + 0.1)
は、何かっていうと、
xという変数に、マウスのx位置情報を拾って来て、サイン波を生成。
それに応じて、
800Hz基準に上下するサイン波のうねうね
と
ピンクノイズ
を作って、再生せよ。
ってことになるかと...
P.S.素直にGetting Started tutorial seriesを見れば良い気もするが、とりあえず、もう一つやってみよう。・
コメント
コメントを投稿