Class: MIDIator::Driver::Mmj

Inherits:
MIDIator::Driver show all
Includes:
Java
Defined in:
lib/midiator/drivers/mmj.rb

Overview

The MIDIator driver for JRuby on OSX.

Authors

  • Jeremy Voorhis

Copyright © 2008 Jeremy Voorhis

This code released under the terms of the MIT license.

Constant Summary

Constants inherited from MIDIator::Driver

CA, CC, OFF, ON, PA, PB, PC

Instance Method Summary collapse

Methods inherited from MIDIator::Driver

#aftertouch, #channel_aftertouch, #control_change, inherited, #initialize, #note_off, #note_on, #pitch_bend, #program_change

Constructor Details

This class inherits a constructor from MIDIator::Driver

Instance Method Details

#closeObject



32
33
34
# File 'lib/midiator/drivers/mmj.rb', line 32

def close
  MidiSystem.close_midi_system
end

#message(*args) ⇒ Object



28
29
30
# File 'lib/midiator/drivers/mmj.rb', line 28

def message( *args )
  @out.send_midi( args.to_java(:byte) )
end

#open(output = 0) ⇒ Object



24
25
26
# File 'lib/midiator/drivers/mmj.rb', line 24

def open( output = 0 )
  @out = MidiSystem.open_midi_output( output )
end

#outputsObject



18
19
20
21
22
# File 'lib/midiator/drivers/mmj.rb', line 18

def outputs
  MidiSystem.get_outputs.inject( [{},0] ) {|(map, i), out|
    [ map.update(out => i), i + 1 ]
  }.first
end