This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ドラムのハイハットをシンセで作る | |
| SynthDef オブジェクトでシンセサイザーをつくる | |
| SynthDef の引数は | |
| SynthDef(シンセの名前, 関数).add; // .add で定義をサーバに送る | |
| シンセの名前は String オブジェクト "I am SuperCollider" など | |
| あるいは Symbol オブジェクト \iamSuperCollider などを使って書く | |
| Symbol は空白を使えない | |
| () 内を選択後、実行 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // サーバの起動 | |
| // 下の行にカーソルを置き、実行 | |
| s.boot; | |
| /* | |
| 「クライアント」から「サーバ」へ命令が行って | |
| サーバが起動し、ポストウィンドウに文字が出力される | |
| ここでは s がサーバで、.boot メッセージを送ることで起動する | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { } カーリーブラッケットは関数 | |
| 関数の中で、音の鳴り方や、計算などができる | |
| f = {}; | |
| SC では、小文字のアルファベットは、変数(関数や値などを格納する) | |
| デフォルトで s にはサーバが格納されている | |
| s.boot; // サーバ起動 | |
| s.isKindOf(Server); // s はサーバですか? yes -> true, no -> false が出力 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // はコメント | |
| /* は複数行に | |
| わたる | |
| コメント */ | |
| // 1 + 1; コメントは実行すると常に Nil (無)値が返ってくる | |
| 下記を実行 | |
| 1 + 2 // + 1 プログラムに影響しない |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SC は音を鳴らす「サーバ」と、 | |
| サーバへ命令やリクエストを送る「クライアント」の二つのプログラムからなる |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| キーボードによるプログラムの実行方法は OS (macOS/Windows/Linux) によって違う | |
| macOS cmd + return | |
| Windows & Linux ctrl + return | |
| 下の行にカーソルを置き、実行する | |
| 1 + 2; | |
| ポストウィンドウに計算結果が出力される |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 関数で音を鳴らす | |
| f = { SinOsc.ar * 0.1 }; | |
| // 実行 -> 音が鳴る | |
| f.play; | |
| 音を止める | |
| macOS cmd + ピリオド | |
| Windows & Linux ctrl + ピリオド |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SC では全てがオブジェクトです。 | |
| オブジェクトとは「もの」です。 | |
| 具体的にはどんな「もの」でもない、抽象的な「もの」で、 | |
| プログラムはオブジェクト同士のメッセージのやりとり、相互作用で表現されます。 | |
| オブジェクトですか? | |
| 1.5.isKindOf(Object); // true | |
| {}.isKindOf(Object); // true | |
| 抽象的な「もの」オブジェクトから |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Stream はオブジェクトのストリーム(流れ)で .next メッセージを受け「流れる」 | |
| Pattern はストリームの設計図 | |
| パターンオブジェクトのひとつ Pseries を使って | |
| 0から始まり、2ずつ増える、5個のストリームをつくる | |
| p = Pseries(0, 2, 5).asStream; | |
| p.next; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Pbind シンセ生成と引数にわたすストリームを bind (結びつけ) | |
| 音楽のフレーズの生成を可能にする | |
| Pbind(\instrument, シンセの名前, 引数名、値、引数名、値…).play; | |
| 先につくったハイハットのシンセ | |
| ( | |
| SynthDef(\hat, {| amp=0.1, pan=0 | | |
| var sig, env; | |
| env = EnvGen.kr(Env.perc(0, 0.03), 1, amp, doneAction: 2); |
OlderNewer