fix: osc should not return a promise

This commit is contained in:
Felix Roos 2023-02-22 19:50:37 +01:00
parent 7c367eb1e8
commit a742a71f67

View File

@ -45,9 +45,9 @@ let startedAt = -1;
* @memberof Pattern
* @returns Pattern
*/
Pattern.prototype.osc = async function () {
const osc = await connect();
return this.onTrigger((time, hap, currentTime, cps = 1) => {
Pattern.prototype.osc = function () {
return this.onTrigger(async (time, hap, currentTime, cps = 1) => {
const osc = await connect();
const cycle = hap.wholeOrPart().begin.valueOf();
const delta = hap.duration.valueOf();
// time should be audio time of onset