SlideShare uma empresa Scribd logo
1 de 45
Baixar para ler offline
// Hello World
quot;Hello World!quot;.postln;

                  enter     (return   )


// ( )
(
	   quot;Hello World!quot;.postln;
	   quot;Hello SuperColliderquot;.postln;
)
//
quot;Hello Worldquot;.postln;

//
f = { 1 + 1 };
f.value;

//
f = { arg a, b; a + b; };
f.value(2, 3);

//
x = [1, 2, 3];
x.postln;

//
{ SinOsc.ar( 440, 660], 0, 0.2) }.play;
//
f = { 1 + 1 };
f.value;

//
f = { arg a, b; a + b; };
f.value(2, 3);

//
f={
	   arg a, b;
	   var firstResult, finalResult;
	   firstResult = a + b;
	   finalResult = firstResult * 2;
	   finalResult;
};
f.value(2, 3); 	 // (2 + 3) * 2 = 10
// 440HZ       0.2
{ SinOsc.ar(440, 0, 0.2) }.play;

//
(
{	 	       	   	     //
	    SinOsc.ar(	     //                      (.ar)
	    440, 	    	     //              440HZ
	    0, 	 	    	     //          0
	    0.2) 	    	     //          0.2
}	   	     	   	     //
.play;	 	      	     // 'play'
)
//
f = { SinOsc.ar(440, 0, 0.2) };
f.play;

//
x = {arg freq=440; SinOsc.ar(freq, 0, 0.2)}.play;
x.set(freq, 880);
x.free;

//       (    2ch)
{ SinOsc.ar([440, 660], 0, 0.2) }.play;

x = {arg freq=440; SinOsc.ar([freq, freq+5], 0, 0.2)}.play;
x.set(freq, 880);
x.set(freq, 80);
x.free;
//
{ SinOsc.ar(440, 0, 0.2) }.play;
	
//SynthDef
SynthDef.new(quot;SinOsc_testquot;,
	   { Out.ar(0, SinOsc.ar(440, 0, 0.2)) }).play;

//                   +2ch
(
SynthDef.new(quot;SinOsc-stereoquot;, {
	 var outArray;
	 outArray = [SinOsc.ar(440, 0, 0.2), SinOsc.ar(442, 0, 0.2)];
	 Out.ar(0, outArray)
}).play;
)
//
Server.default = Server.internal;
s = Server.default;
s.boot;

(
SynthDef.new(quot;SinOsc-stereo-argsquot;, {
	 arg freq=440, mul=0.2;
	 var outArray;
	 outArray = [SinOsc.ar(freq, 0, mul), SinOsc.ar(freq+2, 0, mul)];
	 Out.ar(0, outArray)
}).send(s);
)

x = Synth.new(quot;SinOsc-stereo-argsquot;);
x.set(quot;freqquot;, 660);
x.set(quot;mulquot;, 0.2);
x.set(quot;freqquot;, 100, quot;mulquot;, 0.5);
x.free;
//        quot;myServerquot;   IP:127.0.0.1 port:12000
s = Server(quot;myServerquot;, NetAddr(quot;127.0.0.1quot;, 12000));	    	
s.boot;
//OSC
s.dumpOSC(1);
//SynthDef
(
SynthDef.new(quot;sine-stereoquot;, {
	   arg freq=440, mul=0.2;
	   var outArray;
	   outArray = [SinOsc.ar(freq, 0, mul), SinOsc.ar(freq+2, 0, mul)];
	   Out.ar(0, outArray)
}).send(s);
)
//OSC              quot;sine-stereoquot; SyhtDef
s.sendMsg(quot;s_newquot;, quot;sine-stereoquot;, s.nextNodeID, 0, 1);
//
s.sendMsg(quot;/n_freequot;, n);
//
s.quit;
//SC            Sin          sine-stereo


//       quot;myServerquot;    IP:127.0.0.1 port:12000
s = Server(quot;myServerquot;, NetAddr(quot;127.0.0.1quot;, 12000));
s.boot;

//OSC
s.dumpOSC(1);

//SynthDef
(
SynthDef.new(quot;sine-stereoquot;, {
	 arg freq=440, mul=0.2;
	 var outArray;
	 outArray = [SinOsc.ar(freq, 0, mul), SinOsc.ar(freq+2, 0, mul)];
	 Out.ar(0, outArray)
}).send(s);
)
//           quot;myServerquot;    IP:127.0.0.1 port:12000
s = Server(quot;myServerquot;, NetAddr(quot;127.0.0.1quot;, 12000));
s.boot;

//OSC
s.dumpOSC(1);

//SynthDef
(
SynthDef(quot;          quot;, {
	   arg note = 36, fc = 1000, rq = 25, bal=0, amp= -20, gate = 1;
	   var x;
	   x = Mix.fill(4, {
	   	   LFSaw.ar((note + {0.1.rand2}.dup).midicps, 0, 0.02)
	   });
	   x = RLPF.ar(x, fc, rq/100).softclip;
	   x = RLPF.ar(x, fc, rq/100, amp.dbamp).softclip;
	   x = Balance2.ar(x[0], x[1], bal);
	   x = x * EnvGen.kr(Env.cutoff, gate, doneAction: 2);
	   Out.ar(0, x);
	   }
).load(s);
)
import oscP5.*;
import netP5.*;

OscP5 oscP5;
NetAddress myRemoteLocation;

Ring[] rings;
int numRings = 50;
int currentRing = 0;
int synthId = 1;

void setup() {
    size(400, 400);
    colorMode(HSB, 360, 100, 100, 100);
    frameRate(30);
    oscP5 = new OscP5(this,12000);
    myRemoteLocation = new NetAddress(quot;127.0.0.1quot;,12000);
    colorMode(HSB, 360, 100, 100, 100);
    smooth();
    rings = new Ring[numRings];
    for(int i = 0; i < numRings; i++){
        rings[i] = new Ring();
    }
}
void draw(){
    background(0);
    for(int i = 0; i < numRings; i++){
        rings[i].grow();
        rings[i].display();
    }
}
void mousePressed(){
    //OSC
    OscMessage myMessage = new OscMessage(quot;/s_newquot;);
    myMessage.add(quot;env-sinequot;);
    myMessage.add(synthId);
    myMessage.add(1);
    myMessage.add(0);
    myMessage.add(quot;freqquot;);
    myMessage.add((height - mouseY) * 10);
    myMessage.add(quot;detunequot;);
    myMessage.add(((width/2) - mouseX)/30);
    oscP5.send(myMessage, myRemoteLocation);
    synthId++;

    rings[currentRing].start(mouseX, mouseY);
    currentRing++;
    if(currentRing >= numRings){
        currentRing = 0;
    }
}
class Ring {
	   float x, y;
	   float diameter;
	   boolean on = false;
	   color col;
	
	   void start(float _x, float _y){
	   	      x = _x;
	   	      y = _y;
	   	      on = true;
	   	      diameter = 1;
	   	      col = color(random(360), 50, 100, 50);
	   }
	
	   void grow() {
	   	      if(on) {
	   	      	    diameter++;
	   	      	    if(diameter > 1000){
	   	      	    	     on = false;
	   	      	    }
	   	      }
	   }
void display(){
	   	      if(on){
	   	      	    noFill();
	   	      	    stroke(col);
	   	      	    strokeWeight(4);
	   	      	    ellipse(x, y, diameter, diameter);
	   	      }
	   }
}
//       quot;myServerquot;    IP:127.0.0.1 port:12000
s = Server(quot;myServerquot;, NetAddr(quot;127.0.0.1quot;, 12000));
s.boot;

//OSC
s.dumpOSC(1);

//              sin
(
SynthDef(quot;env-sinequot;, { arg freq = 880, amp=0.125, detune=0;
	 var env, x;
	 env = EnvGen.kr(Env.perc(0.001,20,1,-4), doneAction: 2);
	 x = env * SinOsc.ar([freq, freq+detune],0, amp);
	 Out.ar(0, x) 
}).send(s));
import oscP5.*;
import netP5.*;

OscP5 oscP5;
NetAddress myRemoteLocation;

int numSpots = 24;
Spot [] spots = new Spot[numSpots];
int synthId = 1;

void setup() {
    size(400, 400);
    frameRate(30);

    oscP5 = new OscP5(this,12000);
    myRemoteLocation = new NetAddress(quot;127.0.0.1quot;,12000);

    smooth();
    noStroke();
    colorMode(HSB, 360, 100, 100, 100);
    for(int i = 0; i < spots.length; i++){
        float x = (width / numSpots) * i + width/numSpots/2;
        float rate = (i+1)/4.0;
        color col = color(360/numSpots*i, 80, 50);
        spots[i] = new Spot(i, x, height/2, width/numSpots, rate, col);
}
}

void draw() {
    background(0);
    for(int i = 0; i < spots.length; i++){
        spots[i].move();
        spots[i].display();
    }
}

class Spot {
	   int n;
	   float x, y, diameter, speed;
	   color spotColor;
	
	   Spot(int _n,float _x,float _y,float _diameter,float _speed,color _spotColor) {
	   	      n = _n;
	   	      x = _x;
	   	      y = _y;
	   	      diameter = _diameter;
	   	      speed = _speed;
	   	      spotColor = _spotColor;
	   }
void move() {
	   	     y += speed;
	   	     if(y > height-(diameter/2) || y < diameter/2){
	   	     	    speed *= -1;
	   	     	    //Send OSC Message
	   	     	    OscMessage myMessage = new OscMessage(quot;/s_newquot;);
	   	     	    myMessage.add(quot;env-sine-notequot;);
	   	     	    myMessage.add(synthId);
	   	     	    myMessage.add(1);
	   	     	    myMessage.add(0);
	   	     	    myMessage.add(quot;notequot;);
	   	     	    if(y < diameter/2){
	   	     	    	    myMessage.add(n*4+36);
	   	     	    } else {
	   	     	    	    myMessage.add(n*4+12);
	   	     	    }
	   	     	    myMessage.add(quot;detunequot;);
	   	     	    myMessage.add(6);
	   	     	    oscP5.send(myMessage, myRemoteLocation);
	   	     	    synthId++;
	   	     }
	   }
	
	   void display() {
	   	     fill(spotColor);
ellipse(x, y, diameter, diameter);
	   }
}
//        quot;myServerquot;   IP:127.0.0.1 port:12000
s = Server(quot;myServerquot;, NetAddr(quot;127.0.0.1quot;, 12000));
s.boot;

//OSC
s.dumpOSC(1);

//              sin
(
SynthDef(quot;env-sine-notequot;, { arg note = 10, amp=0.125, detune=6;
	 var env, x;
	 env = EnvGen.kr(Env.perc(0.001,6,1,-4), doneAction: 2);
	 x = env * SinOsc.ar([note.midicps, note.midicps+detune],0, amp);
	 Out.ar(0, x) 
}).send(s));

s.quit;

Mais conteúdo relacionado

Mais procurados

ClojurianからみたElixir
ClojurianからみたElixirClojurianからみたElixir
ClojurianからみたElixirKent Ohashi
 
ZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 VersionZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 VersionIan Barber
 
[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노Chiwon Song
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak PROIDEA
 
2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.jsNoritada Shimizu
 
[131]해커의 관점에서 바라보기
[131]해커의 관점에서 바라보기[131]해커의 관점에서 바라보기
[131]해커의 관점에서 바라보기NAVER D2
 
LLVM Backend の紹介
LLVM Backend の紹介LLVM Backend の紹介
LLVM Backend の紹介Akira Maruoka
 
JavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovyJavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovyYasuharu Nakano
 
Python 炒股指南
Python 炒股指南 Python 炒股指南
Python 炒股指南 Leo Zhou
 
When Bad Things Come In Good Packages
When Bad Things Come In Good PackagesWhen Bad Things Come In Good Packages
When Bad Things Come In Good PackagesSaumil Shah
 
20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会Hiroki Mizuno
 
Go vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoFGo vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoFTimur Safin
 
Ruby closures, how are they possible?
Ruby closures, how are they possible?Ruby closures, how are they possible?
Ruby closures, how are they possible?Carlos Alonso Pérez
 
">&lt;img src="x">
">&lt;img src="x">">&lt;img src="x">
">&lt;img src="x">testeracua
 
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleIan Barber
 
Better performance through Superscalarity
Better performance through SuperscalarityBetter performance through Superscalarity
Better performance through SuperscalarityMårten Rånge
 

Mais procurados (20)

ClojurianからみたElixir
ClojurianからみたElixirClojurianからみたElixir
ClojurianからみたElixir
 
ZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 VersionZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 Version
 
[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
 
2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js
 
[131]해커의 관점에서 바라보기
[131]해커의 관점에서 바라보기[131]해커의 관점에서 바라보기
[131]해커의 관점에서 바라보기
 
20151224-games
20151224-games20151224-games
20151224-games
 
LLVM Backend の紹介
LLVM Backend の紹介LLVM Backend の紹介
LLVM Backend の紹介
 
JavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovyJavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovy
 
Python 炒股指南
Python 炒股指南 Python 炒股指南
Python 炒股指南
 
When Bad Things Come In Good Packages
When Bad Things Come In Good PackagesWhen Bad Things Come In Good Packages
When Bad Things Come In Good Packages
 
Include
IncludeInclude
Include
 
Assignment
AssignmentAssignment
Assignment
 
20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会
 
Go vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoFGo vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoF
 
Ruby closures, how are they possible?
Ruby closures, how are they possible?Ruby closures, how are they possible?
Ruby closures, how are they possible?
 
">&lt;img src="x">
">&lt;img src="x">">&lt;img src="x">
">&lt;img src="x">
 
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made Simple
 
Better performance through Superscalarity
Better performance through SuperscalarityBetter performance through Superscalarity
Better performance through Superscalarity
 
ES6, WTF?
ES6, WTF?ES6, WTF?
ES6, WTF?
 

Destaque

Interactive Music II SuperCollider入門 2 - 関数とUGen
Interactive Music II SuperCollider入門 2 - 関数とUGenInteractive Music II SuperCollider入門 2 - 関数とUGen
Interactive Music II SuperCollider入門 2 - 関数とUGenAtsushi Tadokoro
 
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Atsushi 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
 
芸術情報演習デザイン(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
 
Interactive Music II Processing基本
Interactive Music II Processing基本Interactive Music II Processing基本
Interactive Music II Processing基本Atsushi Tadokoro
 
Interactive Music II - SuperCollider入門
Interactive Music II - SuperCollider入門Interactive Music II - SuperCollider入門
Interactive Music II - SuperCollider入門Atsushi Tadokoro
 
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望Atsushi Tadokoro
 

Destaque (12)

Ssaw08 0701
Ssaw08 0701Ssaw08 0701
Ssaw08 0701
 
Interactive Music II SuperCollider入門 2 - 関数とUGen
Interactive Music II SuperCollider入門 2 - 関数とUGenInteractive Music II SuperCollider入門 2 - 関数とUGen
Interactive Music II SuperCollider入門 2 - 関数とUGen
 
Sbaw090929
Sbaw090929Sbaw090929
Sbaw090929
 
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
 
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するiTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
 
Tamabi media131118
Tamabi media131118Tamabi media131118
Tamabi media131118
 
芸術情報演習デザイン(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
 
Interactive Music II Processing基本
Interactive Music II Processing基本Interactive Music II Processing基本
Interactive Music II Processing基本
 
愛のSuperCollider
愛のSuperCollider愛のSuperCollider
愛のSuperCollider
 
Interactive Music II - SuperCollider入門
Interactive Music II - SuperCollider入門Interactive Music II - SuperCollider入門
Interactive Music II - SuperCollider入門
 
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
 

Semelhante a SC OSC Synth Spots

Semelhante a SC OSC Synth Spots (20)

Sbaw090623
Sbaw090623Sbaw090623
Sbaw090623
 
Security Challenges in Node.js
Security Challenges in Node.jsSecurity Challenges in Node.js
Security Challenges in Node.js
 
Ns2programs
Ns2programsNs2programs
Ns2programs
 
Yg byev2e
Yg byev2eYg byev2e
Yg byev2e
 
Crazy things done on PHP
Crazy things done on PHPCrazy things done on PHP
Crazy things done on PHP
 
Sbaw090908
Sbaw090908Sbaw090908
Sbaw090908
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring Canvas
 
C Language Lecture 17
C Language Lecture 17C Language Lecture 17
C Language Lecture 17
 
Arp
ArpArp
Arp
 
ES6(ES2015) is beautiful
ES6(ES2015) is beautifulES6(ES2015) is beautiful
ES6(ES2015) is beautiful
 
Proga 0706
Proga 0706Proga 0706
Proga 0706
 
Developing High Performance Websites and Modern Apps with JavaScript and HTML5
Developing High Performance Websites and Modern Apps with JavaScript and HTML5Developing High Performance Websites and Modern Apps with JavaScript and HTML5
Developing High Performance Websites and Modern Apps with JavaScript and HTML5
 
Proga 0622
Proga 0622Proga 0622
Proga 0622
 
[SI] Ada Lovelace Day 2014 - Tampon Run
[SI] Ada Lovelace Day 2014  - Tampon Run[SI] Ada Lovelace Day 2014  - Tampon Run
[SI] Ada Lovelace Day 2014 - Tampon Run
 
Marat-Slides
Marat-SlidesMarat-Slides
Marat-Slides
 
Proga 090525
Proga 090525Proga 090525
Proga 090525
 
Assignment7.pdf
Assignment7.pdfAssignment7.pdf
Assignment7.pdf
 
An Intro To ES6
An Intro To ES6An Intro To ES6
An Intro To ES6
 
Internal workshop es6_2015
Internal workshop es6_2015Internal workshop es6_2015
Internal workshop es6_2015
 
Aodv routing protocol code in ns2
Aodv routing protocol code in ns2Aodv routing protocol code in ns2
Aodv routing protocol code in ns2
 

Mais de 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 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
 
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
 
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
 
Interactive Music II SuperCollider入門 5 時間構造をつくる
Interactive Music II SuperCollider入門 5  時間構造をつくるInteractive Music II SuperCollider入門 5  時間構造をつくる
Interactive Music II SuperCollider入門 5 時間構造をつくるAtsushi Tadokoro
 
iTamabi 13 第7回:ARTSAT API 実践 2 衛星の情報で表現する
iTamabi 13  第7回:ARTSAT API 実践 2 衛星の情報で表現するiTamabi 13  第7回:ARTSAT API 実践 2 衛星の情報で表現する
iTamabi 13 第7回:ARTSAT API 実践 2 衛星の情報で表現するAtsushi Tadokoro
 
Media Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGL
Media Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGLMedia Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGL
Media Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGLAtsushi Tadokoro
 
メディア芸術基礎 II Canvas + Javascriptで図形を描く
メディア芸術基礎 II Canvas + Javascriptで図形を描くメディア芸術基礎 II Canvas + Javascriptで図形を描く
メディア芸術基礎 II Canvas + Javascriptで図形を描くAtsushi Tadokoro
 
Interactive Music II SuperCollider入門 4 - 楽器を定義、変調合成(RM, AM, FM)
Interactive Music II SuperCollider入門 4 -  楽器を定義、変調合成(RM, AM, FM)Interactive Music II SuperCollider入門 4 -  楽器を定義、変調合成(RM, AM, FM)
Interactive Music II SuperCollider入門 4 - 楽器を定義、変調合成(RM, AM, FM)Atsushi Tadokoro
 

Mais de 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 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ライブラリ
 
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
 
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
 
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実習 オリジナルの楽器を作ろう!
 
Geidai music131107
Geidai music131107Geidai music131107
Geidai music131107
 
Interactive Music II SuperCollider入門 5 時間構造をつくる
Interactive Music II SuperCollider入門 5  時間構造をつくるInteractive Music II SuperCollider入門 5  時間構造をつくる
Interactive Music II SuperCollider入門 5 時間構造をつくる
 
iTamabi 13 第7回:ARTSAT API 実践 2 衛星の情報で表現する
iTamabi 13  第7回:ARTSAT API 実践 2 衛星の情報で表現するiTamabi 13  第7回:ARTSAT API 実践 2 衛星の情報で表現する
iTamabi 13 第7回:ARTSAT API 実践 2 衛星の情報で表現する
 
Media Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGL
Media Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGLMedia Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGL
Media Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGL
 
メディア芸術基礎 II Canvas + Javascriptで図形を描く
メディア芸術基礎 II Canvas + Javascriptで図形を描くメディア芸術基礎 II Canvas + Javascriptで図形を描く
メディア芸術基礎 II Canvas + Javascriptで図形を描く
 
Interactive Music II SuperCollider入門 4 - 楽器を定義、変調合成(RM, AM, FM)
Interactive Music II SuperCollider入門 4 -  楽器を定義、変調合成(RM, AM, FM)Interactive Music II SuperCollider入門 4 -  楽器を定義、変調合成(RM, AM, FM)
Interactive Music II SuperCollider入門 4 - 楽器を定義、変調合成(RM, AM, FM)
 

SC OSC Synth Spots

  • 1.
  • 2.
  • 3.
  • 4.
  • 5. // Hello World quot;Hello World!quot;.postln; enter (return ) // ( ) ( quot;Hello World!quot;.postln; quot;Hello SuperColliderquot;.postln; )
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. // quot;Hello Worldquot;.postln; // f = { 1 + 1 }; f.value; // f = { arg a, b; a + b; }; f.value(2, 3); // x = [1, 2, 3]; x.postln; // { SinOsc.ar( 440, 660], 0, 0.2) }.play;
  • 14.
  • 15. // f = { 1 + 1 }; f.value; // f = { arg a, b; a + b; }; f.value(2, 3); // f={ arg a, b; var firstResult, finalResult; firstResult = a + b; finalResult = firstResult * 2; finalResult; }; f.value(2, 3); // (2 + 3) * 2 = 10
  • 16. // 440HZ 0.2 { SinOsc.ar(440, 0, 0.2) }.play; // ( { // SinOsc.ar( // (.ar) 440, // 440HZ 0, // 0 0.2) // 0.2 } // .play; // 'play' )
  • 17. // f = { SinOsc.ar(440, 0, 0.2) }; f.play; // x = {arg freq=440; SinOsc.ar(freq, 0, 0.2)}.play; x.set(freq, 880); x.free; // ( 2ch) { SinOsc.ar([440, 660], 0, 0.2) }.play; x = {arg freq=440; SinOsc.ar([freq, freq+5], 0, 0.2)}.play; x.set(freq, 880); x.set(freq, 80); x.free;
  • 18.
  • 19. // { SinOsc.ar(440, 0, 0.2) }.play; //SynthDef SynthDef.new(quot;SinOsc_testquot;, { Out.ar(0, SinOsc.ar(440, 0, 0.2)) }).play; // +2ch ( SynthDef.new(quot;SinOsc-stereoquot;, { var outArray; outArray = [SinOsc.ar(440, 0, 0.2), SinOsc.ar(442, 0, 0.2)]; Out.ar(0, outArray) }).play; )
  • 20. // Server.default = Server.internal; s = Server.default; s.boot; ( SynthDef.new(quot;SinOsc-stereo-argsquot;, { arg freq=440, mul=0.2; var outArray; outArray = [SinOsc.ar(freq, 0, mul), SinOsc.ar(freq+2, 0, mul)]; Out.ar(0, outArray) }).send(s); ) x = Synth.new(quot;SinOsc-stereo-argsquot;); x.set(quot;freqquot;, 660); x.set(quot;mulquot;, 0.2); x.set(quot;freqquot;, 100, quot;mulquot;, 0.5); x.free;
  • 21.
  • 22. // quot;myServerquot; IP:127.0.0.1 port:12000 s = Server(quot;myServerquot;, NetAddr(quot;127.0.0.1quot;, 12000)); s.boot; //OSC s.dumpOSC(1); //SynthDef ( SynthDef.new(quot;sine-stereoquot;, { arg freq=440, mul=0.2; var outArray; outArray = [SinOsc.ar(freq, 0, mul), SinOsc.ar(freq+2, 0, mul)]; Out.ar(0, outArray) }).send(s); ) //OSC quot;sine-stereoquot; SyhtDef s.sendMsg(quot;s_newquot;, quot;sine-stereoquot;, s.nextNodeID, 0, 1); // s.sendMsg(quot;/n_freequot;, n); // s.quit;
  • 23.
  • 24.
  • 25.
  • 26. //SC Sin sine-stereo // quot;myServerquot; IP:127.0.0.1 port:12000 s = Server(quot;myServerquot;, NetAddr(quot;127.0.0.1quot;, 12000)); s.boot; //OSC s.dumpOSC(1); //SynthDef ( SynthDef.new(quot;sine-stereoquot;, { arg freq=440, mul=0.2; var outArray; outArray = [SinOsc.ar(freq, 0, mul), SinOsc.ar(freq+2, 0, mul)]; Out.ar(0, outArray) }).send(s); )
  • 27.
  • 28. // quot;myServerquot; IP:127.0.0.1 port:12000 s = Server(quot;myServerquot;, NetAddr(quot;127.0.0.1quot;, 12000)); s.boot; //OSC s.dumpOSC(1); //SynthDef ( SynthDef(quot; quot;, { arg note = 36, fc = 1000, rq = 25, bal=0, amp= -20, gate = 1; var x; x = Mix.fill(4, { LFSaw.ar((note + {0.1.rand2}.dup).midicps, 0, 0.02) }); x = RLPF.ar(x, fc, rq/100).softclip; x = RLPF.ar(x, fc, rq/100, amp.dbamp).softclip; x = Balance2.ar(x[0], x[1], bal); x = x * EnvGen.kr(Env.cutoff, gate, doneAction: 2); Out.ar(0, x); } ).load(s); )
  • 29.
  • 30.
  • 31.
  • 32.
  • 33. import oscP5.*; import netP5.*; OscP5 oscP5; NetAddress myRemoteLocation; Ring[] rings; int numRings = 50; int currentRing = 0; int synthId = 1; void setup() { size(400, 400); colorMode(HSB, 360, 100, 100, 100); frameRate(30); oscP5 = new OscP5(this,12000); myRemoteLocation = new NetAddress(quot;127.0.0.1quot;,12000); colorMode(HSB, 360, 100, 100, 100); smooth(); rings = new Ring[numRings]; for(int i = 0; i < numRings; i++){ rings[i] = new Ring(); } }
  • 34. void draw(){ background(0); for(int i = 0; i < numRings; i++){ rings[i].grow(); rings[i].display(); } } void mousePressed(){ //OSC OscMessage myMessage = new OscMessage(quot;/s_newquot;); myMessage.add(quot;env-sinequot;); myMessage.add(synthId); myMessage.add(1); myMessage.add(0); myMessage.add(quot;freqquot;); myMessage.add((height - mouseY) * 10); myMessage.add(quot;detunequot;); myMessage.add(((width/2) - mouseX)/30); oscP5.send(myMessage, myRemoteLocation); synthId++; rings[currentRing].start(mouseX, mouseY); currentRing++; if(currentRing >= numRings){ currentRing = 0; } }
  • 35. class Ring { float x, y; float diameter; boolean on = false; color col; void start(float _x, float _y){ x = _x; y = _y; on = true; diameter = 1; col = color(random(360), 50, 100, 50); } void grow() { if(on) { diameter++; if(diameter > 1000){ on = false; } } }
  • 36. void display(){ if(on){ noFill(); stroke(col); strokeWeight(4); ellipse(x, y, diameter, diameter); } } }
  • 37.
  • 38. // quot;myServerquot; IP:127.0.0.1 port:12000 s = Server(quot;myServerquot;, NetAddr(quot;127.0.0.1quot;, 12000)); s.boot; //OSC s.dumpOSC(1); // sin ( SynthDef(quot;env-sinequot;, { arg freq = 880, amp=0.125, detune=0; var env, x; env = EnvGen.kr(Env.perc(0.001,20,1,-4), doneAction: 2); x = env * SinOsc.ar([freq, freq+detune],0, amp); Out.ar(0, x)  }).send(s));
  • 39.
  • 40. import oscP5.*; import netP5.*; OscP5 oscP5; NetAddress myRemoteLocation; int numSpots = 24; Spot [] spots = new Spot[numSpots]; int synthId = 1; void setup() { size(400, 400); frameRate(30); oscP5 = new OscP5(this,12000); myRemoteLocation = new NetAddress(quot;127.0.0.1quot;,12000); smooth(); noStroke(); colorMode(HSB, 360, 100, 100, 100); for(int i = 0; i < spots.length; i++){ float x = (width / numSpots) * i + width/numSpots/2; float rate = (i+1)/4.0; color col = color(360/numSpots*i, 80, 50); spots[i] = new Spot(i, x, height/2, width/numSpots, rate, col);
  • 41. } } void draw() { background(0); for(int i = 0; i < spots.length; i++){ spots[i].move(); spots[i].display(); } } class Spot { int n; float x, y, diameter, speed; color spotColor; Spot(int _n,float _x,float _y,float _diameter,float _speed,color _spotColor) { n = _n; x = _x; y = _y; diameter = _diameter; speed = _speed; spotColor = _spotColor; }
  • 42. void move() { y += speed; if(y > height-(diameter/2) || y < diameter/2){ speed *= -1; //Send OSC Message OscMessage myMessage = new OscMessage(quot;/s_newquot;); myMessage.add(quot;env-sine-notequot;); myMessage.add(synthId); myMessage.add(1); myMessage.add(0); myMessage.add(quot;notequot;); if(y < diameter/2){ myMessage.add(n*4+36); } else { myMessage.add(n*4+12); } myMessage.add(quot;detunequot;); myMessage.add(6); oscP5.send(myMessage, myRemoteLocation); synthId++; } } void display() { fill(spotColor);
  • 43. ellipse(x, y, diameter, diameter); } }
  • 44.
  • 45. // quot;myServerquot; IP:127.0.0.1 port:12000 s = Server(quot;myServerquot;, NetAddr(quot;127.0.0.1quot;, 12000)); s.boot; //OSC s.dumpOSC(1); // sin ( SynthDef(quot;env-sine-notequot;, { arg note = 10, amp=0.125, detune=6; var env, x; env = EnvGen.kr(Env.perc(0.001,6,1,-4), doneAction: 2); x = env * SinOsc.ar([note.midicps, note.midicps+detune],0, amp); Out.ar(0, x)  }).send(s)); s.quit;