Miscellaneous Free Code
Here it is, fellas. This is the page where you'll find little programs I've written which simply don't belong anywhere else! They're free, so don't let anything prevent you from using them.
Support for Numark Total Control in Mixxx
Mixxx is a free, open source DJ mixing program. In 2008, I worked with the Mixxx core development team to add support for Numark's Total Control MIDI control surface. Although I went into the project thinking it would be simple, it ended up being fairly complicated. Here's what I wrote about it in my blog:
“Although I now had a nice, high-quality control surface which worked under Linux, Mixxx still had no idea how to interface with it. I didn't think that would be an issue, as I thought it would simply be a matter of creating a new MIDI map file and ‘training’ Mixxx how to talk with the Total Control.
“Before I could do that, however, I needed to know the MIDI codes used to communicate with the Total Control. There was some documentation available from Numark, but it was incomplete and not quite accurate. So, in preparation for a campaign to add Total Control support to Mixxx, I reverse-engineered the MIDI codes and published them on the Mixxx documentation wiki.
“From there, I thought I would be able to simply assemble an XML MIDI mapping which would allow Mixxx to support the Numark Total Control. However, the Total Control surface has a number of features about it which make it unlike any other MIDI controller previously supported by Mixxx.
“So, in the end, I had to submit about a half-dozen patches to the Mixxx codebase in order to fully support the most important features of the Total Control surface. (For example, the track selection knob, which allows users to scroll through the library and load tracks without ever using the mouse.) And, while I was at it I discovered (and fixed) a number of unrelated bugs in Mixxx, too.
“I let that sit and stew for a while, mostly because I was too busy to worry about it much. But recently I received a couple of emails from people wondering what the status was, which prompted me to finally finish up the patches and the MIDI mapping. So now, as of today, Mixxx officially supports the Numark Total Control. All of my patches and MIDI mappings are in SVN, which means that they will be included in the next release. (From what I'm hearing, probably 1.6.0.)”
The patches I wrote have all been merged with the main Mixxx codebase. My MIDI map file for the Numark Total Control is also officially part of Mixxx, but the most recent version will also remain available here: Numark Total Control.midi.xml
Wrap (Word Wrapping for Human Beings)
Wrap is a word wrapping program I wrote out of frustration with the alternatives. (Although, to my chagrin, I discovered GNU fold about five minutes after finishing up with Wrap.) Here's what I wrote about Wrap in my blog:
“My program, Wrap, is a bit more featureful than GNU fold, but is a tiny bit slower. (Although the benchmarking process wasn’t very comprehensive, so I guess the jury’s still out.)
“The main practical difference between Wrap and fold, as far as I can tell, is that Wrap has a multitude of options for changing the behavior of the word wrapping algorithm. Want to cut words at the maximum line width? Check. Want to wrap words at spaces and tabs? Check. Want to allow long strings (such as URLs) to violate the maximum line width rule? Check. Want to allow wrapping at hyphens and dashes in addition to spaces? Check. Want to change how wide tabs are assumed to be? Check.
“Aside from all the other little improvements, one of Wrap’s most interesting capabilities is a very powerful batch-processing feature which allows you to wrap any combination of input files to any combination of output files, with different combinations of parameters, all in one run. The value of this could be debatable, but it seemed like a good idea at the time, so I put it in.”
So enough with the filthy, unwrapped words! Download the source: wrap.c