Tag Archives: programming

Network no.1 for String Quartet

network_quartet

 I’ve mentioned the piece a couple of times on here over the last few months, but wanted to wait for a performance/recording to explain it a little more. So here we are at last: Network no.1 for string quartet.

The score is a hybrid of graphic and traditional, with a graph network diagram functioning as a map, and traditionally notated reference. Each ‘node’ on the map relates to an element from the separately notated gamut of sonorities. The edges of the map signify a potential route from one musical element to another. The length of an edge determines the duration of the element to be performed. So in this sense the map represents the time-space and structure of the piece, while the reference contains the sonic material.

As previously mentioned here, the work exists in a a state of non-linearity. Performers work independently, following their own paths across score ‘maps’. Routes are determined stochastically (and regenerated each time the network graphs are compiles), although each player may choose their own starting point.


The recording was made on Tuesday, 7th May, 2013.

Many thanks to the performers for their time.

Violins – Alice Dawkins; Hannah Packman

Viola – Katherine Lambeth

Violoncello – Claudia Chapman

Thanks also to Tony @Big_Pause for his patient advice during the programming stage.

Download the score generation used for the recording: Network no.1 – SCORE.pdf

 

Processing; code 2.2

Processing learning is coming on nicely this week. I feel like I’m in a Rocky training montage…

In amongst my choppin’ logs and lifting wagons out of the snow (Rocky IV, natch), I got a little input from @Freeman999, @mugloch and @Big_Pause. We changed a few things up in the last orbitting patch I posted, and now it runs a little smoother, and looks a lot nicer:

Still a couple of problems I’d like to figure out how to tweak.  If you run the code, you’ll see that the third planet in the ‘system’ stands still. If that were us, our entire western hemisphere would burn to a crisp, so we’re lucky I’m not programming the milky way… Also – BIG BOOM – we’re now rocking a duel-planetary system. Mirrored orbits in full effect! Second problem you’ll notice is that the background lines converge slightly ahead of the orbiting objects. So my guess is either dodgy coordinates, or worse…lag.

Anyway, if you’re so inclined – the source .pde is here.

Processing; code #2

More playing around with Processing this morning. Came up with a nice little sketch in which ‘planets’ orbit a ‘sun’, which is moveable with the mouse. I like the animation of the lines to the planets which gives the whole thing a nice atomosephere.

Its meant to move, so for those with Processing (and for those without, it IS free!) here is the source code:

Orbit planet;
Orbit planet2;
Orbit planet3;
Orbit planet4;
void setup() {
size(800,600);
smooth();
ellipseMode(RADIUS);
planet = new Orbit(50,0.01,12);
planet2 = new Orbit(70,-0.02,10);
planet3 = new Orbit(90,0.03,7.5);
planet4 = new Orbit(110,-0.04,5);
}
void draw() {
background(0);
planet.atmos();
planet2.atmos();
planet3.atmos();
planet4.atmos();
planet.move();
planet.display();
planet2.move();
planet2.display();
planet3.move();
planet3.display();
planet4.move();
planet4.display();
}
class Orbit {
float x;
float y;
float angle = 0.0;
float easing = 0.025;
float scalar;
float speed;
float mass;
float xOrb;
float yOrb;
Orbit(float tempScal, float tempSpeed, float tempMass) {
scalar = tempScal;
speed = tempSpeed;
mass = tempMass;
}
void move() {
// Calculate planet's orbit
xOrb = x+sin(angle)*scalar;
yOrb = y+cos(angle)*scalar;
angle+=speed;
//Ease sun to follow mouse when mouse pressed
if (mousePressed==true) {
x+=(mouseX-x)*easing;
y+=(mouseY-y)*easing;
}
}
void display() {
noStroke();
fill(200,128);
//draw 'planet'
ellipse(xOrb,yOrb,mass,mass);
//draw centre 'sun'
ellipse(x,y,mass*2,mass*2);
//link line sun to 'planet'
stroke(255,100);
line(x,y,xOrb,yOrb);
//draw line from planet to mouse position
line(mouseX,mouseY,xOrb,yOrb);
//location crosshair for sun destination
line(0,mouseY,width,mouseY);
line(mouseX,0,mouseX,height);
//location crosshair for sun position
line(0,y,width,y);
line(x,0,x,height);
//location crosshair for planet
line(0,yOrb,width,yOrb);
line(xOrb,0,xOrb,height);
//draw 'orbit' path
noFill();
ellipse(x,y,scalar,scalar);
}
void atmos() {
strokeWeight(0.5);
stroke(100,100);
for (int i = 1; i < width;i += 10) {
line(i,0,xOrb,yOrb);
line(i,height,xOrb,yOrb);
}
for (int i = 1; i < width;i += 10) {
line(0,i,xOrb,yOrb);
line(width,i,xOrb,yOrb);
}
}
}
I'm sure there is a more efficient way to code such a simple program, but its still early days. I think the next step I want to take is to use this program to output some sort of data (perhaps OSC protocol) to control aspects of Max/MSP...

Processing; introduction & code #1

As part of a little area of research (and some personal desire to learn basic coding), I am learning the Processing programming language.  Eventually, I’m hoping that I can use it as both an interface and a tool for visualising data in another project.  For the time being however, I’m still getting to grips with coding in general. (See also the current white and blue header above to see what this program’s big sister looks like!)

Here is a cute little .gif of a code I wrote last week to generate randomly placed nodes from a mouse click. Simple, but cute – especially in the real program as the nodes regenerate randomly as the mouse button is held down.

code #1 (Processing)

This weekend I hope to get my head around Processing.js that will let me drop codes into the page as a java applet – thus the program to run interactively on this site. In all its lagging glory!