fix: always run previous trigger
+ make dominantTrigger more dominant
This commit is contained in:
parent
c20b691683
commit
7a999de602
1 changed files with 6 additions and 5 deletions
|
|
@ -783,13 +783,14 @@ export class Pattern {
|
||||||
hap.setContext({
|
hap.setContext({
|
||||||
...hap.context,
|
...hap.context,
|
||||||
onTrigger: (...args) => {
|
onTrigger: (...args) => {
|
||||||
if (!dominant && hap.context.onTrigger) {
|
// run previously set trigger, if it exists
|
||||||
hap.context.onTrigger(...args);
|
hap.context.onTrigger?.(...args);
|
||||||
}
|
|
||||||
onTrigger(...args);
|
onTrigger(...args);
|
||||||
},
|
},
|
||||||
// we need this to know later if the default trigger should still fire
|
// if dominantTrigger is set to true, the default output (webaudio) will be disabled
|
||||||
dominantTrigger: dominant,
|
// when using multiple triggers, you cannot flip this flag to false again!
|
||||||
|
// example: x.csound('CooLSynth').log() as well as x.log().csound('CooLSynth') should work the same
|
||||||
|
dominantTrigger: hap.context.dominantTrigger || dominant,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue