Automating workout mixes – help?

The mix console of Garageband 5 used to produce a workout MP3

Update: I think I have this figured out: SoX will do pretty much everything I need. It’ll even do intelligent crossfades and tempo adjustment. w00t!

The Problem—Short Form

Given a database of MP3 files and their intro and outro times, I need a piece of software with a text-based file format that will allow me to programmatically produce a workout mix, crossfading between tracks at the specified intervals. Conceptually:

[Track 1]
file    = /path/to/track01.mp3
startAt = 00:00:00
endAt   = 00:03:21

[Track 2]
file    = /path/to/track2.mp3
startAt = 00:00:17
endAt   = 00:02:57

I’m unconcerned with the input file format, as long as it’s something I can produce with, for example, Perl. My one effect requirement is the ability to crossfade, but I don’t need beat-matching or other magic. (I’d like to also be able to pan, but that’s a want, not a need.)

I’ve tried:

The input .band file format is binary. (Wrapped in xml to look friendly, but binary nonetheless.)
The .aup project file format is XML and readily suits my needs … but the audio has to be pre-converted into chunked .au files.
The .stmp file format is binary.

So, Lazyweb, any suggestions?

The Problem—Long Form

As the weather gets warmer and the runs get longer, I find myself in need of more customized music for my workouts. Sometimes I want an interval mix, sometimes a gentle climb. Point being, I’ve got a hundred gigabytes of music and I’d like to put it to good use. I’ve got it BPM-tagged, as well as ancillary data on how long the intros and outros are.

But, mixing the music takes time. I’ve gotten it down to about 2:1 time invested to playback length—a 30-minute mix takes about an hour to prepare—but I’d like a bit more randomization.

I’d really, really like to programmatically generate my own playlists, with instructions for where to start and end each song. But, in all my poking around, I have yet to find a program with a plain text input file that will also take MP3s.

I’ve started looking into Csound, but that seems like it might be like hiring a defense contractor to build a bird house. It may just come down to Perl → mp3spltmadplay → faac, presuming I can figure out a way to hack in little crossfades between tracks.

Any suggestions?

Categorized as Web

By Rick Osborne

I am a web geek who has been doing this sort of thing entirely too long. I rant, I muse, I whine. That is, I am not at all atypical for my breed.