Audio System


The Concept  

Audio system


To Start
The first idea was to use a web-cam to spot people moving in the room. This would then access a program that would randomly selected one audio files I had created and then play it though a single speaker selected at random from a total of six. This system would have used Processing and the JMyron library (WebCamXtra) and then linking into Pure Dater (PD) to access the audio system and speakers. However this system would have been extreamly complicated to create as well as predictable and not very intereative this is why the idea progressed.

Progression
After playing around with JMyron I discovered, with the help of one of my lecturers, Rob Lycett, that a different Processing library would be better. This is called Blobb Detector. After changing some of its settings it allowed for a webcam to track a person’s movements and draw a line around their shape as well as a bounding box.

Progression
After speaking to Rob again and another lecturer, Spencer Roberts, I learned that the system could be made even simpler. We discussed what I wanted and we decided that if the system recorded and then played back the audio backwards this would be a lot ‘freakier’ than the system playing a library of sounds. Creating a better mood.

This meant that the system could be a lot simpler because instead of detecting a person and then their movement all that was needed was to see if something or someone had moved. Therefore, instead of using a webcam Spencer told me of a burglar alarm/door bell that is avalable in B&Q. This device has a PIR sensor in it and when it detects movement it plays a sound. This can be wired into the audio port of a computer and then used in Processing to start the recording system, using the library called Sonia. The audio then needs to be reversed and played back.

alarm/door bell 
The alarm/door bell

Wireing up
I got the alarm/door bell from B&Q and Spencer and I opened it up. We cut the speaker wires and soldered them to two new wires which were then soldered to an audio jack. We then tested my new sensaw by plugging it into the audio “in” on my laptop and checked we were getting audio in the system preferences panel. “Success”, we did! I then re-assembled the alarm/door bell and cut a hole in the side of it so the cables could come out of it easily. I was then ready to start programming Processing.

alarm/door bell with audio jack
The alarm/door bell with audio jack attached

Proccessing and its little hick-ups.
I have been amazed at how easy it is to create something using Processing. However, I have hit some code hick-ups. (For the code please click here)

For some reason the audio will not play back. I have placed a question on the Processing forum but I have not had a reply to date.

Small set back
For some reason the alarm/door bell stopped working. So using the voltmeter I checked to see if electricity was coming though the jack we attached to it. Nothing was coming through. I dismantled the alarm/door bell and checked for electricity at the base (on the board) there was a signal. So I worked my way up the connections we made by soldering wires together and I discovered that at the first connection one of the wires was not connected any more, then through more searching, both wires came off as well as one of the blue original wires that is connected to the board. This means that I need to re-solder my wires.

re-wired
Inside the alarm/door bell

A twist
Because the alarm/door bell is not working I decided to test the system with just the microphone. This still resulted in the same thing. No sound was played back. I tested the microphone in the system preferences panel and you can see that the sound is registering but you can't hear anything. There must be a reason why when the program is being run no audio is being played back.

Progressing
I have had a break-through with my code. Just using the microphone to trigger the system and to record I have managed to get it to record sounds for 1 min and then to play them back. All I need to do now is to flip them round. The problem with the flipping seems to be that the sounds are not being written to the array and so cannot be flipped and then cannot be written to the second sound file and played.

It Works!!!!
We worked out why it was not writing into the second sound file. It took a bit but we got there in the end. We added in a reset function that lets the system keep looping round and we also added a clean up to the end that stops and kills anything left running. This was needed as my laptop was getting clogged up and kept crashing out and acting in a very strange manner.

The Final Code

The Next Step
The next step is to wire up the alarm/door bell to a Pic Chip and then, using the USB port, wire it to the computer. I have to do this because otherwise, when the system is recording, it will record the doorbell sound as well. The Pic Chip will recognise the sensor and send a Hex reference to Processing instead of the meteData I'm using at the moment. This also means that a proper microphone can be plugged into the laptop as well as speakers.

Pic Chip
A Pic Chip

There are two options for the speakers that I could use. The first is a USB speaker called Boynq Cube. This is a high quality speaker and, using a USB extension, I will be able to place it anywhere within 1 meter radius of the laptop. This means it can be hidden. The second option is using SoundBug. This gadget turns any flat surface into a speaker. This might make the audio better but it depends upon the surface where it is placed. This is its big drawback. The second possible problem is that it plugs into the audio port and so the distance is limited to the length of the cables.

I have opted for a single speaker instead of 6 as I feel that the viewer/visitors will become too confused if the audio is constantly moving. I also wanted them to realise that they can influence the audio and even play with it. One speaker means that this can start to happen without confusing them too much. The second reason is that the Window of Cues needs speakers as well and the room will be over run with speakers if I use 6 for the audio system and 6 for the Window.

Pic Chip & re-wireing
During the re-wiring I discovered that the connection to the speakers that the new wires connected to no longer worked when I tested it. This meant that I needed to find a new way to connect the alarm/door bell to the Pic chip. Inside the alarm/door bell there is a chip which means that when the sensor is triggered there must be a signal sent from one of its legs. Using a multimeter and Spencer's help we isolated the leg and then soldered a wire to it. I then soldered a wire to each of the existing power wires. This is so that the board I am building can power the alarm/door bell.

leg wired
A cable wired to one of the alarm/door bell's chip leg

The next thing I had to do was wire up the bread board (that is the electronic board that you use to build your system before making a solid version) I have wired up the board and added the serial port that will connect it all to my laptop. The Pic chip then needs to be programmed with an analogue to digital program that also recognises when information is coming into it from my alarm/door bell. This then sends a string of data to Processing on my laptop

The wired up bread board
My wired up working bread board

All that is left now is to transfer my bread board onto a proper board, solder it together and attach my alarm/door bell to it. The audio system will then be finished