.out error handling
This commit is contained in:
parent
4f460eeb32
commit
712a2ae018
1 changed files with 138 additions and 134 deletions
|
|
@ -126,6 +126,7 @@ const splitSN = (s, n) => {
|
|||
|
||||
Pattern.prototype.out = function () {
|
||||
return this.onTrigger(async (t, hap, ct) => {
|
||||
try {
|
||||
const ac = getAudioContext();
|
||||
// calculate correct time (tone.js workaround)
|
||||
t = ac.currentTime + t - ct;
|
||||
|
|
@ -267,5 +268,8 @@ Pattern.prototype.out = function () {
|
|||
chain.push(ac.destination);
|
||||
// connect chain elements together
|
||||
chain.slice(1).reduce((last, current) => last.connect(current), chain[0]);
|
||||
} catch (e) {
|
||||
console.warn('.out error:', e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue