Module paramset

ParamSet class

Functions

ParamSet.new (id, name) constructor.
ParamSet:add (args) add generic parameter.
ParamSet:add_number (id, name, min, max, default, units, formatter, wrap, allow_pmap) add number.
ParamSet:add_option (id, name, options, default, allow_pmap) add option.
ParamSet:add_binary (id, name, behavior, default, allow_pmap) add binary.
ParamSet:add_trigger (id, name, allow_pmap) add trigger.
ParamSet:add_control (id, name, controlspec, formatter, allow_pmap) add control.
ParamSet:add_text (id, name, txt, locked, check) add text.
ParamSet:add_separator (id, name) add separator.
ParamSet:add_group (id, name, n) add parameter group.
ParamSet:print () print.
ParamSet:list () list.
ParamSet:get_name (index) name.
ParamSet:is_number (index) query whether param used the number template.
ParamSet:get_id (index) id.
ParamSet:string (index[, quant]) string.
ParamSet:set (index, v, silent) set.
ParamSet:set_raw (index, v, silent) set_raw (for control types only).
ParamSet:get (index) get.
ParamSet:get_raw (index) get_raw (for control types only).
ParamSet:delta (index, d) delta.
ParamSet:set_action (index, func) set action.
ParamSet:set_save (index, state) set save state.
ParamSet:t (index) get type.
ParamSet:get_range (index) get range
ParamSet:get_wrap (index) get wrap
ParamSet:get_allow_pmap (index) get whether or not parameter should be pmap'able
ParamSet:hide (index) set visibility to hidden.
ParamSet:show (index) set visiblility to show.
ParamSet:visible (index) get visibility.
ParamSet:bang () bang all params.
ParamSet:clear () clear.
ParamSet:write (PSET, UI) write to disk.
ParamSet:read (filename, silent) read from disk.
ParamSet:delete (filename, name) delete from disk.


Functions

ParamSet.new (id, name)
constructor.

Parameters:

ParamSet: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
ParamSet:add_number (id, name, min, max, default, units, formatter, wrap, allow_pmap)
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
  • units string
  • formatter function
  • wrap bool value adjustments wrap around when incremented / decremented
  • allow_pmap bool
ParamSet:add_option (id, name, options, default, allow_pmap)
add option.

Parameters:

  • id string (no spaces)
  • name string (can contain spaces)
  • options
  • default
  • allow_pmap bool
ParamSet:add_binary (id, name, behavior, default, allow_pmap)
add binary.

Parameters:

  • id string (no spaces)
  • name string (can contain spaces)
  • behavior string "toggle" or "trigger" or "momentary"; defaults to "toggle"
  • default integer 0 or 1
  • allow_pmap bool
ParamSet:add_trigger (id, name, allow_pmap)
add trigger.

Parameters:

  • id string (no spaces)
  • name string (can contain spaces)
  • allow_pmap bool
ParamSet:add_control (id, name, controlspec, formatter, allow_pmap)
add control.

Parameters:

  • id string (no spaces)
  • name string (can contain spaces)
  • controlspec controlspec
  • formatter
  • allow_pmap bool
ParamSet:add_text (id, name, txt, locked, check)
add text.

Parameters:

  • id string (no spaces)
  • name string (can contain spaces)
  • txt string (can contain spaces)
  • locked boolean (true = txt cannot be modified in params menu)
  • check function optional function displays a message of warning or success based on txt
ParamSet: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:

ParamSet: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:

  • id string (no spaces)
  • name string (can contain spaces)
  • n int
ParamSet:print ()
print.
ParamSet:list ()
list. lists param id's
ParamSet:get_name (index)
name.

Parameters:

ParamSet:is_number (index)
query whether param used the number template.

Parameters:

ParamSet:get_id (index)
id.

Parameters:

  • index number
ParamSet:string (index[, quant])
string.

Parameters:

  • index
  • quant rounding qunatification (optional)
ParamSet:set (index, v, silent)
set.

Parameters:

  • index
  • v value
  • silent boolean
ParamSet:set_raw (index, v, silent)
set_raw (for control types only).

Parameters:

  • index
  • v value
  • silent boolean
ParamSet:get (index)
get.

Parameters:

  • index
ParamSet:get_raw (index)
get_raw (for control types only).

Parameters:

  • index
ParamSet:delta (index, d)
delta.

Parameters:

  • index
  • d number delta
ParamSet:set_action (index, func)
set action.

Parameters:

  • index
  • func function set the action for this index
ParamSet:set_save (index, state)
set save state.

Parameters:

  • index
  • state set the save state for this index
ParamSet:t (index)
get type.

Parameters:

  • index
ParamSet:get_range (index)
get range

Parameters:

  • index
ParamSet:get_wrap (index)
get wrap

Parameters:

  • index
ParamSet:get_allow_pmap (index)
get whether or not parameter should be pmap'able

Parameters:

  • index
ParamSet:hide (index)
set visibility to hidden.

Parameters:

  • index
ParamSet:show (index)
set visiblility to show.

Parameters:

  • index
ParamSet:visible (index)
get visibility. parameters are visible by default.

Parameters:

  • index
ParamSet:bang ()
bang all params.
ParamSet:clear ()
clear.
ParamSet:write (PSET, UI)
write to disk.

Parameters:

  • PSET number number
  • UI string name
ParamSet: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
ParamSet:delete (filename, name)
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
generated by LDoc 1.5.0 Last updated 2024-01-13 13:12:10