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 FLknob 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.
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 - a 3-D knob
2 - a pie-like knob
3 - a clock-like knob
4 - a flat knob
A 3-D knob.
A pie knob.
A clock knob.
A flat knob.
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 doesn't 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).
icursorsize (optional) -- If FLknob's itype is set to 1 (3D knob), this parameter controls the size of knob cursor.
Here is an example of the FLknob opcode. It uses the files flknob.orc and flknob.sco.
Example 15-1. Example of the FLknob opcode.
/* flknob.orc */
/* Written by Dave Phillips, edited by Kevin Conder */
; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
; Prepare the FTLK panel.
FLpanel "FLknob Example", 400, 300
; Show the knob's value.
gihandle1 FLvalue "The value of knob", 100, 20, 50, 20
; Show the knob.
gkout, gihandle2 FLknob "Move the knob to change its value", \
80, 5000, -1, 1, gihandle1, 90, 150, 100
FLpanelEnd
FLrun
; Instrument #1.
instr 1
; Use the global variable, gkout, set by
; the knob to change the audio frequency.
a1 oscili 3000, gkout, 1
out a1
endin
/* flknob.orc */
/* flknob.sco */
/* Written by Dave Phillips, edited by Kevin Conder */
; Table #1, a sine wave.
f 1 0 1024 10 1
; Play Instrument #1 for one hour.
i 1 0 3600
e
/* flknob.sco */