mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-13 14:48:36 +00:00
basic pitch envelope
This commit is contained in:
parent
a7daf41934
commit
bdc2af9733
@ -891,6 +891,13 @@ const generic_params = [
|
||||
*
|
||||
*/
|
||||
['freq'],
|
||||
// pitch envelope
|
||||
['pattack', 'patt'],
|
||||
['pdecay', 'pdec'],
|
||||
['psustain', 'psus'],
|
||||
['prelease', 'prel'],
|
||||
['penv'],
|
||||
['panchor'], // TODO
|
||||
// TODO: https://tidalcycles.org/docs/configuration/MIDIOSC/control-voltage/#gate
|
||||
['gate', 'gat'],
|
||||
// ['hatgrain'],
|
||||
|
||||
@ -126,6 +126,12 @@ export function getOscillator(
|
||||
fmvelocity: fmVelocity,
|
||||
fmwave: fmWaveform = 'sine',
|
||||
duration,
|
||||
penv,
|
||||
// panchor = 0, // TODO
|
||||
pattack,
|
||||
pdecay,
|
||||
psustain,
|
||||
prelease,
|
||||
},
|
||||
) {
|
||||
let ac = getAudioContext();
|
||||
@ -196,6 +202,12 @@ export function getOscillator(
|
||||
vibratoOscillator.start(t);
|
||||
}
|
||||
|
||||
// pitch envelope
|
||||
if (penv) {
|
||||
const holdEnd = t + duration;
|
||||
getParamADSR(o.detune, pattack, pdecay, psustain, prelease, 0, penv * 100, t, holdEnd, 'linear');
|
||||
}
|
||||
|
||||
let noiseMix;
|
||||
if (noise) {
|
||||
noiseMix = getNoiseMix(o, noise, t);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user