| 1 |
crange : two-sided slider, with its own graph lines, for time-varying controls |
| 2 |
============================================================================== |
| 3 |
|
| 4 |
Initline |
| 5 |
--------- |
| 6 |
|
| 7 |
.. code:: |
| 8 |
|
| 9 |
crange(name='range', label='Pitch', min=20.0, max=20000.0, |
| 10 |
init=[500.0, 2000.0], rel='log', res='float', gliss=0.025, |
| 11 |
unit='x', up=False, func=None, midictl=None, col='red', help='') |
| 12 |
|
| 13 |
Description |
| 14 |
------------ |
| 15 |
|
| 16 |
This function creates a two-sided slider used to control a minimum and |
| 17 |
a maximum range at the sime time. When created, the range slider is |
| 18 |
stacked in the slider pane of the main Cecilia window in the order it |
| 19 |
is defined. The values of the range slider are passed to the module |
| 20 |
with a variable named `self.name`. The range minimum is collected using |
| 21 |
`self.name[0]` and the range maximum is collected using `self.name[1]`. |
| 22 |
The `up` argument passes the values of the range on mouse up if set to |
| 23 |
True or continuously if set to False. The `gliss` argument determines |
| 24 |
the duration of the portamento (in sec) applied on a new value. The |
| 25 |
resolution of the range slider can be set to 'int' or 'float' using the |
| 26 |
`res` argument. Slider color can be set using the `col` argument and a |
| 27 |
color value. However, sliders with `up` set to True are greyed out and |
| 28 |
the `col` argument is ignored. |
| 29 |
|
| 30 |
Every time a range slider is defined, two graph lines are automatically |
| 31 |
defined for the grapher in the Cecilia interface. One is linked to the |
| 32 |
minimum value of the range, the other one to the maximum value of the |
| 33 |
range. The recording and playback of an automated slider is linked to its |
| 34 |
graph line. |
| 35 |
|
| 36 |
Notes |
| 37 |
------- |
| 38 |
|
| 39 |
In order to quickly select the minimum value (and graph line), the user |
| 40 |
can click on the left side of the crange label, and on the right side of |
| 41 |
the label to select the maximum value (and graph line). |
| 42 |
|
| 43 |
Parameters |
| 44 |
----------- |
| 45 |
|
| 46 |
**name**: str |
| 47 |
Name of the range slider. |
| 48 |
**label**: str |
| 49 |
Label shown in the crange label and the grapher popup. |
| 50 |
**min**: float |
| 51 |
Minimum value of the range slider. |
| 52 |
**max**: float |
| 53 |
Maximum value of the range slider. |
| 54 |
**init**: list of float |
| 55 |
Range slider minimum and maximum initial values. |
| 56 |
**rel**: str {'lin', 'log'} |
| 57 |
Range slider scaling. Defaults to 'lin'. |
| 58 |
**res**: str {'int', 'float'} |
| 59 |
Range slider resolution. Defaults to 'float' |
| 60 |
**gliss**: float |
| 61 |
Portamento between values in seconds. Defaults to 0.025. |
| 62 |
**unit**: str |
| 63 |
Unit symbol shown in the interface. |
| 64 |
**up**: boolean |
| 65 |
Value passed on mouse up if True. Defaults to False. |
| 66 |
**func**: list of list of tuples |
| 67 |
Initial automation in break-points format (serie of time/value |
| 68 |
points). Times must be in increasing order between 0 and 1. |
| 69 |
The list must contain two lists of points, one for the minimum |
| 70 |
value and one for the maximum value. |
| 71 |
**midictl**: list of int |
| 72 |
Automatically map two midi controllers to this range slider. |
| 73 |
Defaults to None. |
| 74 |
**col**: str |
| 75 |
Color of the widget. |
| 76 |
**help**: str |
| 77 |
Help string shown in the crange tooltip. |