Created
December 17, 2008 05:12
-
-
Save urug/36948 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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