Merge pull request #472 from tidalcycles/osc-fix

fix: osc should not return a promise
This commit is contained in:
Felix Roos 2023-02-22 20:01:00 +01:00 committed by GitHub
commit 0198697737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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