Support list syntax in mininotation (#512)
fixes #504 * support list syntax in mininotation * support compound controls * remove redundant : splitting of s/n and note/n from webaudio * patternable scale names
This commit is contained in:
parent
4bfeaa47bf
commit
bf72908dc9
11 changed files with 458 additions and 208 deletions
|
|
@ -97,17 +97,6 @@ const getSoundfontKey = (s) => {
|
|||
return;
|
||||
};
|
||||
|
||||
const splitSN = (s, n) => {
|
||||
if (!s.includes(':')) {
|
||||
return [s, n];
|
||||
}
|
||||
let [s2, n2] = s.split(':');
|
||||
if (isNaN(Number(n2))) {
|
||||
return [s, n];
|
||||
}
|
||||
return [s2, n2];
|
||||
};
|
||||
|
||||
let workletsLoading;
|
||||
function loadWorklets() {
|
||||
if (workletsLoading) {
|
||||
|
|
@ -243,12 +232,6 @@ export const webaudioOutput = async (hap, deadline, hapDuration, cps) => {
|
|||
if (bank && s) {
|
||||
s = `${bank}_${s}`;
|
||||
}
|
||||
if (typeof s === 'string') {
|
||||
[s, n] = splitSN(s, n);
|
||||
}
|
||||
if (typeof note === 'string') {
|
||||
[note, n] = splitSN(note, n);
|
||||
}
|
||||
if (!s || ['sine', 'square', 'triangle', 'sawtooth'].includes(s)) {
|
||||
// destructure adsr here, because the default should be different for synths and samples
|
||||
const { attack = 0.001, decay = 0.05, sustain = 0.6, release = 0.01 } = hap.value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue