Ingeniería en Sistemas Computacionales
Simulación
Algoritmo congruencial cuadrático
Programa que genera una serie de números pseudoaleatorios basándose en el algoritmo congrencial cuadratico, al final los muestra en pantalla.
Introduce the core conceptions of javascript, including prototype chain, constructor, execution context, variable object, scope chain, closure and this.
Interactive Music II ProcessingとSuperColliderの連携 -2Atsushi Tadokoro
This document provides instructions and examples for connecting Processing and SuperCollider using the SuperCollider client for Processing. It begins with assignments for a final project using SuperCollider and/or Processing with SuperCollider to create musical expressions or expressions with sound and visuals. It then reviews how to define Synths in SuperCollider and play them from Processing using the client. Several examples are provided, including circles expanding in response to mouse clicks and playing tones, bouncing balls that play tones when hitting edges, growing rectangles with FM synthesis, and moving bars with sustained tones. The document concludes by suggesting directions for the final project assignments.
Ingeniería en Sistemas Computacionales
Simulación
Algoritmo congruencial cuadrático
Programa que genera una serie de números pseudoaleatorios basándose en el algoritmo congrencial cuadratico, al final los muestra en pantalla.
Introduce the core conceptions of javascript, including prototype chain, constructor, execution context, variable object, scope chain, closure and this.
Interactive Music II ProcessingとSuperColliderの連携 -2Atsushi Tadokoro
This document provides instructions and examples for connecting Processing and SuperCollider using the SuperCollider client for Processing. It begins with assignments for a final project using SuperCollider and/or Processing with SuperCollider to create musical expressions or expressions with sound and visuals. It then reviews how to define Synths in SuperCollider and play them from Processing using the client. Several examples are provided, including circles expanding in response to mouse clicks and playing tones, bouncing balls that play tones when hitting edges, growing rectangles with FM synthesis, and moving bars with sustained tones. The document concludes by suggesting directions for the final project assignments.
3. //
ofxOscMessage m;
m.setAddress( "/setxy" );
m.addFloatArg( float(x) / float(ofGetWidth()));
m.addFloatArg( float(y) / float(ofGetHeight()));
sender.sendMessage( m );
4.
5.
6. #ifndef _TEST_APP
#define _TEST_APP
#include "ofMain.h"
#include "ofxOsc.h"
class testApp : public ofBaseApp {
public:
void setup();
void update();
void draw();
void keyPressed (int key);
void keyReleased(int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button);
void windowResized(int w, int h);
//OSC
ofxOscSender sender;
11. void testApp::mouseDragged(int x, int y, int button){
}
void testApp::mousePressed(int x, int y, int button){
// OSC OSC "/mouse/mouse" 1
ofxOscMessage m;
m.setAddress( "/mouse/button" );
m.addIntArg(1);
sender.sendMessage( m );
}
void testApp::mouseReleased(int x, int y, int button){
// OSC OSC "/mouse/mouse" 0
ofxOscMessage m;
m.setAddress( "/mouse/button" );
m.addIntArg(0);
sender.sendMessage( m );
}
void testApp::windowResized(int w, int h){
}
12.
13.
14.
15.
16. (
//FM
SynthDef("fm2", {
arg bus = 0, freq = 440, carPartial = 0.5,
modPartial = 0.5, detune=2.0, index = 3, mul = 0.2, ts = 1;
var mod;
var car;
mod = SinOsc.ar(
freq * modPartial,
0,
freq * index * LFNoise1.kr(5.reciprocal).abs);
car = SinOsc.ar(
[(freq * carPartial) + mod,(freq+detune * carPartial) + mod],
0,
mul);
car = FreeVerb.ar(
car* EnvGen.kr(Env.new([0,1], [5])),
0.5, 0.8, 0.2, 1.0);
Out.ar(bus, car);
}).load(s);
)
18. //FM OSC "/setxy"
OSCresponderNode(nil, "/setxy",
{
arg time, resp, msg;
var mod, index;
mod = msg[1]*4.0;
index = msg[2]*100.0;
if(play == true, {
s.sendMsg("/n_set", x, "modPartial", mod, "index", index);
});
}).add;
)
19. #ifndef _TEST_APP
#define _TEST_APP
#include "ofMain.h"
#include "ofxOsc.h"
#define HOST "localhost"
#define PORT 57120
class testApp : public ofBaseApp {
public:
void setup();
void update();
void draw();
void keyPressed (int key);
void keyReleased(int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button);
void windowResized(int w, int h);
ofxOscSender sender; //OSC
string info; //
};