Sunday, March 14, 2010

Concentration


Last Christmas, I got my wife a Creative Zen X-Fi 2 media player. It came with one game, Sudoku and the Creative labs website didn't have any others to download; recently a little searching showed that they had released an Application Development Kit for the player. The kit is really just a simulator and a document describing the API. Programming on the X-Fi 2 is done with the text esditor of your choice in Lua, which I'd never used but turned out not to be that hard. Structurally, it's a lot like LISP (which I knew from developing AutoCAD extensions) but with a more straightforward syntax.

I just finished making my first game, a version of the classic memory game Concentration. There are screenshots on this post, and you can download the package (Free, distributed under GPL) here: Concentration.zip

Even if you don't have the Zen, you can play it on the simulator that's part of the ADK above.

Monday, February 22, 2010

Microcontrollers, ho!

One way or another, the next major project will probably involve microcontrollers. A few possibilities:
  1. Reconfigurable tube guitar amplifier: An amplifier has a mutable topology that is be at least as flexible as a typical channel-switched amp, but with fewer signal-path components. The microcontroller is there to keep track of valid topological arrangements and operate relays and softswitches. It also mutes out switching sounds as appropriate and allows for timing sequences to prevent damage during switching. User favorites are assigned to a footswitch. It needs an entire amp designed and debugged with manual switching before the controller is brought into the mix.
  2. Digitally-controlled analog stompbox: The device is a distortion, filter & vibrato effect pedal. The signal path is analog, but reconfigurable in a similar way to the amplifier above. The MCU controls timing of the vibrato, which can be simple or complex, and set to an actual BPM tempo to match the music. In addition, an envelope sense circuit allows the vibrato to be synchronized to the incoming signal.
  3. Digital waveguide synthesizer: Based on the Karplus-Strong algorithm (US Pat 4,649,783), a standalone MIDI synthesizer module, though not necessarily simulating plucked or struck instruments. I'm thinking monophonic, bowed sounds with natural hammered-on slurs.
Projects 1 & 2 could use Arduino or one of the tiniest PICAXE controllers which are easy to program, but 3 would require a DSP, which could be integrated with the MCU (into a DSC). The usual microcontrollers don't have the RAM for a wavetable, and don't have the I/O speed to talk to a pro-audio-quality Digital-to-Analog converter. As far as I can tell, only PIC makes a DSC that is in-circuit programmable. I don't know if the PICAXE bootloader would work, or if another bootloader would be needed.