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:

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

    ReplyDelete
  2. Raise an issue it works for me :)

    ReplyDelete
  3. 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()}'

    ReplyDelete
  4. A new CHAMPION! nicely done sir.

    ReplyDelete
  5. 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

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

    ReplyDelete