Bitwig Studio Control Surface API
5.0.11
|
Instances of this interface are used to setup handler functions for incoming MIDI messages from a specific MIDI hardware.
Expressions can be used to generate matchers for various MIDI events that can then be used to update hardware control states (see MidiIn#createActionMatcher(String) and HardwareControl).
The expression language supports these operators in the same way that C, Java, C++ do: +, -, *, /, %, <<, >>, &&, ||, &, |, ^, <, <=, >, >=, ==, !=
The following variables are also defined for matching parts of the event:
Integers can be represented in hex using same syntax as C. 'true' and 'false' keywords are also defined.
AbsoluteHardwareValueMatcher createAbsoluteCCValueMatcher | ( | int | channel, |
int | controlNumber | ||
) |
Creates a matcher that matches the absolute value of a MIDI CC message.
AbsoluteHardwareValueMatcher createAbsoluteCCValueMatcher | ( | int | controlNumber | ) |
Creates a matcher that matches the absolute value of a MIDI CC message regardless of its channel.
AbsoluteHardwareValueMatcher createAbsolutePitchBendValueMatcher | ( | int | channel | ) |
Create a matcher that matches the absolute value of a MIDI pitch bend message.
AbsoluteHardwareValueMatcher createAbsoluteValueMatcher | ( | String | eventExpression, |
String | valueExpression, | ||
int | valueBitCount | ||
) |
Creates a matcher that matches the absolute value of a MIDI CC message by using expressions to filter and extract a value out of the MIDI event.
eventExpression | Expression that must be true in order to extract the value. |
valueExpression | Expression that determines the value once an event has been matched. |
valueBitCount | The number of bits that are relevant from the value extracted by the valueExpression. |
HardwareActionMatcher createActionMatcher | ( | String | expression | ) |
Creates a matcher that can match an action from a MIDI event. For example, pressing a button based on input of a MIDI CC event.
expression | Expression returns true if the event matches |
HardwareActionMatcher createCCActionMatcher | ( | int | channel, |
int | controlNumber | ||
) |
Creates a matcher that recognizes an action when getting a MIDI CC event regardless of the value.
HardwareActionMatcher createCCActionMatcher | ( | int | channel, |
int | controlNumber, | ||
int | value | ||
) |
Creates a matcher that recognizes an action when getting a MIDI CC event with a specific value.
NoteInput createNoteInput | ( | String | name, |
String... | masks | ||
) |
Creates a note input that appears in the track input choosers in Bitwig Studio. This method must be called within the init()
function of the script. The messages matching the given mask parameter will be fed directly to the application, and are not processed by the script.
name | the name of the note input as it appears in the track input choosers in Bitwig Studio |
masks | a filter string formatted as hexadecimal value with ? as wildcard. For example 80???? would match note-off on channel 1 (0). When this parameter is {@null}, a standard filter will be used to forward note-related messages on channel 1 (0). |
If multiple note input match the same MIDI event then they'll all receive the MIDI event, and if one of them does not consume events then the events wont' be consumed.
HardwareActionMatcher createNoteOffActionMatcher | ( | int | channel, |
int | note | ||
) |
Creates a matcher that recognizes an action when a MIDI note off event occurs.
AbsoluteHardwareValueMatcher createNoteOffVelocityValueMatcher | ( | int | channel, |
int | note | ||
) |
Creates a matcher that recognizes a note's off velocity when a MIDI note off event occurs.
HardwareActionMatcher createNoteOnActionMatcher | ( | int | channel, |
int | note | ||
) |
Creates a matcher that recognizes an action when a MIDI note on event occurs.
AbsoluteHardwareValueMatcher createNoteOnVelocityValueMatcher | ( | int | channel, |
int | note | ||
) |
Creates a matcher that recognizes a note's on velocity when a MIDI note on event occurs.
AbsoluteHardwareValueMatcher createPolyAftertouchValueMatcher | ( | int | channel, |
int | note | ||
) |
Creates a matcher that matches the absolute value of a Poly AT message.
RelativeHardwareValueMatcher createRelative2sComplementCCValueMatcher | ( | int | channel, |
int | controlNumber, | ||
int | valueAmountForOneFullRotation | ||
) |
Creates a matcher that matches the relative value of a MIDI CC message encoded using 2s complement.
valueAmountForOneFullRotation | The value that would represent one full rotation to the right (should be very similar to the amount of rotation needed to take an absolute knob from 0 to 1). For example, if a value of 127 meant it had been rotated to the right by a full rotation then you would pass 127 here. This ensures that RelativeHardwareControls have similar sensitivity to each other and can be mapped and behave in a very similar way to AbsoluteHardwareControls. |
RelativeHardwareValueMatcher createRelative2sComplementValueMatcher | ( | AbsoluteHardwareValueMatcher | valueMatcher, |
int | valueAmountForOneFullRotation | ||
) |
Creates a matcher that converts a value matched by an AbsoluteHardwareValueMatcher to a relative value using 2s complement.
valueAmountForOneFullRotation | The value that would represent one full rotation to the right (should be very similar to the amount of rotation needed to take an absolute knob from 0 to 1). For example, if a value of 127 meant it had been rotated to the right by a full rotation then you would pass 127 here. This ensures that RelativeHardwareControls have similar sensitivity to each other and can be mapped and behave in a very similar way to AbsoluteHardwareControls. |
RelativeHardwareValueMatcher createRelative2sComplementValueMatcher | ( | String | eventExpression, |
String | valueExpression, | ||
int | valueBitCount, | ||
int | valueAmountForOneFullRotation | ||
) |
Creates a matcher that matches the relative value (encoded as 2s complement) of a MIDI CC message by using expressions to filter and extract a value out of the MIDI event.
eventExpression | Expression that must be true in order to extract the value. |
valueExpression | Expression that determines the value once an event has been matched. |
valueBitCount | The number of bits that are relevant from the value extracted by the valueExpression. |
valueAmountForOneFullRotation | The value that would represent one full rotation to the right (should be very similar to the amount of rotation needed to take an absolute knob from 0 to 1). For example, if a value of 127 meant it had been rotated to the right by a full rotation then you would pass 127 here. This ensures that RelativeHardwareControls have similar sensitivity to each other and can be mapped and behave in a very similar way to AbsoluteHardwareControls. |
RelativeHardwareValueMatcher createRelativeBinOffsetCCValueMatcher | ( | int | channel, |
int | controlNumber, | ||
int | valueAmountForOneFullRotation | ||
) |
Creates a matcher that matches the relative value of a MIDI CC message encoded using bin offset.
valueAmountForOneFullRotation | The value that would represent one full rotation to the right (should be very similar to the amount of rotation needed to take an absolute knob from 0 to 1). For example, if a value of 127 meant it had been rotated to the right by a full rotation then you would pass 127 here. This ensures that RelativeHardwareControls have similar sensitivity to each other and can be mapped and behave in a very similar way to AbsoluteHardwareControls. |
RelativeHardwareValueMatcher createRelativeBinOffsetValueMatcher | ( | AbsoluteHardwareValueMatcher | valueMatcher, |
int | valueAmountForOneFullRotation | ||
) |
Creates a matcher that converts a value matched by an AbsoluteHardwareValueMatcher to a relative value using bin offset.
valueAmountForOneFullRotation | The value that would represent one full rotation to the right (should be very similar to the amount of rotation needed to take an absolute knob from 0 to 1). For example, if a value of 127 meant it had been rotated to the right by a full rotation then you would pass 127 here. This ensures that RelativeHardwareControls have similar sensitivity to each other and can be mapped and behave in a very similar way to AbsoluteHardwareControls. |
RelativeHardwareValueMatcher createRelativeBinOffsetValueMatcher | ( | String | eventExpression, |
String | valueExpression, | ||
int | valueBitCount, | ||
int | valueAmountForOneFullRotation | ||
) |
Creates a matcher that matches the relative value (encoded as bin offset) of a MIDI CC message by using expressions to filter and extract a value out of the MIDI event.
eventExpression | Expression that must be true in order to extract the value. |
valueExpression | Expression that determines the value once an event has been matched. |
valueBitCount | The number of bits that are relevant from the value extracted by the valueExpression. |
valueAmountForOneFullRotation | The value that would represent one full rotation to the right (should be very similar to the amount of rotation needed to take an absolute knob from 0 to 1). For example, if a value of 127 meant it had been rotated to the right by a full rotation then you would pass 127 here. This ensures that RelativeHardwareControls have similar sensitivity to each other and can be mapped and behave in a very similar way to AbsoluteHardwareControls. |
RelativeHardwareValueMatcher createRelativeSignedBit2CCValueMatcher | ( | int | channel, |
int | controlNumber, | ||
int | valueAmountForOneFullRotation | ||
) |
Creates a matcher that matches the relative value of a MIDI CC message encoded using signed bit 2.
valueAmountForOneFullRotation | The value that would represent one full rotation to the right (should be very similar to the amount of rotation needed to take an absolute knob from 0 to 1). For example, if a value of 127 meant it had been rotated to the right by a full rotation then you would pass 127 here. This ensures that RelativeHardwareControls have similar sensitivity to each other and can be mapped and behave in a very similar way to AbsoluteHardwareControls. |
RelativeHardwareValueMatcher createRelativeSignedBit2ValueMatcher | ( | AbsoluteHardwareValueMatcher | valueMatcher, |
int | valueAmountForOneFullRotation | ||
) |
Creates a matcher that converts a value matched by an AbsoluteHardwareValueMatcher to a relative value using signed bit 2.
valueAmountForOneFullRotation | The value that would represent one full rotation to the right (should be very similar to the amount of rotation needed to take an absolute knob from 0 to 1). For example, if a value of 127 meant it had been rotated to the right by a full rotation then you would pass 127 here. This ensures that RelativeHardwareControls have similar sensitivity to each other and can be mapped and behave in a very similar way to AbsoluteHardwareControls. |
RelativeHardwareValueMatcher createRelativeSignedBit2ValueMatcher | ( | String | eventExpression, |
String | valueExpression, | ||
int | valueBitCount, | ||
int | valueAmountForOneFullRotation | ||
) |
Creates a matcher that matches the relative value (encoded as signed bit 2) of a MIDI CC message by using expressions to filter and extract a value out of the MIDI event.
eventExpression | Expression that must be true in order to extract the value. |
valueExpression | Expression that determines the value once an event has been matched. |
valueBitCount | The number of bits that are relevant from the value extracted by the valueExpression. |
valueAmountForOneFullRotation | The value that would represent one full rotation to the right (should be very similar to the amount of rotation needed to take an absolute knob from 0 to 1). For example, if a value of 127 meant it had been rotated to the right by a full rotation then you would pass 127 here. This ensures that RelativeHardwareControls have similar sensitivity to each other and can be mapped and behave in a very similar way to AbsoluteHardwareControls. |
RelativeHardwareValueMatcher createRelativeSignedBitCCValueMatcher | ( | int | channel, |
int | controlNumber, | ||
int | valueAmountForOneFullRotation | ||
) |
Creates a matcher that matches the relative value of a MIDI CC message encoded using signed bit.
valueAmountForOneFullRotation | The value that would represent one full rotation to the right (should be very similar to the amount of rotation needed to take an absolute knob from 0 to 1). For example, if a value of 127 meant it had been rotated to the right by a full rotation then you would pass 127 here. This ensures that RelativeHardwareControls have similar sensitivity to each other and can be mapped and behave in a very similar way to AbsoluteHardwareControls. |
RelativeHardwareValueMatcher createRelativeSignedBitValueMatcher | ( | AbsoluteHardwareValueMatcher | valueMatcher, |
int | valueAmountForOneFullRotation | ||
) |
Creates a matcher that converts a value matched by an AbsoluteHardwareValueMatcher to a relative value using signed bit.
valueMatcher | Value matcher that matches the value that needs to be converted to a relative value |
valueAmountForOneFullRotation | The value that would represent one full rotation to the right (should be very similar to the amount of rotation needed to take an absolute knob from 0 to 1). For example, if a value of 127 meant it had been rotated to the right by a full rotation then you would pass 127 here. This ensures that RelativeHardwareControls have similar sensitivity to each other and can be mapped and behave in a very similar way to AbsoluteHardwareControls. |
RelativeHardwareValueMatcher createRelativeSignedBitValueMatcher | ( | String | eventExpression, |
String | valueExpression, | ||
int | valueBitCount, | ||
int | valueAmountForOneFullRotation | ||
) |
Creates a matcher that matches the relative value (encoded as signed bit) of a MIDI CC message by using expressions to filter and extract a value out of the MIDI event.
eventExpression | Expression that must be true in order to extract the value. |
valueExpression | Expression that determines the value once an event has been matched. |
valueBitCount | The number of bits that are relevant from the value extracted by the valueExpression. |
valueAmountForOneFullRotation | The value that would represent one full rotation to the right (should be very similar to the amount of rotation needed to take an absolute knob from 0 to 1). For example, if a value of 127 meant it had been rotated to the right by a full rotation then you would pass 127 here. This ensures that RelativeHardwareControls have similar sensitivity to each other and can be mapped and behave in a very similar way to AbsoluteHardwareControls. |
RelativeHardwareValueMatcher createRelativeValueMatcher | ( | String | eventExpression, |
double | relativeAdjustment | ||
) |
Creates a matcher that applies a relative adjustment when a MIDI event occurs matching an expression.
eventExpression | Expression that must be true in order to extract the value. |
relativeAdjustment | The amount of relative adjustment that should be applied |
AbsoluteHardwareValueMatcher createSequencedValueMatcher | ( | AbsoluteHardwareValueMatcher | firstValueMatcher, |
AbsoluteHardwareValueMatcher | secondValueMatcher, | ||
boolean | areMostSignificantBitsInSecondEvent | ||
) |
Creates an absolute value matcher that is defined by 2 separate MIDI events that have to occur in sequence.
This can be used to get a much higher precision value that a single MIDI event would allow. Some controllers for example will send 2 CC events for a single value.
void setMidiCallback | ( | ShortMidiDataReceivedCallback | callback | ) |
Registers a callback for receiving short (normal) MIDI messages on this MIDI input port.
callback | a callback function that receives three integer parameters: 1. the status byte 2. the data1 value 2. the data2 value |
void setSysexCallback | ( | SysexMidiDataReceivedCallback | callback | ) |
Registers a callback for receiving sysex MIDI messages on this MIDI input port.
callback | a callback function that takes a single string argument |