Class: MusaLCEServer::Bitwig::Bitwig

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

Overview

DAW controller for Bitwig Studio.

Implements the Daw interface for Bitwig Studio, providing transport control, track management, and MIDI routing through the MusaLCE for Bitwig controller extension.

Examples:

# Started via MusaLCEServer.run('bitwig')
daw.track('Bass').out.note(60, velocity: 100, duration: 1)

Since:

  • 0.1.0

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from MusaLCEServer::Daw

Instance Method Details

#continuevoid

This method returns an undefined value.

Continues playback from current position.

Since:

  • 0.1.0



65
66
67
68
# File 'lib/bitwig/bitwig.rb', line 65

def continue
  @handler.continue
  super
end

#daw_initialize(midi_devices:, clock:, osc_server:, osc_client:, logger:) ⇒ Object

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



25
26
27
28
29
30
31
32
33
34
# File 'lib/bitwig/bitwig.rb', line 25

def daw_initialize(midi_devices:, clock:, osc_server:, osc_client:, logger:)
  super

  controllers = Controllers.new(midi_devices, clock: clock, logger: logger)
  handler = Handler.new(osc_server, osc_client, controllers, @sequencer, logger: logger)

  logger.info('Loaded Bitwig Studio driver')

  return controllers.tracks, handler
end

#goto(position) ⇒ void

This method returns an undefined value.

Moves playhead to specified bar position.

Parameters:

  • position (Numeric)

    the bar number (1-based)

Since:

  • 0.1.0



73
74
75
76
# File 'lib/bitwig/bitwig.rb', line 73

def goto(position)
  @handler.goto(position)
  super
end

#playvoid

This method returns an undefined value.

Starts playback in Bitwig.

Since:

  • 0.1.0



51
52
53
54
# File 'lib/bitwig/bitwig.rb', line 51

def play
  @handler.play
  super
end

#recordvoid

This method returns an undefined value.

Starts recording in Bitwig.

Since:

  • 0.1.0



80
81
82
83
# File 'lib/bitwig/bitwig.rb', line 80

def record
  @handler.record
  super
end

#stopvoid

This method returns an undefined value.

Stops playback in Bitwig.

Since:

  • 0.1.0



58
59
60
61
# File 'lib/bitwig/bitwig.rb', line 58

def stop
  @handler.stop
  super
end

#track(name, all: false) ⇒ Track+

Retrieves a track by name.

Parameters:

  • name (String)

    the track name as configured in Bitwig

  • all (Boolean) (defaults to: false)

    if true, returns array; otherwise returns single track

Returns:

  • (Track, Array<Track>)

    the track or array containing the track

Since:

  • 0.1.0



41
42
43
44
45
46
47
# File 'lib/bitwig/bitwig.rb', line 41

def track(name, all: false)
  if all
    [@tracks[name]]
  else
    @tracks[name]
  end
end