Created
August 26, 2012 13:06
-
-
Save youpy/3479014 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class MIDIX | |
def initialize | |
@destinations = CoreMIDI::Destination.all | |
end | |
def program_change(program_number, channel = 0) | |
puts(0b11000000 | channel, program_number) | |
end | |
def control_change(control_number, value, channel = 0) | |
puts(0b10110000 | channel, control_number, value) | |
end | |
def puts(*args) | |
@destinations.each do |dst| | |
dst.puts(*args) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment