/
Clip.js
460 lines (409 loc) · 12.7 KB
/
Clip.js
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
/* API Version - 3.1.2 */
/**
* 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.
*
* @since API version 1
*/
function Clip() {}
Clip.prototype = new ObjectProxy();
Clip.prototype.constructor = 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
*
* @param key
the key that should be the new key with a y position of 0. This must be a value in the range
0...127.
* @since API version 1
*/
Clip.prototype.scrollToKey = function(key) {};
/**
* Scrolls the note grid keys one page up. For example if the note grid is configured to show 12 keys and
* is currently showing keys [36..47], calling this method would scroll the note grid to key range
* [48..59].
*
* @since API version 1
*/
Clip.prototype.scrollKeysPageUp = function() {};
/**
* Scrolls the note grid keys one page down. For example if the note grid is configured to show 12 keys and
* is currently showing keys [36..47], calling this method would scroll the note grid to key range
* [48..59].
*
* @since API version 1
*/
Clip.prototype.scrollKeysPageDown = function() {};
/**
* Scrolls the note grid keys one key up. For example if the note grid is configured to show 12 keys and is
* currently showing keys [36..47], calling this method would scroll the note grid to key range [37..48].
*
* @since API version 1
*/
Clip.prototype.scrollKeysStepUp = function() {};
/**
* Scrolls the note grid keys one key down. For example if the note grid is configured to show 12 keys and
* is currently showing keys [36..47], calling this method would scroll the note grid to key range
* [35..46].
*
* @since API version 1
*/
Clip.prototype.scrollKeysStepDown = function() {};
/**
* Scroll the note grid so that the given step becomes visible.
*
* @param step
the step that should become visible
* @since API version 1
*/
Clip.prototype.scrollToStep = function(step) {};
/**
* Scrolls the note grid steps one page forward. For example if the note grid is configured to show 16
* steps and is currently showing keys [0..15], calling this method would scroll the note grid to key range
* [16..31].
*
* @since API version 1
*/
Clip.prototype.scrollStepsPageForward = function() {};
/**
* Scrolls the note grid steps one page backwards. For example if the note grid is configured to show 16
* steps and is currently showing keys [16..31], calling this method would scroll the note grid to key
* range [0..16].
*
* @since API version 1
*/
Clip.prototype.scrollStepsPageBackwards = function() {};
/**
* Scrolls the note grid steps one step forward. For example if the note grid is configured to show 16
* steps and is currently showing keys [0..15], calling this method would scroll the note grid to key range
* [1..16].
*
* @since API version 1
*/
Clip.prototype.scrollStepsStepForward = function() {};
/**
* Scrolls the note grid steps one step backwards. For example if the note grid is configured to show 16
* steps and is currently showing keys [1..16], calling this method would scroll the note grid to key range
* [0..15].
*
* @since API version 1
*/
Clip.prototype.scrollStepsStepBackwards = function() {};
/**
* Value that reports if the note grid keys can be scrolled further up.
*
* @return {BooleanValue}
* @since API version 2
*/
Clip.prototype.canScrollKeysUp = function() {};
/**
* Value that reports if the note grid keys can be scrolled further down.
*
* @return {BooleanValue}
* @since API version 2
*/
Clip.prototype.canScrollKeysDown = function() {};
/**
* Value that reports if the note grid if the note grid steps can be scrolled backwards.
*
* @return {BooleanValue}
* @since API version 2
*/
Clip.prototype.canScrollStepsBackwards = function() {};
/**
* Value that reports if the note grid if the note grid steps can be scrolled forwards.
*
* @return {BooleanValue}
* @since API version 2
*/
Clip.prototype.canScrollStepsForwards = function() {};
/**
* @param {int} x
* @param {int} y
* @param {int} insertVelocity
* @since API version 1
*/
Clip.prototype.toggleStep = function(x, y, insertVelocity) {};
/**
* Toggles the existence of a note in the note grid cell specified by the given x and y arguments.
*
* @param {int} channel the MIDI channel, between 0 and 15.
* @param x
the x position within the note grid, defining the step/time of the target note
* @param y
the y position within the note grid, defining the key of the target note
* @param insertVelocity
the velocity of the target note in case a new note gets inserted
* @since API version 10
*/
Clip.prototype.toggleStep = function(channel, x, y, insertVelocity) {};
/**
* @param {int} x
* @param {int} y
* @param {int} insertVelocity
* @param {double} insertDuration
* @since API version 1
*/
Clip.prototype.setStep = function(x, y, insertVelocity, insertDuration) {};
/**
* Creates a note in the grid cell specified by the given x and y arguments. Existing notes are
* overwritten.
*
* @param {int} channel
* @param {int} x
* @param {int} y
* @param {int} insertVelocity
* @param {double} insertDuration
* @since API version 1
*/
Clip.prototype.setStep = function(channel, x, y, insertVelocity, insertDuration) {};
/**
* @param {int} x
* @param {int} y
* @since API version 1
*/
Clip.prototype.clearStep = function(x, y) {};
/**
* 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.
*
* @param {int} channel MIDI channel, from 0 to 15.
* @param x
the x position within the note grid, defining the step/time of the target note
* @param y
the y position within the note grid, defining the key of the target note
* @since API version 10
*/
Clip.prototype.clearStep = function(channel, x, y) {};
/**
* Removes all notes in the grid started on the step x.
*
* @param {int} channel
* @param {int} x
* @since API version 10
*/
Clip.prototype.clearStepsAtX = function(channel, x) {};
/**
* Removes all notes in the grid row specified by the given y argument.
*
* @param {int} channel MIDI channel, from 0 to 15.
* @param {int} y the y position within the note grid, defining the key of the target note
* @since API version 10
*/
Clip.prototype.clearStepsAtY = function(channel, y) {};
/**
* Removes all notes in the grid.
*
* @since API version 1
*/
Clip.prototype.clearSteps = function() {};
/**
* @param {int} x
* @param {int} y
* @param {boolean} clearCurrentSelection
* @since API version 1
*/
Clip.prototype.selectStepContents = function(x, y, clearCurrentSelection) {};
/**
* 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.
*
* @param {int} channel MIDI channel, from 0 to 15.
* @param x
the x position within the note grid, defining the step/time of the target note
* @param y
the y position within the note grid, defining the key of the target note
* @param clearCurrentSelection
`true` if the existing selection should be cleared, {@false} if the note should be added to
the current selection.
* @since API version 10
*/
Clip.prototype.selectStepContents = function(channel, x, y, clearCurrentSelection) {};
/**
* Sets the beat time duration that is represented by one note grid step.
*
* @param lengthInBeatTime
the length of one note grid step in beat time.
* @since API version 1
*/
Clip.prototype.setStepSize = function(lengthInBeatTime) {};
/**
* Registers an observer that reports which note grid steps/keys contain notes.
*
* @param callback
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`).
* @since API version 1
*/
Clip.prototype.addStepDataObserver = function(callback) {};
/**
* Registers an observer that reports which note grid steps/keys contain notes.
*
* @param {NoteStepChangedCallback} callback A callback function that receives the StepInfo.
* @since API version 10
*/
Clip.prototype.addNoteStepObserver = function(callback) {};
/**
* Value that reports note grid cells as they get played by the sequencer.
*
* @return {IntegerValue}
* @since API version 2
*/
Clip.prototype.playingStep = function() {};
/**
* Updates the name of the clip.
*
* @param name
the new clip name
* @since API version 1
*/
Clip.prototype.setName = function(name) {};
/**
* Returns shuffle settings of the clip.
*
* @return {SettableBooleanValue} the value object that represents the clips shuffle setting.
* @since API version 1
*/
Clip.prototype.getShuffle = function() {};
/**
* Returns accent setting of the clip.
*
* @return {SettableRangedValue} the ranged value object that represents the clips accent setting.
* @since API version 1
*/
Clip.prototype.getAccent = function() {};
/**
* Returns the start of the clip in beat time.
*
* @return {SettableBeatTimeValue} the beat time object that represents the clips start time.
* @since API version 1
*/
Clip.prototype.getPlayStart = function() {};
/**
* Returns the length of the clip in beat time.
*
* @return {SettableBeatTimeValue} the beat time object that represents the duration of the clip.
* @since API version 1
*/
Clip.prototype.getPlayStop = function() {};
/**
* Returns an object that provides access to the loop enabled state of the clip.
*
* @return {SettableBooleanValue} a boolean value object.
* @since API version 1
*/
Clip.prototype.isLoopEnabled = function() {};
/**
* Returns the loop start time of the clip in beat time.
*
* @return {SettableBeatTimeValue} the beat time object that represents the clips loop start time.
* @since API version 1
*/
Clip.prototype.getLoopStart = function() {};
/**
* Returns the loop length of the clip in beat time.
*
* @return {SettableBeatTimeValue} the beat time object that represents the clips loop length.
* @since API version 1
*/
Clip.prototype.getLoopLength = function() {};
/**
* Get the color of the clip.
*
* @return {SettableColorValue}
* @since API version 2
*/
Clip.prototype.color = function() {};
/**
* Duplicates the clip.
*
* @since API version 1
*/
Clip.prototype.duplicate = function() {};
/**
* Duplicates the content of the clip.
*
* @since API version 1
*/
Clip.prototype.duplicateContent = function() {};
/**
* Transposes all notes in the clip by the given number of semitones.
*
* @param semitones
the amount of semitones to transpose, can be a positive or negative integer value.
* @since API version 1
*/
Clip.prototype.transpose = function(semitones) {};
/**
* Quantize the start time of all notes in the clip according to the given amount. The note lengths remain
* the same as before.
*
* @param amount
a factor between `0` and `1` that allows to morph between the original note start and the
quantized note start.
* @since API version 1
*/
Clip.prototype.quantize = function(amount) {};
/**
* Gets the track that contains the clip.
*
* @return {Track} a track object that represents the track which contains the clip.
* @since API version 1
*/
Clip.prototype.getTrack = function() {};
/**
* Setting for the default launch quantization.
*
* Possible values are `"default"`, `"none"`, `"8"`, `"4"`, `"2"`, `"1"`, `"1/2"`, `"1/4"`, `"1/8"`,
* `"1/16"`.
*
* @return {SettableEnumValue}
* @since API version 8
*/
Clip.prototype.launchQuantization = function() {};
/**
* Setting "Q to loop" in the inspector.
*
* @return {SettableBooleanValue}
* @since API version 8
*/
Clip.prototype.useLoopStartAsQuantizationReference = function() {};
/**
* Setting "Launch Mode" from the inspector.
* Possible values are:
* - play_with_quantization
* - continue_immediately
* - continue_with_quantization
*
* @return {SettableEnumValue}
* @since API version 9
*/
Clip.prototype.launchMode = function() {};
/**
* Get step info
*
* @param {int} channel
* @param {int} x
* @param {int} y
* @return {NoteStep}
* @since API version 10
*/
Clip.prototype.getStep = function(channel, x, y) {};
/**
* Launches the clip.
*
* @since API version 10
*/
Clip.prototype.launch = function() {};
/**
* Get the clip launcher slot containing the clip.
*
* @return {ClipLauncherSlot}
* @since API version 10
*/
Clip.prototype.clipLauncherSlot = function() {};