<-- -->
 

The  cslider object

Name
Synopsis
Options
Description
Substitution
Examples



NAME  top

cslider - Creation of input control slider.

SYNOPSIS  top

cslider name ?options?

OPTIONS  top

-label   character string
                        will replace the name label besides or underneath the slider. ;default     none

-min     int | float
                        determines the minimum value of te slider  ;default     0

-max     int | float
                        determines the maximum value of te slider  ;default     100

-rate    k | i
                        determines whether the slider is k-rate or i-rate  ;default     k
 

-res     int | float
                        determines the resolution of the slider   ;default     .01

-orient  h / v
                        determines the vertical or horizontal orientation of the slider  ;default     horizontal
 
-unit    character string
                        dtermines the unit of measurement for the slider   ;default     x

-rel     log / lin
                        determines whether the slider will issues its values according to a linear or logarithmic function   ;default     lin

-color   color
                        determines the color of the through of the slider    ;default     gray

-width   int
                        determines the width of the display for the slider value   ;default     automatic

-init    int | float
                        determines the initial value of the slider.  ;default     0 | -min
 

DESCRIPTION  top

The cslider command creates a slider. There are two types of sliders: the i-rate slider and the k-rate slider.

The i-rate slider is evaluated at init-time only. Its value at compile time is substituted into the orchestra and/or score with giname The k-rate slider is usable at performance time and values are passed to the orchestra via a global gkname variable. The k-rate cslider is implemented with a special Csound routine that handles values though console-driven events.  The initial value of the variable is set at the current value of the slider.

For k-rate sliders, an option menu is also produced with the options: k-rate, record, playback, load and save. The user can record slider events with record and replay them with playback. A given stream can be saved under any name with save and recalled with load. k-rate allows to simply play the slider without recording.

When the orchestra and score are compiled, the clider object creates its own instruments to direct slider information to Csound. This is not normally seen by the user.

To obtain better slider resolution, it is advisable to size the interface window to a convenient height and/or width.

CAVEATS:

1-  It is compulsory, when using the k-rate slider object, to also declare a "total_time/duree_totale" i-rate slider, unless there is a cfilein object present (in which case the sliders will be in function for the duration of the longest sound selected).

2 - The k-rate slider will not transfer values to the orchestras during performance if the Csound console is open.
 

SUBSTITUTION  top

At compilation, any instance of gkname or giname in the orchestra, will be replaced by the current value of the slider. The user determines the propriety of an i-rate or k-rate usage in a given context. The i-rate cslider object can also be used in the score by using the replacement string : [name]
 

EXAMPLES  top

The definition: 

cslider pit -label pitch -ra k -unit Hz -res .01  -min 50 -colo red -max 4500 -init 2000
sets up a k-rate slider named pitch in the interface window. Values are passed with a global variable named "gkpit". The data will be scaled to a value between 50 and 4500 with a resolution of 0.01 in a linear relationship. The trough of the slider will be red.
 
The definition: 

cslider amp -ra i -unit db -rel log -res .01  -min 30 -max 90 -init 40
sets up a i-rate slider in the interface window. The value of the slider at init time will pass through any giamp in the orchestra .  The slider will issue values through a logarithmic function. The label for the slider will be the same as the name.
 
The definition: 

cslider freq
sets up a k-rate slider in the interface window. The value of the slider at init time will pass through any gkfreq in the orchestra .  The slider will issue values through a linear function between a minimum of 0 and a maximum of 100 with a resolution of .01. The label for the slider will be freq.
 


Copyright 1996 - 97