模块 lib.lfo
通用脚本的低频振荡器
灵感来自 @markwheeler (changes)、@justmat (hnds) 和 @sixolet (toolkit) 的贡献 由 @dndrks + @sixolet 添加,@Dewb 和 @sonoCircuit 改进
norns 脚本参考 有 此模块的示例。
函数
| new (shape, min, max, depth, mode, period, action, phase, baseline) | 构造一个LFO |
| add (args) | 通过表参数构造LFO 例如 |
| start (from_parameter) | 开始 LFO |
| stop () | 停止 LFO |
| set (var, arg) | 设置LFO变量状态 |
| get (var) | 获取LFO变量状态 |
| reset_phase () | 重置LFO的相位 |
| add_params (id[, sep[, group]]) | 为已构造的LFO构建参数菜单UI。 |
函数
- new (shape, min, max, depth, mode, period, action, phase, baseline)
-
构造一个LFO
参数:
- shape string 此LFO的形状(选项:'sine', 'tri', 'up', 'down', 'square', 'random';默认:'sine')
- min number 此LFO的最小边界(默认:0)
- max number 此LFO的最大边界(默认:1)
- depth number min/max之间的调制深度(范围:0.0到1.0;默认:0.0)
- mode string 如何推进LFO(选项:'clocked', 'free';默认:'clocked')
- period number 此LFO推进的时间。如果模式是'clocked',参数以节拍为单位。如果模式是'free',参数以秒为单位。
- action function 当LFO推进时执行的回调函数。此库将缩放值和原始值都传递给回调函数。
- phase number 此LFO的相位偏移量(范围:0.0到1.0;默认:0)
- baseline string LFO应该从哪里开始(选项:'min', 'center', 'max';默认:'min')
- add (args)
-
通过表参数构造LFO 例如:my_lfo:add{shape = 'sine', min = 200, max = 12000}
- shape: (string) 此LFO的形状(选项:'sine', 'tri', 'up', 'down', 'square', 'random';默认:'sine')
- min: (number) 此LFO的最小边界(默认:0)
- max: (number) 此LFO的最大边界(默认:1)
- depth: (number) min/max之间的调制深度(范围:0.0到1.0;默认:0.0)
- mode: (string) 如何推进LFO(选项:'clocked', 'free';默认:'clocked')
- period: (number) 此LFO推进的时间。如果模式是'clocked',参数以节拍为单位。如果模式是'free',参数以秒为单位。
- action: (function) 当LFO推进时执行的回调函数。此库将缩放值和原始值都传递给回调函数。
- phase: (number) 此LFO的相位偏移量(范围:0.0到1.0;默认:0)
- baseline: (string) LFO应该从哪里开始(选项:'min', 'center', 'max';默认:'min')
参数:
- args
- start (from_parameter)
-
开始 LFO
参数:
- from_parameter
- stop ()
- 停止 LFO
- set (var, arg)
-
设置LFO变量状态
参数:
- var string 要目标化的变量(选项:'shape', 'min', 'max', 'depth', 'offset', 'phase', 'mode', 'period', '重置_target', 'baseline', 'action', 'ppqn')
- arg various 传递给目标的参数(通常是数字+字符串,但'action'期望一个函数)
- get (var)
-
获取LFO变量状态
参数:
- var string 要查询的变量(选项:'shape', 'min', 'max', 'depth', 'offset', 'phase', 'mode', 'period', '重置_target', 'baseline', 'action', 'enabled', 'controlspec')
- reset_phase ()
- 重置LFO的相位
- add_params (id[, sep[, group]])
-
为已构造的LFO构建参数菜单UI。
参数: