+ make cyclist trigger backwards compatible for now
+ add absolute time as new 5th onTrigger param
This commit is contained in:
parent
14a5e7dcb6
commit
e8f6124a07
3 changed files with 13 additions and 7 deletions
|
|
@ -16,7 +16,9 @@ const hap2value = (hap) => {
|
|||
};
|
||||
|
||||
export const webaudioOutputTrigger = (t, hap, ct, cps) => superdough(hap2value(hap), t - ct, hap.duration / cps, cps);
|
||||
export const webaudioOutput = (hap, deadline, hapDuration) => superdough(hap2value(hap), deadline, hapDuration);
|
||||
// uses more precise, absolute t if available, see https://github.com/tidalcycles/strudel/pull/1004
|
||||
export const webaudioOutput = (hap, deadline, hapDuration, cps, t) =>
|
||||
superdough(hap2value(hap), t ? `=${t}` : deadline, hapDuration);
|
||||
|
||||
Pattern.prototype.webaudio = function () {
|
||||
return this.onTrigger(webaudioOutputTrigger);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue