envelope
This commit is contained in:
parent
f62b268f1d
commit
1690030b1d
2 changed files with 39 additions and 3 deletions
|
|
@ -143,12 +143,27 @@ class BetterOscillatorProcessor extends AudioWorkletProcessor {
|
|||
}
|
||||
static get parameterDescriptors() {
|
||||
return [
|
||||
{
|
||||
name: 'begin',
|
||||
defaultValue: 0,
|
||||
max: Number.POSITIVE_INFINITY,
|
||||
min: 0,
|
||||
},
|
||||
|
||||
{
|
||||
name: 'end',
|
||||
defaultValue: 0,
|
||||
max: Number.POSITIVE_INFINITY,
|
||||
min: 0,
|
||||
},
|
||||
|
||||
{
|
||||
name: 'phase',
|
||||
defaultValue: 0,
|
||||
max: 1,
|
||||
min: 0,
|
||||
},
|
||||
|
||||
{
|
||||
name: 'duty',
|
||||
defaultValue: 0.5,
|
||||
|
|
@ -174,6 +189,13 @@ class BetterOscillatorProcessor extends AudioWorkletProcessor {
|
|||
];
|
||||
}
|
||||
process(input, outputs, params) {
|
||||
if (currentTime <= params.begin[0]) {
|
||||
return true;
|
||||
}
|
||||
if (currentTime >= params.end[0]) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let z = 0; z < outputs.length; z++) {
|
||||
const out = outputs[z][0];
|
||||
const outlen = out.length;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue