DJPlayer - the personal media performance
(http://www.youtube.com/watch?v=0Af_bi_UDnU)
The purpose of this design was to make a music player which was not only a personal media player, but also a personal media performance. Probably the audience I am most designing for is college- and high-school- age people who want to do more with their music than just listen to it. The DJPlayer is a device which plays songs as if on a record player - you can control the speed of the playback, as well as "scratch" the song by moving the player rapidly back and forth. This is mostly accomplished through an accelerometer.
Future goals for this project:
- Song announcement. Since there is no display, we would like the player to speak the name of the song when the user changes songs.
- Automatic download software. Since the player requires a specific file format (for which the tools are not easily accessible to un-computer-saavy users), we would like an easy software package which automatically handles the conversion.
- Support reverse play.
Implementation details:
The software is written in C++, using the Arduino libraries. In the end, I ditched the actual Arduino IDE and build system, and simply used a Makefile along with WinAVR to compile my code. (Since the Teensy loader can load .HEX files from anywhere, uploading was still relatively easy.) This is because of a problem I ran into early - the Teensy's Atmega is just barely fast enough to stream PCM wave data to the MP3 decoder chip. My software uses some custom functions and Makefile optimization flags in order to run at an acceptable speed.
The decoding works as follows: all songs are stored in standard PCM WAV format, with 16-bit unsigned samples, mono, at 22 KHz. I standardized the song format so that doing the speed interpolation would be easier, and used some slightly lower quality settings both to save space on the MicroSD card and to allow the Teensy to keep up, speed-wise. Speed variance is done sample-by-sample - no actual interpolation is done between samples due to inadequate speed. Only forward speeds are supported for now. All math is done in fixed point: I use a 8p8 fixed-point format. (That is, 7 bits (+1 sign bit) for the integral part and 8 bits for the fractional part. That means the smallest positive number I can store is 1/256 and the largest is 127 + 255/256.) Floating-point math on the Arduino (which doesn't have dedicated hardware for it) is reportedly up to 1000x slower than integer math, so the choice was obvious.
I have also other small libraries for things such as reading the joystick (which currently doesn't do anything). The code which I have written for this player can be found here:
http://nongraphical.com/hg-pub/
Hardware details:
The whole thing runs on 3.3V. My power source is a 6-battery pack running through an LD33V regulator.

Rough diagram of assembly:

Comments (0)
You don't have permission to comment on this page.