Module paramset
Sets of parameters, such as those in the PARAMETERS menu.
See also the norns script reference which has examples for using params.
Functions
Functions
- new (id, name)
-
constructor.
Parameters:
- add (args)
-
add generic parameter.
helper function to add param to paramset
two uses:
- pass "param" table with optional "action" function
- pass keyed table to generate "param" table. required keys are "type" and "id"
Parameters:
- args
- add_number (id, name, min, max, default, formatter, wrap)
-
add number.
Parameters:
- id string identifier slug (no spaces)
- name string user-facing name (can contain spaces)
- min number minimum value
- max number maximum value
- default number default / initial value
- formatter function function accepting a value and returning a string
- wrap boolean if true, value wraps on delta; otherwise saturates
- add_option (id, name, options, default)
-
add option.
Parameters:
- add_control (id, name, controlspec, formatter)
-
add control.
Parameters:
- add_file (id, name, path)
-
add file.
Parameters:
- add_text (id, name, txt)
-
add text.
Parameters:
- id
- name
- txt
- add_taper (id, name, min, max, default, k, units)
-
add taper.
Parameters:
- add_trigger (id, name)
-
add trigger.
Parameters:
- add_binary (id, name, behavior, default)
-
add binary
Parameters:
- add_separator (id, name)
-
add separator.
id and name are optional.
if neither id or name are provided,
separator will be named 'separator'
and will not have a unique parameter index.
separators which have their own parameter index
can be hidden / shown.
Parameters:
- add_group (id, name, n)
-
add parameter group.
groups cannot be nested,
i.e. a group cannot be made within a group.
id and name are optional.
if neither id or name are provided,
group will be named 'group'
and will not have a unique parameter index.
groups which have their own parameter index
can be hidden / shown.
Parameters:
- print ()
- print.
- list ()
- list. lists param id's
- get_id (index)
-
id.
Parameters:
- index number
- string (index)
-
string.
Parameters:
- index
- set (index, v, silent)
-
set.
Parameters:
- index
- v value
- silent boolean
- set_raw (index, v, silent)
-
set_raw (for control types only).
Parameters:
- index
- v value
- silent boolean
- get (index)
-
get.
Parameters:
- index
- get_raw (index)
-
get_raw (for control types only).
Parameters:
- index
- delta (index, d)
-
delta.
Parameters:
- index
- d number delta
- set_action (index, func)
-
set action.
Parameters:
- index
- func function set the action for this index
- set_save (index, state)
-
set save state.
Parameters:
- index
- state set the save state for this index
- t (index)
-
get type.
Parameters:
- index
- get_range (index)
-
get range
Parameters:
- index
- get_allow_pmap (index)
-
get whether or not parameter should be pmap'able
Parameters:
- index
- hide (index)
-
set visibility to hidden.
Parameters:
- index
- show (index)
-
set visiblility to show.
Parameters:
- index
- visible (index)
-
get visibility.
parameters are visible by default.
Parameters:
- index
- write (filename, name)
-
write to disk.
Parameters:
- filename either an absolute path, a number (to write [scriptname]-[number].pset to local data folder) or nil (to write default [scriptname].pset to local data folder)
- name string
- read (filename, silent)
-
read from disk.
Parameters:
- filename string either an absolute path, number (to read [scriptname]-[number].pset from local data folder) or nil (to read pset number specified by pset-last.txt in the data folder)
- silent boolean if true, do not trigger parameter actions
- delete (filename, name, pset_number)
-
delete from disk.
Parameters:
- filename either an absolute path, a number (for [scriptname]-[number].pset in local data folder) or nil (for default [scriptname].pset in local data folder)
- name string
- pset_number
- default ()
- read default pset if present.
- bang ()
- bang all params.
- clear ()
- clear.