09 March 2010

More Cowbell in One Line of Groovy

Sometimes you just need more cowbell.

It is for those times that I wrote this:

groovy -e 's=javax.sound.midi.MidiSystem.synthesizer;s.open();c=s.channels[9];c.noteOn 56,99;Thread.sleep 99;c.noteOff 96;s.close()'

I do often find myself needing more cowbell, such as when invoking a maven comannd which inevitably downloads the internet, like mvn clean. So get this puppy on your PATH and you can do this:

mvn clean && cowbell

...for an audio cue that tells you the internet has been successfully downloaded with a modicum of funk.

6 comments:

Dushan Hanuska said...

It does not seem to work, Chris... :-(

Chris Mountford said...

Raise an issue it works for me :)

Tim Yates said...

Think this is 2 chars shorter ;-)

groovy -e 'javax.sound.midi.MidiSystem.synthesizer.with{open();c=channels[9];c.noteOn 56,99;Thread.sleep 99;c.noteOff 96;close()}'

Chris Mountford said...

A new CHAMPION! nicely done sir.

Luis Miranda said...

groovy -e 'javax.sound.midi.MidiSystem.synthesizer.with{open();channels[9].with{noteOn 56,99;sleep 99;noteOff 96};close()}'

Consider yourself out-geeked :P

Chris Mountford said...

I knew with was probably the way to make mine better but I'd never used it because I'm still a groovy noob. :)

Post a Comment