Seaquence : A Sequencer Modelled as a Living Organism

Posted December 21st, 2010 in audio / music creation by admin

Found a great tool at Seaquence.com for making generative sound & music via electronic sequencer. It uses an analogy of living organisms in a petri dish to craft and tweak your musical experiment.

Highly recommended for its fun and intuitive design.

Seaquence Demo from Daniel Massey.

Arduino Ultrasonic Distance Detection Code Samples

Posted September 28th, 2010 in electronic by admin
Distance detection techniques with MaxSonar ultrasonic rangefinder by Bruce Allen
  1. Analog.
  2. PW – Pulse Width.

Analog

//Feel free to use this code.
//Please be respectful by acknowledging the author in the code if you use or modify it.
//Author: Bruce Allen
//Date: 23/07/09

//Analog pin 1 for reading in the analog voltage from the MaxSonar device.
//This variable is a constant because the pin will not change throughout execution of this code.
const int anPin = 1;

//variables needed to store values
long anVolt, inches, cm;
int sum=0;//Create sum variable so it can be averaged
int avgrange=60;//Quantity of values to average (sample size)

void setup() {

  //This opens up a serial connection to shoot the results back to the PC console
  Serial.begin(9600);

}

void loop() {

  pinMode(anPin, INPUT);
  //MaxSonar Analog reads are known to be very sensitive. See the Arduino forum for more information.
  //A simple fix is to average out a sample of n readings to get a more consistant reading.\\
  //Even with averaging I still find it to be less accurate than the pw method.\\
  //This loop gets 60 reads and averages them

  for(int i = 0; i < avgrange ; i++)
  {
    //Used to read in the analog voltage output that is being sent by the MaxSonar device.
    //Scale factor is (Vcc/512) per inch. A 5V supply yields ~9.8mV/in
    anVolt = analogRead(anPin);
    sum += anVolt;
    delay(10);
  }
  inches = sum/avgrange;
  cm = inches * 2.54;
  Serial.print(inches);
  Serial.print("in, ");
  Serial.print(cm);
  Serial.print("cm");
  Serial.println();
  //reset sample total
  sum = 0;
  delay(500);

}


PW

I found this to be more accurate than the analog method and just as easy to implement.

//Feel free to use this code.
//Please be respectful by acknowledging the author in the code if you use or modify it.
//Author: Bruce Allen
//Date: 23/07/09

//Digital pin 7 for reading in the pulse width from the MaxSonar device.
//This variable is a constant because the pin will not change throughout execution of this code.
const int pwPin = 7;
//variables needed to store values
long pulse, inches, cm;

void setup() {

  //This opens up a serial connection to shoot the results back to the PC console
  Serial.begin(9600);

}

void loop() {

  pinMode(pwPin, INPUT);
    //Used to read in the pulse that is being sent by the MaxSonar device.
  //Pulse Width representation with a scale factor of 147 uS per Inch.

  pulse = pulseIn(pwPin, HIGH);
  //147uS per inch
  inches = pulse/147;
  //change inches to centimetres
  cm = inches * 2.54;
  Serial.print(inches);
  Serial.print("in, ");
  Serial.print(cm);
  Serial.print("cm");
  Serial.println();
  delay(500);

}

Fiber Optic Cable Tree Bark Example

Posted September 17th, 2010 in Future concepts, Lighting by admin

Saw this on the London Design Festival site.

Appears to be a column wrapped with fiber optic cable to some pretty interesting effect.

Other project using Arduino PWM audio

Posted September 16th, 2010 in audio / music creation, audio hardware by uber

I found a guy making his own interactive art project and is using an Arduino with PWM output for tone generation.

http://jeremyblum.com/tag/reacXion/

I really liked his final solution for controlling the gain using a digital potentiometer. Here are a couple of other articles about how to use a digital pot with Arduino.

Here is a page about using an I2C digital potentiometer with Arduino

http://combustory.com/wiki/index.php/X9241A_-_Digital_Potentiometer

and here is one about using an SPI digital potentiometer with Arduino

http://www.arduino.cc/en/Tutorial/SPIDigitalPot

Arduino PWM music Generation

Posted September 13th, 2010 in audio / music creation, audio hardware by admin

We had a problem with the arduino PWM output damaging out amplifier. Turns out the PWM is outputing the audio signal at 5 Volts and the amp prefers input around the .5 to 1 volt range.

So, I found a method of reducing the voltage and also cleaning up the signal of the PWM using some simple electronic components.

This article called: Arduino Audio DAC Options describes the technique.

First issue is the DAC bias:

DAC Biasing for +/- swing
Since analog signals, especially sound, needs to swing plus and minus around zero volts we often bias the DAC so that mid scale is considered 0V. If the DAC outputs from 0 to 5V then we usually bias the signals so that 2.5V is translated to 0V. If we generate our output signals so that half scale is 2.5V then we can AC couple the output to get a +/- 2.5V swing.

The half scale biasing may be a bit confusing but really it’s easy once you get the general idea. We just call 1/2 scale zero so that any numbers above 1/2 are positive and below are negative. For an 8 bit converter we can use the MSB as a sign bit to make this happen. Consider that decimal 128 is 10000000 in binary. Note that the MSB is set and this is basically half scale of the possible 0-255 range. Think of the MSB as a sign bit, it’s one for positive values and 0 for negative.

Using this 1/2 scale bias we can convert any digital number that might represent sound data into a value to load into a DAC. The first step is to convert the number into the range of +/-127 and add 128 to it. In this example that will make the analog version swing from 0 to 5V with the original zero point set at 2.5V. We can remove that 2.5V bias in the hardware with a simple series capacitor.

A/C Coupling
The series capacitor is not even needed in most applications. For example I use my sound card line input to do these experiments. This input has a series capacitor. The series capacitor is used to provide A/C coupling. This just means that the signal swings evenly around 0V. The +/- voltage swing is enforced about the average DC level by the capacitor. Of course there is a frequency response for the series capacitor but the value of the capacitor is usually high enough so that it will not be a problem for audio frequency ranges.

Filtering the DAC output
AudioFilter

This diagram shows the circuit I used between the various DAC outputs and my PC sound card input. The series resistor and capacitor to ground form a simple filter to knock off the high frequency noise caused by the DAC switching instantly between the voltage values. It removes the high frequency components. The 100K variable resistor (POT) lets me adjust the output voltage level for each DAC. A line input should be kept in the 1V Peak to Peak range or +0.5 to -0.5 range. Since the sound card has A/C coupling I only need to adjust the amplitude using this POT as a voltage divider. Also note that I connected both the right and left side inputs to the filtered output.

So, based on this I’m thinking of building an A/C coupler and an DAC filter to make the PWM output from the arduino more amiable to amplification.

1 Bit Sound Generation Example

Posted August 19th, 2010 in audio / music creation, audio hardware by admin

Interesting example of a 1 bit music generator built into a CD jewel case. The music itself is also quite good and is related to the generative square wave sounds we’re building right now using the Arduino.

From Tristan Perich: 1bitsymphony.com

Two Other Processor Boards

Posted August 11th, 2010 in audio hardware by admin

For future ideas we’re looking at two other processing boards to extend the capabilities of the Arduino MEGA:

http://leaflabs.com

http://beagleboard.org

BitF 2010

Posted July 26th, 2010 in Photos by uber

Morning frond at BitF

Assembled and standing on the beach at Burn in the Forest. The final product was bigger than we had imagined, standing over 10′ tall.

Assembly of Components

Posted July 12th, 2010 in construction, Design Plans by admin

First assembly of all the major Sound Frond components and a visual of the overall size and shape of the new sculpture. Looks like it will be just over 10 feet tall.

Forming Foam Core Plug for Horn

Posted June 15th, 2010 in construction by admin

Working in the studio on forming the horn for the new Frond:

Foam Horn Plug Construction

Notice the circles cut out of fiberboard and positioned on a string. These are mathematically defined areas every 10cm along the horn that are required to create the desired sound properties. When the small circles move down and reach the base, the pieces flare to create the radius of the mouth.

We used plastic stapled around the circles to shape a sleeve around the form, and we used elastic cords to tension it into the arc we were after. Once positioned, expanding foam was added to fill the space and create a rigid structure. We can easily work the shape of the foam once it has set to create our final plug.

The horn is about 1.5 meters long and the area of the mouth is 2 square meters.