SlideShare a Scribd company logo
1 of 33
Download to read offline
Interactive Music II
SuperCollider入門 5
時間構造をつくる
2013年10月31日
東京藝術大学芸術情報センター(AMC)
田所 淳
今日の内容
‣ 時間構造をつくる
!

‣ エンベロープ(Envelope): 音量の時間的な変化
‣ EnvGen, Env
!

‣ スケジューリング
‣ Rutine
SuperColliderにおける時間構造
‣ ここまでは、プログラムした単体の音を鳴らすだけだった
‣ 音楽、音響作品にしていくには、音を時間構造の中で配置して
いかなくてはならない
!

‣ SuperColliderでの時間構造のとらえ方
‣ シーケンサーや、DAW(ProToolsなど)などの時間の考え方とは
異なる
‣ ロジックによる時間構造の構築 (←→ タイムライン)
‣ 時間の流れは一つとは限らない
エンベロープ (Envelope)
エンベロープ (Envelope)
‣ 音の3要素: 音高、音量、音色
!

‣ しかし、それ意外にも重要な要素がある
‣ 音の時間的な変化 → エンベロープ
!

‣ 同じ音色でも、そのエンベロープが異なると違うキャラクター
の音になる
エンベロープ (Envelope)
‣ エンベロープ

元の音

エンベロープ信号

エンベロープを適用した音
エンベロープ (Envelope)
‣ ADSR (Attack - Decay - Sustain - Release)
エンベロープ (Envelope)
‣ SuperColliderで、エンベロープを使用してみる
!

‣ Env と EnvGen を使用する
‣ Env - エンベロープの形態を定義
‣ EnvGen - Envで生成した形態で信号を生成
エンベロープ (Envelope)
‣ エンベロープ 1 - Env.linen
// Env.linen - アタック、サステイン、リリース、レベルで指定
Env.linen(0.05, 0.2, 0.5, 0.7).plot;

!

{
var env = Env.linen(0.05, 0.1, 0.5);
SinOsc.ar(440) * EnvGen.kr(env, doneAction: 2)
}.play
エンベロープ (Envelope)
‣ エンベロープ 2 - Env.perc
// Env.perk - パーカッシブなエンベロープ
Env.perc(0.01, 2.0).plot;
(
{
var env = Env.perc(0.01, 2.0);
SinOsc.ar(440) * EnvGen.kr(env, doneAction: 2)
}.play
)
エンベロープ (Envelope)
‣ エンベロープ 3 - Env.triangle
// Env.triangle - 三角形のエンベロープ
Env.triangle(1, 1).plot;
(
{
var env = Env.triangle(1, 1);
SinOsc.ar(440) * EnvGen.kr(env, doneAction: 2)
}.play
)
エンベロープ (Envelope)
‣ エンベロープ 3 - Env.sine
// Env.sine - ハニング窓
Env.sine(1, 1).plot;
(
{
var env = Env.sine(1, 1);
SinOsc.ar(440) * EnvGen.kr(env, doneAction: 2)
}.play
)
エンベロープ (Envelope)
‣ エンベロープ 4 - Env.new
// Env.new - 完全に自由なエンベロープ生成
// レベルの配列と、時間の配列で指定
Env.new([0, 1, 0.9, 0], [0.1, 0.5, 1],[-5, 0, -5]).plot;
(
{
var env = Env.new([0, 1, 0.9, 0], [0.1, 0.5, 1],[-5, 0, -5]);
SinOsc.ar(440) * EnvGen.kr(env, doneAction: 2)
}.play
)
エンベロープ (Envelope)
‣ EnvGenで指定されている doneAction:2 とは?
‣ エンベロープが終了した後に、するてつづき
‣ 1∼14まで規定されている
エンベロープ (Envelope)
‣ doneAction
!
0. do nothing when the UGen is finished
1. pause the enclosing synth, but do not free it
2. free the enclosing synth
3. free both this synth and the preceding node
4. free both this synth and the following node
5. free this synth; if the preceding node is a group then do g_freeAll on it, else free it
6. free this synth; if the following node is a group then do g_freeAll on it, else free it
7. free this synth and all preceding nodes in this group
8. free this synth and all following nodes in this group
9. free this synth and pause the preceding node
10. free this synth and pause the following node
11. free this synth and if the preceding node is a group then do g_deepFree on it, else free it
12. free this synth and if the following node is a group then do g_deepFree on it, else free it
13. free this synth and all other nodes in this group (before and after)
14. free the enclosing group and all nodes within it (including this synth)
エンベロープ (Envelope)
‣ doneAction
!
0. do nothing when the UGen is finished
1. pause the enclosing synth, but do not free it
2. free the enclosing synth → Synthを終了して開放
3. free both this synth and the preceding node
4. free both this synth and the following node
5. free this synth; if the preceding node is a group then do g_freeAll on it, else free it
6. free this synth; if the following node is a group then do g_freeAll on it, else free it
7. free this synth and all preceding nodes in this group
8. free this synth and all following nodes in this group
9. free this synth and pause the preceding node
10. free this synth and pause the following node
11. free this synth and if the preceding node is a group then do g_deepFree on it, else free it
12. free this synth and if the following node is a group then do g_deepFree on it, else free it
13. free this synth and all other nodes in this group (before and after)
14. free the enclosing group and all nodes within it (including this synth)
スケジューリング (Scheduling)
スケジューリング (Scheduling)
‣ 音楽は時間の中で展開される
‣ どのタイミングで何を行うかを、細かくコントロールする必要
がある
スケジューリング (Scheduling)
‣ Routine - ルーチン
‣ データ処理のアクション
‣ 必要なパラメータを設定し、スリープする(次のタイミングを
待つ)
‣ 他のコンピュータ言語でいうThread (スレッド) のようなもの
スケジューリング (Scheduling)
‣ Routine基本
// ! Routineをスケジューリング- 1
Routine({
!
12.do{
! arg i; // カウンタ変数

!

"Count = ".post; i.postln; // カウンタ出力
1.yield; // 1秒待つ

!
}
}).play;
!
!

‣ 実行してみる
‣ Post windowに何が表示されるか?
スケジューリング (Scheduling)
‣ Routine - 実行結果
Count
!
Count
Count
!
Count
Count
!
Count
Count
!
Count
Count
!
Count
Count
!
Count

!

=
=
=
=
=
=
=
=
=
=
=
=

0
1
2
3
4
5
6
7
8
9
10
11

‣ 1秒おきに、カウントアップする
スケジューリング (Scheduling)
‣ Routine応用 - ランダムな時間で生成
// Routineをスケジューリング - 2
r = Routine({
//待ち時間を記録する変数
var delta;
12.do {
//待ち時間、1∼5秒をランダムに生成
delta = rrand(1,5);
//メッセージを出力
"Will wait ".post; delta.postln;
//1∼5秒待つ
delta.yield;
}
}).play;
スケジューリング (Scheduling)
‣ Routineを使用して、シーケンスパターンを生成してみる
‣ まずは、エンベロープ付きのSin波の楽器を定義
‣ 定義した楽器を、Routineでくりかえし実行する
スケジューリング (Scheduling)
‣ Routine実験用のSynth singrain を定義
// Routine実験用、Synth "singrain"
(
SynthDef("singrain", {
arg freq = 440, amp = 0.2, sustain = 1;
var env, sig;
env = EnvGen.kr(Env.perc(0.01, sustain), doneAction: 2);
sig = SinOsc.ar([freq, freq * 1.01], 0, amp) * env;
Out.ar(0, sig);
}).add;
)
スケジューリング (Scheduling)
‣ Routineによるシーケンス1 - 反復
//反復して演奏
(
Routine({
loop{
Synth("singrain");
1.yield;
}
}).play;
)
スケジューリング (Scheduling)
‣ Routineによるシーケンス2 - 等比的に上昇
//等比的に上昇
(
Routine({
var freq;
24.do{
arg i;
freq = i * 1.5 * 55;
Synth("singrain", ["freq", freq]);
0.2.yield;
}
}).play;
)
スケジューリング (Scheduling)
‣ Routineによるシーケンス3 - 12音階をランダムに
//12音階をランダムに
(
Routine({
var freq;
loop{
freq = [60,61,62,63,64,65,66,67,68,69,70,71].choose.midicps;
Synth("singrain", ["freq", freq]);
0.5.yield;
}
}).play;
)
スケジューリング (Scheduling)
‣ Routineによるシーケンス4 - 音程、長さ、音量をランダムに
//音程、長さ、音量をランダムに
(
Routine({
var freq, amp, sustain;
loop{
freq = [60,61,62,63,64,65,66,67,68,69,70,71].choose.midicps;
amp = exprand(0.1, 0.5);
sustain = rrand(1, 4) * 0.5;
Synth("singrain", ["freq", freq, "amp", amp, "sustain", sustain]);
(sustain * 0.8).yield;
}
}).play;
)
スケジューリング (Scheduling)
‣ Routineによるシーケンス5 - 2つの音程
//2つの音程
(
Routine({
var freq1, freq2, amp, sustain;
loop{
freq1 = [60,61,62,63,64,65,66,67,68,69,70,71].choose.midicps;
freq2 = [60,61,62,63,64,65,66,67,68,69,70,71].choose.midicps;
amp = exprand(0.1, 0.3);
sustain = rrand(1, 4) * 0.5;
Synth("singrain", ["freq", freq1, "amp", amp, "sustain", sustain]);
Synth("singrain", ["freq", freq2, "amp", amp, "sustain", sustain]);
(sustain * 0.8).yield;
}
}).play;
)
スケジューリング (Scheduling)
‣ Routineによるシーケンス6 - 2つの音程(2)
//2つの音程 - 2
(
Routine({
var freq1, freq2, amp, sustain;
loop{
freq1 = [60,61,62,63,64,65,66,67,68,69,70,71].choose.midicps;
freq2 = freq1 * [1.0/1.0, 2.0/1.0, 3.0/2.0, 4.0/3.0, 5.0/4.0].choose;
amp = exprand(0.1, 0.3);
sustain = rrand(1, 4) * 0.5;
Synth("singrain", ["freq", freq1, "amp", amp, "sustain", sustain]);
Synth("singrain", ["freq", freq2, "amp", amp, "sustain", sustain]);
(sustain * 0.8).yield;
}
}).play;
)
スケジューリング (Scheduling)
‣ Routineによるシーケンス7 - 4つの音程
//4つの音程
(
Routine({
var note1, note2, note3, note4, amp, sustain;
loop{
note1 = [60,61,62,63,64,65,66,67,68,69,70,71].choose;
note2 = note1 + [0, 2, 4, 5, 7, 9].choose - [0, 12].choose;
note3 = note1 + [0, 2, 4, 5, 7, 9].choose - [0, 12].choose;
note4 = note1 + [0, 2, 4, 5, 7, 9].choose - [0, 12].choose;
amp = exprand(0.05, 0.2);
sustain = rrand(1, 8);
Synth("singrain", ["freq", note1.midicps, "amp", amp, "sustain",
Synth("singrain", ["freq", note2.midicps, "amp", amp, "sustain",
Synth("singrain", ["freq", note3.midicps, "amp", amp, "sustain",
Synth("singrain", ["freq", note4.midicps, "amp", amp, "sustain",
(sustain * 0.8).yield;
}
}).play;
)

sustain]);
sustain]);
sustain]);
sustain]);
スケジューリング (Scheduling)
‣ Routineによるシーケンス7 - 4つの音程2
//4つの音程2
(
Routine({
var note1, note2, note3, note4, amp, sustain;
loop{
note1 = [60,61,62,63,64,65,66,67,68,69,70,71].choose;
note2 = note1 + [0, 5, 7].choose - [0, 12].choose;
note3 = note2 + [0, 5, 7].choose - [0, 12].choose;
note4 = note3 + [0, 5, 7].choose - [0, 12].choose;
amp = exprand(0.1, 0.2);
sustain = rrand(1, 8);
Synth("singrain", ["freq", note1.midicps, "amp", amp,
Synth("singrain", ["freq", note2.midicps, "amp", amp,
Synth("singrain", ["freq", note3.midicps, "amp", amp,
Synth("singrain", ["freq", note4.midicps, "amp", amp,
(sustain * 0.8).yield;
}
}).play;
)

"sustain",
"sustain",
"sustain",
"sustain",

sustain]);
sustain]);
sustain]);
sustain]);
スケジューリング (Scheduling)
‣ Routineによるシーケンス8 - 4つの音程 x 2
//4つの音程 x 2
(
r = Routine({
var note1, note2, note3, note4, amp, sustain;
loop{
note1 = [60,61,62,63,64,65,66,67,68,69,70,71].choose;
note2 = note1 + [0, 5, 7].choose - [0, 12, 24].choose;
note3 = note2 + [0, 5, 7].choose - [0, 12, 24].choose;
note4 = note3 + [0, 5, 7].choose - [0, 12, 24].choose;
amp = exprand(0.05, 0.1);
sustain = rrand(1, 8);
Synth("singrain", ["freq", note1.midicps, "amp", amp, "sustain",
Synth("singrain", ["freq", note2.midicps, "amp", amp, "sustain",
Synth("singrain", ["freq", note3.midicps, "amp", amp, "sustain",
Synth("singrain", ["freq", note4.midicps, "amp", amp, "sustain",
(sustain * 0.8).yield;
}
});
r.play;
r.play;
)

sustain]);
sustain]);
sustain]);
sustain]);

More Related Content

What's hot

はじめようARCore:自己位置推定・平面検出・FaceTracking
はじめようARCore:自己位置推定・平面検出・FaceTrackingはじめようARCore:自己位置推定・平面検出・FaceTracking
はじめようARCore:自己位置推定・平面検出・FaceTrackingTakashi Yoshinaga
 
PHP AST 徹底解説
PHP AST 徹底解説PHP AST 徹底解説
PHP AST 徹底解説do_aki
 
Unityではじめるオープンワールド入門 アーティスト編
Unityではじめるオープンワールド入門 アーティスト編Unityではじめるオープンワールド入門 アーティスト編
Unityではじめるオープンワールド入門 アーティスト編Unity Technologies Japan K.K.
 
型安全性入門
型安全性入門型安全性入門
型安全性入門Akinori Abe
 
Constexpr 中3女子テクニック
Constexpr 中3女子テクニックConstexpr 中3女子テクニック
Constexpr 中3女子テクニックGenya Murakami
 
MVPパターンによる設計アプローチ「あなたのアプリ報連相できてますか」
MVPパターンによる設計アプローチ「あなたのアプリ報連相できてますか」MVPパターンによる設計アプローチ「あなたのアプリ報連相できてますか」
MVPパターンによる設計アプローチ「あなたのアプリ報連相できてますか」U-dai Yokoyama
 
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートIIopenFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートIIAtsushi Tadokoro
 
Pythonによる黒魔術入門
Pythonによる黒魔術入門Pythonによる黒魔術入門
Pythonによる黒魔術入門大樹 小倉
 
音声の生成と符号化
音声の生成と符号化音声の生成と符号化
音声の生成と符号化Akinori Ito
 
Behaviour Tree AI in Gentou Senki Griffon (幻塔戦記グリフォンでのBehaviour Treeの試み)
 Behaviour Tree AI in Gentou Senki Griffon (幻塔戦記グリフォンでのBehaviour Treeの試み) Behaviour Tree AI in Gentou Senki Griffon (幻塔戦記グリフォンでのBehaviour Treeの試み)
Behaviour Tree AI in Gentou Senki Griffon (幻塔戦記グリフォンでのBehaviour Treeの試み)Sindharta Tanuwijaya
 
すごい constexpr たのしくレイトレ!
すごい constexpr たのしくレイトレ!すごい constexpr たのしくレイトレ!
すごい constexpr たのしくレイトレ!Genya Murakami
 
組み込みでこそC++を使う10の理由
組み込みでこそC++を使う10の理由組み込みでこそC++を使う10の理由
組み込みでこそC++を使う10の理由kikairoya
 
Pythonが動く仕組み(の概要)
Pythonが動く仕組み(の概要)Pythonが動く仕組み(の概要)
Pythonが動く仕組み(の概要)Yoshiaki Shibutani
 
RSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjpRSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjpsonickun
 
モバイルアプリにおけるアーティストフレンドリーな水面表現戦略
モバイルアプリにおけるアーティストフレンドリーな水面表現戦略モバイルアプリにおけるアーティストフレンドリーな水面表現戦略
モバイルアプリにおけるアーティストフレンドリーな水面表現戦略Haruki Yano
 
Observableで非同期処理
Observableで非同期処理Observableで非同期処理
Observableで非同期処理torisoup
 
An Internal of LINQ to Objects
An Internal of LINQ to ObjectsAn Internal of LINQ to Objects
An Internal of LINQ to ObjectsYoshifumi Kawai
 
純粋関数型アルゴリズム入門
純粋関数型アルゴリズム入門純粋関数型アルゴリズム入門
純粋関数型アルゴリズム入門Kimikazu Kato
 
【Unity】 Behavior TreeでAIを作る
 【Unity】 Behavior TreeでAIを作る 【Unity】 Behavior TreeでAIを作る
【Unity】 Behavior TreeでAIを作るtorisoup
 
【Unite Tokyo 2018】さては非同期だなオメー!async/await完全に理解しよう
【Unite Tokyo 2018】さては非同期だなオメー!async/await完全に理解しよう【Unite Tokyo 2018】さては非同期だなオメー!async/await完全に理解しよう
【Unite Tokyo 2018】さては非同期だなオメー!async/await完全に理解しようUnity Technologies Japan K.K.
 

What's hot (20)

はじめようARCore:自己位置推定・平面検出・FaceTracking
はじめようARCore:自己位置推定・平面検出・FaceTrackingはじめようARCore:自己位置推定・平面検出・FaceTracking
はじめようARCore:自己位置推定・平面検出・FaceTracking
 
PHP AST 徹底解説
PHP AST 徹底解説PHP AST 徹底解説
PHP AST 徹底解説
 
Unityではじめるオープンワールド入門 アーティスト編
Unityではじめるオープンワールド入門 アーティスト編Unityではじめるオープンワールド入門 アーティスト編
Unityではじめるオープンワールド入門 アーティスト編
 
型安全性入門
型安全性入門型安全性入門
型安全性入門
 
Constexpr 中3女子テクニック
Constexpr 中3女子テクニックConstexpr 中3女子テクニック
Constexpr 中3女子テクニック
 
MVPパターンによる設計アプローチ「あなたのアプリ報連相できてますか」
MVPパターンによる設計アプローチ「あなたのアプリ報連相できてますか」MVPパターンによる設計アプローチ「あなたのアプリ報連相できてますか」
MVPパターンによる設計アプローチ「あなたのアプリ報連相できてますか」
 
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートIIopenFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
 
Pythonによる黒魔術入門
Pythonによる黒魔術入門Pythonによる黒魔術入門
Pythonによる黒魔術入門
 
音声の生成と符号化
音声の生成と符号化音声の生成と符号化
音声の生成と符号化
 
Behaviour Tree AI in Gentou Senki Griffon (幻塔戦記グリフォンでのBehaviour Treeの試み)
 Behaviour Tree AI in Gentou Senki Griffon (幻塔戦記グリフォンでのBehaviour Treeの試み) Behaviour Tree AI in Gentou Senki Griffon (幻塔戦記グリフォンでのBehaviour Treeの試み)
Behaviour Tree AI in Gentou Senki Griffon (幻塔戦記グリフォンでのBehaviour Treeの試み)
 
すごい constexpr たのしくレイトレ!
すごい constexpr たのしくレイトレ!すごい constexpr たのしくレイトレ!
すごい constexpr たのしくレイトレ!
 
組み込みでこそC++を使う10の理由
組み込みでこそC++を使う10の理由組み込みでこそC++を使う10の理由
組み込みでこそC++を使う10の理由
 
Pythonが動く仕組み(の概要)
Pythonが動く仕組み(の概要)Pythonが動く仕組み(の概要)
Pythonが動く仕組み(の概要)
 
RSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjpRSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjp
 
モバイルアプリにおけるアーティストフレンドリーな水面表現戦略
モバイルアプリにおけるアーティストフレンドリーな水面表現戦略モバイルアプリにおけるアーティストフレンドリーな水面表現戦略
モバイルアプリにおけるアーティストフレンドリーな水面表現戦略
 
Observableで非同期処理
Observableで非同期処理Observableで非同期処理
Observableで非同期処理
 
An Internal of LINQ to Objects
An Internal of LINQ to ObjectsAn Internal of LINQ to Objects
An Internal of LINQ to Objects
 
純粋関数型アルゴリズム入門
純粋関数型アルゴリズム入門純粋関数型アルゴリズム入門
純粋関数型アルゴリズム入門
 
【Unity】 Behavior TreeでAIを作る
 【Unity】 Behavior TreeでAIを作る 【Unity】 Behavior TreeでAIを作る
【Unity】 Behavior TreeでAIを作る
 
【Unite Tokyo 2018】さては非同期だなオメー!async/await完全に理解しよう
【Unite Tokyo 2018】さては非同期だなオメー!async/await完全に理解しよう【Unite Tokyo 2018】さては非同期だなオメー!async/await完全に理解しよう
【Unite Tokyo 2018】さては非同期だなオメー!async/await完全に理解しよう
 

More from Atsushi Tadokoro

「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望Atsushi Tadokoro
 
プログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようプログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようAtsushi Tadokoro
 
Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Atsushi Tadokoro
 
coma Creators session vol.2
coma Creators session vol.2coma Creators session vol.2
coma Creators session vol.2Atsushi Tadokoro
 
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Atsushi Tadokoro
 
Interactive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションInteractive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションAtsushi Tadokoro
 
Interactive Music II Processing基本
Interactive Music II Processing基本Interactive Music II Processing基本
Interactive Music II Processing基本Atsushi Tadokoro
 
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Atsushi Tadokoro
 
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス Atsushi Tadokoro
 
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くiTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くAtsushi Tadokoro
 
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリメディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリAtsushi Tadokoro
 
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使うAtsushi Tadokoro
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Atsushi Tadokoro
 
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得Atsushi Tadokoro
 
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングWebデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングAtsushi Tadokoro
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Atsushi Tadokoro
 
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するiTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するAtsushi Tadokoro
 
Media Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えMedia Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えAtsushi Tadokoro
 
Interactive Music II SuperCollider実習 オリジナルの楽器を作ろう!
Interactive Music II SuperCollider実習  オリジナルの楽器を作ろう!Interactive Music II SuperCollider実習  オリジナルの楽器を作ろう!
Interactive Music II SuperCollider実習 オリジナルの楽器を作ろう!Atsushi Tadokoro
 

More from Atsushi Tadokoro (20)

「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
 
プログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようプログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめよう
 
Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2
 
coma Creators session vol.2
coma Creators session vol.2coma Creators session vol.2
coma Creators session vol.2
 
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1
 
Interactive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションInteractive Music II Processingによるアニメーション
Interactive Music II Processingによるアニメーション
 
Interactive Music II Processing基本
Interactive Music II Processing基本Interactive Music II Processing基本
Interactive Music II Processing基本
 
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
 
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
 
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くiTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
 
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリメディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
 
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
 
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
 
Tamabi media131118
Tamabi media131118Tamabi media131118
Tamabi media131118
 
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングWebデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
 
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するiTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
 
Media Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えMedia Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替え
 
Interactive Music II SuperCollider実習 オリジナルの楽器を作ろう!
Interactive Music II SuperCollider実習  オリジナルの楽器を作ろう!Interactive Music II SuperCollider実習  オリジナルの楽器を作ろう!
Interactive Music II SuperCollider実習 オリジナルの楽器を作ろう!
 

Interactive Music II SuperCollider入門 5 時間構造をつくる

  • 1. Interactive Music II SuperCollider入門 5 時間構造をつくる 2013年10月31日 東京藝術大学芸術情報センター(AMC) 田所 淳
  • 2. 今日の内容 ‣ 時間構造をつくる ! ‣ エンベロープ(Envelope): 音量の時間的な変化 ‣ EnvGen, Env ! ‣ スケジューリング ‣ Rutine
  • 3. SuperColliderにおける時間構造 ‣ ここまでは、プログラムした単体の音を鳴らすだけだった ‣ 音楽、音響作品にしていくには、音を時間構造の中で配置して いかなくてはならない ! ‣ SuperColliderでの時間構造のとらえ方 ‣ シーケンサーや、DAW(ProToolsなど)などの時間の考え方とは 異なる ‣ ロジックによる時間構造の構築 (←→ タイムライン) ‣ 時間の流れは一つとは限らない
  • 5. エンベロープ (Envelope) ‣ 音の3要素: 音高、音量、音色 ! ‣ しかし、それ意外にも重要な要素がある ‣ 音の時間的な変化 → エンベロープ ! ‣ 同じ音色でも、そのエンベロープが異なると違うキャラクター の音になる
  • 7. エンベロープ (Envelope) ‣ ADSR (Attack - Decay - Sustain - Release)
  • 8. エンベロープ (Envelope) ‣ SuperColliderで、エンベロープを使用してみる ! ‣ Env と EnvGen を使用する ‣ Env - エンベロープの形態を定義 ‣ EnvGen - Envで生成した形態で信号を生成
  • 9. エンベロープ (Envelope) ‣ エンベロープ 1 - Env.linen // Env.linen - アタック、サステイン、リリース、レベルで指定 Env.linen(0.05, 0.2, 0.5, 0.7).plot; ! { var env = Env.linen(0.05, 0.1, 0.5); SinOsc.ar(440) * EnvGen.kr(env, doneAction: 2) }.play
  • 10. エンベロープ (Envelope) ‣ エンベロープ 2 - Env.perc // Env.perk - パーカッシブなエンベロープ Env.perc(0.01, 2.0).plot; ( { var env = Env.perc(0.01, 2.0); SinOsc.ar(440) * EnvGen.kr(env, doneAction: 2) }.play )
  • 11. エンベロープ (Envelope) ‣ エンベロープ 3 - Env.triangle // Env.triangle - 三角形のエンベロープ Env.triangle(1, 1).plot; ( { var env = Env.triangle(1, 1); SinOsc.ar(440) * EnvGen.kr(env, doneAction: 2) }.play )
  • 12. エンベロープ (Envelope) ‣ エンベロープ 3 - Env.sine // Env.sine - ハニング窓 Env.sine(1, 1).plot; ( { var env = Env.sine(1, 1); SinOsc.ar(440) * EnvGen.kr(env, doneAction: 2) }.play )
  • 13. エンベロープ (Envelope) ‣ エンベロープ 4 - Env.new // Env.new - 完全に自由なエンベロープ生成 // レベルの配列と、時間の配列で指定 Env.new([0, 1, 0.9, 0], [0.1, 0.5, 1],[-5, 0, -5]).plot; ( { var env = Env.new([0, 1, 0.9, 0], [0.1, 0.5, 1],[-5, 0, -5]); SinOsc.ar(440) * EnvGen.kr(env, doneAction: 2) }.play )
  • 14. エンベロープ (Envelope) ‣ EnvGenで指定されている doneAction:2 とは? ‣ エンベロープが終了した後に、するてつづき ‣ 1∼14まで規定されている
  • 15. エンベロープ (Envelope) ‣ doneAction ! 0. do nothing when the UGen is finished 1. pause the enclosing synth, but do not free it 2. free the enclosing synth 3. free both this synth and the preceding node 4. free both this synth and the following node 5. free this synth; if the preceding node is a group then do g_freeAll on it, else free it 6. free this synth; if the following node is a group then do g_freeAll on it, else free it 7. free this synth and all preceding nodes in this group 8. free this synth and all following nodes in this group 9. free this synth and pause the preceding node 10. free this synth and pause the following node 11. free this synth and if the preceding node is a group then do g_deepFree on it, else free it 12. free this synth and if the following node is a group then do g_deepFree on it, else free it 13. free this synth and all other nodes in this group (before and after) 14. free the enclosing group and all nodes within it (including this synth)
  • 16. エンベロープ (Envelope) ‣ doneAction ! 0. do nothing when the UGen is finished 1. pause the enclosing synth, but do not free it 2. free the enclosing synth → Synthを終了して開放 3. free both this synth and the preceding node 4. free both this synth and the following node 5. free this synth; if the preceding node is a group then do g_freeAll on it, else free it 6. free this synth; if the following node is a group then do g_freeAll on it, else free it 7. free this synth and all preceding nodes in this group 8. free this synth and all following nodes in this group 9. free this synth and pause the preceding node 10. free this synth and pause the following node 11. free this synth and if the preceding node is a group then do g_deepFree on it, else free it 12. free this synth and if the following node is a group then do g_deepFree on it, else free it 13. free this synth and all other nodes in this group (before and after) 14. free the enclosing group and all nodes within it (including this synth)
  • 18. スケジューリング (Scheduling) ‣ 音楽は時間の中で展開される ‣ どのタイミングで何を行うかを、細かくコントロールする必要 がある
  • 19. スケジューリング (Scheduling) ‣ Routine - ルーチン ‣ データ処理のアクション ‣ 必要なパラメータを設定し、スリープする(次のタイミングを 待つ) ‣ 他のコンピュータ言語でいうThread (スレッド) のようなもの
  • 20. スケジューリング (Scheduling) ‣ Routine基本 // ! Routineをスケジューリング- 1 Routine({ ! 12.do{ ! arg i; // カウンタ変数 ! "Count = ".post; i.postln; // カウンタ出力 1.yield; // 1秒待つ ! } }).play; ! ! ‣ 実行してみる ‣ Post windowに何が表示されるか?
  • 21. スケジューリング (Scheduling) ‣ Routine - 実行結果 Count ! Count Count ! Count Count ! Count Count ! Count Count ! Count Count ! Count ! = = = = = = = = = = = = 0 1 2 3 4 5 6 7 8 9 10 11 ‣ 1秒おきに、カウントアップする
  • 22. スケジューリング (Scheduling) ‣ Routine応用 - ランダムな時間で生成 // Routineをスケジューリング - 2 r = Routine({ //待ち時間を記録する変数 var delta; 12.do { //待ち時間、1∼5秒をランダムに生成 delta = rrand(1,5); //メッセージを出力 "Will wait ".post; delta.postln; //1∼5秒待つ delta.yield; } }).play;
  • 23. スケジューリング (Scheduling) ‣ Routineを使用して、シーケンスパターンを生成してみる ‣ まずは、エンベロープ付きのSin波の楽器を定義 ‣ 定義した楽器を、Routineでくりかえし実行する
  • 24. スケジューリング (Scheduling) ‣ Routine実験用のSynth singrain を定義 // Routine実験用、Synth "singrain" ( SynthDef("singrain", { arg freq = 440, amp = 0.2, sustain = 1; var env, sig; env = EnvGen.kr(Env.perc(0.01, sustain), doneAction: 2); sig = SinOsc.ar([freq, freq * 1.01], 0, amp) * env; Out.ar(0, sig); }).add; )
  • 25. スケジューリング (Scheduling) ‣ Routineによるシーケンス1 - 反復 //反復して演奏 ( Routine({ loop{ Synth("singrain"); 1.yield; } }).play; )
  • 26. スケジューリング (Scheduling) ‣ Routineによるシーケンス2 - 等比的に上昇 //等比的に上昇 ( Routine({ var freq; 24.do{ arg i; freq = i * 1.5 * 55; Synth("singrain", ["freq", freq]); 0.2.yield; } }).play; )
  • 27. スケジューリング (Scheduling) ‣ Routineによるシーケンス3 - 12音階をランダムに //12音階をランダムに ( Routine({ var freq; loop{ freq = [60,61,62,63,64,65,66,67,68,69,70,71].choose.midicps; Synth("singrain", ["freq", freq]); 0.5.yield; } }).play; )
  • 28. スケジューリング (Scheduling) ‣ Routineによるシーケンス4 - 音程、長さ、音量をランダムに //音程、長さ、音量をランダムに ( Routine({ var freq, amp, sustain; loop{ freq = [60,61,62,63,64,65,66,67,68,69,70,71].choose.midicps; amp = exprand(0.1, 0.5); sustain = rrand(1, 4) * 0.5; Synth("singrain", ["freq", freq, "amp", amp, "sustain", sustain]); (sustain * 0.8).yield; } }).play; )
  • 29. スケジューリング (Scheduling) ‣ Routineによるシーケンス5 - 2つの音程 //2つの音程 ( Routine({ var freq1, freq2, amp, sustain; loop{ freq1 = [60,61,62,63,64,65,66,67,68,69,70,71].choose.midicps; freq2 = [60,61,62,63,64,65,66,67,68,69,70,71].choose.midicps; amp = exprand(0.1, 0.3); sustain = rrand(1, 4) * 0.5; Synth("singrain", ["freq", freq1, "amp", amp, "sustain", sustain]); Synth("singrain", ["freq", freq2, "amp", amp, "sustain", sustain]); (sustain * 0.8).yield; } }).play; )
  • 30. スケジューリング (Scheduling) ‣ Routineによるシーケンス6 - 2つの音程(2) //2つの音程 - 2 ( Routine({ var freq1, freq2, amp, sustain; loop{ freq1 = [60,61,62,63,64,65,66,67,68,69,70,71].choose.midicps; freq2 = freq1 * [1.0/1.0, 2.0/1.0, 3.0/2.0, 4.0/3.0, 5.0/4.0].choose; amp = exprand(0.1, 0.3); sustain = rrand(1, 4) * 0.5; Synth("singrain", ["freq", freq1, "amp", amp, "sustain", sustain]); Synth("singrain", ["freq", freq2, "amp", amp, "sustain", sustain]); (sustain * 0.8).yield; } }).play; )
  • 31. スケジューリング (Scheduling) ‣ Routineによるシーケンス7 - 4つの音程 //4つの音程 ( Routine({ var note1, note2, note3, note4, amp, sustain; loop{ note1 = [60,61,62,63,64,65,66,67,68,69,70,71].choose; note2 = note1 + [0, 2, 4, 5, 7, 9].choose - [0, 12].choose; note3 = note1 + [0, 2, 4, 5, 7, 9].choose - [0, 12].choose; note4 = note1 + [0, 2, 4, 5, 7, 9].choose - [0, 12].choose; amp = exprand(0.05, 0.2); sustain = rrand(1, 8); Synth("singrain", ["freq", note1.midicps, "amp", amp, "sustain", Synth("singrain", ["freq", note2.midicps, "amp", amp, "sustain", Synth("singrain", ["freq", note3.midicps, "amp", amp, "sustain", Synth("singrain", ["freq", note4.midicps, "amp", amp, "sustain", (sustain * 0.8).yield; } }).play; ) sustain]); sustain]); sustain]); sustain]);
  • 32. スケジューリング (Scheduling) ‣ Routineによるシーケンス7 - 4つの音程2 //4つの音程2 ( Routine({ var note1, note2, note3, note4, amp, sustain; loop{ note1 = [60,61,62,63,64,65,66,67,68,69,70,71].choose; note2 = note1 + [0, 5, 7].choose - [0, 12].choose; note3 = note2 + [0, 5, 7].choose - [0, 12].choose; note4 = note3 + [0, 5, 7].choose - [0, 12].choose; amp = exprand(0.1, 0.2); sustain = rrand(1, 8); Synth("singrain", ["freq", note1.midicps, "amp", amp, Synth("singrain", ["freq", note2.midicps, "amp", amp, Synth("singrain", ["freq", note3.midicps, "amp", amp, Synth("singrain", ["freq", note4.midicps, "amp", amp, (sustain * 0.8).yield; } }).play; ) "sustain", "sustain", "sustain", "sustain", sustain]); sustain]); sustain]); sustain]);
  • 33. スケジューリング (Scheduling) ‣ Routineによるシーケンス8 - 4つの音程 x 2 //4つの音程 x 2 ( r = Routine({ var note1, note2, note3, note4, amp, sustain; loop{ note1 = [60,61,62,63,64,65,66,67,68,69,70,71].choose; note2 = note1 + [0, 5, 7].choose - [0, 12, 24].choose; note3 = note2 + [0, 5, 7].choose - [0, 12, 24].choose; note4 = note3 + [0, 5, 7].choose - [0, 12, 24].choose; amp = exprand(0.05, 0.1); sustain = rrand(1, 8); Synth("singrain", ["freq", note1.midicps, "amp", amp, "sustain", Synth("singrain", ["freq", note2.midicps, "amp", amp, "sustain", Synth("singrain", ["freq", note3.midicps, "amp", amp, "sustain", Synth("singrain", ["freq", note4.midicps, "amp", amp, "sustain", (sustain * 0.8).yield; } }); r.play; r.play; ) sustain]); sustain]); sustain]); sustain]);