Method: PM::Connection#start

Defined in:
lib/patchmaster/connection.rb

#start(start_bytes = nil) ⇒ Object



27
28
29
30
31
32
33
34
35
# File 'lib/patchmaster/connection.rb', line 27

def start(start_bytes=nil)
  bytes = []
  bytes += start_bytes if start_bytes
  # Bank select uses MSB if we're only sending one byte
  bytes += [CONTROLLER + @output_chan, CC_BANK_SELECT+32, @bank] if @bank
  bytes += [PROGRAM_CHANGE + @output_chan, @pc_prog] if @pc_prog
  midi_out(bytes) unless bytes.empty?
  @input.add_connection(self)
end