Musical Blocks Using Atmel ATmega 644


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

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.


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 List Quantity Amount Source
Infrared LED Vishay/Semiconductors TSAL6400 12 $5.34 Digikey
Resistor Pack 1K 1 476 Lab Stock
Resistor Pack 2K 2 476 Lab Stock
Resistor (Low-pass filter and LED board) 5 476 Lab Stock
Atmel ATmega 644 1 $8
ECE 476 Custom PCB 1 $4
MAX232 1 Sampled Maxim-IC
Perf Board 3 $3 476 Lab Stock
9V batteries 3 $3.75 Battery Warehouse
DIP Socket 2 $1 476 Lab Stock
Header socket/plug 2 $1 476 Lab Stock
Wiimote 1 previously owned
STK500 1 $15 476 Lab Stock
40 pin socket 1 $.50 476 Lab Stock
20 pin socket 1 $.50 476 Lab Stock
Serial Connector 1 $1.65 476 Lab Stock
jumpers 3 $1.50 476 Lab Stock
White Board 1 $6 476 Lab Stock
Total: $51.24

For more detail: Musical Blocks Using Atmel ATmega 644

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top