You Are Here: Home » AVR ATmega Projects » Sound - Audio Projects » Musical Blocks Using Atmel ATmega 644

Musical Blocks Using Atmel ATmega 644




ntroduction

The purpose of this project is to create musical blocks that output music without requiring some sort of musical talent.

Musical Blocks tracks the position of the blocks on a flat surface in a range seen by the Wiimote. The path of the blocks is then converted into a sequence of notes which is output. One can create an interactive system by having many blocks which can be used by many people simultaneously. Unlike traditional computer interfaces used to create electronic music, the musical block is a more expressive and physical/hands-on tools for creating music. In our design, the user can move blocks on any 2-D surface in a specified range and modify the musical rhythm in real time by changing the path of the block. Each block has its own unique sound associated with it and the musical rhythm would continuously play unless the block is stationary. One block is allocated to change the volume of the music played by the other blocks.

High Level Design

Project Inspiration

This project is inspired by the idea from the project called Siftables from MIT media lab. Siftables came from the idea of modifying the way we interact with computer in terms of pictures, music, or any sort of digital information. According to one of Siftables creator David Merrill, when we were children, reaching out and moving blocks, we are actually learning to think and solve problems by understanding and manipulating spatial relationship. Spatial reasoning is deeply connected to how we understand the world around us. We were inspired by the concept of Siftables and decided to create a musical block system specifically targeting young children. Without being a child musical protege, children can try to create a world of spatial interaction by manipulating and creating music. This can also serve to cultivate creativity and curiosity in children. Our decision to create a sound based on path is inspired from the collection of games called electroplankton (with a specific game interface called Tracy) on the Nintendo DS. Tracy allows the user to draw a line on the touch screen and create the sound based on the line drawn. We were fascinated by these two concepts and decided to create musical blocks. In our design we used three blocks, one to represent a plucked string sound, one to represent a violin sound, and one to control the volume.

Background Math

We used the Karplus-Strong Algorithm to compute the sound to output. The Karplus-Strong Algorithm uses physical modeling synthesis to generate a sound. A mathematical model of this algorithm is

KarlplusStrong
In this model, x(n) represents a white noise which is used as an excitation for the initial part of the sound. The output sound is fed back to the delay line and averaged to create the pluck-sound. The averager is used to create the damping feature of the string. Studies of Ideal Plucked String and why Karplus Strong Algorithm works:
plucked string
equency. In general, damping will increase with frequency.

Violin

A physical model for the bow-String such as a violin is very complicated in terms of keeping track of bow pressure, bow velocity, bow width and bridge distance. A basic model of bow-string interaction model consist of two traveling waves represented by velocity v at the contact point coming from vin from nut and vib from the bridge and outputting two travelling waves of von and vob. Bow String interaction is represented by

In the next figure f represents the frictional force while Hlt and Hrt are the filters that model the losses of the left-going and right-going waves propagating toward the bridge and the nut respectively.
We noticed that this model looks a little like the physical model of the Karplus-Strong Algorithm. However, a plucked-string waveform has a feature of decaying slowly over time while the violin has a feature of creating a longer sustain time to create that bowed-string sound.
Therefore, we decided to use Karplus-Strong Algorithm to create a pulled-string sound. To create the sound, we used an ADSR envelope and convoluted with Karplus-Strong Algorithm output. ADSR stands for Attack, Decay, Sustain and Release time and is used to model the timbre of an instrument.
Different family of instruments has their own ADSR profiles. The attack phase is refers to how the sound is initiated. The greater the slope of attack the harder you press down on the piano or faster you strum on a guitar. The decay phase describes how rapidly the sound dies down from the attack phase to the sustain phase. Some instruments like a drum have extremely fast decay. The sustain phase refers to how long the sound resonates from when it is played. Finally, the release phase refers to how fast the sound decays away once you release the instrument such as releasing the piano key.
The violin has a slightly slower attack than the guitar but the other phases are drastically different. Because a violin is bowed to produce sound, there is virtually no decay and a long sustain. Constant vibrational energy is delivered to the violins sound box and the sound only fades once the bowing stops.

As mentioned previously, due to some of the similarities between the physical model of the plucked-string and bowed-string, we decided to apply the Violin ADSR Profile onto the plucked-string output from the Karplus-Strong Algorithm.

Parts List:

Budget and Parts ListQuantityAmountSource
Infrared LED Vishay/Semiconductors TSAL640012$5.34Digikey
Resistor Pack 1K1476 Lab Stock
Resistor Pack 2K2476 Lab Stock
Resistor (Low-pass filter and LED board)5476 Lab Stock
Atmel ATmega 6441$8
ECE 476 Custom PCB1$4
MAX2321SampledMaxim-IC
Perf Board3$3476 Lab Stock
9V batteries3$3.75Battery Warehouse
DIP Socket2$1476 Lab Stock
Header socket/plug2$1476 Lab Stock
Wiimote1previously owned
STK5001$15476 Lab Stock
40 pin socket1$.50476 Lab Stock
20 pin socket1$.50476 Lab Stock
Serial Connector1$1.65476 Lab Stock
jumpers3$1.50476 Lab Stock
White Board1$6476 Lab Stock
Total: $51.24

For more detail: Musical Blocks Using Atmel ATmega 644

Leave a Comment

You must be logged in to post a comment.

Read previous post:
Earliest humans had diverse range of body types, just as we do today

One of the dominant theories of our evolution is that our genus, Homo, evolved from small-bodied early humans to become...

Close
Scroll to top