Bitwig Studio Control Surface API  5.0.11
HardwareSurface Interface Reference

Public Member Functions

HardwareSlider createHardwareSlider (String id)
 
HardwareSlider createHardwareSlider (String id, double currentValue)
 
AbsoluteHardwareKnob createAbsoluteHardwareKnob (String id)
 
AbsoluteHardwareKnob createAbsoluteHardwareKnob (String id, double currentValue)
 
RelativeHardwareKnob createRelativeHardwareKnob (String id)
 
PianoKeyboard createPianoKeyboard (String id, int numKeys, int octave, int startKeyInOctave)
 
HardwareButton createHardwareButton (String id)
 
OnOffHardwareLight createOnOffHardwareLight (String id)
 
MultiStateHardwareLight createMultiStateHardwareLight (String id)
 
HardwareTextDisplay createHardwareTextDisplay (String id, int numLines)
 
HardwarePixelDisplay createHardwarePixelDisplay (String id, Bitmap bitmap)
 
void setPhysicalSize (double widthInMM, double heightInMM)
 
void updateHardware ()
 
void invalidateHardwareOutputState ()
 
List<? extends HardwareControlhardwareControls ()
 
HardwareElement hardwareElementWithId (String id)
 
List<? extends HardwareOutputElementhardwareOutputElements ()
 

Detailed Description

Represents a surface that can contain HardwareElements such as HardwareButtons, HardwareSliders, MultiStateHardwareLights etc

This information allows Bitwig Studio to construct a reliable physical model of the hardware. This information can be used to simulate hardware being present even when physical hardware is not available (and may also be used for other purposes in the future).

To be able to simulate hardware being connected so that you can debug controllers without the real hardware you need to do the following:

Create a file with the name "config.json" in your user settings directory. The location of this directory is platform dependent:

  • On Windows: LOCALAPPDATA%\Bitwig Studio
  • On macOS: Library/Application Support/Bitwig/Bitwig Studio
  • On Linux: $HOME/.BitwigStudio

Then add the following line to the config.json file:

extension-dev : true

You will then need to restart Bitwig Studio. To simulate the controller being connected you can right click on the controller in the preferences and select "Simulate device connected".

If you have also provided physical positions for various HardwareElements using HardwareElement#setBounds(double, double, double, double) then you can also see a GUI simulator for your controller by selecting "Show simulated hardware GUI".

Since
API version 10

Member Function Documentation

◆ createAbsoluteHardwareKnob() [1/2]

AbsoluteHardwareKnob createAbsoluteHardwareKnob ( String  id)

Creates an AbsoluteHardwareKnob that represents a physical knob on a controller that can be used to input an absolute value.

Parameters
idA unique string that identifies this control.
Since
API version 10

◆ createAbsoluteHardwareKnob() [2/2]

AbsoluteHardwareKnob createAbsoluteHardwareKnob ( String  id,
double  currentValue 
)

Creates an AbsoluteHardwareKnob that represents a physical knob on a controller that can be used to input an absolute value.

Parameters
idA unique string that identifies this control.
currentValueThe current position of the knob 0..1
Since
API version 10

◆ createHardwareButton()

HardwareButton createHardwareButton ( String  id)

Creates a HardwareButton that represents a physical button on a controller

Parameters
idA unique string that identifies this control.
Since
API version 10

◆ createHardwarePixelDisplay()

HardwarePixelDisplay createHardwarePixelDisplay ( String  id,
Bitmap  bitmap 
)

Creates a HardwarePixelDisplay that displays the provided Bitmap that is rendered by the controller.

Since
API version 10

◆ createHardwareSlider() [1/2]

HardwareSlider createHardwareSlider ( String  id)

Creates a HardwareSlider that represents a physical slider on a controller.

Parameters
idA unique string that identifies this control.
Since
API version 10

◆ createHardwareSlider() [2/2]

HardwareSlider createHardwareSlider ( String  id,
double  currentValue 
)

Creates a HardwareSlider that represents a physical slider on a controller.

Parameters
idA unique string that identifies this control.
currentValueThe current position of the slider 0..1
Since
API version 15

◆ createHardwareTextDisplay()

HardwareTextDisplay createHardwareTextDisplay ( String  id,
int  numLines 
)

Creates a HardwareTextDisplay that represents a physical text display on a controller

Parameters
idA unique string that identifies this control.
Since
API version 10

◆ createMultiStateHardwareLight()

MultiStateHardwareLight createMultiStateHardwareLight ( String  id)

Creates a MultiStateHardwareLight that represents a physical light on a controller

Parameters
idA unique string that identifies this parameter.
internalStateToLightVisualStateFunctionA function that can be used to determine the visual state of the light on the hardware so it can be visualized in Bitwig Studio's user interface when needed.
Since
API version 10

◆ createOnOffHardwareLight()

OnOffHardwareLight createOnOffHardwareLight ( String  id)

Creates a OnOffHardwareLight that represents a physical light on a controller

Since
API version 10

◆ createRelativeHardwareKnob()

RelativeHardwareKnob createRelativeHardwareKnob ( String  id)

Creates an RelativeHardwareKnob that represents a physical knob on a controller that can be used to input a relative value change.

Parameters
idA unique string that identifies this control.
Since
API version 10

◆ hardwareControls()

List<? extends HardwareControl> hardwareControls ( )

A list of all the HardwareControls that have been created on this HardwareSurface.

◆ hardwareElementWithId()

HardwareElement hardwareElementWithId ( String  id)

Finds the HardwareElement that has the supplied id or null if not found.

◆ hardwareOutputElements()

List<? extends HardwareOutputElement> hardwareOutputElements ( )

List of all HardwareElements on this HardwareSurface.

◆ invalidateHardwareOutputState()

void invalidateHardwareOutputState ( )

Mark all HardwareOutputElements as needing to resend their output state, regardless of it has changed or not.

◆ setPhysicalSize()

void setPhysicalSize ( double  widthInMM,
double  heightInMM 
)

Sets the physical size of this controller in mm.

Since
API version 10

◆ updateHardware()

void updateHardware ( )

Updates the state of all HardwareOutputElements that have changed since the last time this method was called.

Any onUpdateHardware callbacks that have been registered on HardwareOutputElements or HardwarePropertys will be invoked if their state/value has changed since the last time it was called.

This is typically called by the control script from its flush method.

Since
API version 10

The documentation for this interface was generated from the following file: