martes 30 de junio de 2009

CubesWithinACube [ejemplo de Processing]

Jugueteando y mezclando entre si algunos de los ejemplos de Processing, salió esto.

cubeswithincube.pde

import processing.opengl.*;

// Flock array
int birdCount = 20;
Bird[]birds = new Bird[birdCount];
float[]birdsx = new float[birdCount];
float[]birdsy = new float[birdCount];
float[]birdsz = new float[birdCount];
float[]birdsrx = new float[birdCount];
float[]birdsry = new float[birdCount];
float[]birdsrz = new float[birdCount];
float[]birdsspd = new float[birdCount];
float[]birdsrot = new float[birdCount];

Cube stage; // external large cube
int cubies = 50;
Cube[]c = new Cube[cubies]; // internal little cubes
color[][]quadBG = new color[cubies][6];

// Controls cubie's movement
float[]x = new float[cubies];
float[]y = new float[cubies];
float[]z = new float[cubies];
float[]xSpeed = new float[cubies];
float[]ySpeed = new float[cubies];
float[]zSpeed = new float[cubies];

// Controls cubie's rotation
float[]xRot = new float[cubies];
float[]yRot = new float[cubies];
float[]zRot = new float[cubies];

// Size of external cube
float bounds = 300;

void setup() {
size(400, 300, OPENGL);
colorMode(RGB, 1);
texmap = loadImage("world32k.jpg");
initializeSphere(sDetail);

for (int i = 0; i < cubies; i++){
// Each cube face has a random color component
float colorShift = random(0, 1);
quadBG[i][0] = color(0, 0, 0);
quadBG[i][1] = color(random(0, .1), random(0, .1), random(0, .1));
quadBG[i][2] = color(random(0, .2), random(0, .2), random(0, .2));
quadBG[i][3] = color(random(0, .3), random(0, .3), random(0, .3));
quadBG[i][4] = color(random(0, .4), random(0, .4), random(0, .4));
quadBG[i][5] = color(random(0, .5), random(0, .5), random(0, .5));

// Cubies are randomly sized
float cubieSizex = random(10, 250);
float cubieSizey = random(10, 250);
float cubieSizez = random(10, 250);
c[i] = new Cube(cubieSizex, cubieSizey, cubieSizez);

// Initialize cubie's position, speed and rotation
x[i] = random(-10, 10);
y[i] = random(-10, 10);
z[i] = random(-10, 10);

xSpeed[i] = random(-.25, .25);
ySpeed[i] = random(-.25, .25);
zSpeed[i] = random(-.25, .25);

xRot[i] = random(1000, 100000);
yRot[i] = random(1000, 100000);
zRot[i] = random(1000, 100000);
}


for (int i = 0; i < birdCount; i++){
birds[i] = new Bird(random(-300, 300), random(-300, 300), random(-500, -2500), random(5, 30), random(5, 30));

birdsx[i] = random(20, 340);
birdsy[i] = random(30, 350);
birdsz[i] = random(1000, 4800);
birdsrx[i] = random(-160, 160);
birdsry[i] = random(-55, 55);
birdsrz[i] = random(-20, 20);
birdsspd[i] = random(.1, 3.75);
birdsrot[i] = random(.025, .15);
}

// Instantiate external large cube
stage = new Cube(bounds, bounds, bounds);
}

void draw(){
background(random(0, .025));
lights();
renderGlobe();

for (int i = 0; i < birdCount; i++){
birds[i].setFlight(birdsx[i], birdsy[i], birdsz[i], birdsrx[i], birdsry[i], birdsrz[i]);
birds[i].setWingSpeed(birdsspd[i]);
birds[i].setRotSpeed(birdsrot[i]);
birds[i].fly();
}

// Center in display window
translate(width/2, height/2, -130);

// Outer transparent cube
noFill();

// Rotate everything, including external large cube
rotateX(frameCount * 0.001);
rotateY(frameCount * 0.002);
rotateZ(frameCount * 0.001);
stroke(255);

// Move and rotate cubies
for (int i = 0; i < cubies; i++){
pushMatrix();
translate(x[i], y[i], z[i]);
rotateX(frameCount*PI/xRot[i]);
rotateY(frameCount*PI/yRot[i]);
rotateX(frameCount*PI/zRot[i]);
noStroke();
c[i].create(quadBG[i]);
x[i] += xSpeed[i];
y[i] += ySpeed[i];
z[i] += zSpeed[i];
popMatrix();

// Draw lines connecting cubbies
stroke(0);
if (i < cubies-1){
line(x[i], y[i], z[i], x[i+1], y[i+1], z[i+1]);
}

}
}

// ----------------------------------------------------------------------------------------------

PImage bg;
PImage texmap;

int sDetail = 35; // Sphere detail setting
float rotationX = 0;
float rotationY = 0;
float velocityX = 0;
float velocityY = 0;
float globeRadius = 450;
float pushBack = 0;

float[] cx, cz, sphereX, sphereY, sphereZ;
float sinLUT[];
float cosLUT[];
float SINCOS_PRECISION = 0.5;
int SINCOS_LENGTH = int(360.0 / SINCOS_PRECISION);

void renderGlobe() {
pushMatrix();
translate(width/2,height/2,-130);
pushMatrix();
noFill();
stroke(255,200);
strokeWeight(2);
smooth();
popMatrix();
lights();
pushMatrix();
rotateX( radians(-rotationX) );
rotateY( radians(270 - rotationY) );
fill(200);
noStroke();
textureMode(IMAGE);
texturedSphere(globeRadius, texmap);
popMatrix();
popMatrix();
rotationX += velocityX;
rotationY += velocityY;
velocityX *= 0.95;
velocityY *= 0.95;

// Implements mouse control (interaction will be inverse when sphere is upside down)
if(mousePressed){
velocityX += (mouseY-pmouseY) * 0.01;
velocityY -= (mouseX-pmouseX) * 0.01;
}
}

void initializeSphere(int res)
{
sinLUT = new float[SINCOS_LENGTH];
cosLUT = new float[SINCOS_LENGTH];

for (int i = 0; i < SINCOS_LENGTH; i++) {
sinLUT[i] = (float) Math.sin(i * DEG_TO_RAD * SINCOS_PRECISION);
cosLUT[i] = (float) Math.cos(i * DEG_TO_RAD * SINCOS_PRECISION);
}

float delta = (float)SINCOS_LENGTH/res;
float[] cx = new float[res];
float[] cz = new float[res];

// Calc unit circle in XZ plane
for (int i = 0; i < res; i++) {
cx[i] = -cosLUT[(int) (i*delta) % SINCOS_LENGTH];
cz[i] = sinLUT[(int) (i*delta) % SINCOS_LENGTH];
}

// Computing vertexlist vertexlist starts at south pole
int vertCount = res * (res-1) + 2;
int currVert = 0;

// Re-init arrays to store vertices
sphereX = new float[vertCount];
sphereY = new float[vertCount];
sphereZ = new float[vertCount];
float angle_step = (SINCOS_LENGTH*0.5f)/res;
float angle = angle_step;

// Step along Y axis
for (int i = 1; i < res; i++) {
float curradius = sinLUT[(int) angle % SINCOS_LENGTH];
float currY = -cosLUT[(int) angle % SINCOS_LENGTH];
for (int j = 0; j < res; j++) {
sphereX[currVert] = cx[j] * curradius;
sphereY[currVert] = currY;
sphereZ[currVert++] = cz[j] * curradius;
}
angle += angle_step;
}
sDetail = res;
}

// Generic routine to draw textured sphere
void texturedSphere(float r, PImage t)
{
int v1,v11,v2;
r = (r + 100) * 0.2;
beginShape(TRIANGLE_STRIP);
texture(t);
float iu=(float)(t.width-1)/(sDetail);
float iv=(float)(t.height-1)/(sDetail);
float u=0,v=iv;
for (int i = 0; i < sDetail; i++) {
vertex(0, -r, 0,u,0);
vertex(sphereX[i]*r, sphereY[i]*r, sphereZ[i]*r, u, v);
u+=iu;
}
vertex(0, -r, 0,u,0);
vertex(sphereX[0]*r, sphereY[0]*r, sphereZ[0]*r, u, v);
endShape();

// Middle rings
int voff = 0;
for(int i = 2; i < sDetail; i++) {
v1=v11=voff;
voff += sDetail;
v2=voff;
u=0;
beginShape(TRIANGLE_STRIP);
texture(t);
for (int j = 0; j < sDetail; j++) {
vertex(sphereX[v1]*r, sphereY[v1]*r, sphereZ[v1++]*r, u, v);
vertex(sphereX[v2]*r, sphereY[v2]*r, sphereZ[v2++]*r, u, v+iv);
u+=iu;
}

// Close each ring
v1=v11;
v2=voff;
vertex(sphereX[v1]*r, sphereY[v1]*r, sphereZ[v1]*r, u, v);
vertex(sphereX[v2]*r, sphereY[v2]*r, sphereZ[v2]*r, u, v+iv);
endShape();
v+=iv;
}
u=0;

// Add the northern cap
beginShape(TRIANGLE_STRIP);
texture(t);
for (int i = 0; i < sDetail; i++) {
v2 = voff + i;
vertex(sphereX[v2]*r, sphereY[v2]*r, sphereZ[v2]*r, u, v);
vertex(0, r, 0,u,v+iv);
u+=iu;
}
vertex(sphereX[voff]*r, sphereY[voff]*r, sphereZ[voff]*r, u, v);
endShape();

}


bird.pde

class Bird {

// Properties
float offsetX, offsetY, offsetZ;
float w, h;
int bodyFill;
int wingFill;
float ang = 0, ang2 = 0, ang3 = 0, ang4 = 0;
float radiusX = 120, radiusY = 200, radiusZ = 700;
float rotX = 15, rotY = 10, rotZ = 5;
float flapSpeed = 0.4;
float rotSpeed = 0.1;

// Constructors
Bird(){
this(0, 0, 0, 60, 80);
}

Bird(float offsetX, float offsetY, float offsetZ, float w, float h){
this.offsetX = offsetX;
this.offsetY = offsetY;
this.offsetZ = offsetZ;
this.h = h;
this.w = w;
bodyFill = color(random(0, .5), random(0, .5), random(0, .5));
wingFill = color(random(0, .1), random(0, .1), random(0, .1));
}

void setFlight(float radiusX, float radiusY, float radiusZ,
float rotX, float rotY, float rotZ){
this.radiusX = radiusX;
this.radiusY = radiusY;
this.radiusZ = radiusZ;

this.rotX = rotX;
this.rotY = rotY;
this.rotZ = rotZ;
}

void setWingSpeed(float flapSpeed){
this.flapSpeed = flapSpeed;
}

void setRotSpeed(float rotSpeed){
this.rotSpeed = rotSpeed;
}

void fly() {
pushMatrix();
float px, py, pz;

// Flight
px = sin(radians(ang3)) * radiusX;
py = cos(radians(ang3)) * radiusY;
pz = sin(radians(ang4)) * radiusZ;

translate(width/2 + offsetX + px, height/2 + offsetY+py, -700 + offsetZ+pz);

rotateX(sin(radians(ang2)) * rotX);
rotateY(sin(radians(ang2)) * rotY);
rotateZ(sin(radians(ang2)) * rotZ);

// Body
fill(bodyFill);
box(w/5, h, w/5);

// Left wing
fill(wingFill);
pushMatrix();
rotateY(sin(radians(ang)) * 20);
rect(0, -h/2, w, h);
popMatrix();

// Right wing
pushMatrix();
rotateY(sin(radians(ang)) * -20);
rect(-w, -h/2, w, h);
popMatrix();

// Wing flap
ang += flapSpeed;
if (ang > 3) {
flapSpeed*=-1;
}
if (ang < -3) {
flapSpeed*=-1;
}

// Ang's run trig functions
ang2 += rotSpeed;
ang3 += 1.25;
ang4 += 0.55;
popMatrix();
}
}



cube.pde

// Custom Cube Class

class Cube{
PVector[] vertices = new PVector[24];
float w, h, d;

// Default constructor
Cube(){ }

// Constructor 2
Cube(float w, float h, float d) {
this.w = w;
this.h = h;
this.d = d;

// cube composed of 6 quads
//front
vertices[0] = new PVector(-w/2,-h/2,d/2);
vertices[1] = new PVector(w/2,-h/2,d/2);
vertices[2] = new PVector(w/2,h/2,d/2);
vertices[3] = new PVector(-w/2,h/2,d/2);
//left
vertices[4] = new PVector(-w/2,-h/2,d/2);
vertices[5] = new PVector(-w/2,-h/2,-d/2);
vertices[6] = new PVector(-w/2,h/2,-d/2);
vertices[7] = new PVector(-w/2,h/2,d/2);
//right
vertices[8] = new PVector(w/2,-h/2,d/2);
vertices[9] = new PVector(w/2,-h/2,-d/2);
vertices[10] = new PVector(w/2,h/2,-d/2);
vertices[11] = new PVector(w/2,h/2,d/2);
//back
vertices[12] = new PVector(-w/2,-h/2,-d/2);
vertices[13] = new PVector(w/2,-h/2,-d/2);
vertices[14] = new PVector(w/2,h/2,-d/2);
vertices[15] = new PVector(-w/2,h/2,-d/2);
//top
vertices[16] = new PVector(-w/2,-h/2,d/2);
vertices[17] = new PVector(-w/2,-h/2,-d/2);
vertices[18] = new PVector(w/2,-h/2,-d/2);
vertices[19] = new PVector(w/2,-h/2,d/2);
//bottom
vertices[20] = new PVector(-w/2,h/2,d/2);
vertices[21] = new PVector(-w/2,h/2,-d/2);
vertices[22] = new PVector(w/2,h/2,-d/2);
vertices[23] = new PVector(w/2,h/2,d/2);
}
void create(){
// Draw cube
for (int i=0; i<6; i++){
beginShape(QUADS);
for (int j=0; j<4; j++){
vertex(vertices[j+4*i].x, vertices[j+4*i].y, vertices[j+4*i].z);
}
endShape();
}
}
void create(color[]quadBG){
// Draw cube
for (int i=0; i<6; i++){
fill(quadBG[i]);
beginShape(QUADS);
for (int j=0; j<4; j++){
vertex(vertices[j+4*i].x, vertices[j+4*i].y, vertices[j+4*i].z);
}
endShape();
}
}
}


jueves 25 de junio de 2009

Los radios-celulares

¿Qué tan difícil es que cuando los radios-celulares utilizan el sistema de radio usen también el mismo sistema de llamar/contestar que cuando se llama como celular normal? Es decir, que en lugar de que el distinguidísimo usuario tenga que sostener su teléfono frente a su rostro y gritar para hablar pueda simplemente pegarlo a su orejita y hablar.

Analicemos la situación:

Radio: *clic* *crack* ¡GÜEY! ¡GÜEY!
Fulano: *sosteniendo su teléfono de la mencionada forma y gritando como ya se apuntó* ¡SI! ¡ADELANTE! ¡SI!
Radio: *clic* ¡GÜEY! ¡NO LLEGÓ EL PINCHE EMBARQUE, NO MAMES!
Fulano: *paseándose* ¡LE DIJE A AQUEL CABRÓN QUE NO LA FUERA A CAGAR! ¡¿YA LE LLAMARON A GODINEZ?!
Radio: *clic* ¡SI, GÜEY! ¡PERO NO MAMES!

Etc. Por el diálogo y el fino vocabulario de los personajes, se entiende que son ingenieros.

Se entenderá el disgusto que esto causa. Ahora, si se utilizara el radio-celular como un celular normal, la cosa sería así:

Fulano: *sosteniendo su teléfono como la gente* Bueno. ¡Le dije a aquel cabrón que no la fuera a cagar! ¡¿Ya le llamaron a Godinez?

¡Mucho mejor! Asi, cuando menos, nos ahorramos la mitad de la molestia y la perturbación. Creo yo que mi propuesta es 100% factible, y desconociendo el manejo de dichos telefonitos, no estoy seguro de que todos puedan usarse de tal forma, pero las posibilidades son dos:

1) Si se pueden usar de esa forma y los usuarios no lo hacen. Entonces, en lo que a mi respecta, pueden proceder a metérselos por el orificio corporal que encuentren más apropiado para dicho fin.

2) No se pueden usar de esa forma. Los fabricantes son unos idiotas que no piensan en la incomodidad de terceros y en el hecho de que tales artefactos pueden llegar a caer en manos de ingenieros mexicanos (¡el horror!).

He dicho.


sábado 6 de junio de 2009

Felices 25 años, Tetris



Has traído tanta felicidad a este mundo.

Fuente de la imagen.

lunes 25 de mayo de 2009

¡Feliz Día de la Toalla 2009!

viernes 22 de mayo de 2009

Welcome Address, by Karl Paulnack

“One of my parents’ deepest fears, I suspect, is that society would not properly value me as a musician, that I wouldn’t be appreciated. I had very good grades in high school, I was good in science and math, and they imagined that as a doctor or a research chemist or an engineer, I might be more appreciated than I would be as a musician. I still remember my mother’s remark when I announced my decision to apply to music school—she said, “you’re WASTING your SAT scores.” On some level, I think, my parents were not sure themselves what the value of music was, what its purpose was. And they LOVED music, they listened to classical music all the time. They just weren’t really clear about its function. So let me talk about that a little bit, because we live in a society that puts music in the “arts and entertainment” section of the newspaper, and serious music, the kind your kids are about to engage in, has absolutely nothing whatsoever to do with entertainment, in fact it’s the opposite of entertainment. Let me talk a little bit about music, and how it works.

The first people to understand how music really works were the ancient Greeks. And this is going to fascinate you; the Greeks said that music and astronomy were two sides of the same coin. Astronomy was seen as the study of relationships between observable, permanent, external objects, and music was seen as the study of relationships between invisible, internal, hidden objects. Music has a way of finding the big, invisible moving pieces inside our hearts and souls and helping us figure out the position of things inside us. Let me give you some examples of how this works.

One of the most profound musical compositions of all time is the Quartet for the End of Time written by French composer Olivier Messiaen in 1940. Messiaen was 31 years old when France entered the war against Nazi Germany. He was captured by the Germans in June of 1940, sent across Germany in a cattle car and imprisoned in a concentration camp.

He was fortunate to find a sympathetic prison guard who gave him paper and a place to compose. There were three other musicians in the camp, a cellist, a violinist, and a clarinetist, and Messiaen wrote his quartet with these specific players in mind. It was performed in January 1941 for four thousand prisoners and guards in the prison camp. Today it is one of the most famous masterworks in the repertoire.

Given what we have since learned about life in the concentration camps, why would anyone in his right mind waste time and energy writing or playing music? There was barely enough energy on a good day to find food and water, to avoid a beating, to stay warm, to escape torture—why would anyone bother with music? And yet—from the camps, we have poetry, we have music, we have visual art; it wasn’t just this one fanatic Messiaen; many, many people created art. Why? Well, in a place where people are only focused on survival, on the bare necessities, the obvious conclusion is that art must be, somehow, essential for life. The camps were without money, without hope, without commerce, without rec reation, without basic respect, but they were not without art. Art is part of survival; art is part of the human spirit, an unquenchable expression of who we are. Art is one of the ways in which we say, “I am alive, and my life has meaning.”

On September 12, 2001 I was a resident of Manhattan. That morning I reached a new understanding of my art and its relationship to the world. I sat down at the piano that morning at 10 AM to practice as was my daily routine; I did it by force of habit, without thinking about it. I lifted the cover on the keyboard, and opened my music, and put my hands on the keys and took my hands off the keys. And I sat there and thought, does this even matter? Isn’t this completely irrelevant? Playing the piano right now, given what happened in this city yesterday, seems silly, absurd, irreverent, pointless. Why am I here? What place has a musician in this moment in time? Who needs a piano player right now? I was completely lost.

And then I, along with the rest of New York, went through the journey of getting through that week. I did not play the piano that day, and in fact I contemplated briefly whether I would ever want to play the piano again. And then I observed how we got through the day.

At least in my neighborhood, we didn’t shoot hoops or play Scrabble. We didn’t play cards to pass the time, we didn’t watch TV, we didn’t shop, we most certainly did not go to the mall. The first organized activity that I saw in New York, that same day, was singing. People sang. People sang around fire houses, people sang “We Shall Overcome”. Lots of people sang America the Beautiful. The first organized public event that I remember was the Brahms Requiem, later that week, at Lincoln Center, with the New York Philharmonic. The first organized public expression of grief, our first communal response to that historic event, was a concert. That was the beginning of a sense that life might go on. The US Military secured the airspace, but recovery was led by the arts, and by music in particular, that very night.

From these two experiences, I have come to understand that music is not part of “arts and entertainment” as the newspaper section would have us believe. It’s not a luxury, a lavish thing that we fund from leftovers of our budgets, not a plaything or an amusement or a pass time. Music is a basic need of human survival. Music is one of the ways we make sense of our lives, one of the ways in which we express feelings when we have no words, a way for us to understand things with our hearts when we cannot with our minds.

Some of you may know Samuel Barber’s heartwrenchingly beautiful piece Adagio for Strings. If you don’t know it by that name, then some of you may know it as the background music which accompanied the Oliver Stone movie Platoon, a film about the Vietnam War. If you know that piece of music either way, you know it has the ability to crack your heart open like a walnut; it can make you cry over sadness you didn’t know you had. Music can slip beneath our conscious reality to get at what’s really going on inside us the way a good therapist does.

I bet that you have never been to a wedding where there was absolutely no music. There might have been only a little music, there might have been some really bad music, but I bet you there was some music. And something very predictable happens at weddings—people get all pent up with all kinds of emotions, and then there’s some musical moment where the action of the wedding stops and someone sings or plays the flute or something. And even if the music is lame, even if the quality isn’t good, predictably 30 or 40 percent of the people who are going to cry at a wedding cry a couple of moments after the music starts. Why? The Greeks. Music allows us to move around those big invisible pieces of ourselves and rearrange our insides so that we can express what we feel even when we can’t talk about it. Can you imagine watching Indiana Jones or Superman or Star Wars with the dialogue but no music? What is it about the music swelling up at just the right moment in ET so that all the softies in the audience start crying at exactly the same moment? I guarantee you if you showed the movie with the music stripped out, it wouldn’t happen that way. The Greeks: Music is the understanding of the relationship between invisible internal objects.

I’ll give you one more example, the story of the most important concert of my life. I must tell you I have played a little less than a thousand concerts in my life so far. I have played in places that I thought were important. I like playing in Carnegie Hall; I enjoyed playing in Paris; it made me very happy to please the critics in St. Petersburg. I have played for people I thought were important; music critics of major newspapers, foreign heads of state. The most important concert of my entire life took place in a nursing home in Fargo, ND, about 4 years ago.

I was playing with a very dear friend of mine who is a violinist. We began, as we often do, with Aaron Copland’s Sonata, which was written during World War II and dedicated to a young friend of Copland’s, a young pilot who was shot down during the war. Now we often talk to our audiences about the pieces we are going to play rather than providing them with written program notes. But in this case, because we began the concert with this piece, we decided to talk about the piece later in the program and to just come out and play the music without explanation.

Midway through the piece, an elderly man seated in a wheelchair near the front of the concert hall began to weep. This man, whom I later met, was clearly a soldier—even in his 70’s, it was clear from his buzz-cut hair, square jaw and general demeanor that he had spent a good deal of his life in the military. I thought it a little bit odd that someone would be moved to tears by that particular movement of that particular piece, but it wasn’t the first time I’ve heard crying in a concert and we went on with the concert and finished the piece.

When we came out to play the next piece on the program, we decided to talk about both the first and second pieces, and we described the circumstances in which the Copland was written and mentioned its dedication to a downed pilot. The man in the front of the audience became so disturbed that he had to leave the auditorium. I honestly figured that we would not see him again, but he did come backstage afterwards, tears and all, to explain himself.

What he told us was this: “During World War II, I was a pilot, and I was in an aerial combat situation where one of my team’s planes was hit. I watched my friend bail out, and watched his parachute open, but the Japanese planes which had engaged us returned and machine gunned across the parachute chords so as to separate the parachute from the pilot, and I watched my friend drop away into the ocean, realizing that he was lost. I have not thought about this for many years, but during that first piece of music you played, this memory returned to me so vividly that it was as though I was reliving it. I didn’t understand why this was happening, why now, but then when you came out to explain that this piece of music was written to commemorate a lost pilot, it was a little more than I could handle. How does the music do that? How did it find those feelings and those memories in me?”

Remember the Greeks: music is the study of invisible relationships between internal objects. This concert in Fargo was the most important work I have ever done. For me to play for this old soldier and help him connect, somehow, with Aaron Copland, and to connect their memories of their lost friends, to help him remember and mourn his friend, this is my work. This is why music matters.

What follows is part of the talk I will give to this year’s freshman class when I welcome them a few days from now. The responsibility I will charge your sons and daughters with is this:

“If we were a medical school, and you were here as a med student practicing appendectomies, you’d take your work very seriously because you would imagine that some night at two AM someone is going to waltz into your emergency room and you’re going to have to save their life. Well, my friends, someday at 8 PM someone is going to walk into your concert hall and bring you a mind that is confused, a heart that is overwhelmed, a soul that is weary. Whether they go out whole again will depend partly on how well you do your craft.

You’re not here to become an entertainer, and you don’t have to sell yourself. The truth is you don’t have anything to sell; being a musician isn’t about dispensing a product, like selling used Chevies. I’m not an entertainer; I’m a lot closer to a paramedic, a firefighter, a rescue worker. You’re here to become a sort of therapist for the human soul, a spiritual version of a chiropractor, physical therapist, someone who works with our insides to see if they get things to line up, to see if we can come into harmony with ourselves and be healthy and happy and well.

Frankly, ladies and gentlemen, I expect you not only to master music; I expect you to save the planet. If there is a future wave of wellness on this planet, of harmony, of peace, of an end to war, of mutual understanding, of equality, of fairness, I don’t expect it will come from a government, a military force or a corporation. I no longer even expect it to come from the religions of the world, which together seem to have brought us as much war as they have peace. If there is a future of peace for humankind, if there is to be an understanding of how these invisible, internal things should fit together, I expect it will come from the artists, because that’s what we do. As in the concentration camp and the evening of 9/11, the artists are the ones who might be able to help us with our internal, invisible lives.”

Link original.

jueves 14 de mayo de 2009

Pulses

// PULSES

// By: Jorge Rangel - http://blog.jrangel.net - jarg1985[at]gmail[dot]com - Main code

// Licence
// Creative Commons NC-BY-SA 3.0

[48, 50, 52, 55, 57, 60, 62, 64, 67, 69] @=> int melodynotes[];
[24, 26, 28, 31, 33, 36, 38, 40, 43, 45] @=> int bassnotes[];

// Mono channel stuff...

SinOsc a;
SinOsc b;
JCRev rev;
ADSR adsr;

adsr.set (250::ms, 50::ms, 1, 100::ms);

rev.mix (0.4);
rev.gain (0.2);

a.gain (0.3);
b.gain (0.5);

a => adsr => rev => dac;
b => dac;

fun void notes()
{
    if ( Std.rand2f(0,1) < 0.6 )
    {
        adsr.keyOff();
        Std.mtof(melodynotes[Std.rand2(0,melodynotes.cap()-1)]) => a.freq;
        adsr.keyOn();
    }
}

fun void bass()
{
    if ( Std.rand2f(0,1) < 0.6 )
    {
        Std.mtof(bassnotes[Std.rand2(0,bassnotes.cap()-1)]) => b.freq;
    }
}

fun void melodyloop()
{
    while (true)
    {
        notes();
        250::ms => now;
    }
}

fun void bassloop()
{
    while (true)
    {
        bass();
        500::ms => now;
    }
}

// Left channel stuff...

SinOsc aleft;
SinOsc bleft;
JCRev revleft;
ADSR adsrleft;

adsrleft.set (500::ms, 50::ms, 1, 250::ms);

revleft.mix (0.3);
revleft.gain (0.2);

aleft.gain (0.7);
bleft.gain (0.1);

aleft => adsrleft => revleft => dac.left;
bleft => dac.left;

fun void notesleft()
{
    if ( Std.rand2f(0,1) < 0.6 )
    {
        adsrleft.keyOff();
        Std.mtof(melodynotes[Std.rand2(0,melodynotes.cap()-1)]) => aleft.freq;
        adsrleft.keyOn();
    }
}

fun void bassleft()
{
    if ( Std.rand2f(0,1) < 0.6 )
    {
        Std.mtof(bassnotes[Std.rand2(0,bassnotes.cap()-1)]) => bleft.freq;
    }
}

fun void melodyloopleft()
{
    while (true)
    {
        notesleft();
        500::ms => now;
    }
}

fun void bassloopleft()
{
    while (true)
    {
        bassleft();
        1000::ms => now;
    }
}

// Right channel stuff

SinOsc aright;
SinOsc bright;
JCRev revright;
ADSR adsrright;

adsrright.set (500::ms, 50::ms, 1, 250::ms);

revright.mix (0.3);
revright.gain (0.2);

aright.gain (0.7);
bright.gain (0.1);

aright => adsrright => revright => dac.right;
bright => dac.right;

fun void notesright()
{
    if ( Std.rand2f(0,1) < 0.6 )
    {
        adsrright.keyOff();
        Std.mtof(melodynotes[Std.rand2(0,melodynotes.cap()-1)]) => aright.freq;
        adsrright.keyOn();
    }
}

fun void bassright()
{
    if ( Std.rand2f(0,1) < 0.6 )
    {
        Std.mtof(bassnotes[Std.rand2(0,bassnotes.cap()-1)]) => bright.freq;
    }
}

fun void melodyloopright()
{
    while (true)
    {
        notesright();
        500::ms => now;
    }
}

fun void bassloopright()
{
    while (true)
    {
        bassright();
        1000::ms => now;
    }
}

spork ~ melodyloop();
spork ~ bassloop();
spork ~ melodyloopleft();
spork ~ bassloopleft();
spork ~ melodyloopright();
spork ~ bassloopright();

while (true) 60::second => now;

// Pretty cool soundz, uh?

sábado 9 de mayo de 2009

Karlheinz Stockhausen - Helicopter String Quartet

En 1991, el profesor Hans Landesmann le dijo a Stockhausen que si le escribía un cuarteto de cuerdas para ser presentado en el Festival de Salzburgo (Salzburger Festpiele). Stockhausen muy amablemente le contestó que francamente le daba mucha hueva escribir un cuarteto de cuerdas, así que declinó la oferta. Pero sucedió que una noche, después de cenar pesado (quiero creer), Stockhausen tuvo un sueño muy loco en el volaba por encima de cuatro helicópteros, cada uno llevando a un miembro de un cuarteto de cuerdas.

Desde luego que semejante idea no podía desperdiciarse, así que se puso a hacer planes para poder llevar a cabo su sueño, así que entre 1992 y 1993 compuso el Cuarteto de cuerdas y helicópteros (Helikopter-Streichquartett). Al terminar la partitura se la mandó al profe Landesmann para que viera que tal. Tanto Landesmann como Gerard Mortier, director del Festival de Salzburgo, vieron la partitura con buenos ojos y le dieron luz verde al proyecto y negociaron con la armada austriaca para que les rentaran unos helicópteros. Pero como los ecologistas más radicales siempre gustan de echar a perder todas las cosas que hacen que valga la pena vivir en este mundo, dijeron que no, que como iban a contaminar el cielo interpretando la pieza de Stockhausen (¡!), lo que provocó que la premiere se cancelara. El caso es que finalmente se pudo interpretar por primera vez el 26 de junio de 1995, pero esa vez en el Festival de Holanda.

Desde luego que interpretar esta pieza representa muchos problemas logísticos que hay que resolver, principalmente en lo que se trata de conseguir cuatro helicópteros para trepar un cuarteto de cuerdas. Cada helicóptero debe contar también con un técnico de audio/video para transmitir todo al teatro o foro donde oficialmente se está presentando la pieza y donde el público podrá ver todo desde el momento en que el cuarteto sale del escenario, hasta que sube en los helicópteros, interpretan la pieza y regresan al escenario. De cada helicóptero salen tres señales de audio: de la voz del intérprete, de su instrumento y del rotor del helicóptero, que actúa como acompañamiento para el cuarteto.

Si después de leer sobre esta mariguanada les dan ganas de escuchar un cachito de sus poco más de 21 minutos de duración, aquí les dejo este video tan bello:



¡Chaca chaca chaca chaca!