add pcurve
This commit is contained in:
parent
3fc0fdbe62
commit
0655af4d4f
2 changed files with 4 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue