/
bitwig.d.ts
4276 lines (3171 loc) · 165 KB
/
bitwig.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/** Something that can be bound to an {@link AbsoluteHardwareControl} and can respond to the user input (such
as user moving a slider up or down) in a meaningful way. */
declare interface AbsoluteHardwarControlBindable extends HardwareBindable {
/** Binds this target to the supplied hardware control so that when the user moves the hardware control this
target will respond in a meaningful way.
When the binding is no longer needed the {@link HardwareBinding#removeBinding()} method can be called on
it. */
addBinding(hardwareControl: AbsoluteHardwareControl, ): AbsoluteHardwareControlBinding
/** Binds this target to the supplied hardware control so that when the user moves the hardware control this
target will respond in a meaningful way. This target will be adjusted within the supplied normalized
range.
When the binding is no longer needed the {@link HardwareBinding#removeBinding()} method can be called on
it. */
addBindingWithRange(hardwareControl: AbsoluteHardwareControl, minNormalizedValue: number, maxNormalizedValue: number, ): AbsoluteHardwareControlBinding
}
/** Represents a hardware control that can input and absolute value (for example, a slider, knob or foot
pedal). */
declare interface AbsoluteHardwareControl extends ContinuousHardwareControl<AbsoluteHardwarControlBinding> {
/** Sets the {@link AbsoluteHardwareValueMatcher} that can be used to detect when the user adjusts the
hardware control's value. */
setAdjustValueMatcher(matcher: AbsoluteHardwareValueMatcher, ): void
/** Adds a new binding from this hardware control to the supplied target. */
addBindingWithRange(target: AbsoluteHardwarControlBindable, minNormalizedValue: number, maxNormalizedValue: number, ): AbsoluteHardwareControlBinding
/** Convenience methods that ensures there is only a single binding to the supplied target. This is
equivalent to calling {@link #clearBindings()} and then
{@link #addBindingWithRange(AbsoluteHardwarControlBindable, double, double)} */
setBindingWithRange(target: AbsoluteHardwarControlBindable, minNormalizedValue: number, maxNormalizedValue: number, ): AbsoluteHardwareControlBinding
}
/** Represents a binding from an {@link AbsoluteHardwareControl} to some target. */
declare interface AbsoluteHardwareControlBinding extends HardwareBindingWithRange {
}
/** Represents a physical hardware knob that inputs an absolute value. */
declare interface AbsoluteHardwareKnob extends AbsoluteHardwareControl {
}
/** Defines a means of recognizing when an absolute value is input by the user (for example, when moving a
slider or turning a knob based on some MIDI message). This matcher can then be set on an
{@link AbsoluteHardwareControl} using
{@link AbsoluteHardwareControl#setAdjustValueMatcher(AbsoluteHardwareValueMatcher)}. */
declare interface AbsoluteHardwareValueMatcher extends ContinuousHardwareValueMatcher {
}
/** Instances of this interface represent actions in Bitwig Studio, such as commands that can be launched from
the main menu or via keyboard shortcuts.
To receive the list of all actions provided by Bitwig Studio call {@link Application#getActions()}. The
list of actions that belong to a certain category can be queried by calling
{@link ActionCategory#getActions()}. Access to specific actions is provided in
{@link Application#getAction(String)}. */
declare interface Action extends HardwareActionBindable {
}
/** Instances of this interface are used to categorize actions in Bitwig Studio. The list of action categories
provided by Bitwig Studio can be queried by calling {@link Application#getActionCategories()}. To receive a
specific action category call {@link Application#getActionCategory(String)}. */
declare interface ActionCategory {
}
/** An interface that provides methods for accessing the most common global application commands.<br/>
In addition, functions are provided for accessing any application action in a generic and categorized way,
pretty much as displayed in the Bitwig Studio commander dialog (see {@link #getActions()},
{@link #getAction(String)}, {@link #getActionCategories()}), {@link #getActionCategory(String)}).<br/>
To receive an instance of the application interface call {@link ControllerHost#createApplication()}. */
declare interface Application {
/** Creates a new audio track at the given position. */
createAudioTrack(
/** the index within the list of main tracks where the new track should be inserted, or `-1` in
case the track should be inserted at the end of the list. Values outside the valid range will
get pinned to the valid range, so the actual position might be different from the provided
parameter value.*/
position: any, ): void
/** Creates a new instrument track at the given position. */
createInstrumentTrack(
/** the index within the list of main tracks where the new track should be inserted, or `-1` in
case the track should be inserted at the end of the list. Values outside the valid range will
get pinned to the valid range, so the actual position might be different from the provided
parameter value.*/
position: any, ): void
/** Creates a new effect track at the given position. */
createEffectTrack(
/** the index within the list of effect tracks where the new track should be inserted, or `-1` in
case the track should be inserted at the end of the list. Values outside the valid range will
get pinned to the valid range, so the actual position might be different from the provided
parameter value.*/
position: any, ): void
/** Returns the action for the given action identifier. For a list of available actions, see
{@link #getActions()}. */
getAction(
/** the action identifier string, must not be `null`*/
id: any, ): Action
/** Returns the action category associated with the given identifier. For a list of available action
categories, see {@link #getActionCategories()}. */
getActionCategory(
/** the category identifier string, must not be `null`*/
id: any, ): ActionCategory
/** Set BitwigStudio to navigate into the group. */
navigateIntoTrackGroup(track: Track, ): void
/** Switches the Bitwig Studio user interface to the panel layout with the given name. The list of available
panel layouts depends on the active display profile. */
setPanelLayout(
/** the name of the new panel layout*/
panelLayout: any, ): void
createAudioTrack(position: number): void
createInstrumentTrack(position: number): void
createEffectTrack(position: number): void
getActions(): Action[]
getAction(id: string): Action
getActionCategories(): ActionCategory[]
getActionCategory(id: string): ActionCategory
activateEngine(): void
deactivateEngine(): void
hasActiveEngine(): BooleanValue
addHasActiveEngineObserver(callable: BooleanValueChangedCallback): void
projectName(): StringValue
addProjectNameObserver(callback: StringValueChangedCallback, maxChars: number): void
nextProject(): void
previousProject(): void
navigateIntoTrackGroup(track: Track): void
navigateToParentTrackGroup(): void
undo(): void
undoAction(): HardwareActionBindable
redo(): void
redoAction(): HardwareActionBindable
setPanelLayout(panelLayout: string): void
nextPanelLayout(): void
previousPanelLayout(): void
panelLayout(): StringValue
addPanelLayoutObserver(callable: StringValueChangedCallback, maxChars: number): void
displayProfile(): StringValue
addDisplayProfileObserver(callable: StringValueChangedCallback, maxChars: number): void
toggleInspector(): void
toggleDevices(): void
toggleMixer(): void
toggleNoteEditor(): void
toggleAutomationEditor(): void
toggleBrowserVisibility(): void
previousSubPanel(): void
nextSubPanel(): void
arrowKeyLeft(): void
arrowKeyRight(): void
arrowKeyUp(): void
arrowKeyDown(): void
enter(): void
escape(): void
selectAll(): void
selectAllAction(): HardwareActionBindable
selectNone(): void
selectNoneAction(): HardwareActionBindable
selectPrevious(): void
selectPreviousAction(): HardwareActionBindable
selectNext(): void
selectNextAction(): HardwareActionBindable
selectFirst(): void
selectFirstAction(): HardwareActionBindable
selectLast(): void
selectLastAction(): HardwareActionBindable
cut(): void
cutAction(): HardwareActionBindable
copy(): void
copyAction(): HardwareActionBindable
paste(): void
pasteAction(): HardwareActionBindable
duplicate(): void
duplicateAction(): HardwareActionBindable
remove(): void
removeAction(): HardwareActionBindable
rename(): void
zoomIn(): void
zoomInAction(): HardwareActionBindable
zoomOut(): void
zoomOutAction(): HardwareActionBindable
zoomToSelection(): void
zoomToSelectionAction(): HardwareActionBindable
zoomToSelectionOrAll(): void
zoomToSelectionOrAllAction(): HardwareActionBindable
zoomToSelectionOrPrevious(): void
zoomToSelectionOrPreviousAction(): HardwareActionBindable
zoomToFit(): void
zoomToFitAction(): HardwareActionBindable
focusPanelToLeft(): void
focusPanelToRight(): void
focusPanelAbove(): void
focusPanelBelow(): void
toggleFullScreen(): void
setPerspective(perspective: string): void
nextPerspective(): void
previousPerspective(): void
addSelectedModeObserver(callable: StringValueChangedCallback, maxChars: number, fallbackText: string): void
recordQuantizationGrid(): SettableEnumValue
recordQuantizeNoteLength(): SettableBooleanValue
}
/** Proxy to an arpeggiator component. */
declare interface Arpeggiator extends ObjectProxy {
/**
* one of: all, up, up-down, up-then-down, down, down-up, down-then-up,
* flow, random, converge-up, converge-down, diverge-up, diverge-down,
* thumb-up, thumb-down, pinky-up, pinky-down
*/
mode(): SettableEnumValue
octaves(): SettableIntegerValue
isEnabled(): SettableBooleanValue
isFreeRunning(): SettableBooleanValue
shuffle(): SettableBooleanValue
rate(): SettableDoubleValue
gateLength(): SettableDoubleValue
usePressureToVelocity(): SettableBooleanValue
releaseNotes(): void
}
/** An interface representing various commands which can be performed on the Bitwig Studio arranger.<br/>
To receive an instance of the application interface call {@link ControllerHost#createArranger}. */
declare interface Arranger {
/** Returns an object that provides access to a bank of successive cue markers using a window configured with
the given size, that can be scrolled over the list of markers. */
createCueMarkerBank(
/** the number of simultaneously accessible items*/
size: number): CueMarkerBank
isPlaybackFollowEnabled(): SettableBooleanValue
hasDoubleRowTrackHeight(): SettableBooleanValue
areCueMarkersVisible(): SettableBooleanValue
isClipLauncherVisible(): SettableBooleanValue
isTimelineVisible(): SettableBooleanValue
isIoSectionVisible(): SettableBooleanValue
areEffectTracksVisible(): SettableBooleanValue
addPlaybackFollowObserver(callback: BooleanValueChangedCallback): void
addTrackRowHeightObserver(callback: BooleanValueChangedCallback): void
addCueMarkerVisibilityObserver(callback: BooleanValueChangedCallback): void
togglePlaybackFollow(): void
toggleTrackRowHeight(): void
toggleCueMarkerVisibility(): void
}
/** Callback that is notified when an asynchronous transfer has completed. */
declare interface AsyncTransferCompledCallback {
/** Called upon completion of an asynchronous read. */
asyncTransferCompleted(amountTransferred: number, ): void
}
declare interface AutoDetectionMidiPortNames {
}
declare interface AutoDetectionMidiPortNamesList {
add(inputNames: String[], outputNames: String[], ): void
getPortNamesAt(index: number, ): AutoDetectionMidiPortNames
}
/** A bank provides access to a range of items in Bitwig Studio. Instances of a bank are configured with a
fixed number of items and represent an excerpt of a larger list of items. Various methods are provided for
scrolling to different sections of the item list. It basically acts like a window moving over the list of
underlying items. */
declare interface Bank extends ObjectProxy, Scrollable {
/** Sets the size of this bank */
setSizeOfBank(
/** number of items in the bank that has to be greater than 0 and less or equal to the capacity of the bank.*/
size: number, ): void
/** Gets the item in the bank at the supplied index. The index must be >= 0 and < {@link #getSizeOfBank()}. */
getItemAt(index: number, ): ItemType
}
/** Defines a formatter for a beat time that can convert a beat time to a string for display to the user. */
declare interface BeatTimeFormatter {
/** Formats the supplied beat time as a string in the supplied time signature. */
formatBeatTime(beatTime: number, isAbsolute: boolean, timeSignatureNumerator: number, timeSignatureDenominator: number, timeSignatureTicks: number, ): string
}
/** Instances of this interface represent beat time values.
Beat time values are double-precision number representing the number of quarter notes, regardless of time-signature. */
declare interface BeatTimeValue extends DoubleValue {
/** Gets the current beat time formatted according to the supplied formatter. */
getFormatted(formatter: BeatTimeFormatter, ): string
}
/** Represents a bitmap image which can be painted via {@link #render(Renderer)}. */
declare interface Bitmap extends Image {
/** Call this method to start painting the bitmap.
This method will take care of disposing allocated patterns during the rendering. */
render(renderer: Renderer, ): void
/** Updates the display window title. */
setDisplayWindowTitle(title: string, ): void
/** Saves the image as a PPM file. */
saveToDiskAsPPM(
/** the location of the target file.*/
path: string, ): void
}
/** Represents an output value shown on some hardware (for example, if an LED is on or off). */
declare interface BooleanHardwareProperty extends HardwareProperty {
/** Specifies a callback that should be called with the value that needs to be sent to the hardware. This
callback is called as a result of calling the {@link HardwareSurface#updateHardware()} method (typically
from the flush method). */
onUpdateHardware(sendValueConsumer: java.util.function.Consumer<java.lang.Boolean>, ): void
/** Sets the current value. */
setValue(value: boolean, ): void
/** Sets the current value from a {@link BooleanSupplier} that supplies the latest value. */
setValueSupplier(supplier: (...args: any[]) => boolean, ): void
}
declare interface BooleanValue extends Value<BooleanValueChangedCallback> {
get(): boolean
}
declare interface BooleanValueChangedCallback extends ValueChangedCallback {
valueChanged(newValue: boolean, ): void
}
/** Instances of this interface are used to navigate a column in the Bitwig Studio browser. */
declare interface BrowserColumn extends ObjectProxy {
/** Returns an object that provides access to a bank of successive entries using a window configured with
the given size, that can be scrolled over the list of entries. */
createItemBank(
/** the number of simultaneously accessible items*/
size: any, ): BrowserItemBank
}
/** Instances of this interface are used to navigate a filter column in the Bitwig Studio browser. */
declare interface BrowserFilterColumn extends BrowserColumn {
/** Returns an object that provides access to a bank of successive entries using a window configured with
the given size, that can be scrolled over the list of entries. */
createItemBank(
/** the number of simultaneously accessible items*/
size: any, ): BrowserFilterItemBank
}
/** Instances of this interface represent entries in a browser filter column. */
declare interface BrowserFilterItem extends BrowserItem {
}
/** Instances of this interface are used to navigate a filter column in the Bitwig Studio browser. */
declare interface BrowserFilterItemBank {
}
/** Instances of this interface represent entries in a browser filter column. */
declare interface BrowserItem {
}
/** Instances of this interface are used to navigate a column in the Bitwig Studio browser. */
declare interface BrowserItemBank {
}
/** Instances of this interface are used to navigate a results column in the Bitwig Studio browser. */
declare interface BrowserResultsColumn {
/** Returns an object that provides access to a bank of successive entries using a window configured with
the given size, that can be scrolled over the list of entries. */
createItemBank(
/** the number of simultaneously accessible items*/
size: any, ): BrowserResultsItemBank
}
/** Instances of this interface represent entries in a browser results column. */
declare interface BrowserResultsItem {
}
/** Instances of this interface are used to navigate the results column in the Bitwig Studio browser. */
declare interface BrowserResultsItemBank {
}
/** Instances of this interface are used to navigate the available sessions in Bitwig Studio's contextual
browser. The sessions are shown as tabs in the graphical user interface of the browser. */
declare interface BrowsingSessionBank {
/** Returns the browser session for the given index. */
getSession(
/** the session index, must be in the range `[0..getSize-1]`*/
index: any, ): GenericBrowsingSession
}
/** This interface represents a chain selector device which can be:
- instrument selector
- effect selector */
declare interface ChainSelector extends {
activeChainIndex(): SettableIntegerValue
chainCount(): IntegerValue
activeChain(): DeviceLayer
cycleNext(): void
cyclePrevious(): void
}
/** This interface defines access to the common attributes and operations of channels, such as tracks or nested
device channels. */
declare interface Channel {
/** Registers an observer for the VU-meter of this track. */
addVuMeterObserver(
/** the number of steps to which the reported values should be scaled. For example a range of 128
would cause the callback to be called with values between 0 and 127.*/
range: any,
/** 0 for left channel, 1 for right channel, -1 for the sum of both*/
channel: any,
/** when `true` the peak value is reported, otherwise the RMS value*/
peak: any,
/** a callback function that takes a single numeric argument. The value is in the range
[0..range-1].*/
callback: any, ): void
/** Registers an observer that reports if the device chain is selected in Bitwig Studio mixer. */
addIsSelectedInMixerObserver(
/** a callback function that takes a single boolean parameter.*/
callback: any, ): void
}
/** A channel bank provides access to a range of channels in Bitwig Studio, such as tracks or device layers.
Instances of channel bank are typically configured with support for a fixed number of channels and
represent an excerpt of a larger list of channels. Various methods are provided for scrolling to different
sections of the channel list. It basically acts like a window moving over the list of channels. */
declare interface ChannelBank {
/** Sets the step size used for scrolling the channel bank. */
setChannelScrollStepSize(
/** the step size used for scrolling. Default is `1`.*/
stepSize: any, ): void
}
/** An interface that provides access to the contents of a clip in Bitwig Studio.
The note content of the clip is exposed in terms of steps and keys, mainly targeted to x-y-grid
applications such as step sequencers. */
declare interface Clip {
/** Scroll the note grid so that the given key becomes the key with y position of 0.
Note: This can cause some parts of the grid to represent invalid keys as there is no clipping */
scrollToKey(
/** the key that should be the new key with a y position of 0. This must be a value in the range
0...127.*/
key: any, ): void
/** Scroll the note grid so that the given step becomes visible. */
scrollToStep(
/** the step that should become visible*/
step: any, ): void
/** Toggles the existence of a note in the note grid cell specified by the given x and y arguments. */
toggleStep(
/** the MIDI channel, between 0 and 15.*/
channel: number,
/** the x position within the note grid, defining the step/time of the target note*/
x: any,
/** the y position within the note grid, defining the key of the target note*/
y: any,
/** the velocity of the target note in case a new note gets inserted*/
insertVelocity: any, ): void
/** Creates a note in the grid cell specified by the given x and y arguments. Existing notes are
overwritten. */
setStep(channel: number, x: number, y: number, insertVelocity: number, insertDuration: number, ): void
/** Removes the note in the grid cell specified by the given x and y arguments. Calling this method does
nothing in case no note exists at the given x-y-coordinates. */
clearStep(
/** MIDI channel, from 0 to 15.*/
channel: number,
/** the x position within the note grid, defining the step/time of the target note*/
x: any,
/** the y position within the note grid, defining the key of the target note*/
y: any, ): void
/** Removes all notes in the grid started on the step x. */
clearStepsAtX(channel: number, x: number, ): void
/** Removes all notes in the grid row specified by the given y argument. */
clearStepsAtY(
/** MIDI channel, from 0 to 15.*/
channel: number,
/** the y position within the note grid, defining the key of the target note*/
y: number, ): void
/** Selects the note in the grid cell specified by the given x and y arguments, in case there actually is a
note at the given x-y-coordinates. */
selectStepContents(
/** MIDI channel, from 0 to 15.*/
channel: number,
/** the x position within the note grid, defining the step/time of the target note*/
x: any,
/** the y position within the note grid, defining the key of the target note*/
y: any,
/** `true` if the existing selection should be cleared, {@false} if the note should be added to
the current selection.*/
clearCurrentSelection: any, ): void
/** Sets the beat time duration that is represented by one note grid step. */
setStepSize(
/** the length of one note grid step in beat time.*/
lengthInBeatTime: any, ): void
/** Registers an observer that reports which note grid steps/keys contain notes. */
addStepDataObserver(
/** A callback function that receives three parameters: 1. the x (step) coordinate within the note
grid (integer), 2. the y (key) coordinate within the note grid (integer), and 3. an integer
value that indicates if the step is empty (`0`) or if a note continues playing (`1`) or starts
playing (`2`).*/
callback: any, ): void
/** Registers an observer that reports which note grid steps/keys contain notes. */
addNoteStepObserver(
/** A callback function that receives the StepInfo.*/
callback: NoteStepChangedCallback, ): void
/** Updates the name of the clip. */
setName(
/** the new clip name*/
name: any, ): void
/** Transposes all notes in the clip by the given number of semitones. */
transpose(
/** the amount of semitones to transpose, can be a positive or negative integer value.*/
semitones: any, ): void
/** Quantize the start time of all notes in the clip according to the given amount. The note lengths remain
the same as before. */
quantize(
/** a factor between `0` and `1` that allows to morph between the original note start and the
quantized note start.*/
amount: any, ): void
/** Get step info */
getStep(channel: number, x: number, y: number, ): NoteStep
}
declare interface ClipLauncherSlot {
/** Creates an new clip. */
createEmptyClip(lengthInBeats: number, ): void
}
/** Instances of this interface represent a scrollable fixed-size window that is connected to a section of the
clip launcher slots for a specific track. */
declare interface ClipLauncherSlotBank {
/** Selects the slot with the given index. */
select(
/** the index of the slot within the slot window.*/
slot: any, ): void
/** Starts recording into the slot with the given index. */
record(
/** the index of the slot within the slot window.*/
slot: any, ): void
/** Makes the clip content of the slot with the given index visible in the note or audio editor. */
showInEditor(
/** the index of the slot within the slot window.*/
slot: any, ): void
/** Creates an new clip in the slot with the given index. */
createEmptyClip(slot: number, lengthInBeats: number, ): void
/** Duplicates the clip in the slot with the given index. */
duplicateClip(
/** the index of the slot within the slot window.*/
slot: any, ): void
/** Registers an observer that reports selection changes for the slots inside the window. */
addIsSelectedObserver(
/** a callback function that receives two parameters: 1. the slot index (integer), and 2. a
boolean parameter indicating if the slot at that index is selected (`true`) or not (`false`)*/
callback: any, ): void
/** Registers an observer that reports which slots contain clips. */
addHasContentObserver(
/** a callback function that receives two parameters: 1. the slot index (integer), and 2. a
boolean parameter indicating if the slot at that index contains a clip (`true`) or not
(`false`)*/
callback: any, ): void
/** Registers an observer that reports the playback state of clips / slots. The reported states include
`stopped`, `playing`, `recording`, but also `queued for stop`, `queued for playback`, `queued for
recording`. */
addPlaybackStateObserver(
/** a callback function that receives three parameters: 1. the slot index (integer), 2. the queued
or playback state: `0` when stopped, `1` when playing, or `2` when recording, and 3. a boolean
parameter indicating if the second argument is referring to the queued state (`true`) or the
actual playback state (`false`)*/
callback: any, ): void
/** Registers an observer that reports which slots have clips that are currently playing. */
addIsPlayingObserver(
/** a callback function that receives two parameters: 1. the slot index (integer), and 2. a
boolean parameter indicating if the slot at that index has a clip that is currently playing
(`true`) or not (`false`)*/
callback: any, ): void
/** Registers an observer that reports which slots have clips that are currently recording. */
addIsRecordingObserver(
/** a callback function that receives two parameters: 1. the slot index (integer), and 2. a
boolean parameter indicating if the slot at that index has a clip that is currently recording
(`true`) or not (`false`)*/
callback: any, ): void
/** Add an observer if clip playback is queued on the slot. */
addIsPlaybackQueuedObserver(
/** a callback function that receives two parameters: 1. the slot index (integer), and 2. a
boolean parameter indicating if the slot at that index has a clip that is currently queued for
playback (`true`) or not (`false`)*/
callback: any, ): void
/** Add an observer if clip recording is queued on the slot. */
addIsRecordingQueuedObserver(
/** a callback function that receives two parameters: 1. the slot index (integer), and 2. a
boolean parameter indicating if the slot at that index has a clip that is currently queued for
recording (`true`) or not (`false`)*/
callback: any, ): void
/** Add an observer if clip playback is queued to stop on the slot. */
addIsStopQueuedObserver(
/** a callback function that receives two parameters: 1. the slot index (integer), and 2. a
boolean parameter indicating if the slot at that index has a clip that is currently queued for
stop (`true`) or not (`false`)*/
callback: any, ): void
/** Registers an observer that reports the colors of clip in the current slot window. */
addColorObserver(
/** a callback function that receives four parameters: 1. the slot index (integer), 2. the red
coordinate of the RBG color value, 3. the green coordinate of the RBG color value, and 4. the
blue coordinate of the RBG color value*/
callback: any, ): void
/** Specifies if the Bitwig Studio clip launcher should indicate which slots are part of the window. By
default indications are disabled. */
setIndication(
/** `true` if visual indications should be enabled, `false` otherwise*/
shouldIndicate: any, ): void
}
declare interface ClipLauncherSlotBankPlaybackStateChangedCallback {
/** Registers an observer that reports the playback state of clips / slots. The reported states include
`stopped`, `playing`, `recording`, but also `queued for stop`, `queued for playback`, `queued for
recording`. */
playbackStateChanged(slotIndex: number, playbackState: number, isQueued: boolean, ): void
}
declare interface ClipLauncherSlotOrScene {
/** Specifies if the Bitwig Studio clip launcher should indicate which slots and scenes are part of the window. By
default indications are disabled. */
setIndication(
/** `true` if visual indications should be enabled, `false` otherwise*/
shouldIndicate: any, ): void
}
/** An abstract interface that represents the clip launcher scenes or slots of a single track. */
declare interface ClipLauncherSlotOrSceneBank {
/** Launches the scene/slot with the given index. */
launch(
/** the index of the slot that should be launched*/
slot: any, ): void
/** Registers an observer that reports the names of the scenes and slots. The slot names reflect the names
of containing clips. */
addNameObserver(
/** a callback function receiving two parameters: 1. the slot index (integer) within the
configured window, and 2. the name of the scene/slot (string)*/
callback: any, ): void
}
/** This class represents an RGBA color with each component being stored as double. */
declare interface Color {
fromRGB(red: number, green: number, blue: number, ): Color
fromRGBA(red: number, green: number, blue: number, alpha: number, ): Color
fromRGB255(red: number, green: number, blue: number, ): Color
fromRGBA255(red: number, green: number, blue: number, alpha: number, ): Color
fromHex(hex: string, ): Color
/** Mixes two colors. */
mix(c1: Color, c2: Color, blend: number, ): Color
}
/** Represents an output value shown on some hardware (for example, the color of a light). */
declare interface ColorHardwareProperty {
/** Specifies a callback that should be called with the value that needs to be sent to the hardware. This
callback is called as a result of calling the {@link HardwareSurface#updateHardware()} method (typically
from the flush method). */
onUpdateHardware(sendValueConsumer: java.util.function.Consumer<Color>, ): void
/** Sets the current value. */
setValue(value: Color, ): void
/** Sets the current value from a {@link Supplier} that supplies the latest value. */
setValueSupplier(supplier: java.util.function.Supplier<Color>, ): void
}
declare interface ColorValue {
}
declare interface ColorValueChangedCallback {
/** As alpha component was introduced after this interface was released,
the alpha component is not part of the parameter and would have to be
checked manually. */
valueChanged(red: number, green: number, blue: number, ): void
}
declare interface ConnectionEstablishedCallback {
connectionEstablished(connection: RemoteConnection, ): void
}
/** Represents a hardware control that can input a relative or absolute value (for example, a slider, knob,
relative encoder...). */
declare interface ContinuousHardwareControl {
/** Sets an optional button that can be associated with this control when this control can also act as a
button (e.g by pressing down on it). */
setHardwareButton(button: HardwareButton, ): void
}
/** Defines a means of recognizing when a continuous value is input by the user (for example, when moving a
slider or turning a knob based on some MIDI message). */
declare interface ContinuousHardwareValueMatcher {
}
/** Defines an extension that enabled a controller to work with Bitwig Studio. */
declare interface ControllerExtension {
getMidiInPort(index: number, ): MidiIn
getMidiOutPort(index: number, ): MidiOut
}
/** Defines an extension that enabled a controller to work with Bitwig Studio. */
declare interface ControllerExtensionDefinition {
/** Obtains a {@link AutoDetectionMidiPortNamesList} that defines the names of the MIDI in and out ports
that can be used for auto detection of the controller for the supplied platform type. */
getAutoDetectionMidiPortNamesList(platformType: PlatformType, ): AutoDetectionMidiPortNamesList
/** Lists the {@link AutoDetectionMidiPortNames} that defines the names of the MIDI in and out ports that
can be used for auto detection of the controller for the supplied platform type. */
listAutoDetectionMidiPortNames(list: AutoDetectionMidiPortNamesList, platformType: PlatformType, ): void
/** Lists the hardware devices that this controller needs to function. For each device that is listed the
user will see a chooser in the preferences for this extension that allows them to choose a connected
device. The {@link HardwareDeviceMatcher} will also be used during auto detection to automatically add
and select the device if possible. */
listHardwareDevices(list: HardwareDeviceMatcherList, ): void
/** Creates an instance of this extension. */
createInstance(host: ControllerHost, ): ControllerExtension
}
/** 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 {@link #defineController},
{@link #defineMidiPorts}, {@link #defineSysexIdentityReply} and {@link #addDeviceNameBasedDiscoveryPair}.
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. */
declare interface ControllerHost {
/** 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. */
loadAPI(version: number, ): void
/** 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. */
setShouldFailOnDeprecatedUse(value: boolean, ): void
/** 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. */
load(path: string, ): void
/** Registers a controller script with the given parameters. This function must be called once at the global
scope of the script. */
defineController(
/** the name of the hardware vendor. Must not be <code>null</code>.*/
vendor: any,
/** the name of the controller script as listed in the user interface of Bitwig Studio. Must not
be <code>null</code>.*/
name: any,
/** the version of the controller script. Must not be <code>null</code>.*/
version: any,
/** a universal unique identifier (UUID) string that is used to distinguish one script from
another, for example `550e8400-e29b-11d4-a716-446655440000`. Must not be <code>null</code>.
For generating random UUID strings several free web tools are available.*/
uuid: any,
/** the name of the script author*/
author: any, ): void
/** 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 using {@link #getMidiInPort(int index)} and
{@link #getMidiInPort(int index)}. */
defineMidiPorts(
/** the number of input ports*/
numInports: any,
/** the number of output ports*/
numOutports: any, ): void
/** Returns the MIDI input port with the given index. */
getMidiInPort(
/** the index of the MIDI input port, must be valid.*/
index: any, ): MidiIn
/** Returns the MIDI output port with the given index. */
getMidiOutPort(
/** the index of the MIDI output port, must be valid.*/
index: any, ): MidiOut
/** Gets the {@link HardwareDevice} at the specified index. This index corresponds to the index of the
{@link HardwareDeviceMatcher} specified in the
{@link ControllerExtensionDefinition#listHardwareDevices(java.util.List)} */
hardwareDevice(index: number, ): HardwareDevice
/** Registers patterns which are used to automatically detect hardware devices that can be used with the
script.<br/>
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.<br/>
Calling this function is optional, but can also be called multiple times in the global script scope in
order to support alternative driver names. */
addDeviceNameBasedDiscoveryPair(
/** the array of strings used to detect MIDI input ports, must not be `null`.*/
inputs: any,
/** the array of strings used to detect MIDI output ports, must not be `null`.*/
outputs: any, ): void
/** Returns an object which provides access to the `Arranger` panel inside the specified window. */
createArranger(
/** 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*/
window: any, ): Arranger
/** Returns an object which provides access to the `Mixer` panel that matches the specified parameters. */
createMixer(
/** 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 see
{@link Application#addPanelLayoutObserver}.*/
panelLayout: any,
/** 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*/
window: any, ): Mixer
/** Returns a track bank with the given number of child tracks, sends and scenes.<br/>
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.<br/>
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.<br/>
Creating a track bank using this method will consider all tracks in the document, including effect
tracks and the master track. Use {@link #createMainTrackBank} or {@link #createEffectTrackBank} in case
you are only interested in tracks of a certain kind. */
createTrackBank(
/** the number of child tracks spanned by the track bank*/
numTracks: any,
/** the number of sends spanned by the track bank*/
numSends: any,
/** the number of scenes spanned by the track bank*/
numScenes: any,
/** 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.*/
hasFlatTrackList: any, ): TrackBank
/** 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 for {@link #createTrackBank}. */
createMainTrackBank(
/** the number of tracks spanned by the track bank*/
numTracks: any,
/** the number of sends spanned by the track bank*/
numSends: any,
/** the number of scenes spanned by the track bank*/
numScenes: any, ): TrackBank
/** 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 for {@link #createTrackBank}. */
createEffectTrackBank(