-
Notifications
You must be signed in to change notification settings - Fork 2
/
roli_LittleFootFunctions.dox
853 lines (614 loc) · 28.1 KB
/
roli_LittleFootFunctions.dox
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
/** @defgroup LittleFootFunctions LittleFoot Functions
Functions available in the LittleFoot language
@{
*/
/** Reads and returns the value of a single byte from the heap.
@param byteIndex the index (in bytes) of the byte to read
@returns the value of the byte
*/
int getHeapByte (int byteIndex);
/** Reads 4 bytes from the heap and returns the value as an integer.
@param byteIndex the index (in bytes) of the start of the 4 bytes to read
@returns the value of the 4 bytes as an integer
*/
int getHeapInt (int byteIndex);
/** Reads a sequence of bits from the heap and returns the value as an integer.
@param startBitIndex the index (in bits) of the start of the sequence of bits to read
@param numBits how many bits to read
@returns the value of the sequence of bits as an integer
*/
int getHeapBits (int startBitIndex, int numBits);
/** Writes a single byte to the heap.
@param byteIndex the index (in bytes) of the byte to set
@param newValue the new value to set this byte to
*/
void setHeapByte (int byteIndex, int newValue);
/** Writes 4 bytes to the heap.
@param byteIndex the index (in bytes) of the start of the 4 bytes to set
@param newValue the new value to set the 4 bytes to
*/
void setHeapInt (int byteIndex, int newValue);
/** Returns the smaller of two integer values.
@param a The first parameter
@param b The second parameter
@retval The minimum of a and b
*/
int min (int a, int b);
/** Returns the smaller of two floating point values.
@param a The first parameter
@param b The second parameter
@retval The minimum of a and b
*/
float min (float a, float b);
/** Returns the larger of two integer values.
@param a The first parameter
@param b The second parameter
@retval The maximum of a and b
*/
int max (int a, int b);
/** Returns the larger of two floating point values.
@param a The first parameter
@param b The second parameter
@retval The maximum of a and b
*/
float max (float a, float b);
/** Constrains an integer value to keep it within a given range.
@param lowerLimit the minimum value to return
@param upperLimit the maximum value to return
@param valueToConstrain the value to try to return
@returns the closest value to valueToConstrain which lies between lowerLimit
and upperLimit (inclusive)
*/
int clamp (int lowerLimit, int upperLimit, int valueToConstrain);
/** Constrains a floating point value to keep it within a given range.
@param lowerLimit the minimum value to return
@param upperLimit the maximum value to return
@param valueToConstrain the value to try to return
@returns the closest value to valueToConstrain which lies between lowerLimit
and upperLimit (inclusive)
*/
float clamp (float lowerLimit, float upperLimit, float valueToConstrain);
/** Returns the absolute value of an integer value.
@param arg The argument to compute the absolute value of
@retval either -arg if arg is negative or arg if arg is positive
*/
int abs (int arg);
/** Returns the absolute value of a floating point value.
@param arg The argument to compute the absolute value of
@retval either -arg if arg is negative or arg if arg is positive
*/
float abs (float arg);
/** Remaps a value from a source range to a target range.
@param value the value within the source range to map
@param sourceMin the minimum value of the source range
@param sourceMax the maximum value of the source range
@param destMin the minimum value of the destination range
@param destMax the maximum value of the destination range
@returns the original value mapped to the destination range
*/
float map (float value, float sourceMin, float sourceMax, float destMin, float destMax);
/** Remaps a value from a source range to the range 0 - 1.0.
@param value the value within the source range to map
@param sourceMin the minimum value of the source range
@param sourceMax the maximum value of the source range
@returns the original value mapped to the range 0 - 1.0
*/
float map (float value, float sourceMin, float sourceMax);
/** Performs a modulo operation (can cope with the dividend being negative).
The divisor must be greater than zero.
@returns the result of the modulo operation
*/
int mod (int dividend, int divisor);
/** Returns a random floating-point number.
@returns a random value in the range 0 (inclusive) to 1.0 (exclusive)
*/
float getRandomFloat();
/** Returns a random integer, limited to a given range.
@returns a random integer between 0 (inclusive) and maxValue (exclusive).
*/
int getRandomInt (int maxValue);
/** Returns the number of milliseconds since a fixed event (usually system startup).
@returns a monotonically increasing value which is unaffected by changes to the
system clock. It should be accurate to within a few millisecseconds.
*/
int getMillisecondCounter();
/** Returns the length of time spent in the current function call in milliseconds.
@returns the length of time spent in the current function call in milliseconds.
*/
int getTimeInCurrentFunctionCall();
/** Logs an integer value to the console.
@param data The 32 bit signed integer to log to the topology as an integer
*/
void log (int data);
/** Logs a hexadecimal value to the console.
@param data The 32 bit signed integer to log to the topology as a hexidecimal int
*/
void logHex (int data);
/** Sends a 1-byte short midi message. */
void sendMIDI (int byte0);
/** Sends a 2-byte short midi message. */
void sendMIDI (int byte0, int byte1);
/** Sends a 3-byte short midi message. */
void sendMIDI (int byte0, int byte1, int byte2);
/** Sends a key-down message.
@param channel the midi channel, in the range 0 to 15
@param noteNumber the key number, in the range 0 to 127
@param velocity the velocity, in the range 0 to 127
*/
void sendNoteOn (int channel, int noteNumber, int velocity);
/** Sends a key-up message.
@param channel the midi channel, in the range 0 to 15
@param noteNumber the key number, in the range 0 to 127
@param velocity the velocity, in the range 0 to 127
*/
void sendNoteOff (int channel, int noteNumber, int velocity);
/** Sends an aftertouch message.
@param channel the midi channel, in the range 0 to 15
@param noteNumber the key number, in the range 0 to 127
@param level the amount of aftertouch, in the range 0 to 127
*/
void sendAftertouch (int channel, int noteNumber, int level);
/** Sends a controller message.
@param channel the midi channel, in the range 0 to 15
@param controller the type of controller
@param value the controller value
*/
void sendCC (int channel, int controller, int value);
/** Sends a pitch bend message.
@param channel the midi channel, in the range 0 to 15
@param position the wheel position, in the range 0 to 16383
*/
void sendPitchBend (int channel, int position);
/** Sends a channel-pressure change event.
@param channel the midi channel, in the range 0 to 15
@param pressure the pressure, in the range 0 to 127
*/
void sendChannelPressure (int channel, int pressure);
/** Sets the MIDI channel range.
@param useMPE whether to use MPE mode
@param lowChannel the lowest MIDI channel
@param highChannel the highest MIDI channel
*/
void setChannelRange (bool useMPE, int lowChannel, int highChannel);
/** Assigns a MIDI channel to a note number.
@param noteNumber the note number to assign the channel to
@returns the MIDI channel that has been assigned
*/
int assignChannel (int noteNumber);
/** Deassigns a channel from a note number.
@param noteNumber the note number to deassign
@param channel the MIDI channel
*/
void deassignChannel (int noteNumber, int channel);
/** Returns the channel that is being used for control messages.
@returns the channel that is being used for control messages. (If MPE is enabled then this will be the first channel.)
*/
int getControlChannel();
/** Sets whether duplicate notes should be filtered out when MPE is enabled. */
void useMPEDuplicateFilter (bool active);
/** Use this method to draw the display.
The block will call this approximately 25 times per second.
*/
void repaint();
/** Called when a button is pushed.
@param index the index of the button that was pushed
*/
void handleButtonDown (int index);
/** Called when a button is released.
@param index the index of the button that was released
*/
void handleButtonUp (int index);
/** Call this when a control block button is pressed to trigger the buttons default behaviour.
@param buttonIndex the index of the button
@note Requires >= 0.2.5 firmware
@note Only valid with a control block
@see initControl onControlRelease
*/
void onControlPress (int buttonIndex);
/** Call this when a control block button is released to trigger the buttons default behaviour.
@param buttonIndex the index of the button
@note Requires >= 0.2.5 firmware
@note Only valid with a control block
@see initControl onControlPress
*/
void onControlRelease (int buttonIndex);
/** Called when a touch event starts.
Block units follow the number of DNA connectors on the side of the device.
For instance, a Lightpad Block is 2x2 and a Control Block is 2x1.
@param index the touch index, which will stay constant for each finger as it is tracked
@param x the X position of this touch on the device, in block units starting from 0 (left)
@param y the Y position of this touch on the device, in block units starting from 0 (top)
@param z the current pressure of this touch, in the range 0.0 (no pressure) to 1.0 (very hard)
@param vz the rate at which pressure is currently changing, measured in units/second
*/
void touchStart (int index, float x, float y, float z, float vz);
/** Called when a touch event moves.
Block units follow the number of DNA connectors on the side of the device.
For instance, a Lightpad Block is 2x2 and a Control Block is 2x1.
@param index the touch index, which will stay constant for each finger as it is tracked
@param x the X position of this touch on the device, in block units starting from 0 (left)
@param y the Y position of this touch on the device, in block units starting from 0 (top)
@param z the current pressure of this touch, in the range 0.0 (no pressure) to 1.0 (very hard)
@param vz the rate at which pressure is currently changing, measured in units/second
*/
void touchMove (int index, float x, float y, float z, float vz);
/** Called when a touch event ends.
Block units follow the number of DNA connectors on the side of the device.
For instance, a Lightpad Block is 2x2 and a Control Block is 2x1.
@param index the touch index, which will stay constant for each finger as it is tracked
@param x the X position of this touch on the device, in block units starting from 0 (left)
@param y the Y position of this touch on the device, in block units starting from 0 (top)
@param z the current pressure of this touch, in the range 0.0 (no pressure) to 1.0 (very hard)
@param vz the rate at which pressure is currently changing, measured in units/second
*/
void touchEnd (int index, float x, float y, float z, float vz);
/** Called when a program is loaded onto the block and is about to start. Do any setup here. */
void initialise();
/** Called when a block receives a MIDI message. */
void handleMIDI (int byte0, int byte1, int byte2);
/** Called when a block receives a message.
@see sendMessageToBlock
*/
void handleMessage (int param1, int param2, int param3);
/** Combines a set of 8-bit ARGB values into a 32-bit colour and returns the result.
@return a 32-bit colour
@param alpha The alpha in range 0 - 255 inclusive
@param red The red in range 0 - 255 inclusive
@param green The green in range 0 - 255 inclusive
@param blue The blue in range 0 - 255 inclusive
*/
int makeARGB (int alpha, int red, int green, int blue);
/** Blends the overlaid ARGB colour onto the base one and returns the new colour.
@param baseColour the colour to blend on to
@param overlaidColour The colour to blend in to the baseColour
@returns The blended colour
*/
int blendARGB (int baseColour, int overlaidColour);
/** Displays an animation indicating the current battery level of this block.
A control block will light up its top LEDs indicating battery level and a lightpad
block will draw the battery level on the display.
@note Requires >= 0.2.5 firmware
*/
void displayBatteryLevel();
/** Clears the display and sets all the LEDs to black. */
void clearDisplay();
/** Clears the display and sets all the LEDs to a specified colour.
@param rgb the colour to use (0xff...)
*/
void clearDisplay (int rgb);
/** Sets a pixel to a specified colour with full alpha.
@param rgb the colour to use (0xff...)
@param x the x coordinate of the pixel to fill
@param y the y coordinate of the pixel to fill
*/
void fillPixel (int rgb, int x, int y);
/** Blends the current pixel colour with a specified colour.
@param argb the colour to use
@param x the x coordinate of the pixel to blend
@param y the y coordinate of the pixel to blend
*/
void blendPixel (int argb, int x, int y);
/** Fills a rectangle on the display with a specified colour.
@param rgb the colour to use (0xff...)
@param x the x coordinate of the rectangle to draw
@param y the y coordinate of the rectangle to draw
@param width the width of the rectangle to draw
@param height the height of the rectangle to draw
*/
void fillRect (int rgb, int x, int y, int width, int height);
/** Blends a rectangle on the display with a specified colour.
@param argb the colour to use
@param x the x coordinate of the rectangle to blend
@param y the y coordinate of the rectangle to blend
@param width the width of the rectangle to blend
@param height the height of the rectangle to blend
*/
void blendRect (int argb, int x, int y, int width, int height);
/** Fills a rectangle on the display with four corner colours blended together.
@param colourNW the colour to use in the north west corner of the rectangle
@param colourNE the colour to use in the north east corner of the rectangle
@param colourSE the colour to use in the south east corner of the rectangle
@param colourSW the colour to use in the south west corner of the rectangle
@param x the x coordinate of the rectangle
@param y the y coordinate of the rectangle
@param width the width of the rectangle
@param height the height of the rectangle
*/
void blendGradientRect (int colourNW, int colourNE, int colourSE, int colourSW, int x, int y, int width, int height);
/** Blends a circle on the display with a specified colour.
@param argb the colour to use
@param xCentre the x position of the circle's centre in block units
@param yCentre the y position of the circle's centre in block units
@param radius the radius of the circle in block units
@param fill if true then the circle will be filled, if false the circle will be an outline
@note Requires >= 0.2.5 firmware
*/
void blendCircle (int argb, float xCentre, float yCentre, float radius, bool fill);
/** Draws a number on the display.
@param value the number to draw between 0 and 99
@param colour the colour to use
@param x the x coordinate to use
@param y the y coordinate to use
*/
void drawNumber (int value, int colour, int x, int y);
/** Returns the current firmware version of this block.
@returns The firmware version of the form 0xMJMIRV (where MJ = Major, MI = Minor, RV = Revision)
@note Requires >= 0.2.5 firmware
*/
int getFirmwareVersion();
/** Returns the battery level of this block, between 0 and 1.0.
@returns the battery level of this block, between 0 and 1.0.
@note Requires >= 0.2.5 firmware
*/
float getBatteryLevel();
/** Returns true if this block's battery is charging.
@returns true if this block's battery is charging
@note Requires >= 0.2.5 firmware
*/
bool isBatteryCharging();
/** Sets whether status overlays should be displayed on this block.
@note Requires >= 0.2.5 firmware
*/
void setStatusOverlayActive (bool active);
/** Sets whether power saving mode should be enabled on this block.
@note Requires >= 0.2.5 firmware
*/
void setPowerSavingEnabled (bool enabled);
/** Returns the type of the block with a given ID.
@returns an enum indicating the type of block @see Block::Type
@note Requires >= 0.2.5 firmware
*/
int getBlockTypeForID (int blockID);
/** Sends a message to the block with the specified ID.
This will be processed in the handleMessage() callback.
@param blockID the ID of the block to send this message to
@param param1 the first chunk of data to send
@param param2 the second chunk of data to send
@param param3 the third chunk of data to send
*/
void sendMessageToBlock (int blockID, int param1, int param2, int param3);
/** Sends a message to the host. To receive this the host will need to implement
the Block::ProgramEventListener::handleProgramEvent() method.
@param param1 the first chunk of data to send
@param param2 the second chunk of data to send
@param param3 the third chunk of data to send
*/
void sendMessageToHost (int param1, int param2, int param3);
/** Draws a pressure point with a specified colour and pressure.
@param argb the colour to use
@param touchX the x position of the touch in block units
@param touchY the y position of the touch in block units
@param touchZ the pressure value of the touch
*/
void addPressurePoint (int argb, float touchX, float touchY, float touchZ);
/** Draws the pressure map on the display. */
void drawPressureMap();
/** Fades the pressure map on the display. */
void fadePressureMap();
/** Links a another block to this control block.
@param blockID the ID of the block to link
@note Requires >= 0.2.5 firmware
@note Only valid with a control block
*/
void linkBlockIDtoController (int blockID);
/** Repaints the control block display.
@note Requires >= 0.2.5 firmware
@note Only valid with a control block
*/
void repaintControl();
/** Initialises one of the control block buttons.
@param buttonIndex the index of the button to initialise
@param modeToUse the mode to use for this button @see ControlMode
@param outputType the control type to use @see ControlType
@param val the current value to set this button to
@param min the minimum value for this button
@param max the maximum value for this button
@param index the item index
@param onColourToUse the colour to use when this button is on
@param offColourToUse the colour to use when this button is off
@note Requires >= 0.2.5 firmware
@note Only valid with a control block
*/
void initControl (int buttonIndex, int modeToUse, int outputType, int val, int min, int max,
int index, int onColourToUse, int offColourToUse);
/** Control type for use with initControl
@see initControl
*/
enum ControlType
{
internalConfig = 0,
midiCC,
sysex
};
/** Control mode for use with initControl
@see initControl
*/
enum ControlMode
{
toggle = 0,
togglePulse,
gate,
trigger,
cycle,
incDec,
triState
};
/** Forces a touch event to be handled as seaboard playing.
@param touchIndex the index of the touch event
@note Requires >= 0.2.5 firmware
@note Only valid on a Seaboard
*/
void handleTouchAsSeaboard (int touchIndex);
/** Returns the number of blocks in the current topology.
@note Requires >= 0.2.5 firmware
*/
int getNumBlocksInTopology();
/** Returns the ID of a block at a given index in the topology.
@param index The index of the block to find in the topology
@returns int The id of the block
@note Requires >= 0.2.5 firmware
*/
int getBlockIDForIndex (int index);
/** Returns true if this block is directly connected to the host,
as opposed to only being connected to a different block via a connection port.
@note Requires >= 0.2.5 firmware
*/
bool isMasterBlock();
/** Returns true if this block is connected to the host computer, this can be
directly or through connections to other blocks.
@note Requires >= 0.2.5 firmware
*/
bool isConnectedToHost();
/** Returns the ID of a block connected to a specified port on this block.
@note Requires >= 0.2.5 firmware
*/
int getBlockIDOnPort (int port);
/** Returns the port number that is connected to the master block. Returns 0xFF if there is
no port connected to master.
@returns the port number that is connected to the master block. Returns 0xFF if there is
no port connected to master.
@note Requires >= 0.2.5 firmware
*/
int getPortToMaster();
/** Returns the horizontal distance between this block and the master block in block units.
@note Requires >= 0.2.5 firmware
*/
int getHorizontalDistFromMaster();
/** Returns the vertical distance between this block and the master block in block units.
@note Requires >= 0.2.5 firmware
*/
int getVerticalDistFromMaster();
/** Returns the angle of this block relative to the master block in degrees.
@note Requires >= 0.2.5 firmware
*/
int getAngleFromMaster();
/** Sets whether this block should auto-rotate when its angle relative to the master block changes.
@note Requires >= 0.2.5 firmware
*/
void setAutoRotate (bool enabled);
/** Returns the index of this block in the current cluster.
@note Requires >= 0.2.5 firmware
*/
int getClusterIndex();
/** Returns how many blocks wide the current cluster is.
@returns the width of the cluster (note that a single block will return 1 here)
@note Requires >= 0.2.5 firmware
*/
int getClusterWidth();
/** Returns how many blocks high the current cluster is.
@returns the height of the cluster (note that a single block will return 1 here)
@note Requires >= 0.2.5 firmware
*/
int getClusterHeight();
/** Returns the x index of this block in the current cluster.
@returns int The cluster x position. (0, 0) is considered to be the top left block
@note Requires >= 0.2.5 firmware
*/
int getClusterXpos();
/** Returns the y index of this block in the current cluster.
@returns int The cluster x position. (0, 0) is considered to be the top left block
@note Requires >= 0.2.5 firmware
*/
int getClusterYpos();
/** Returns the number of blocks in the current cluster.
@returns the number of blocks in the current cluster.
@note Requires >= 0.2.5 firmware
*/
int getNumBlocksInCurrentCluster();
/** Returns the block ID for a block in the current cluster.
@param index the cluster index of the block to get the ID of
@note Requires >= 0.2.5 firmware
*/
int getBlockIdForBlockInCluster (int index);
/** Returns true if the master block is in the current cluster.
@note Requires >= 0.2.5 firmware
*/
bool isMasterInCurrentCluster();
/** Returns current value of one of the local config items.
@param item the config item to get (see ConfigItemId enum in roli_BlockConfigId.h)
@note Requires >= 0.2.5 firmware
*/
int getLocalConfig (int item);
/** Sets the current value of one of the local config items.
@param item the config item to set the value of (see ConfigItemId enum in roli_BlockConfigId.h)
@param value the value to set the config to
@note Requires >= 0.2.5 firmware
*/
void setLocalConfig (int item, int value);
/** Sets the local config of a block to the config item of a remote block.
@param longAddress the address of the remote block
@param item the config item (see ConfigItemId enum in roli_BlockConfigId.h)
@note Requires >= 0.2.5 firmware
*/
void requestRemoteConfig (int longAddress, int item);
/** Sets the config of a remote block.
@param longAddress the address of the remote block
@param item the config item (see ConfigItemId enum in roli_BlockConfigId.h)
@param value the value to set the config to
@note Requires >= 0.2.5 firmware
*/
void setRemoteConfig (int longAddress, int item, int value);
/** Sets the range of one of the local config items.
@param item the config item to set the range of (see ConfigItemId enum in roli_BlockConfigId.h)
@param min the minimum value this config item should use
@param max the maximum value this config item should use
@note Requires >= 0.2.5 firmware
*/
void setLocalConfigItemRange (int item, int min, int max);
/** Sets whether a local config item should be active.
@param item the config item to set active (see ConfigItemId enum in roli_BlockConfigId.h)
@param isActive sets whether the config should be active or not
@param saveToFlash if true then this config item will be saved to the flash memory of the block
@note Requires >= 0.2.5 firmware
*/
void setLocalConfigActiveState (int item, bool isActive, bool saveToFlash);
/** Sets whether to use the default key handler for custom key handling on LUMI
@param active sets whether to use the default key handler for touches and lighting
@note Requires >= 1.3.0 firmware
@see keyStrike, keyPress, keyLift, keyMove
*/
void setUseDefaultKeyHandler (bool active);
/** Sets whether to use the default key handler for custom key handling on LUMI
@param touchActive sets whether to use the default key handler for touches
@param lightingActive sets whether to use the default key handler for key lighting
@note Requires >= 1.3.0 firmware
@see keyStrike, keyPress, keyLift, keyMove
*/
void setUseDefaultKeyHandler (bool touchActive, bool lightingActive);
/** Strike key handler callback
@param keyIndex the index of the key
@param unused unused variable
@param velocity velocity of strike, in the range 0 to 127
@see setUseDefaultKeyHandler
*/
void keyStrike (int keyIndex, int unused, int velocity)
{
}
/** Press key handler callback
@param keyIndex the index of the key
@param aftertouch aftertouch amount, in the range 0 to 127
@param velocity velocity of strike, in the range 0 to 127
@see setUseDefaultKeyHandler
*/
void keyPress (int keyIndex, int aftertouch, int velocity)
{
}
/** Lift key handler callback
@param keyIndex the index of the key
@param unused unused variable
@param velocity velocity of lift, in the range 0 to 127
@see setUseDefaultKeyHandler
*/
void keyLift (int keyIndex, int unused, int velocity)
{
}
/** Key move handler callback
@param keyIndex the index of the key
@param pitchbend pitchbend amount, in the range 0 to 16383
@param aftertouch aftertouch amount , in the range 0 to 127
@see setUseDefaultKeyHandler
*/
void keyMove (int keyIndex, int pitchbend, int aftertouch)
{
}
/** @} */