mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 21:58:31 +00:00
add pcurve
This commit is contained in:
parent
3fc0fdbe62
commit
0655af4d4f
@ -897,6 +897,7 @@ const generic_params = [
|
||||
['psustain', 'psus'],
|
||||
['prelease', 'prel'],
|
||||
['penv'],
|
||||
['pcurve'],
|
||||
['panchor'],
|
||||
// TODO: https://tidalcycles.org/docs/configuration/MIDIOSC/control-voltage/#gate
|
||||
['gate', 'gat'],
|
||||
|
||||
@ -145,6 +145,7 @@ export function drywet(dry, wet, wetAmount = 0) {
|
||||
return mix;
|
||||
}
|
||||
|
||||
let curves = ['linear', 'exponential'];
|
||||
export function getPitchEnvelope(param, value, t, holdEnd) {
|
||||
if (value.penv) {
|
||||
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 min = 0 - 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