mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 21:58:37 +00:00
build
This commit is contained in:
parent
d58a706b9b
commit
c427b1594d
12
docs/dist/useCycle.js
vendored
12
docs/dist/useCycle.js
vendored
@ -12,15 +12,11 @@ function useCycle(props) {
|
||||
onSchedule?.(events, cycle);
|
||||
const cancelFrom = timespan.begin.valueOf();
|
||||
Tone.Transport.cancel(cancelFrom);
|
||||
const queryNextTime = (cycle + 1) * cycleDuration - 0.1;
|
||||
const delta = queryNextTime - Tone.Transport.seconds;
|
||||
if (delta < 0.2) {
|
||||
const queryNextTime = (cycle + 1) * cycleDuration - 0.5;
|
||||
const t = Math.max(Tone.Transport.seconds, queryNextTime) + 0.1;
|
||||
Tone.Transport.schedule(() => {
|
||||
query(cycle + 1);
|
||||
} else {
|
||||
Tone.Transport.schedule(() => {
|
||||
query(cycle + 1);
|
||||
}, queryNextTime);
|
||||
}
|
||||
}, t);
|
||||
events?.filter((event) => event.part.begin.valueOf() === event.whole.begin.valueOf()).forEach((event) => {
|
||||
Tone.Transport.schedule((time) => {
|
||||
const toneEvent = {
|
||||
|
||||
@ -97423,16 +97423,13 @@ function useCycle(props) {
|
||||
// query next cycle in the middle of the current
|
||||
const cancelFrom = timespan.begin.valueOf();
|
||||
_tone.Transport.cancel(cancelFrom);
|
||||
const queryNextTime = (cycle + 1) * cycleDuration - 0.1;
|
||||
const delta = queryNextTime - _tone.Transport.seconds;
|
||||
if (delta < 0.2) // if calling Tone.Transport.schedule barely before the scheduled time, it sometimes happen that the event is swallowed
|
||||
// i think this has something to do with the fact that Tone.Transport.schedule is called with a time that is slightly before the scheduled time
|
||||
// so, if the delta is too small (using 0.2 for no specific reason), just schedule directly
|
||||
// this if branch should only be entered if the user triggers the scheduling, to make sure no endless recursion is happening
|
||||
query(cycle + 1);
|
||||
else _tone.Transport.schedule(()=>{
|
||||
// const queryNextTime = (cycle + 1) * cycleDuration - 0.1;
|
||||
const queryNextTime = (cycle + 1) * cycleDuration - 0.5;
|
||||
// if queryNextTime would be before current time, execute directly (+0.1 for safety that it won't miss)
|
||||
const t = Math.max(_tone.Transport.seconds, queryNextTime) + 0.1;
|
||||
_tone.Transport.schedule(()=>{
|
||||
query(cycle + 1);
|
||||
}, queryNextTime);
|
||||
}, t);
|
||||
// schedule events for next cycle
|
||||
events?.filter((event)=>event.part.begin.valueOf() === event.whole.begin.valueOf()
|
||||
).forEach((event)=>{
|
||||
@ -108738,4 +108735,4 @@ exports.default = cx;
|
||||
|
||||
},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}]},["3uVTb"], "3uVTb", "parcelRequire94c2")
|
||||
|
||||
//# sourceMappingURL=index.ea127b5f.js.map
|
||||
//# sourceMappingURL=index.a1b5cf57.js.map
|
||||
File diff suppressed because one or more lines are too long
@ -11,6 +11,6 @@
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<script src="/tutorial/index.ea127b5f.js" defer=""></script>
|
||||
<script src="/tutorial/index.a1b5cf57.js" defer=""></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user