Steve Mostovoy and Tim Boy Jr recently created a digital audio workstation for their high school senior project. Dubbed “TouchSynth,” the platform is powered by an Atmel-based Arduino Mega (ATmega1280). Additional key specs include a Maxim 7224 8-Bit DAC (with output amplifier), Longtech Optics LCM1602A 16×2 LCD, Philips HEF4794B LED driver, NFM-7881 8×8 LED Matrix and a four-wire resistive touchpad.
“Putting together the hardware was months of work. We started with breadboard designs to test the circuitry, and eventually moved to a vector board and a project box to get the project into its final form,” Mostovoy wrote in a detailed blog post describing the project. “For the stripboard design, we designed it digitally before we got started soldering. It turned out alright, if not a bit messier than we hoped. A large part of the issue [was related to] sending 16 wires to the 8×8 LED matrix. That could have been avoided with multiplexing and demultiplexing, but we decided not to spend the effort at that point, as we had a tight deadline.”
On the software side, the duo coded a simple program to generate amplitude lists for sin, triangle, saw and square waves at every frequency between A3 and G#5 (the range of the device), which were then written to program memory.
“The pgmLoc array stores the array positions that each different frequency starts at. They get smaller and smaller because we started at a low frequency, long wavelength and end up at a high frequency, short wavelength. Each waveform is a full period,” Mostovoy explained. “From there, we had to design the play function. In short, it had to do the following: play the song at full speed with no interruptions and handle varying tempos, [all while] displaying the song as it plays and highlights the (currently) played column.”
TouchSynth was a remarkably fun project to work on, says Mostovoy, as it taught him how not to organize code, how to think in terms of data and how to optimize.
“It also taught me not to pre-optimize, after I saw how ugly the settings code got for no reason. That could have been solved through some abstraction, but it was an unnecessary effort. I’m very happy with the final product, and I’m pleased with the Arduino’s robustness and reliability,” he added.
Interested in learning more? You can check out the project’s official page here and the code on Github here.
It should be noted that the TouchSynth was recently featured on the official Arduino blog.