FLroller
Prev | Orchestra Opcodes and Operators | Next

## FLroller

FLroller — A FLTK widget that creates a transversal knob.

## Description

FLroller is a sort of knob, but put transversally.

## Syntax

    kout, ihandle FLroller "label", imin, imax, istep, iexp, itype, idisp, \
          iwidth, iheight, ix, iy

## Initialization

ihandle -- a handle value (an integer number) that unequivocally references a corresponding widget. This is used by other opcodes that modify a widget's properties (see Modifying FLTK Widget Appearance). It is automatically output by FLroller and must not be set by the user label. (The user label is a double-quoted string containing some user-provided text placed near the widget.)

“label” -- a double-quoted string containing some user-provided text, placed near the corresponding widget.

imin -- minimum value of output range.

imax -- maximum value of output range.

istep -- a floating-point number indicating the increment of valuator value corresponding to of each mouse click. The istep argument allows the user to arbitrarily slow roller's motion, enabling arbitrary precision.

iexp -- an integer number denoting the behaviour of valuator:

- 0 = valuator output is linear

- -1 = valuator output is exponential

All other positive numbers for iexp indicate the number of an existing table that is used for indexing. Linear interpolation is provided in table indexing. A negative table number suppresses interpolation.

| IMPORTANT!
Notice that the tables used by valuators must be created with the ftgen opcode and placed in the orchestra before the corresponding valuator. They can not placed in the score. In fact, tables placed in the score are created later than the initialization of the opcodes placed in the header section of the orchestra.

itype -- an integer number denoting the appearance of the valuator.

The itype argument can be set to the following values:

- 1 - horizontal roller

- 2 - vertical roller

idisp -- a handle value that was output from a previous instance of the FLvalue opcode to display the current value of the current valuator in the FLvalue widget itself. If the user does not want to use this feature that displays current values, it must be set to a negative number by the user.

iwidth -- width of widget.

iheight -- height of widget.

ix -- horizontal position of upper left corner of the valuator, relative to the upper left corner of corresponding window (expressed in pixels).

iy -- vertical position of upper left corner of the valuator, relative to the upper left corner of corresponding window (expressed in pixels).

## Performance

kout -- output value

FLroller is a sort of knob, but put transversally:

FLroller.

## Examples

Here is an example of the FLroller opcode. It uses the file FLroller.csd.

Example 323. Example of the FLroller opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

    <CsoundSynthesizer>
    <CsOptions>
    ; Select audio/midi flags here according to platform
    ; Audio out   Audio in    No messages
    -odac           -iadc     -d     ;;;RT audio I/O
    ; For Non-realtime ouput leave only the line below:
    ; -o FLroller.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

    ; A sine with oscillator with flroller controlled frequency
    sr = 44100
    kr = 441
    ksmps = 100
    nchnls = 1

    FLpanel "Frequency Roller", 900, 400, 50, 50
        ; Minimum value output by the roller
        imin = 200
        ; Maximum value output by the roller
        imax = 5000
        ; Increment with each pixel
        istep = 1
        ; Logarithmic type roller selected
        iexp = -1
        ; Roller graphic type (1=horizontal)
        itype = 1
        ; Display handle (-1=not used)
        idisp = -1
        ; Width of the roller in pixels
        iwidth = 300
        ; Height of the roller in pixels
        iheight = 50
        ; Distance of the left edge of the knob
        ; from the left edge of the panel
        ix = 300
        ; Distance of the top edge of the knob
        ; from the top edge of the panel
        iy = 50

        gkfreq, ihandle FLroller "Frequency", imin, imax, istep, iexp, itype, idisp, iwidth, iheight, ix, iy
    ; End of panel contents
    FLpanelEnd
    ; Run the widget thread!
    FLrun

    instr 1
        iamp = 15000
        ifn = 1
        asig oscili iamp, gkfreq, ifn
        out asig
    endin

    </CsInstruments>
    <CsScore>

    ; Function table that defines a single cycle
    ; of a sine wave.
    f 1 0 1024 10 1

    ; Instrument 1 will play a note for 1 hour.
    i 1 0 3600
    e

    </CsScore>
    </CsoundSynthesizer>

## See Also

FLcount, FLjoy, FLknob, FLslider, FLtext

## Credits

Author: Gabriel Maldonado

New in version 4.22

Example written by Iain McCurdy, edited by Kevin Conder.

Prev | Up | Next
FLprintk2 | Home | FLrun