Tuesday, November 28, 2006

Orders Finalized

I ordered two red, super bright, bar lights and the qprox sensor. They should arrive Thursday or Friday. Despite me ordering the accelerometer on Tuesday last week it was shipped out Monday of this week. Hopefully (should I paid for express shipping) it will arrive this week but the tracking number has not been entered in yet so I cannot track it. I am surprised at how much resistance the LED backlights require. Even the bar lights require much more than the standard LED.

Wednesday, November 22, 2006

Order Away

The accelerometer was ordered but I forgot the qprox sensor (luckily that is not necessary for the prototype). For lighting I ordered several bar LED lights but could not find them with high brightness for a reasonable price. I also ordered LED backlights in green to experiment with that. I am adding a clouded piece of mylar to the inside of the acrylic cylinder to further obscure the instrumentation inside.

Tuesday, November 21, 2006

Final Project Idea

Submitted 11/14/06: "This piece will be called alchemical fire. The idea comes from a short story a friend of mine wrote. As well as an art piece entitled “Fireflies” where fireflies were emulated with LED’s in a jar. The piece will contain several jars that will react to proximity and motion. The will emit both sound and light. The light will be diffused by the glass jar or by some other means. The light will be created using pulse width modulation and different colored LED’s. The piece will contain several of these jars in a dimly lit area.
As a person approaches a jar it will glow slightly through use of a proximity sensor and LED’s. The LED’s will pulse slightly as they approach. This pulse should have an organic feel much like fireflies. If the user picks up the light will no longer pulse but remain dim. If the user swirls the jar the light will increase in intensity. The faster one swirls the jar the brighter the light will glow. If the user puts the jar down it will eventually fade out. A speaker will emit soothing sine waves when the jar is swirled. The sounds will be set up in harmonics so they will always blend well. The resulting outcome will be a song of different sine waves and colors."

Updates: I am no longer using mason jars. I am looking into using treated acrylic containers or scientific flasks. I will also add different sounds and lighting behaviors for different motions.

Need: Some type of accelerometer and QPROX sensor.

Saturday, November 04, 2006

Give and Receive

I made my little sound generator send data to processing to create art based off the frequency and duration.

Arduino Code:

Click here for the Processing Code


#define header 224 //224-239 are pitch bend outputs in Midi

// Variables:
int speakerOut = 9; //Speaker Out
int delTime = 0; //Delay Time
int ranFreq = 0; //Pulse Width (PW)
int maxTime = 10; //Controls the length of Sound
int analogPin = 0; // Digital input pin for a switch
int ledPin = 13; // Digital output pin for on-board LED
int analogValue = 0; // value from the analog input, Analog to Digital Converter (ADC)
int frqValMSB = 0;
int frqValLSB = 0;
int scaledValue = 0; // scaled value for MIDI transmission
byte testbyte = 0;

void setup() { // Here we set the baud rate,
Serial.begin(9600); // Note that midi is just regular serial with a specified
pinMode(speakerOut, OUTPUT);// Sets output Pin
}


void sendData3Byte(char cmd, char data1, char data2, char data3) {
Serial.print(cmd, BYTE);
Serial.print(data1, BYTE);
Serial.print(data2, BYTE);
Serial.print(data3, BYTE);
}

void loop() {
ranFreq = random (150,2500);
maxTime = random (5,60);
delTime = random (10,500);
//This for loop sets the length of the note
for (int i = 0; i < maxTime; i++){
//This sets the frequence f = 1/t or PW = 1/(2*f) time is in microseconds
digitalWrite(speakerOut,HIGH);
delayMicroseconds(ranFreq);
digitalWrite(speakerOut,LOW);
delayMicroseconds(ranFreq);
}
frqValLSB = ranFreq & 127; //Keep lower 7 bits bits, 0000000011111111 = 127
frqValMSB = (ranFreq >> 7) ; //Need to shift the MSB into to the lower 7 bits
sendData3Byte(header, frqValLSB,frqValMSB, maxTime); //224 LSB MSB = header command, LSB, MSB
//Pauses between notes
delay(delTime);

}