Restore old lfo to avoid unifying right now

This commit is contained in:
Aria 2025-12-13 14:59:14 -06:00
parent 12f9af227c
commit ef2ee0969a
2 changed files with 27 additions and 7 deletions

View file

@ -109,7 +109,29 @@ export function getEnvelope(audioContext, properties = {}) {
return getWorklet(audioContext, 'envelope-processor', properties);
}
export function getLfo(audioContext, properties = {}) {
export function getLfo(audioContext, begin, end, properties = {}) {
const { shape = 0, ...props } = properties;
const { dcoffset = -0.5, depth = 1 } = properties;
const lfoprops = {
frequency: 1,
depth,
skew: 0.5,
phaseoffset: 0,
time: begin,
begin,
end,
shape: getModulationShapeInput(shape),
dcoffset,
min: dcoffset * depth,
max: dcoffset * depth + depth,
curve: 1,
...props,
};
return getWorklet(audioContext, 'lfo-processor', lfoprops);
}
export function getCustomLfo(audioContext, properties = {}) {
// Extract some params we need for deriving other params
const { shape = 0, ...props } = properties;
const lfoprops = {