Merge branch 'pre_eval' of ssh://codeberg.org/uzu/strudel into pre_eval
This commit is contained in:
commit
f80fdbc38a
2 changed files with 9 additions and 4 deletions
|
|
@ -238,8 +238,8 @@ export function repl({
|
||||||
pattern = eachTransform(pattern);
|
pattern = eachTransform(pattern);
|
||||||
}
|
}
|
||||||
if (allTransforms.length) {
|
if (allTransforms.length) {
|
||||||
for (let i in allTransforms) {
|
for (const transform of allTransforms) {
|
||||||
pattern = allTransforms[i](pattern);
|
pattern = transform(pattern);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -362,9 +362,9 @@ const mod = (freq, range = 1, type = 'sine') => {
|
||||||
}
|
}
|
||||||
|
|
||||||
osc.start();
|
osc.start();
|
||||||
const g = new GainNode(ctx, { gain: range });
|
const g = gainNode(range);
|
||||||
osc.connect(g); // -range, range
|
osc.connect(g); // -range, range
|
||||||
return { node: g, stop: (t) => osc.stop(t) };
|
return { node: g, stop: (t) => osc.stop(t), osc: osc };
|
||||||
};
|
};
|
||||||
const fm = (frequencyparam, harmonicityRatio, modulationIndex, wave = 'sine') => {
|
const fm = (frequencyparam, harmonicityRatio, modulationIndex, wave = 'sine') => {
|
||||||
const carrfreq = frequencyparam.value;
|
const carrfreq = frequencyparam.value;
|
||||||
|
|
@ -416,6 +416,11 @@ export function applyFM(param, value, begin) {
|
||||||
modulator.connect(envGain);
|
modulator.connect(envGain);
|
||||||
envGain.connect(param);
|
envGain.connect(param);
|
||||||
}
|
}
|
||||||
|
fmmod.osc.onended = () => {
|
||||||
|
envGain.disconnect();
|
||||||
|
modulator.disconnect();
|
||||||
|
fmmod.osc.disconnect();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return { stop };
|
return { stop };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue