Skip to content

Instantly share code, notes, and snippets.

@urug
Created December 17, 2008 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save urug/36948 to your computer and use it in GitHub Desktop.
Save urug/36948 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'midiator'
midi = MIDIator::Interface.new
midi.use("dls_synth")
#midi.autodetect_driver
midi.control_change 32, 10, 1
midi.program_change 10, 26
include MIDIator::Drums
(1..100).each do |i|
note, val = if i%15 == 0
[CrashCymbal1, "FizzBuzz"]
elsif i%5 == 0
[SnareDrum1, "Buzz"]
elsif i%3 == 0
[LowTom1, "Fizz"]
else
[BassDrum1, i]
end
puts val
midi.play note, 0.25, 10
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment