a recipe for audio sensing
May 14, 2011
piezo transducers:
A piezoelectric sensor is a device that uses the piezoelectric effect to measure pressure, acceleration, strain or force by converting them to an electrical signal. thanks, wikipedia.
when a piezo transducer is in contact with a surface, when it vibrates it will cause the sensor to output sound the same way a microphone does. 
to make the whole setup i needed 10 piezo transducers (one for each section of the wall as the vibrations couldn’t travel between as it was not a solid sheet of metal all across the wall. I had to buy 100m of 2-core cable to wire the sensors with enough length to sit in the middle of each panel to get the best spread of vibrations. These wires plugged into a box at the bottom of the wall to connect them in series, and then this box had an XLR microphone out as this is a standard connection for a film shoot and there was lots of xlr cable we could use to run it across the warehouse to where we had the computers set up. then i just needed an xlr->mini jack transformer so the signal could be run into my audio input on my laptop, which was running a max/MSP patch to detect attacks in the sound.
i had to buy:
100m 2 core cable
heatshrink
solder
10x mini jack plugs (mono)
10x mini jack sockets (mono)
1x xlr socket
10x piezo transducer
10x 2-pin connector
1x circuit box
1x xlr cable
1x xlr – mini jack transformer
i had cut the wires to the lengths i calculated and then on the end of each one i soldered a 2-pin connector on the transducer end and a mini jack to the other end, i soldered a 2 pin connector to the transducer so it could easily be connected and disconnected from the wire. i then drilled 10 holes in the circuit box for 10 mini jack sockets and wired the sockets up in parallel-series, with 2 sets of 5 parallel connections, to give the least resistance.
i had been considering using arduino but it seemed overcomplicated for this task and i didnt have any experience with the arduino code, and i do have experience with electronics and max/MSP.
For the max patch, i used an object called “bonk” which detects attacks in the sound and prints an output whenever the signal is above specified parameters (how high the attack, how fast the decay), which i then added a crossover object so i could filter certain frequencies to make it more accurate. Then i made the print function connect to a flash server so the printed message is sent to flash and can be programmed in the game to signal a ‘hit’.
here is my max patch for download it will work with any sound (like a clap or a hit, something with fast decay) and also can work with a normal microphone, it requires the bonk object and flashserver dependencies which can be found online. the slider is gain to boost the low output of the transducers.