Interface ControllerHost
- All Superinterfaces:
Host
An interface representing the host application to the script. A singleton instance of this interface is
available in the global scope of each script. The methods provided by this interface can be divided in
different categories:
1. functions for registering the script in Bitwig Studio, so that it can be listed, detected and configured
in the controller preferences. The methods that belong to this group are
defineController(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String),
defineMidiPorts(int, int), defineSysexIdentityReply(java.lang.String) and addDeviceNameBasedDiscoveryPair(java.lang.String[], java.lang.String[]).
2. functions for creating objects that provide access to the various areas of Bitwig Studio to the script.
The name of those methods typically start with `create...` 3. functions for printing to the Control Surface
Console, which can be opened from the `View` menu of Bitwig Studio. 4. functions for determining the name
of the host application, API version, the host operating system and such.
The first group of methods should be called on the global scope of the script. The function in the second
and third group are typically called from the init method of the script or other handler functions. The
last group is probably only required in rare cases and can be called any time.- Since:
- API version 1
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddDatagramPacketObserver(String name, int port, DataReceivedCallback callback) Adds an observer for incoming UDP (User Datagram Protocol) packets on the selected port.voidaddDeviceNameBasedDiscoveryPair(String[] inputs, String[] outputs) Registers patterns which are used to automatically detect hardware devices that can be used with the script.
When the user clicks on the `detect` button in the Bitwig Studio controller preferences dialog, Bitwig Studio searches for connected controller hardware by comparing the parameters passed into this function are compared with the port names of the available MIDI drivers.voidconnectToRemoteHost(String host, int port, ConnectionEstablishedCallback callback) Connects to a remote TCP (Transmission Control Protocol) socket.createAbsoluteHardwareControlAdjustmentTarget(DoubleConsumer adjustmentConsumer) Creates aAbsoluteHardwarControlBindablethat can be used to adjust some value in an arbitrary way.createAction(Runnable runnable, Supplier<String> descriptionProvider) Creates aHardwareActionBindablethat can be bound to someHardwareAction(such as a button press) and when that action occurs the suppliedRunnablewill be run.createAction(DoubleConsumer actionPressureConsumer, Supplier<String> descriptionProvider) Creates aHardwareActionBindablethat can be bound to someHardwareAction(such as a button press) and when that action occurs the suppliedRunnablewill be runCreates aDeviceMatcherthat will only match devices that are currently active.createAndDeviceMatcher(DeviceMatcher... deviceMatchers) Creates aDeviceMatcherthat matches a device if all the supplied matchers match the device.Returns an object that provides access to general application functionality, including global view settings, the list of open projects, and other global settings that are not related to a certain document.Deprecated.Returns an object which provides access to the `Arranger` panel of Bitwig Studio.createArranger(int window) Returns an object which provides access to the `Arranger` panel inside the specified window.createArrangerCursorClip(int gridWidth, int gridHeight) Returns a clip object that represents the cursor of the arranger clip selection.createArrangerCursorTrack(int numSends, int numScenes) Deprecated.UsecreateCursorTrack(int, int)instead.createArrangerSection(int screenIndex) Deprecated.UsecreateArranger(int)instead.Creates aDeviceMatcherthat will match any audio effect.createAudioHardwareInputInfo(AudioIoDeviceMatcher matcher, int[] channels) Creates aAudioHardwareIoInfofor the specified input.createAudioHardwareOutputInfo(AudioIoDeviceMatcher matcher, int[] channels) Creates aAudioHardwareIoInfofor the specified output.createAudioIoDeviceHardwareAddressMatcher(String hardwareAddress) Creates a matcher that matches devices with the given hardware address.createBeatTimeFormatter(String separator, int barsLen, int beatsLen, int subdivisionLen, int ticksLen) Creates aBeatTimeFormatterthat can be used to format beat times.Creates aDeviceMatcherthat will match any Bitwig native device with the supplied id.default HardwareActionBindablecreateCallbackAction(Runnable runnable, Supplier<String> descriptionProvider) Creates aHardwareActionBindablethat can be bound to someHardwareAction(such as a button press) and when that action occurs the suppliedRunnablewill be run.createCursorClip(int gridWidth, int gridHeight) Deprecated.UsecreateLauncherCursorClip(int, int)orcreateArrangerCursorClip(int, int)instead.createCursorClipSection(int gridWidth, int gridHeight) Deprecated.UsecreateCursorClip(int, int)instead.Deprecated.UsecreateEditorCursorDevice()instead.createCursorDeviceSection(int numControllers) Deprecated.UsecreateEditorCursorDevice()instead.createCursorTrack(int numSends, int numScenes) createCursorTrack(String name, int numSends, int numScenes) Deprecated.usecreateCursorTrack(String, String, int, int, boolean)instead.createCursorTrack(String id, String name, int numSends, int numScenes, boolean shouldFollowSelection) Returns an object that represents a named cursor track, that is independent from the arranger or mixer track selection in the user interface of Bitwig Studio.createCursorTrackSection(int numSends, int numScenes) Deprecated.UsecreateArrangerCursorTrack(int, int)instead.Returns an object which provides access to the `DetailEditor` panel of Bitwig Studio.createDetailEditor(int window) Returns an object which provides access to the `DetailEditor` panel inside the specified window.Deprecated.createEditorCursorDevice(int numSends) Deprecated.Use cursorTrack.createCursorDevice().createEffectTrackBank(int numTracks, int numScenes) Returns a track bank with the given number of effect tracks and scenes.createEffectTrackBank(int numTracks, int numSends, int numScenes) Returns a track bank with the given number of effect tracks, sends and scenes.createEffectTrackBankSection(int numTracks, int numScenes) Deprecated.UsecreateEffectTrackBank(int, int)instead.Creates aDeviceMatcherthat will only match devices if it is the last device in the chain.Returns an object for controlling and monitoring the `Groove` section in Bitwig Studio.Deprecated.UsecreateGroove()instead.Creates aHardwareSurfacethat can contain hardware controls.Creates aDeviceMatcherthat will match any instrument.createLastClickedParameter(String id, String name) The last clicked parameter in the gui.Creates aDeviceMatcherthat will only match devices if it is the last device in the chain.createLauncherCursorClip(int gridWidth, int gridHeight) Returns a clip object that represents the cursor of the launcher clip selection.createMainTrackBank(int numTracks, int numSends, int numScenes) Returns a track bank with the given number of tracks, sends and scenes.createMainTrackBankSection(int numTracks, int numSends, int numScenes) Deprecated.UsecreateMainTrackBank(int, int, int)instead.Creates aMasterRecorder.createMasterTrack(int numScenes) Returns an object that represents the master track of the document.createMasterTrackSection(int numScenes) Deprecated.UsecreateMasterTrack(int)instead.Returns an object which provides access to the `Mixer` panel of Bitwig Studio.createMixer(int window) Returns an object which provides access to the `Mixer` panel inside the specified window.createMixer(String panelLayout) Returns an object which provides access to the `Mixer` panel that belongs to the specified panel layout.createMixer(String panelLayout, int window) Returns an object which provides access to the `Mixer` panel that matches the specified parameters.createMixerSection(String perspective, int screenIndex) Deprecated.UsecreateMixer(String, int)instead.createNotDeviceMatcher(DeviceMatcher deviceMatcher) Creates aDeviceMatcherthat matches a device if the supplied matcher does not match the device.Creates aDeviceMatcherthat will match any note effect.createOrAbsoluteHardwareValueMatcher(AbsoluteHardwareValueMatcher matcher1, AbsoluteHardwareValueMatcher matcher2) Creates aAbsoluteHardwareValueMatcherthat is matched by either of the 2 supplied action matchers.createOrDeviceMatcher(DeviceMatcher... deviceMatchers) Creates aDeviceMatcherthat matches a device if any of the supplied matchers match the device.createOrHardwareActionMatcher(HardwareActionMatcher matcher1, HardwareActionMatcher matcher2) Creates aHardwareActionMatcherthat is matched by either of the 2 supplied action matchers.createOrRelativeHardwareValueMatcher(RelativeHardwareValueMatcher matcher1, RelativeHardwareValueMatcher matcher2) Creates aRelativeHardwareValueMatcherthat is matched by either of the 2 supplied action matchers.Creates aPopupBrowserthat represents the pop-up browser in Bitwig Studio.default HardwareActionBindablecreatePressureCallbackAction(DoubleConsumer actionPressureConsumer, Supplier<String> descriptionProvider) Creates aHardwareActionBindablethat can be bound to someHardwareAction(such as a button press) and when that action occurs the suppliedRunnablewill be run.createRelativeHardwareControlAdjustmentTarget(DoubleConsumer adjustmentConsumer) Creates aRelativeHardwarControlBindablethat can be used to adjust some value in an arbitrary way.createRelativeHardwareControlStepTarget(HardwareActionBindable stepForwardsAction, HardwareActionBindable stepBackwardsAction) Creates aRelativeHardwarControlBindablethat can be used to step forwards or backwards when aRelativeHardwareControlis adjusted.createRemoteConnection(String name, int defaultPort) Opens a TCP (Transmission Control Protocol) host socket for allowing network connections from other hardware and software.createSceneBank(int numScenes) Returns a scene bank with the given number of scenes.
A scene bank can be seen as a fixed-size window onto the list of scenes in the current document, that can be scrolled in order to access different parts of the scene list.createTrackBank(int numTracks, int numSends, int numScenes) Returns a track bank with the given number of tracks, sends and scenes.
A track bank can be seen as a fixed-size window onto the list of tracks in the current document including their sends and scenes, that can be scrolled in order to access different parts of the track list.createTrackBank(int numTracks, int numSends, int numScenes, boolean hasFlatTrackList) Returns a track bank with the given number of child tracks, sends and scenes.
A track bank can be seen as a fixed-size window onto the list of tracks in the connected track group including their sends and scenes, that can be scrolled in order to access different parts of the track list.createTrackBankSection(int numTracks, int numSends, int numScenes) Deprecated.UsecreateTrackBank(int, int, int)instead.Returns an object for controlling and monitoring the elements of the `Transport` section in Bitwig Studio.Deprecated.UsecreateTransport()instead.createUsbAudioIoDeviceMatcher(int vendorId, int productId) Creates a matcher that matches devices with the given USB vendor and product id.createUserControls(int numControllers) Returns an object that is used to define a bank of custom user controls.createUserControlsSection(int numControllers) Deprecated.UsecreateUserControls(int)instead.createVST2DeviceMatcher(int id) Creates aDeviceMatcherthat will match any VST2 plug-in with the supplied id.Creates aDeviceMatcherthat will match any VST3 plug-in with the supplied id.BeatTimeFormatterused to format beat times by default.voiddefineController(String vendor, String name, String version, String uuid) Deprecated.voidRegisters a controller script with the given parameters.voiddefineMidiPorts(int numInports, int numOutports) Defines the number of MIDI ports for input and output that the device uses.voiddefineSysexDiscovery(String request, String reply) Deprecated.UsedefineSysexIdentityReply(String)instead.voiddefineSysexIdentityReply(String reply) Deprecated.voiddeleteObjects(DeleteableObject... objects) It will delete multiple object within one undo step.voiddeleteObjects(String undoName, DeleteableObject... objects) It will delete multiple object within one undo step.voidduplicateObjects(DuplicableObject... objects) It will duplicate multiple object within one undo step.voidduplicateObjects(String undoName, DuplicableObject... objects) It will duplicate multiple object within one undo step.voidPrints the given string in the control surface console window using a text style that highlights the string as error.Creates a document state object that can be used to insert settings into the Studio I/O Panel in Bitwig Studio.getMidiInPort(int index) Returns the MIDI input port with the given index.getMidiOutPort(int index) Returns the MIDI output port with the given index.Returns an object that is used to configure automatic notifications.Creates a preferences object that can be used to insert settings into the Controller Preferences panel in Bitwig Studio.Returns an object for controlling various aspects of the currently selected project.hardwareDevice(int index) Gets theHardwareDeviceat the specified index.voidLoads the script defined by the supplied path.voidloadAPI(int version) Loads the supplied API version into the calling script.An object that can be used to generate useful MIDI expression strings which can be used inMidiIn.createActionMatcher(String)and other related methods.booleanIndicates if the host platform is Linux.booleanIndicates if the host platform is Apple Mac OS X.booleanIndicates if the host platform is Windows.voidPrints the given string in the control surface console window.voidRequests that the driver's flush method gets called.voidrestart()Restarts this controller.voidscheduleTask(Object callback, Object[] args, long delay) Deprecated.voidscheduleTask(Runnable callback, long delay) Schedules the given callback function for execution after the given delay.voidsendDatagramPacket(String host, int port, byte[] data) Sends a UDP (User Datagram Protocol) packet with the given data to the specified host.voidsetDefaultBeatTimeFormatter(BeatTimeFormatter formatter) Sets theBeatTimeFormatterto use by default for formatting beat times.voidsetShouldFailOnDeprecatedUse(boolean value) Sets whether the calling script should fail if it calls a deprecated method based on the API version that it requested.booleanDetermines whether the calling script should fail if it calls a deprecated method based on the API version that it requested.voidshowPopupNotification(String text) Shows a temporary text overlay on top of the application GUI, that will fade-out after a short interval.voidCall this method to allow your script to use Beta APIs.Methods inherited from interface com.bitwig.extension.api.Host
allocateMemoryBlock, createBitmap, createFontOptions, getHostApiVersion, getHostProduct, getHostVendor, getHostVersion, getOscModule, getPlatformType, loadFontFace, loadPNG, loadSVG, setErrorReportingEMail
-
Method Details
-
restart
void restart()Restarts this controller.- Since:
- API version 7
-
loadAPI
void loadAPI(int version) Loads the supplied API version into the calling script. This is only intended to be called from a controller script. It cannot be called from a Java controller extension. -
useBetaApi
void useBetaApi()Call this method to allow your script to use Beta APIs. Beta APIs are still on development and might not be available in a future version of Bitwig Studio. Turning this flag to true, will flag your extension as being a beta extension which might not work after updating Bitwig Studio.- Since:
- API version 7
-
shouldFailOnDeprecatedUse
boolean shouldFailOnDeprecatedUse()Determines whether the calling script should fail if it calls a deprecated method based on the API version that it requested. -
setShouldFailOnDeprecatedUse
void setShouldFailOnDeprecatedUse(boolean value) Sets whether the calling script should fail if it calls a deprecated method based on the API version that it requested. This is only intended to be called from a controller script. It cannot be called from a Java controller extension. -
load
Loads the script defined by the supplied path. This is only intended to be called from a controller script. It cannot be called from a Java controller extension. -
platformIsWindows
boolean platformIsWindows()Indicates if the host platform is Windows.- Returns:
- `true` if the host platform is Windows, `false` otherwise.
- Since:
- API version 1
-
platformIsMac
boolean platformIsMac()Indicates if the host platform is Apple Mac OS X.- Returns:
- `true` if the host platform is Mac, `false` otherwise.
- Since:
- API version 1
-
platformIsLinux
boolean platformIsLinux()Indicates if the host platform is Linux.- Returns:
- `true` if the host platform is Linux, `false` otherwise.
- Since:
- API version 1
-
defineController
Registers a controller script with the given parameters. This function must be called once at the global scope of the script.- Parameters:
vendor- the name of the hardware vendor. Must not benull.name- the name of the controller script as listed in the user interface of Bitwig Studio. Must not benull.version- the version of the controller script. Must not benull.uuid- a universal unique identifier (UUID) string that is used to distinguish one script from another, for example `550e8400-e29b-11d4-a716-446655440000`. Must not benull. For generating random UUID strings several free web tools are available.author- the name of the script author- Since:
- API version 1
-
defineMidiPorts
void defineMidiPorts(int numInports, int numOutports) Defines the number of MIDI ports for input and output that the device uses. This method should be called once in the global scope if the script is supposed to exchange MIDI messages with the device, or if the script adds entries to the MIDI input/output choosers in Bitwig Studio. After calling this method the individual port objects can be accessed usinggetMidiInPort(int index)andgetMidiInPort(int index).- Parameters:
numInports- the number of input portsnumOutports- the number of output ports- Since:
- API version 1
-
getMidiInPort
Returns the MIDI input port with the given index.- Parameters:
index- the index of the MIDI input port, must be valid.- Returns:
- the requested MIDI input port
- Since:
- API version 1
-
getMidiOutPort
Returns the MIDI output port with the given index.- Parameters:
index- the index of the MIDI output port, must be valid.- Returns:
- the requested MIDI output port
- Since:
- API version 1
-
hardwareDevice
Gets theHardwareDeviceat the specified index. This index corresponds to the index of theHardwareDeviceMatcherspecified in theControllerExtensionDefinition.listHardwareDevices(com.bitwig.extension.controller.HardwareDeviceMatcherList)- Since:
- API version 7
-
addDeviceNameBasedDiscoveryPair
Registers patterns which are used to automatically detect hardware devices that can be used with the script.
When the user clicks on the `detect` button in the Bitwig Studio controller preferences dialog, Bitwig Studio searches for connected controller hardware by comparing the parameters passed into this function are compared with the port names of the available MIDI drivers. Found controller scripts are automatically added with their input/output ports configured.
Calling this function is optional, but can also be called multiple times in the global script scope in order to support alternative driver names.- Parameters:
inputs- the array of strings used to detect MIDI input ports, must not be `null`.outputs- the array of strings used to detect MIDI output ports, must not be `null`.- Since:
- API version 1
-
defineSysexIdentityReply
Deprecated.Registers the `Identity Reply Universal SysEx` message (if any) that the MIDI device sends after receiving the `Identity Request Universal SysEx` message (`F0 7E 7F 06 01 F7`), as defined in the MIDI standard.
This function may be called at the global scope of the script, but is optional. Please note that this function is only applicable to scripts with one MIDI input and one MIDI output. Also note that not all MIDI hardware supports SysEx identity messages.- Parameters:
reply- the `Identity Reply Universal SysEx` message. Must not benull- Since:
- API version 1
-
getPreferences
Preferences getPreferences()Creates a preferences object that can be used to insert settings into the Controller Preferences panel in Bitwig Studio.- Returns:
- an object that provides access to custom controller preferences
- Since:
- API version 1
-
getDocumentState
DocumentState getDocumentState()Creates a document state object that can be used to insert settings into the Studio I/O Panel in Bitwig Studio.- Returns:
- an object that provides access to custom document settings
- Since:
- API version 1
-
getNotificationSettings
NotificationSettings getNotificationSettings()Returns an object that is used to configure automatic notifications. Bitwig Studio supports automatic visual feedback from controllers that shows up as popup notifications. For example when the selected track or the current device preset was changed on the controller these notifications are shown, depending on your configuration.- Returns:
- a configuration object used to enable/disable the various automatic notifications supported by Bitwig Studio
- Since:
- API version 1
-
getProject
Project getProject()Returns an object for controlling various aspects of the currently selected project.- Since:
- API version 1
-
createTransport
Transport createTransport()Returns an object for controlling and monitoring the elements of the `Transport` section in Bitwig Studio. This function should be called once during initialization of the script if transport access is desired.- Returns:
- an object that represents the `Transport` section in Bitwig Studio.
- Since:
- API version 1
-
createGroove
Groove createGroove()Returns an object for controlling and monitoring the `Groove` section in Bitwig Studio. This function should be called once during initialization of the script if groove control is desired.- Returns:
- an object that represents the `Groove` section in Bitwig Studio.
- Since:
- API version 1
-
createApplication
Application createApplication()Returns an object that provides access to general application functionality, including global view settings, the list of open projects, and other global settings that are not related to a certain document.- Returns:
- an application object.
- Since:
- API version 1
-
createArranger
Arranger createArranger()Returns an object which provides access to the `Arranger` panel of Bitwig Studio. Calling this function is equal to `createArranger(-1)`.- Returns:
- an arranger object
- Since:
- API version 1
- See Also:
-
createArranger
Returns an object which provides access to the `Arranger` panel inside the specified window.- Parameters:
window- the index of the window where the arranger panel is shown, or -1 in case the first arranger panel found on any window should be taken- Returns:
- an arranger object
- Since:
- API version 1
-
createMixer
Mixer createMixer()Returns an object which provides access to the `Mixer` panel of Bitwig Studio. Calling this function is equal to `createMixer(-1, null)`.- Returns:
- a `Mixer` object
- Since:
- API version 1
-
createMixer
Returns an object which provides access to the `Mixer` panel that belongs to the specified panel layout. Calling this function is equal to `createMixer(-1, panelLayout)`.- Parameters:
panelLayout- the name of the panel layout that contains the mixer panel, or `null` in case the selected panel layout in Bitwig Studio should be followed. Empty strings or invalid names are treated the same way as `null`. To receive the list of available panel layouts seeApplication.addPanelLayoutObserver(com.bitwig.extension.callback.StringValueChangedCallback, int).- Returns:
- a `Mixer` object
- Since:
- API version 1
-
createMixer
Returns an object which provides access to the `Mixer` panel inside the specified window. Calling this function is equal to `createMixer(window, null)`.- Parameters:
window- the index of the window where the mixer panel is shown, or -1 in case the first mixer panel found on any window should be taken- Returns:
- a `Mixer` object
- Since:
- API version 1
-
createMixer
Returns an object which provides access to the `Mixer` panel that matches the specified parameters.- Parameters:
panelLayout- the name of the panel layout that contains the mixer panel, or `null` in case the selected panel layout in Bitwig Studio should be followed. Empty strings or invalid names are treated the same way as `null`. To receive the list of available panel layouts seeApplication.addPanelLayoutObserver(com.bitwig.extension.callback.StringValueChangedCallback, int).window- the index of the window where the mixer panel is shown, or -1 in case the first mixer panel found on any window should be taken- Returns:
- a `Mixer` object
- Since:
- API version 1
-
createDetailEditor
DetailEditor createDetailEditor()Returns an object which provides access to the `DetailEditor` panel of Bitwig Studio. Calling this function is equal to `createDetailEditor(-1)`.- Returns:
- a detail editor object
- Since:
- API version 14
- See Also:
-
createDetailEditor
Returns an object which provides access to the `DetailEditor` panel inside the specified window.- Parameters:
window- the index of the window where the detail editor panel is shown, or -1 in case the first detail editor panel found on any window should be taken- Returns:
- a detail editor object
- Since:
- API version 14
-
createTrackBank
Returns a track bank with the given number of tracks, sends and scenes.
A track bank can be seen as a fixed-size window onto the list of tracks in the current document including their sends and scenes, that can be scrolled in order to access different parts of the track list. For example a track bank configured for 8 tracks can show track 1-8, 2-9, 3-10 and so on.
The idea behind the `bank pattern` is that hardware typically is equipped with a fixed amount of channel strips or controls, for example consider a mixing console with 8 channels, but Bitwig Studio documents contain a dynamic list of tracks, most likely more tracks than the hardware can control simultaneously. The track bank returned by this function provides a convenient interface for controlling which tracks are currently shown on the hardware.
Creating a track bank using this method will consider all tracks in the document, including effect tracks and the master track. UsecreateMainTrackBank(int, int, int)orcreateEffectTrackBank(int, int, int)in case you are only interested in tracks of a certain kind.- Parameters:
numTracks- the number of tracks spanned by the track banknumSends- the number of sends spanned by the track banknumScenes- the number of scenes spanned by the track bank- Returns:
- an object for bank-wise navigation of tracks, sends and scenes
- Since:
- API version 1
- See Also:
-
createTrackBank
Returns a track bank with the given number of child tracks, sends and scenes.
A track bank can be seen as a fixed-size window onto the list of tracks in the connected track group including their sends and scenes, that can be scrolled in order to access different parts of the track list. For example a track bank configured for 8 tracks can show track 1-8, 2-9, 3-10 and so on.
The idea behind the `bank pattern` is that hardware typically is equipped with a fixed amount of channel strips or controls, for example consider a mixing console with 8 channels, but Bitwig Studio documents contain a dynamic list of tracks, most likely more tracks than the hardware can control simultaneously. The track bank returned by this function provides a convenient interface for controlling which tracks are currently shown on the hardware.
Creating a track bank using this method will consider all tracks in the document, including effect tracks and the master track. UsecreateMainTrackBank(int, int, int)orcreateEffectTrackBank(int, int, int)in case you are only interested in tracks of a certain kind.- Parameters:
numTracks- the number of child tracks spanned by the track banknumSends- the number of sends spanned by the track banknumScenes- the number of scenes spanned by the track bankhasFlatTrackList- specifies whether the track bank should operate on a flat list of all nested child tracks or only on the direct child tracks of the connected group track.- Returns:
- an object for bank-wise navigation of tracks, sends and scenes
- Since:
- API version 1
- See Also:
-
createMainTrackBank
Returns a track bank with the given number of tracks, sends and scenes. Only audio tracks, instrument tracks and hybrid tracks are considered. For more information about track banks and the `bank pattern` in general, see the documentation forcreateTrackBank(int, int, int).- Parameters:
numTracks- the number of tracks spanned by the track banknumSends- the number of sends spanned by the track banknumScenes- the number of scenes spanned by the track bank- Returns:
- an object for bank-wise navigation of tracks, sends and scenes
- Since:
- API version 1
- See Also:
-
createEffectTrackBank
Returns a track bank with the given number of effect tracks, sends and scenes. Only effect tracks are considered. For more information about track banks and the `bank pattern` in general, see the documentation forcreateTrackBank(int, int, int).- Parameters:
numTracks- the number of tracks spanned by the track banknumSends- the number of sends spanned by the track banknumScenes- the number of scenes spanned by the track bank- Returns:
- an object for bank-wise navigation of tracks, sends and scenes
- Since:
- API version 18
- See Also:
-
createEffectTrackBank
Returns a track bank with the given number of effect tracks and scenes. Only effect tracks are considered. For more information about track banks and the `bank pattern` in general, see the documentation forcreateTrackBank(int, int, int).- Parameters:
numTracks- the number of tracks spanned by the track banknumScenes- the number of scenes spanned by the track bank- Returns:
- an object for bank-wise navigation of tracks, sends and scenes
- Since:
- API version 1
- See Also:
-
createMasterTrack
Returns an object that represents the master track of the document.- Parameters:
numScenes- the number of scenes for bank-wise navigation of the master tracks clip launcher slots.- Returns:
- an object representing the master track.
- Since:
- API version 1
- See Also:
-
createArrangerCursorTrack
Deprecated.UsecreateCursorTrack(int, int)instead.Returns an object that represents the cursor item of the arranger track selection.- Parameters:
numSends- the number of sends for bank-wise navigation of the sends that are associated with the track selectionnumScenes- the number of scenes for bank-wise navigation of the clip launcher slots that are associated with the track selection- Returns:
- an object representing the currently selected arranger track (in the future also multiple tracks)
- Since:
- API version 1
-
createCursorTrack
Deprecated.usecreateCursorTrack(String, String, int, int, boolean)instead.Returns an object that represents a named cursor track, that is independent from the arranger or mixer track selection in the user interface of Bitwig Studio.- Parameters:
name- the name of the track cursornumSends- the number of sends for bank-wise navigation of the sends that are associated with the track selectionnumScenes- the number of scenes for bank-wise navigation of the clip launcher slots that are associated with the track selection- Returns:
- an object representing the currently selected arranger track (in the future also multiple tracks).
- Since:
- API version 1
-
createCursorTrack
CursorTrack createCursorTrack(String id, String name, int numSends, int numScenes, boolean shouldFollowSelection) Returns an object that represents a named cursor track, that is independent from the arranger or mixer track selection in the user interface of Bitwig Studio.- Parameters:
name- the name of the track cursornumSends- the number of sends for bank-wise navigation of the sends that are associated with the track selectionnumScenes- the number of scenes for bank-wise navigation of the clip launcher slots that are associated with the track selection- Returns:
- an object representing the currently selected arranger track (in the future also multiple tracks).
- Since:
- API version 1
-
createSceneBank
Returns a scene bank with the given number of scenes.
A scene bank can be seen as a fixed-size window onto the list of scenes in the current document, that can be scrolled in order to access different parts of the scene list. For example a scene bank configured for 8 scenes can show scene 1-8, 2-9, 3-10 and so on.
The idea behind the `bank pattern` is that hardware typically is equipped with a fixed amount of channel strips or controls, for example consider a mixing console with 8 channels, but Bitwig Studio documents contain a dynamic list of scenes, most likely more scenes than the hardware can control simultaneously. The scene bank returned by this function provides a convenient interface for controlling which scenes are currently shown on the hardware.- Parameters:
numScenes- the number of scenes spanned by the track bank- Returns:
- an object for bank-wise navigation of scenes
- Since:
- API version 1
-
createEditorCursorDevice
Deprecated.Returns an object that represents the cursor device in devices selections made by the user in Bitwig Studio. Calling this method is equal to the following code:var cursorTrack = createArrangerCursorTrack(numSends, numScenes); var cursorDevice = cursorTrack.createCursorDevice();To create a custom device selection that is not connected to the main device selection in the user interface, callcursorTrack.createCursorDevice(String name).- Returns:
- an object representing the currently selected device.
- Since:
- API version 1
- See Also:
-
createEditorCursorDevice
Deprecated.Use cursorTrack.createCursorDevice().Returns an object that represents the cursor device in devices selections made by the user in Bitwig Studio. Calling this method is equal to the following code:var cursorTrack = createArrangerCursorTrack(numSends, numScenes); var cursorDevice = cursorTrack.createCursorDevice();To create a custom device selection that is not connected to the main device selection in the user interface, callcursorTrack.createCursorDevice(String name).- Parameters:
numSends- the number of sends that are simultaneously accessible in nested channels.- Returns:
- an object representing the currently selected device.
- Since:
- API version 1
- See Also:
-
createCursorClip
Deprecated.UsecreateLauncherCursorClip(int, int)orcreateArrangerCursorClip(int, int)instead.- Since:
- API version 1
-
createLauncherCursorClip
Returns a clip object that represents the cursor of the launcher clip selection. The gridWidth and gridHeight parameters specify the grid dimensions used to access the note content of the clip.- Parameters:
gridWidth- the number of steps spanned by one page of the note content grid.gridHeight- the number of keys spanned by one page of the note content grid.- Returns:
- an object representing the currently selected cursor clip
- Since:
- API version 1
-
createArrangerCursorClip
Returns a clip object that represents the cursor of the arranger clip selection. The gridWidth and gridHeight parameters specify the grid dimensions used to access the note content of the clip.- Parameters:
gridWidth- the number of steps spanned by one page of the note content grid.gridHeight- the number of keys spanned by one page of the note content grid.- Returns:
- an object representing the currently selected cursor clip
- Since:
- API version 1
-
createUserControls
Returns an object that is used to define a bank of custom user controls. These controls are available to the user for free controller assignments and are typically used when bank-wise navigation is inconvenient.- Parameters:
numControllers- the number of controls that are available for free assignments- Returns:
- An object that represents a set of custom user controls.
- Since:
- API version 1
-
createLastClickedParameter
The last clicked parameter in the gui. Can also be pinned- Parameters:
id- used for persistent state. Extensions should use different IDs for different objects, but should try to not change IDs in between different versions.name- user facing name, used for example in context menus. Extensions may change the name in between different versions.- Since:
- API version 20
-
scheduleTask
Deprecated.Schedules the given callback function for execution after the given delay. For timer applications call this method once initially and then from within the callback function.- Parameters:
callback- the callback function that will be calledargs- that array of arguments that gets passed into the callback function, may be `null`delay- the duration after which the callback function will be called in milliseconds- Since:
- API version 1
-
scheduleTask
Schedules the given callback function for execution after the given delay. For timer applications call this method once initially and then from within the callback function.- Parameters:
callback- the callback function that will be calleddelay- the duration after which the callback function will be called in milliseconds- Since:
- API version 2
-
requestFlush
void requestFlush()Requests that the driver's flush method gets called.- Since:
- API version 2
-
println
Prints the given string in the control surface console window. The console window can be opened in the view menu of Bitwig Studio.- Parameters:
s- the string to be printed- Since:
- API version 1
-
errorln
Prints the given string in the control surface console window using a text style that highlights the string as error. The console window can be opened in the view menu of Bitwig Studio.- Parameters:
s- the error string to be printed- Since:
- API version 1
-
showPopupNotification
Shows a temporary text overlay on top of the application GUI, that will fade-out after a short interval. If the overlay is already shown, it will get updated with the given text.- Parameters:
text- the text to be shown- Since:
- API version 1
-
createRemoteConnection
Opens a TCP (Transmission Control Protocol) host socket for allowing network connections from other hardware and software.- Parameters:
name- a meaningful name that describes the purpose of this connection.defaultPort- the port that should be used for the connection. If the port is already in use, then another port will be used. CheckRemoteSocket.getPort()on the returned object to be sure.- Returns:
- the object that represents the socket
- Since:
- API version 1
-
connectToRemoteHost
Connects to a remote TCP (Transmission Control Protocol) socket.- Parameters:
host- the host name or IP address to connect to.port- the port to connect tocallback- the callback function that gets called when the connection gets established. A singleRemoteConnectionparameter is passed into the callback function.- Since:
- API version 1
-
sendDatagramPacket
Sends a UDP (User Datagram Protocol) packet with the given data to the specified host.- Parameters:
host- the destination host name or IP addressport- the destination portdata- the data to be send. When creating a numeric byte array in JavaScript, the byte values must be signed (in the range -128..127).- Since:
- API version 1
-
addDatagramPacketObserver
Adds an observer for incoming UDP (User Datagram Protocol) packets on the selected port.- Parameters:
name- a meaningful name that describes the purpose of this observer.port- the port that should be usedcallback- the callback function that gets called when data arrives. The function receives a single parameter that contains the data byte array.- Returns:
- true if was possible to bind the port, false otherwise
- Since:
- API version 1
-
defineController
Deprecated.- Since:
- API version 1
-
createTransportSection
Deprecated.UsecreateTransport()instead.- Since:
- API version 1
-
createCursorTrack
- Since:
- API version 1
-
createGrooveSection
Deprecated.UsecreateGroove()instead.- Since:
- API version 1
-
createApplicationSection
Deprecated.UsecreateApplication()instead.- Since:
- API version 1
-
createArrangerSection
Deprecated.UsecreateArranger(int)instead.- Since:
- API version 1
-
createMixerSection
Deprecated.UsecreateMixer(String, int)instead.- Since:
- API version 1
-
createTrackBankSection
Deprecated.UsecreateTrackBank(int, int, int)instead.- Since:
- API version 1
-
createMainTrackBankSection
Deprecated.UsecreateMainTrackBank(int, int, int)instead.- Since:
- API version 1
-
createEffectTrackBankSection
Deprecated.UsecreateEffectTrackBank(int, int)instead.- Since:
- API version 1
-
createCursorTrackSection
Deprecated.UsecreateArrangerCursorTrack(int, int)instead.- Since:
- API version 1
-
createMasterTrackSection
Deprecated.UsecreateMasterTrack(int)instead.- Since:
- API version 1
-
createCursorClipSection
Deprecated.UsecreateCursorClip(int, int)instead.- Since:
- API version 1
-
createCursorDeviceSection
Deprecated.UsecreateEditorCursorDevice()instead.- Since:
- API version 1
-
createCursorDevice
Deprecated.UsecreateEditorCursorDevice()instead.- Since:
- API version 1
-
createUserControlsSection
Deprecated.UsecreateUserControls(int)instead.- Since:
- API version 1
-
defineSysexDiscovery
Deprecated.UsedefineSysexIdentityReply(String)instead.- Since:
- API version 1
-
createPopupBrowser
PopupBrowser createPopupBrowser()Creates aPopupBrowserthat represents the pop-up browser in Bitwig Studio.- Since:
- API version 2
-
defaultBeatTimeFormatter
BeatTimeFormatter defaultBeatTimeFormatter()BeatTimeFormatterused to format beat times by default. This will be used to format beat times when asking for a beat time in string format without providing any formatting options. For example by callingDoubleValue.get().- Since:
- API version 2
-
setDefaultBeatTimeFormatter
Sets theBeatTimeFormatterto use by default for formatting beat times.- Since:
- API version 2
- See Also:
-
createBeatTimeFormatter
BeatTimeFormatter createBeatTimeFormatter(String separator, int barsLen, int beatsLen, int subdivisionLen, int ticksLen) Creates aBeatTimeFormatterthat can be used to format beat times.- Parameters:
separator- the character used to separate the segments of the formatted beat time, typically ":", "." or "-"barsLen- the number of digits reserved for barsbeatsLen- the number of digits reserved for beatssubdivisionLen- the number of digits reserved for beat subdivisionsticksLen- the number of digits reserved for ticks- Since:
- API version 2
-
createHardwareSurface
HardwareSurface createHardwareSurface()Creates aHardwareSurfacethat can contain hardware controls.- Since:
- API version 10
-
createOrHardwareActionMatcher
HardwareActionMatcher createOrHardwareActionMatcher(HardwareActionMatcher matcher1, HardwareActionMatcher matcher2) Creates aHardwareActionMatcherthat is matched by either of the 2 supplied action matchers.- Since:
- API version 10
-
createOrRelativeHardwareValueMatcher
RelativeHardwareValueMatcher createOrRelativeHardwareValueMatcher(RelativeHardwareValueMatcher matcher1, RelativeHardwareValueMatcher matcher2) Creates aRelativeHardwareValueMatcherthat is matched by either of the 2 supplied action matchers.- Since:
- API version 10
-
createOrAbsoluteHardwareValueMatcher
AbsoluteHardwareValueMatcher createOrAbsoluteHardwareValueMatcher(AbsoluteHardwareValueMatcher matcher1, AbsoluteHardwareValueMatcher matcher2) Creates aAbsoluteHardwareValueMatcherthat is matched by either of the 2 supplied action matchers.- Since:
- API version 10
-
midiExpressions
MidiExpressions midiExpressions()An object that can be used to generate useful MIDI expression strings which can be used inMidiIn.createActionMatcher(String)and other related methods.- Since:
- API version 10
-
createCallbackAction
default HardwareActionBindable createCallbackAction(Runnable runnable, Supplier<String> descriptionProvider) Creates aHardwareActionBindablethat can be bound to someHardwareAction(such as a button press) and when that action occurs the suppliedRunnablewill be run. This is exactly the same ascreateAction(Runnable, Supplier)but does not use parameter overloading so can be used from non type safe languages like JavaScript.- Parameters:
runnable- The runnable to be rundescriptionProvider- Provider that can provide a description of what the runnable does (used for showing onscreen feedback or help to the user).- Since:
- API version 18
-
createAction
Creates aHardwareActionBindablethat can be bound to someHardwareAction(such as a button press) and when that action occurs the suppliedRunnablewill be run.- Parameters:
runnable- The runnable to be rundescriptionProvider- Provider that can provide a description of what the runnable does (used for showing onscreen feedback or help to the user).- Since:
- API version 10
-
createPressureCallbackAction
default HardwareActionBindable createPressureCallbackAction(DoubleConsumer actionPressureConsumer, Supplier<String> descriptionProvider) Creates aHardwareActionBindablethat can be bound to someHardwareAction(such as a button press) and when that action occurs the suppliedRunnablewill be run. This is exactly the same ascreateAction(DoubleConsumer, Supplier)but does not use parameter overloading so can be used from non type safe languages like JavaScript.- Parameters:
actionPressureConsumer- Consumer that will be notified of the pressure of the actiondescriptionProvider- Provider that can provide a description of what the runnable does (used for showing onscreen feedback or help to the user).- Since:
- API version 18
-
createAction
HardwareActionBindable createAction(DoubleConsumer actionPressureConsumer, Supplier<String> descriptionProvider) Creates aHardwareActionBindablethat can be bound to someHardwareAction(such as a button press) and when that action occurs the suppliedRunnablewill be run- Parameters:
actionPressureConsumer- Consumer that will be notified of the pressure of the actiondescriptionProvider- Provider that can provide a description of what the runnable does (used for showing onscreen feedback or help to the user).- Since:
- API version 10
-
createRelativeHardwareControlStepTarget
RelativeHardwarControlBindable createRelativeHardwareControlStepTarget(HardwareActionBindable stepForwardsAction, HardwareActionBindable stepBackwardsAction) Creates aRelativeHardwarControlBindablethat can be used to step forwards or backwards when aRelativeHardwareControlis adjusted. A step is defined by theRelativeHardwareControl.setStepSize(double).- Parameters:
stepForwardsAction- The action that should happen when stepping forwardsstepBackwardsAction- The action that should happen when stepping backwards- Since:
- API version 10
-
createRelativeHardwareControlAdjustmentTarget
RelativeHardwarControlBindable createRelativeHardwareControlAdjustmentTarget(DoubleConsumer adjustmentConsumer) Creates aRelativeHardwarControlBindablethat can be used to adjust some value in an arbitrary way.- Parameters:
adjustmentConsumer- A consumer that will receive the relative adjustment amount when bound to aRelativeHardwareControl.- Since:
- API version 10
-
createAbsoluteHardwareControlAdjustmentTarget
AbsoluteHardwarControlBindable createAbsoluteHardwareControlAdjustmentTarget(DoubleConsumer adjustmentConsumer) Creates aAbsoluteHardwarControlBindablethat can be used to adjust some value in an arbitrary way.- Parameters:
adjustmentConsumer- A consumer that will receive the absolute adjustment amount when bound to anAbsoluteHardwareControl.- Since:
- API version 10
-
deleteObjects
It will delete multiple object within one undo step.- Since:
- API version 10
-
deleteObjects
It will delete multiple object within one undo step.- Since:
- API version 10
-
duplicateObjects
It will duplicate multiple object within one undo step.- Since:
- API version 19
-
duplicateObjects
It will duplicate multiple object within one undo step.- Since:
- API version 19
-
createInstrumentMatcher
DeviceMatcher createInstrumentMatcher()Creates aDeviceMatcherthat will match any instrument.- Since:
- API version 12
-
createAudioEffectMatcher
DeviceMatcher createAudioEffectMatcher()Creates aDeviceMatcherthat will match any audio effect.- Since:
- API version 12
-
createNoteEffectMatcher
DeviceMatcher createNoteEffectMatcher()Creates aDeviceMatcherthat will match any note effect.- Since:
- API version 12
-
createBitwigDeviceMatcher
Creates aDeviceMatcherthat will match any Bitwig native device with the supplied id.- Since:
- API version 12
-
createVST2DeviceMatcher
Creates aDeviceMatcherthat will match any VST2 plug-in with the supplied id.- Since:
- API version 12
-
createVST3DeviceMatcher
Creates aDeviceMatcherthat will match any VST3 plug-in with the supplied id.- Since:
- API version 12
-
createActiveDeviceMatcher
DeviceMatcher createActiveDeviceMatcher()Creates aDeviceMatcherthat will only match devices that are currently active.- Since:
- API version 12
-
createFirstDeviceInChainMatcher
DeviceMatcher createFirstDeviceInChainMatcher()Creates aDeviceMatcherthat will only match devices if it is the last device in the chain.- Since:
- API version 12
-
createLastDeviceInChainMatcher
DeviceMatcher createLastDeviceInChainMatcher()Creates aDeviceMatcherthat will only match devices if it is the last device in the chain.- Since:
- API version 12
-
createOrDeviceMatcher
Creates aDeviceMatcherthat matches a device if any of the supplied matchers match the device.- Since:
- API version 12
-
createAndDeviceMatcher
Creates aDeviceMatcherthat matches a device if all the supplied matchers match the device.- Since:
- API version 12
-
createNotDeviceMatcher
Creates aDeviceMatcherthat matches a device if the supplied matcher does not match the device.- Since:
- API version 12
-
createMasterRecorder
MasterRecorder createMasterRecorder()Creates aMasterRecorder.- Since:
- API version 20
-
createAudioIoDeviceHardwareAddressMatcher
Creates a matcher that matches devices with the given hardware address.- Since:
- API version 22
-
createUsbAudioIoDeviceMatcher
Creates a matcher that matches devices with the given USB vendor and product id.- Since:
- API version 22
-
createAudioHardwareOutputInfo
Creates aAudioHardwareIoInfofor the specified output.- Parameters:
channels- zero based channel indices- Since:
- API version 22
-
createAudioHardwareInputInfo
Creates aAudioHardwareIoInfofor the specified input.- Parameters:
channels- zero based channel indices- Since:
- API version 22
-
createApplication()instead.