class MTK::IO::DLSSynthOutput

Provides realtime MIDI output on OS X to the built-in “DLS” Synthesizer @note This class is optional and only available if you require ‘mtk/midi/dls_synth_output’.

It depends on the 'gamelan' gem.

Public Class Methods

devices() click to toggle source
# File lib/mtk/io/dls_synth_output.rb, line 13
def self.devices
  @devices ||= [DLSSynthDevice.new]
end
devices_by_name() click to toggle source
# File lib/mtk/io/dls_synth_output.rb, line 17
def self.devices_by_name
  @devices_by_name ||= {devices.first.name => devices.first}
end

Protected Instance Methods

bend(midi_value, channel) click to toggle source

(see MIDIOutput#bend)

# File lib/mtk/io/dls_synth_output.rb, line 51
def bend(midi_value, channel)
  @device.message(0xE0|channel, midi_value & 127, (midi_value >> 7) & 127)
end
channel_pressure(midi_value, channel) click to toggle source

(see MIDIOutput#channel_pressure)

# File lib/mtk/io/dls_synth_output.rb, line 41
def channel_pressure(midi_value, channel)
  @device.message(0xD0|channel, midi_value, 0)
end
control(number, midi_value, channel) click to toggle source

(see MIDIOutput#control)

# File lib/mtk/io/dls_synth_output.rb, line 36
def control(number, midi_value, channel)
  @device.message(0xB0|channel, number, midi_value)
end
note_off(pitch, velocity, channel) click to toggle source

(see MIDIOutput#note_off)

# File lib/mtk/io/dls_synth_output.rb, line 31
def note_off(pitch, velocity, channel)
  @device.message(0x80|channel, pitch, velocity)
end
note_on(pitch, velocity, channel) click to toggle source

(see MIDIOutput#note_on)

# File lib/mtk/io/dls_synth_output.rb, line 26
def note_on(pitch, velocity, channel)
  @device.message(0x90|channel, pitch, velocity)
end
poly_pressure(pitch, midi_value, channel) click to toggle source

(see MIDIOutput#poly_pressure)

# File lib/mtk/io/dls_synth_output.rb, line 46
def poly_pressure(pitch, midi_value, channel)
  @device.message(0xA0|channel, pitch, midi_value)
end
program(number, channel) click to toggle source

(see MIDIOutput#program)

# File lib/mtk/io/dls_synth_output.rb, line 56
def program(number, channel)
  @device.message(0xC0|channel, number, 0)
end