mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-24 20:18:34 +00:00
add pcurve
This commit is contained in:
parent
3fc0fdbe62
commit
0655af4d4f
@ -897,6 +897,7 @@ const generic_params = [
|
|||||||
['psustain', 'psus'],
|
['psustain', 'psus'],
|
||||||
['prelease', 'prel'],
|
['prelease', 'prel'],
|
||||||
['penv'],
|
['penv'],
|
||||||
|
['pcurve'],
|
||||||
['panchor'],
|
['panchor'],
|
||||||
// TODO: https://tidalcycles.org/docs/configuration/MIDIOSC/control-voltage/#gate
|
// TODO: https://tidalcycles.org/docs/configuration/MIDIOSC/control-voltage/#gate
|
||||||
['gate', 'gat'],
|
['gate', 'gat'],
|
||||||
|
|||||||
@ -145,6 +145,7 @@ export function drywet(dry, wet, wetAmount = 0) {
|
|||||||
return mix;
|
return mix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let curves = ['linear', 'exponential'];
|
||||||
export function getPitchEnvelope(param, value, t, holdEnd) {
|
export function getPitchEnvelope(param, value, t, holdEnd) {
|
||||||
if (value.penv) {
|
if (value.penv) {
|
||||||
let [pattack, pdecay, psustain, prelease] = getADSRValues([
|
let [pattack, pdecay, psustain, prelease] = getADSRValues([
|
||||||
@ -157,7 +158,8 @@ export function getPitchEnvelope(param, value, t, holdEnd) {
|
|||||||
const cents = value.penv * 100; // penv is in semitones
|
const cents = value.penv * 100; // penv is in semitones
|
||||||
const min = 0 - cents * panchor;
|
const min = 0 - cents * panchor;
|
||||||
const max = cents - cents * panchor;
|
const max = cents - cents * panchor;
|
||||||
getParamADSR(param, pattack, pdecay, psustain, prelease, min, max, t, holdEnd, 'linear');
|
const curve = curves[value.pcurve ?? 0];
|
||||||
|
getParamADSR(param, pattack, pdecay, psustain, prelease, min, max, t, holdEnd, curve);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user