Class: MusaLCEServer::Bitwig::Controller Private

Inherits:
Object
  • Object
show all
Defined in:
lib/bitwig/controllers.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Represents a MIDI controller in Bitwig.

A controller corresponds to a hardware MIDI device with 16 channels that can be routed to tracks.

Since:

  • 0.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, midi_devices, clock, tracks, logger:) ⇒ Controller

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Creates a new controller.

Parameters:

  • name (String)

    the controller name

  • midi_devices (MIDIDevices)

    the MIDI devices manager

  • clock (Musa::Clock::InputMidiClock)

    the MIDI clock

  • tracks (Tracks)

    the tracks collection

  • logger (Logger)

    the logger

Since:

  • 0.1.0



113
114
115
116
117
118
119
120
121
122
123
# File 'lib/bitwig/controllers.rb', line 113

def initialize(name, midi_devices, clock, tracks, logger:)
  @midi_devices = midi_devices
  @clock = clock
  @tracks = tracks
  @logger = logger

  @midi_device = nil

  self.name = name
  @channels = Array.new(16) { |channel| Channel.new(self, tracks, channel, logger: logger) }
end

Instance Attribute Details

#channelsArray<Channel> (readonly)

Returns the 16 MIDI channels.

Returns:

  • (Array<Channel>)

    the 16 MIDI channels



137
# File 'lib/bitwig/controllers.rb', line 137

attr_reader :name, :midi_device, :channels, :is_clock

#is_clockObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



137
# File 'lib/bitwig/controllers.rb', line 137

attr_reader :name, :midi_device, :channels, :is_clock

#midi_deviceMIDIDevice? (readonly)

Returns the associated MIDI device.

Returns:

  • (MIDIDevice, nil)

    the associated MIDI device



137
# File 'lib/bitwig/controllers.rb', line 137

attr_reader :name, :midi_device, :channels, :is_clock

#nameString

Returns the controller name.

Returns:

  • (String)

    the controller name



137
138
139
# File 'lib/bitwig/controllers.rb', line 137

def name
  @name
end

#port_nameString

Returns the MIDI port name.

Returns:

  • (String)

    the MIDI port name



127
128
129
# File 'lib/bitwig/controllers.rb', line 127

def port_name
  @port_name
end