mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-12 22:15:27 -04:00
Add retrig option for LFOs
This commit is contained in:
@@ -3046,6 +3046,7 @@ registerSubControls('lfo', [
|
||||
['skew', 'sk'],
|
||||
['curve', 'cu'],
|
||||
['sync', 's'],
|
||||
['retrig', 'rt'],
|
||||
['fxi'],
|
||||
]);
|
||||
registerSubControls('env', [
|
||||
@@ -3132,13 +3133,14 @@ Pattern.prototype.modulate = function (type, config, idPat) {
|
||||
* @param {string | Pattern} [config.control] Node to modulate. Aliases: c
|
||||
* @param {string | Pattern} [config.subControl] Sub-control name to append to the control key. Aliases: sc
|
||||
* @param {number | Pattern} [config.rate] Modulation rate. Aliases: r
|
||||
* @param {number | Pattern} [config.sync] Tempo-synced modulation rate. Aliases: s
|
||||
* @param {number | Pattern} [config.depth] Relative modulation depth. Aliases: dep, dr
|
||||
* @param {number | Pattern} [config.depthabs] Absolute modulation depth. Aliases: da
|
||||
* @param {number | Pattern} [config.dcoffset] DC offset / bias for the waveform. Aliases: dc
|
||||
* @param {number | Pattern} [config.shape] Shape index. Aliases: sh
|
||||
* @param {number | Pattern} [config.skew] Skew amount. Aliases: sk
|
||||
* @param {number | Pattern} [config.curve] Exponential curve amount. Aliases: cu
|
||||
* @param {number | Pattern} [config.sync] Tempo-synced modulation rate. Aliases: s
|
||||
* @param {number | Pattern} [config.retrig] If > 0.5, the LFO will retrigger on each event. Aliases: rt
|
||||
* @param {number | Pattern} [config.fxi] FX index to target
|
||||
* @param {string | Pattern} id ID to use for this modulator
|
||||
* @returns Pattern
|
||||
|
||||
@@ -98,6 +98,7 @@ export const connectLFO = (id, params, nodeTracker) => {
|
||||
fxi = 'main',
|
||||
depth = 1,
|
||||
depthabs,
|
||||
retrig = 0,
|
||||
...filteredParams
|
||||
} = params;
|
||||
const { targetParams, paramName } = getTargetParamsForControl(control, nodeTracker[fxi], subControl);
|
||||
@@ -109,7 +110,7 @@ export const connectLFO = (id, params, nodeTracker) => {
|
||||
const modParams = {
|
||||
...filteredParams,
|
||||
frequency: sync !== undefined ? sync * cps : rate,
|
||||
time: cycle / cps,
|
||||
time: retrig > 0.5 ? 0 : cycle / cps,
|
||||
depth: depthValue,
|
||||
min,
|
||||
max,
|
||||
|
||||
Reference in New Issue
Block a user