Hi there, just thought I'd document what I've been working on since the RasPi came through the letterbox on Friday. If anyone has questions or suggestions, I'm all ears! Oh, and although I can cobble together some easyish stuff, bear in mind that I'm not a programmer; just an enthusiastic amateur. I'm happy to be corrected where I've gone wrong!
I'm not going to bore everyone with a history of the demoscene, the Commodore Amiga and Protracker/FastTracker/ScreamTracker module formats as I'm sure this'll only get clicked on by people who know what the subject heading means
Long story short: I made a very flexible, very lightweight, highly interactive MOD/XM/S3M replayer library for Processing some years ago. The idea was that people could put module-format soundtracks in Processing sketches while keeping the sketches very small for web viewing - most MOD music is well under 500kb, often around 20kb. Not many people used it, but I'd mostly done it for my own amusement. I used that library to create a dual-deck module DJing app called Chipdisco, an old version of which you can try in the browser complete with multiple MIDI input devices, multiple soundcard support and a baffling user interface here (drag and drop a file from the playlist to a deck to start playback).
Processing is dropping applet support and, frankly, running this in the browser in this day and age is problematic - Apple's Java implementations seem to get worse every year and they've already broken bits of javasound. So I decided to overhaul Chipdisco last week, throw out a load of bloat and turn it back into an app to be run locally without any of the security/signing problems.
The more I optimised it, the more I realised that playing back these archaic formats should be quite possible on a machine like RasPi - after all, the Amiga 500 was only rocking 7mhz and a bit of DMA hardware. Ordered a RasPi from Farnell, arrived a few days later, and after some false starts (and a lot of helpful posts on this forum about the Java situation) I got openJDK installed and got Chipdisco to at least *run*, if not play anything. Writing a tiny test Java app using my PortaMod library got me successful playback of a 4-channel MOD, but with epic stuttering. I realised that was mostly due to Processing's draw() loop, which uses quite a lot of juice and can't be disabled. Well, it can, but you can't run Processing apps headless. So I had to strip all the Processing-reliant stuff out and recreate it in pure Java - bit of a nightmare as I'm a horribly bad programmer, but there's a lot of help out there and I've become quite experienced at Googling it
Once I'd got that app together and transferred it over, the errors I was getting were javasound SourceDataLine errors mentioning PulseAudio. Got past that by just installing PulseAudio (a whopping 100mb on my tiny SD card), but I think it's a failure on the JVM's part to simply detect whether or not PulseAudio is there and, if not, to just use ALSA instead. Sledgehammer/walnut - I hope that ceases to be a problem when a solid, fast, Oracle JVM comes along for RasPi. From the chat on this forum and elsewhere, there seems to be a lot of interest in getting Java to run tolerably on RasPi and, as I use Processing quite a bit for teaching and for interactive digital art, I'd love to see it easily available to beginners on the platform. Anyway, openJDK is slow for now but EVEN SO, I got listenable playback!
Playing from the commandline is fine; when the Rasbpian GUI is running, moving the mouse will cause stutters while the poor thing tries to keep up with its redraws. Booting to shell is better, and I'm sure better audio driver implementations, better FPU, better JVMs and various other improvements will eventually mean I can play complex 32-channel FastTracker XMs without stuttering (gotta be optimistic!)
My final experiments have been with receiving USB MIDI with Java. It seems to work quite well, but I've read that having the USB ports enabled draws quite a bit of CPU, even when they're idle...so it might be better to do this over the GPIO in future - someone's designed a breakout board that I might try to build.
Put it all together and, ultimately, I want to have RasPi as a headless, mouseless, keyboardless, portable, dual-deck MOD DJ box into which I can plug my MIDI controller and rock some (very nerdy) parties! Reet - sorry for the huge essay, and I'll update this thread when (and if) I make progress.