Interface HardwareSurface
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
-
Method Summary
Modifier and TypeMethodDescriptionCreates anAbsoluteHardwareKnobthat represents a physical knob on a controller that can be used to input an absolute value.createAbsoluteHardwareKnob(String id, double currentValue) Creates anAbsoluteHardwareKnobthat represents a physical knob on a controller that can be used to input an absolute value.Creates aHardwareButtonthat represents a physical button on a controllercreateHardwarePixelDisplay(String id, Bitmap bitmap) Creates aHardwarePixelDisplaythat displays the providedBitmapthat is rendered by the controller.Creates aHardwareSliderthat represents a physical slider on a controller.createHardwareSlider(String id, double currentValue) Creates aHardwareSliderthat represents a physical slider on a controller.createHardwareTextDisplay(String id, int numLines) Creates aHardwareTextDisplaythat represents a physical text display on a controllerCreates aMultiStateHardwareLightthat represents a physical light on a controllerCreates aOnOffHardwareLightthat represents a physical light on a controllercreatePianoKeyboard(String id, int numKeys, int octave, int startKeyInOctave) Creates anRelativeHardwareKnobthat represents a physical knob on a controller that can be used to input a relative value change.List<? extends HardwareControl> A list of all theHardwareControls that have been created on thisHardwareSurface.Finds theHardwareElementthat has the supplied id or null if not found.List<? extends HardwareOutputElement> List of allHardwareElements on thisHardwareSurface.voidMark allHardwareOutputElements as needing to resend their output state, regardless of it has changed or not.voidsetPhysicalSize(double widthInMM, double heightInMM) Sets the physical size of this controller in mm.voidUpdates the state of allHardwareOutputElements that have changed since the last time this method was called.
-
Method Details
-
createHardwareSlider
Creates aHardwareSliderthat represents a physical slider on a controller.- Parameters:
id- A unique string that identifies this control.- Since:
- API version 10
-
createHardwareSlider
Creates aHardwareSliderthat represents a physical slider on a controller.- Parameters:
id- A unique string that identifies this control.currentValue- The current position of the slider 0..1- Since:
- API version 15
-
createAbsoluteHardwareKnob
Creates anAbsoluteHardwareKnobthat represents a physical knob on a controller that can be used to input an absolute value.- Parameters:
id- A unique string that identifies this control.- Since:
- API version 10
-
createAbsoluteHardwareKnob
Creates anAbsoluteHardwareKnobthat represents a physical knob on a controller that can be used to input an absolute value.- Parameters:
id- A unique string that identifies this control.currentValue- The current position of the knob 0..1- Since:
- API version 10
-
createRelativeHardwareKnob
Creates anRelativeHardwareKnobthat represents a physical knob on a controller that can be used to input a relative value change.- Parameters:
id- A unique string that identifies this control.- Since:
- API version 10
-
createPianoKeyboard
-
createHardwareButton
Creates aHardwareButtonthat represents a physical button on a controller- Parameters:
id- A unique string that identifies this control.- Since:
- API version 10
-
createOnOffHardwareLight
Creates aOnOffHardwareLightthat represents a physical light on a controller- Since:
- API version 10
-
createMultiStateHardwareLight
Creates aMultiStateHardwareLightthat represents a physical light on a controller- Parameters:
id- A unique string that identifies this parameter.- Since:
- API version 10
-
createHardwareTextDisplay
Creates aHardwareTextDisplaythat represents a physical text display on a controller- Parameters:
id- A unique string that identifies this control.- Since:
- API version 10
-
createHardwarePixelDisplay
Creates aHardwarePixelDisplaythat displays the providedBitmapthat is rendered by the controller.- Since:
- API version 10
-
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 allHardwareOutputElements that have changed since the last time this method was called. Any onUpdateHardware callbacks that have been registered onHardwareOutputElements orHardwarePropertys 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
-
invalidateHardwareOutputState
void invalidateHardwareOutputState()Mark allHardwareOutputElements as needing to resend their output state, regardless of it has changed or not. -
hardwareControls
List<? extends HardwareControl> hardwareControls()A list of all theHardwareControls that have been created on thisHardwareSurface. -
hardwareElementWithId
Finds theHardwareElementthat has the supplied id or null if not found. -
hardwareOutputElements
List<? extends HardwareOutputElement> hardwareOutputElements()List of allHardwareElements on thisHardwareSurface.
-