Archive for the ‘Music’ category

VisualTouch Music Game — blending HW & SW

July 1, 2015

Embedded systems are everywhere.  A digital watch, microwave oven, electronic toy, and your car dashboard are a few disparate examples.  The characteristics of an embedded system are:

  • Made from a combination of hardware and software
  • Task specific. They’re designed to perform one specialized task as opposed to general purpose computers
  • Usually reactive or feedback-oriented.  E.g. most home or kitchen appliances only function when you interact with them.
  • Built with efficiency and frugality.  Your toaster needs a timer and heat control, but it really doesn’t need a full-fledged CPU
  • Should be reliable and stable.  Because they are simple, we expect these machines to work. They shouldn’t require maintenance because it’s often easier and cheaper to buy a new one.

For my required EE Hardware design project, my team developed an embedded system on an Atlys Spartan-6 Development Board.  This board constructs your hardware specification, like an FPGA, but then it can also run C software that you place on top of the hardware.

StanleyFPGA

My brother’s Flat Stanley visited me while I was working in the EE lab.  Sadly, I couldn’t find a photo of our finished project, but this is our Spartan-6 Development Board

We hooked up a webcam, a screen, and speakers to our Board.  We had the screen display the camera’s output.  Our game consisted of these playable modes:

  1. Changes the chord’s duration based on the red/blue/green content of the overall pixel count.
  2. Changes the chord based the amount of movement detected by the camera.
  3. A grid is overlaid on the screen. When a user in front of the camera covers a square of the grid with their hand, the board plays a song.

Skills:

  •  Verilog code in Xilinx Platform Studio configures the processor-based system.  [The hardware platform managed the transfer of data from the camera to the screen.  All the song data was also implemented in hardware.]
  •  C programming in Xilinx Software Development Kit.  [Everything else:  the music player, game controls, game logic, pixel computations were done in software.]

Key Takeaway:    This project was a turning point: creating the hardware infrastructure was important, but the software was the crux of the game! My specialty was more on the hardware side and I realized that I shouldn’t leave college without delving into the software domain.

Screen Shot 2015-07-01 at 8.00.14 PM

DJ mode allows user to mash these pop songs together based on where one’s hand is positioned in the screen’s grid.

Arduino Music Box

June 30, 2015

In my first year, I took an introductory electronics course that gave us access to

  • analog circuits:  circuits are closed loops featuring electronic components (such as resistors, transistors, LEDs, transistors, amplifiers);  there’s also a power source that raises the voltage, pumps current, putting all the components in action.
  • sensors:  interactive devices (such as buttons, wheels, temperature sensor etc. ) that can sense their surroundings
  • microcrontrollers:  named ‘micro’ because they are small, simple, cheap computers; ‘controller’ because they are mainly are used to run simple logic to control other devices.  Though it can execute code like any computer, it doesn’t have the computing power to run your laptop or phone.

After training us with all these parts and more, we were then let loose to build our own final project.  I had the most fun running simple code on an Arduino Nano microcrontroller.    Using an empty cigar box, I made a music box that plays mp3s from an SD card and displays its song name on a tiny screen.

This was filmed in 2011 when my phone was technologically more similar to a potato than a modern smartphone.

New skills:

  • First time constructing non-trivial circuits and using equations like Ohm’s Law in real life instead in a notebook.
  • C++ programming in using Arduino Integrated Development Environment (IDE) which runs the code.

Followup Questions:  How does the microcontroller work?  How did it interpret the mp3 file and decode into playable sounds? How to organize circuit wirings so it’s not a hot mess?

Key Takeaway:  An auspicious introduction to electronics where I quickly learned that digital domain (running code on microcrontroller) is friendlier than analog domain (soldering little wires and devices together and measuring with oscilloscope).

In retrospect, this key takeaway became a catalyst for a lot of other things.  First impressions DO count!