On this page:
6.2.1 continuous-slider
6.2.2 discrete-slider
6.2.3 switch
6.2.4 one-of-many and one-of-few
6.2.5 color
6.2.6 Responding to style parameters

6.2 The style-parameters section

A style can provide a range of behaviours by exposing some controls to the muvee Reveal user. For example, a “birthday party” style can provide a control for the number of balloons to use in the muvee. A style describes its parameters in the

(style-parameters ....)

section which should be the first section in the style’s data.scm file.

If you’re not exposing any parameters in your style, define an empty section right at the start of your data.scm file, like so -

(style-parameters)

Here is an example capturing all the different types of parameters you can expose in a style -
(style-parameters
    ;                  ParamName   Default  Min     Max
    (continuous-slider SPEED       1.0      1.0     2.0)
    (discrete-slider   BALLOONS    2        0       8)
 
    ; CheckBox  ParamName     Default (on/off)
    (switch     SHOW_CAPTIONS on)
 
    ; ComboBox   ParamName  Default       ListOfValues
    (one-of-many CAKE       WeddingCake   (WeddingCake BirthdayCake NewYearCake))
 
    ; RadioButtons  ParamName    Default     ListOfValues
    (one-of-few     CAPTION_POS  Bottom      (Top Middle Bottom))
 
    ; ColorPicker   ParamName       Default (0x00RRGGBB)
    (color          FADE_TO_COLOR   0x00FFFFFF))

The value of any parameter can be accessed simply by using its name wherever the currently set value is required.

6.2.1 continuous-slider

;                  ParamName   Default  Min     Max
(continuous-slider SPEED       1.0      1.0     2.0)
Specifies a continuous value in the given range. Note that the minimum value must be less than the maximum value and the given default value must lie within that range. Otherwise, muSE will pop up an error message.

The code above, when used as is, will create a slider named “SPEED” with the end points named “SPEEDMIN” and “SPEEDMAX”. If you want to change these strings, you can add the following entries in your style’s strings.txt file -
SPEED   en-US   Speed
SPEED_MIN       en-US   Low
SPEED_MAX       en-US   High
With these strings in place, you’ll see the slider end points named Low and High instead of SPEEDMIN and SPEEDMAX.

6.2.2 discrete-slider
;                  ParamName   Default  Min     Max
(discrete-slider   BALLOONS    2        0       8)

Similar to continuous-slider` above except that the values are integral.

6.2.3 switch
; CheckBox  ParamName     Default (on/off)
(switch     SHOW_CAPTIONS on)

Defines a check-box kind of parameter - a parameter that can have either on or off as its value. The display name can be specified via the strings.txt file just like continuous-slider above.

6.2.4 one-of-many and one-of-few
; ComboBox   ParamName  Default       ListOfValues
(one-of-many CAKE       WeddingCake   (WeddingCake BirthdayCake NewYearCake))
 
; RadioButtons  ParamName    Default     ListOfValues
(one-of-few     CAPTION_POS  Bottom      (Top Middle Bottom))

one-of-many creates a drop-down list of items that the user can select from and one-of-few creates a set of radio buttons. Although both are about selecting one item from a set, the name difference is used as an indicator to the GUI about the control to display.

You can do things in the style based on the CAKE parameter using a branch expression such as -
(case CAKE
  ('WeddingCake ....)
  ('BirthdayCake ....)
  ('NewYearCake ....))

The parameters as specified above will cause the style to put up a CAKE drop-down menu with the strings WeddingCake, BirthdayCake and NewYearCake as the menu entries. If you want to change the display strings for these choices, you can add your preference to the strings.txt file as follows -
CAKE    en-US   Cake type
WeddingCake     en-US   A 3-storey wedding cake
BirthdayCake    en-US   Happy Birthday!
NewYearCake     en-US   Happy New Year!

6.2.5 color
; ColorPicker   ParamName       Default (0x00RRGGBB)
(color          FADE_TO_COLOR   0x00FFFFFF)

Defines a color selection parameter. In the UI, this parameter should be displayed as a color swatch (i.e. rectangle showing the current color), which when clicked brings up the standard color picker control.

6.2.6 Responding to style parameters

Style parameters are just plain values - either numeric or symbolic. You can use the current settings of a style’s parameters to compute any aspect of the muvee. A parameter’s symbol becomes automatically defined to the current value of the style’s control at the time a muvee is made.

For example, if you want the speed to be converted into a scaling factor to apply to a duration value, you can write -

(define scaling-factor (/ 1.0 SPEED))

and use scaling-factor in any other computation.