Renaming Your ‘The’ Folders

I was working on tagging and ordering my music collection tonight and had to decide what to do with all my artisit folders that are named leading with “The”, e.g. “The Weakerthans” or “The Strokes”. I decided to go with moving the “The” to the end so that “The Weakerthans” becomes “Weakerthans, The” and is placed with the W’s in an alphabetical sort.

To do this I used a nice one-liner that leverages the rename tool. It’s just a regular expression but it does it nicely.

rename 's/^(The) (.*)/$2, $1/' *

I recommend running it with the -n flag first to make sure it’s going to do exactly what you think it is. I also came up with a line to do the reverse, just in case you decide you don’t like it that way.

rename -n 's/(.*), (The)$/$2 $1/' *

Regular expressions rock.

Update (01/08/07)
Bonus! If you have all your music (or something else) organized by folders I recommend using the tree tool to get a nice text representation of your collection. I don’t know about other distro’s but it’s not installed in the default Ubuntu Edgy 6.10, so you’ll want to grab it with:

sudo apt-get install tree

After that it’s a snap, just run it on your directory and divert the output into a file. Here’s my run on my music collection, and you can view the produced file here (11k)

tree -d /media/hdb/Music/  > musicList.txt
Posted January 8th, 2007 - Permalink
Categories: Linux - Music - Snippets
No Comments »
 
More DK421 Hardware

I think I’ve sorted out how I’m going to make my switches for the drums. I’m still tempted to go the “air-pressure triggered in tubs” route, but I think my current design would be more robust, sturdy and just as long lasting (if not more).

The idea is to get two flat chunks of plywood, as thin as I can go (1/8th” probably?), some nuts, bolts and springs. Cut the plywood to be equal in size, then put together with 4 bolts and the springs in between. That should allow for the give I need to keep the switches apart, plus it should be adjustable if the play is too much for the drummer.

The switch itself will be a bolt that threads up to a contact point (a.k.a. some scrap piece of metal). This will also allow for quick adjustments in the force required to trigger it. The switch will then run off to a standard 1/4″ or 1/8″ mono plug for plugging into the controller. As an added bit there will be silencer padding on the drum, since that’s sorta what we’re going for here… I’m thinking about just searching for a bunch of old mousepads rather than spend $20 on pads.

Here are some explanatory images I painfully crafted in that wonderful prototyping program “Paint”.



Posted November 8th, 2006 - Permalink
Categories: DK421 - DrumKit - Equipment - Projects
No Comments »
 
DK421 Hardware

This afternoon I was without anything to do when I remembered my DK421 project, which had been shoved off into a dusty corner of my hard drive. I didn’t feel like programming any, and wouldn’t know what to do or add anyway, so I got into the hardware side of it.


The Sheets

I dug into Stephanies old room and found the keyboard from the green dinosaur, an Acer computer from the early-90’s. Anyway, I found it, took it to my room and cracked it open. Very simple device really. The keypresses are captured by switches composed of two sheets of plastic, very similar to slide-projector transparency sheets, with tracing on them. When you press the key it compresses a rubber bubble in a sheet and smashes the air, and thus the switch, down and completes the circuit. These connections go to a board with some leds and a chip for translating them into whatever goes down that PS2 cable.

I imagine that a newer keyboard might be more complicated, at least if it’s usb. Maybe not though. I only have so many keyboards to rip open.

Following the tearing apart of the keyboard I hooked it up to my old gateway laptop (it’s the computer I care the least about) and fired it up. No lights, no response. I shut it back down and figured out that I hadn’t reconnected a little black ground that had been hooked onto the metal mounting board as well as one of the pins. If you look at the picture of the transparency-stuff circuit you can see that one pin is connected only to a big spot for the ground.


The Pins

I taped it up and got it working right off the bat. Shiny. I then taped it onto the laptop in the lovely testing position illustrated here. I got a piece of thick copper wire, off of an old power supply, and generously stripped the ends (okay, my father did for me), 1.5″ at least, then coiled each end around a long finishing nail (that’s what it said on the box) and taped it up. This made for a nice, easy to control point-to-point connector for me.

With my newly created tool I fired up VIM and started shorting the pins together to see what they wrote. Okay, thats not true. First I tried tracing individual keys on the transparent stuff, but that got old real fast. It is, however, necessary for finding keys like shift. Regardless, I tried out the good old hunt and peck method, and soon had a list with more than enough keys for the drum triggers. I then tried out the shift key with a piece of spare wire, it works great. Thats an important one, because it is needed for the high-hat pedal.


The Shift Key

Well, thats enough for now. Hopefully the pictures shed some light on the matter if it’s still fuzzy. I haven’t made up my mind on what to build the triggers out of. I almost want to go the air pressure route so the switches won’t wear out to fast. I’ll also have to consider how to build and mount all this, I’m thinking PVC at this point. Off to a good start though :)

Additional Photos

Posted November 5th, 2006 - Permalink
Categories: DK421 - DrumKit - Electronics - Equipment - Hardware - Music - Projects
No Comments »
 
Ozma Show

I saw Ozma at Knickerbockers in Lincoln last right. Awesome show. They played for a long time, and we got them to play an encore of Battlescars and Rocks as well. Those guys are so awesome.

With them were “Everybody Else”, who I liked. They were, in Adam’s words, “Rooney meets the Beach Boys”. Good band, though it took forever to get them set up so they didn’t play as long (I think).

Also there was an amazing band from Lincoln that I have once again forgotten their name. Wilson, or something. Good bar band, the guitarist could really make his firebird scream.

Update (10/25/06)
The Lincoln band’s name is Willis and they are delicious.

Posted October 25th, 2006 - Permalink
Categories: Concerts - Music
No Comments »
 
DrumKit v0.01

I finally started work on my DrumKit project today. Essentially this is an attempt to create a electronic drum set from some pads, an old keyboard and a computer. I got down to buisness and wrote up a Java app that plays back the drum sounds on key press events. It filters them and even handles shift for the hi-hat open/close, which I’ll use to make the hi-hat pedal work.

The source is messy, and still has relative path’s for the sound files. Essentially it’s a frame, a keylistener and some clips. Not too rough, though patching this together from the Java API and sparse information on javax.sound.sampled was tougher than I guessed it would be. Anyway, it’s got some bugs and features not implemented, but I can play drums with my keyboard now, which is a good start.

DrumKit v0.01
The Cutting Edge DrumKit GUI

I suppose I should upload the code just in case, and to keep track of my versions. You can get the source and the sounds for Version 0.01 below. As a heads up, all the kit samples are absolute path’d for my machine, so you’ll need to adjust them if you intend to compile it.
» DrumKit001.tar.gz - Everything
» DrumKit.java - Main class
» KeyHandler.java - Event listener
» KitClip.java - Kit sample class

Posted September 30th, 2006 - Permalink
Categories: DrumKit - Equipment - Java - Music - Programming - Projects
No Comments »
 
More Posts
« Older
Newer »