Skip to content

Instantly share code, notes, and snippets.

@christo
Created November 12, 2009 23:37
Show Gist options
  • Save christo/233429 to your computer and use it in GitHub Desktop.
Save christo/233429 to your computer and use it in GitHub Desktop.
#!/usr/bin/env groovy
import javax.sound.midi.*
def synth = MidiSystem.getSynthesizer()
synth.open()
def channel = synth.getChannels()[9]
// midi note for cowbell is 56
channel.noteOn(56, 96)
Thread.sleep(100)
channel.noteOff(56)
synth.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment