14th June, 2014 · 7 minute read
Beat Buddy was my final project for MDDN251 Physical Computing at Victoria University of Wellington.
Beat Buddy is a sort of assistive device. Playing heavily on the idea of ‘knocking’ as communication that drove Study Buddy. However, in with Beat Buddy there is more of a playful aspect. From time to time I find myself tapping on my desk (or any surface) the beat to a song I’m thinking of. The idea for Beat Buddy centres around this.
Beat Buddy can sit on any firm surface plugged into a computer for power and data transmission. With a piezoelectric sensor the device is constantly monitoring any knocks against the surface it is placed on. Any knocks it does detect are fed back to the computer where the data is creatively, yet informatively displayed in a companion program coded in Processing. This Processing sketch also has controls and configuration options such as the threshold of the knocks that should be registered. The companion program is then able to feedback the recorded beat to the Arduino Pro Mini (running Firmata) which plays a beat. A servomotor driven hammer comes down against the surface to play back the beat that the user tapped on the surface. The user is then able to add in beats to the loop and these beats are played by the hammer on the next loop through. The user is effectively creating a drum beat with the help of Beat Buddy and the accompanying program creates a generative art piece based on this beat.
In project 1 my device detected knocks and bumps against a surface to determine if the user was enraged with their study or homework and attempted to calm the user with a playful sound and a calming light. In project 2 I developed the idea of knock sensing further. I chose to reimagine the interaction as a musical toy. It detected knocks against the surface it had been placed on and fed this data to the computer. A program coded in Processing processed the knock data and recorded it on a looping timeline.
For project 3 I would like to polish the specific idea I used in project 2. I would still like to use an Arduino Pro Mini running Firmata because it proved the perfect combination of hardware and software for my needs. I still intend of having a ‘hammer’ that converts the recorded beats back into a physical representation. One aspect I would like to further develop is the software. While I would like the recorded knocks to generate an creative artistic representation, I would still very much like to develop the functional side of the software. The ability to create, delete, and move beats on the computer could be very useful to someone attempting to use the device as a serious music tool. The user should also have more control over the speed and duration of the loop. One thing I will need to be careful of is making the device too complicated to operate. It needs to be user-friendly, fun and effortless while still having customisable settings to get the experience the user wants. Overall, I would like to create a polished, functional product that can simply be plugged in and used.
In project 1 I chose to explore the interaction of knocking. I wanted to explore how knocking could be used as a form of communication with a computer and how the interaction could be used productively. I created Study Buddy to explore this interaction initially. Study Buddy was designed to detect when a user was so frustrated by studying that they needed to relax. Study Buddy would detects knocks of aggression or frustration and respond by turning on a calming light. The light would gradually fade from off to on repeatedly until the user tapped Study Buddy directly to signify that the calming light was no longer needed. Study Buddy proved a valuable exercise as I learned that calibration was important to avoid picking up accidental knocks.
In project 2 I created the primitive version of Beat Buddy to explore ‘knocking’ in a more playful light. Beat Buddy detected taps and knocks against the surface it was placed on and fed this data to a companion program running on a computer. The program would process the data and plot the interpreted beats on a loop. The loop would then feed back to Beat Buddy and the device would play the beats using a servomotor. The user would be able to see the beats that had been recorded and either tap along to the beat they just made, or add to it by tapping the surface again.
Version 2 of Beat Buddy had a much more interesting user interface. The companion program I wrote using Processing visualised the beats in real-time and in an interesting way. Not only was the program interesting visually, it also had very useful functions built in; the user was able to manipulate the beats that had been recorded. For the hardware I used a similar layout to that of Study Buddy, it proved to work well for the purposes of this project.
One of the more complex parts of the project was the code. By the end of the project the companion program for Beat Buddy ended up having over 800 lines of code. However, roughly 80% of the code was to drive the visual animation. Part of what made the visuals so complex is that they were generative; they grew and changed without user input. This allowed for some incredibly unique and complex graphics to be generated.
The companion app was made up of five classes; cell, link, node, beat and time. The first three are solely to drive the visuals. The beat class handled the knocks that were read in from Beat Buddy. It would determine if the knock detected was greater than the specified threshold and if so, it would create a beat on the timeline. The time class is what looped over the recorded beats. It played the important part of feeding the beats back to the device to be played on the servomotor. It also hooked into the user interface to give the user control over the beats. The user could remove any one of the individual beats or remove them all at once to create a new loop.
The enclosure for Beat Buddy appears simple enough on the outside, however, it took some precise measurements and a LOT of trial and error with the laser cutter before everything came together perfectly.
In my initial sketches I outlined that I would like to have curved edges for the top of the enclosure. I thought this would surely be simple enough to achieve with the laser cutter. My first cut snapped well before it got to the 90° angle. It was obvious that I needed to do a bit of research. I soon found out that this type of curve is called a ‘lattice hinge’ or ‘living hinge’ and that people had done research into a good formula for cutting these hinges. After reading up on the tests that had been done at http://www.deferredprocrastination.co.uk/ I managed to create a hinge that worked well for the thickness of ply I was using.
The circuitry for Beat Buddy was quite simple. There was a servomotor to drive the hammer and a piezoelectric sensor that detects knocks against the surface. The piezoelectric sensor was limited by a 330 ohm resistor. I tested several different resistors and 330 ohms proved to be the most reliable for what I was measuring. The servomotor was driven directly off the 5v line from the Arduino Pro Mini.