Bordeaux-FFT is a small library for computing the FFT/IFFT on complex data, originally written by Robert Strandh (and/or Sylvain Marchand and Martin Raspaud), with contributions by Paul Khuong and myself. Last summer I did some audio processing experiments, originally using the FFT code from Sapaclisp. Robert helpfully volunteered his FFT implementation, which I cleaned up slightly and have been cheerfully employing in various audio hacks ever since. Several versions have changed hands through email, lisppaste, and my web server, so I've finally come around to collecting the changes, writing a brief manual, and tarring up a release. It's surprisingly fast, particularly with Paul Khuong's recent work on SBCL, although I don't know how it stacks up against some of the highly tuned assembly language implementations out there. I use it along with my fledgling task queuing code to grind out batches of FFTs across four CPU cores.
Shuffletron is a simple music player in CL, with a few interesting features. I've been running this program full time for several weeks now as my preferred music player. It snuck on to the lisp subreddit before I really announced it, and I'm sure folks on IRC are already sick of hearing about it, so I won't say much. I began with plans for a much more ambitious player, with a fancy graphical interface, and wrote the first version of this one Saturday realizing I needed something simple to put the audio code through its paces while I wrote the full player, intending to include this one as an example program with Mixalot. It worked better than expected, so I ended up fleshing out the feature set instead and decided that it was really all I needed. The code is lean and mean.
I've had a number of problems trying to produce redistributable binaries of this which I believe I've finally solved (although new binaries are forthcoming). I hope to write about these later.
Mixalot is the audio back-end of Shuffletron, factored into its own system(s) because it might be useful for other purposes. It includes a mixer which pulls audio from any number of streamer objects and outputs them to ALSA. It also includes FFI definitions for libmpg123 with some helpers for decoding MP3 files and reading ID3 tags, and a streamer class for decoding and playing MP3 files in real time. The libmpg123 portions are usable independently of the audio mixing/output code.
Perhaps eMusic feels that access to the wider catalog of music will offset the increased cost. If they think their existing subscribers will understand, they are gravely mistaken. Given the option, I'd rather Sony Music go out of business, their back catalog be destroyed in a fire, and their CEO choke to death on his breakfast. This article puts it nicely:
Most eMusic fans I've heard from are real music nuts, and are there to sample a wide range of music from relatively unknown cutting-edge acts, not to download music they could find anywhere. Imagine the clerks in High Fidelity suddenly being told that their favorite mail-order distributor is raising prices, but in exchange will now let them order ABBA and Chili Peppers records just like the chain stores in the mall.
In my brief investigations so far, I haven't found another music service that is competitive with eMusic, even (perhaps) at their new price point. I don't consider that an argument for staying with eMusic rather than defecting to another service, though. Given that I consider $0.40/song roughly twice what I'd call a reasonable price, I instead take it as an argument for not buying music online at all. It isn't like there aren't alternatives.
- Music:Au Revoir Simone, "The Lucky One"
Audacious - No, this one is a step backward. The file dialog (which I suppose is just the Gtk2 file dialog, tarted up with their obnoxious theme) is noticeably slower than the one you get in xmms (the old Gtk 1.2 file selector, which responds practically instantaneously under any reasonable circumstance), and the loss of the "Add selected files" button destroys the workflow - I'm not going to make ten round trips in and out of that dialog just to pick a handful of files in different directories. This program would be much more useful to me if this feature were restored.
xmms2 - Imagine my dismay when installing xmms2 didn't yield any UI except a command-line interface, and expected me to run a separate server process. A client/server music player? Thanks, but no thanks. Enough with the servers. Trying to be a good sport, I apt-got a graphical client, gxmms2, and attempted to play a song. Oops, "xmms2d" isn't running - why can't it start the goddamn thing itself? The UI is a bit clumsy, but I poked around and added an mp3 to the playlist, or so I thought. Upon hitting play, it instead played "/usr/share/xmms2/mind.in.a.box-lament_s
iTunes style players - These don't really compete - the style of use is different. I often run Quod Libet and xmms at the same time, but most music is played through xmms, for at least two reasons - first, iTunes-alikes have large windows that deserve a whole desktop to themselves, whereas xmms is tiny and fits on whichever desktop I'm working without cluttering it, such that I use xmms just because it's closer. Second, having organized my music into a reasonable tree on the disk, I can find whatever I want just as quickly as you might using a fancy overengineered browser based on id3 tags, and without the headaches of bad or missing tags, multiple spellings of artists names (plus the mess of various artist + collaborator combinations), etc. Indeed, even in Quod Libet, I usually use the "Filesystem Browser" mode.
Although think Quod Libet is the most usable of the iTunes-style players, it's been a couple years since I last surveyed them and settled on it, and there are some very irritating things about the UI - that the volume and seek bars are hidden inside of little popup menus, or the height of the "queue" not being resizable (such that if you want to rearrange songs in the queue, you can only move them a few spaces at a time between scrolling, like some kind of goddamn bubble sort).
In fact, the whole reason I reached for xmms is because I'd been using Quod Libet on this machine to sort through some new music, but this particular instance of it frequently misbehaves such that I'd just prefer something simpler.
Search seems like a promising way to find files to play, but I haven't used a player that embraces this concept. I used the search in iTunes on occasion, but it was unnecessarily sluggish. Quod has a search feature too, but it's hidden in another tab with no obvious keyboard short cut, and is outrageously slow (many seconds to conduct a search). I never understood why this sort of thing should be anything less than instantaneous, even over many tens of thousands of files, so one day a couple years ago I quickly hacked together something in Lisp that used a Boyer-Moore search across the filenames and showed the matches interactively as you typed with a simple mcclim gui, and it didn't take more than a few hours of effort to get this fast enough to feel instantaneous, even running synchronously inside the text field's "value changed" event handler. So all the really fun stuff I imagined implementing, like doing the searching in a background thread, and pipelining the search to refine the results of previous searches as you continued to type (rather than searching the whole data set on every keystroke, as it currently does), turned out to be completely unnecessary! So you'd type, and as you did the matches would appear in a list below the search line, and you could click one to play it in xmms. Very simple. I used this on and off for a few weeks, and had some ambitions of turning it into a genuinely useful music player, but never got around to it due to short attention span and various mcclim issues which I am unable or unwilling to fix, such as the focus insanity and difficulty in establishling workable keyboard controls. I think I'll just wait until I have a better substrate for the UI. A fuller implementation would have to do several times as much work due to searching metadata in addition to filenames, but several times a small number might still be a fairly small number, so no problem. Anyway, with Lisp's reputation for being slow (or within the Lisp community, mcclim's reputation for being slow ;), maybe the authors of the more ambitious music players can be shamed into improving their search and making it fast.
And now I'm off to compile xmms and see how many of the plugins I can 1) locate and 2) succeed in compiling.
- Music:Tito Puente And His Latin Ensemble, "Giant Steps"
These are the first things that leap to mind when attempting to enumerate my favorite chiptunes:
- Highscore (Adlib), composed by Drax and Metal of Vibrants for the game Lollypop, but not used. I peeked at the 'source' in Edlib so I could play it on piano. Too bad there isn't a longer version. [mp3]
- Breaking Wind (Adlib), another by Drax/Metal. I'm not normally fond of the OPL2, but these guys really make it sing. [mp3]
- Azzdjazz (C64), by PRI. His masterpiece. There's several others I like by him as well - Going_Round.sid, Rainbow_Shuffle.sid, Short_and_Sweet.sid, Soundwave.sid, and Sweet_and_Sour.sid are runners up.
- AcidJazzed Evening (C64) by Glenn Gallefoss, a sidtune remake of this mod file. I discovered this gem during the controversy involving a certain famous producer. I'm not sure which version I prefer.
- Weather_Girl.sid (C64) by Alien.
- A Juicy Doodle (C64) by Hein Holt is somewhat unsettling.
- Commando (C64) by the famous Rob Hubbard, rocks out like nothing before or since. See also: "Commando Jackson" (not an easy file to find).
- The Ballblazer theme. This is a tricky one - the SID version is inferior, and the SAP (Pokey) version I've found is 50 Hz, which ruins the whole thing, and it wouldn't play correctly anyway. My solution was to let the game run for 36 minutes in an emulator at the correct (NTSC) frequency, recording it to a wave file. Wave files of emulated chiptunes compress surprisingly well using standard lossless compression, due to the absence of noise and uniformity of waveforms. Wikipedia claims the melody is algorithmically generated -- some day I'll disassemble it to see for myself.
I could list more, but I think I'm already cheating by including music from well-known games. Time to get my players in order and find another list worth of tunes. Kohina is a start.
- Mood:Not an atomic playboy
I approach the store from the worst possible angle - I use Linux as my desktop OS, and so am unable to run Amazon's download manager, and further I use the adblock and no-script plugins, which wreak havoc with hostile and poorly designed web sites. While it might be unfair passing judgement on the service from this perspective, i already use emusic from the same configuration, and despite there being a linux version of the emusic download manager, I don't bother with it.
The Good:
- Uncrippled, high-quality mp3 files, with sane file names
- As an existing Amazon customer, I could immediately purchase MP3 downloads with no fuss or registration.
- Everything else.
Does it work better in Windows, with IE and Amazon's download manager software? Probably. I wouldn't know.
- Music:David Alexandre Winter, "Qu'Est Ce Que J'Ai Danse!"
(in file.c, mckc 0.25)
113c113 < ptr = malloc( size ); --- > ptr = malloc( size + 1);
In order to simplify my workflow, I put the sequence of commands to compile/assemble/play the mckc song into a shell script, go.sh:
#!/bin/sh rm -f make_nsf.nes rm -f effect.h rm -f songdata.h ./mckc songdata.mml >/tmp/mckc-out # useless return code if [[ -f songdata.h ]] then ./nesasm -raw make_nsf.txt >>/tmp/mckc-out fi # neither mckc nor nesmasm appear to indicate failure # in their exit status. If we give xmms the name of a # nonexistant file, it will pop open its file dialog, # which is not helpful. To avoid this, check that the # output file was created, playing it if so, or show # the error output if not. if [[ -a make_nsf.nes ]] then xmms make_nsf.nes else play /usr/share/sounds/gnobots2/splat.wav vol 0.3 >/dev/null 2>&1 & xmessage -file /tmp/mckc-out fi
I wanted to trigger this from emacs by a single key press, so I defined the following function which saves the MML buffer and runs the compile/play script. I seldom use elisp and had to dig around in apropos the find the functions I needed, but this seems to do the trick:
(defun play-mck-songdata ()
(interactive)
(save-some-buffers
(list (find-buffer-visiting
"/home/hefner/nerdly/mck/songdata.mml")))
(call-process-shell-command
"cd /home/hefner/nerdly/mck/ && /home/hefner/nerdly/mck/go.sh"))
Binding that to F12, I can edit and hear the results with a single keystroke (versus the six and a half keystrokes it would take to save the file, switch to a terminal, recall/repeat the compile and play command, and switch back, but whatever, this way is more fun). Neat.
- Music:Ruxpin, "Ljufa Lif"
MML, the "Music Macro Language". Widely used by Japanese VGM composers targeting classic sound chips, or so I've read. Specifying polyphonic music textually is a tricky business, doubly so when various parameters (pitch, amplitude, duty cycle, etc.) must be animated continuously to coax interesting timbres from simple hardware.
MML embodies one successful approach to the problem. The MCKC compiler, in conjunction with the MCK sound driver and an appropriate assembler toolchain, allows compilation of music specified via MML into a playable NSF file. Despite the name, there doesn't appear to be a general purpose macro facility. Rather, it provides a number of built-in 'macros' for automating parameters, performing arpeggios, etc.
I haven't taken MCKC for a spin yet, but it looks very capable. Certainly an improvement over composing music in assembly language.
MML/MCKC Links:
