Class: MusaLCEServer::Bitwig::Channel 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 channel on a controller.

Each channel can be named and mapped to a track for MIDI output.

Since:

  • 0.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller, tracks, channel_number, logger:) ⇒ Channel

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 channel.

Parameters:

  • controller (Controller)

    the parent controller

  • tracks (Tracks)

    the tracks collection

  • channel_number (Integer)

    the MIDI channel (0-15)

  • logger (Logger)

    the logger

Since:

  • 0.1.0



183
184
185
186
187
188
# File 'lib/bitwig/controllers.rb', line 183

def initialize(controller, tracks, channel_number, logger:)
  @controller = controller
  @tracks = tracks
  @channel_number = channel_number
  @logger = logger
end

Instance Attribute Details

#channel_numberInteger (readonly)

Returns the MIDI channel number (0-15).

Returns:

  • (Integer)

    the MIDI channel number (0-15)



194
195
196
# File 'lib/bitwig/controllers.rb', line 194

def channel_number
  @channel_number
end

#nameObject

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



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

attr_reader :channel_number, :name

Instance Method Details

#outputMusa::MIDIVoices::MIDIVoice

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.

Returns the MIDI voice for this channel.

Returns:

  • (Musa::MIDIVoices::MIDIVoice)

    the MIDI voice for output

Since:

  • 0.1.0



210
211
212
# File 'lib/bitwig/controllers.rb', line 210

def output
  @controller.midi_device.channels[@channel_number]
end

#to_sString

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.

Returns a string representation of this channel.

Returns:

  • (String)

    description including channel number, name, port, and controller

Since:

  • 0.1.0



217
218
219
# File 'lib/bitwig/controllers.rb', line 217

def to_s
  "<Channel #{@channel_number} '#{@name}' on port '#{@controller.port_name}' (controller '#{@controller.name}')>"
end