Skip to content

Instantly share code, notes, and snippets.

@youpy
Created August 26, 2012 13:06
Show Gist options
  • Save youpy/3479014 to your computer and use it in GitHub Desktop.
Save youpy/3479014 to your computer and use it in GitHub Desktop.
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