add helper hap.ensureObjectValue
This commit is contained in:
parent
c8f8f02a46
commit
6283273d81
4 changed files with 18 additions and 18 deletions
|
|
@ -28,9 +28,7 @@ export const csound = register('csound', (instrument, pat) => {
|
|||
logger('[csound] not loaded yet', 'warning');
|
||||
return;
|
||||
}
|
||||
if (typeof hap.value !== 'object') {
|
||||
throw new Error('csound only support objects as hap values');
|
||||
}
|
||||
hap.ensureObjectValue();
|
||||
let { gain = 0.8 } = hap.value;
|
||||
gain *= 0.2;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue