mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-26 13:08:28 +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);
|
onSchedule?.(events, cycle);
|
||||||
const cancelFrom = timespan.begin.valueOf();
|
const cancelFrom = timespan.begin.valueOf();
|
||||||
Tone.Transport.cancel(cancelFrom);
|
Tone.Transport.cancel(cancelFrom);
|
||||||
const queryNextTime = (cycle + 1) * cycleDuration - 0.1;
|
const queryNextTime = (cycle + 1) * cycleDuration - 0.5;
|
||||||
const delta = queryNextTime - Tone.Transport.seconds;
|
const t = Math.max(Tone.Transport.seconds, queryNextTime) + 0.1;
|
||||||
if (delta < 0.2) {
|
Tone.Transport.schedule(() => {
|
||||||
query(cycle + 1);
|
query(cycle + 1);
|
||||||
} else {
|
}, t);
|
||||||
Tone.Transport.schedule(() => {
|
|
||||||
query(cycle + 1);
|
|
||||||
}, queryNextTime);
|
|
||||||
}
|
|
||||||
events?.filter((event) => event.part.begin.valueOf() === event.whole.begin.valueOf()).forEach((event) => {
|
events?.filter((event) => event.part.begin.valueOf() === event.whole.begin.valueOf()).forEach((event) => {
|
||||||
Tone.Transport.schedule((time) => {
|
Tone.Transport.schedule((time) => {
|
||||||
const toneEvent = {
|
const toneEvent = {
|
||||||
|
|||||||
@ -97423,16 +97423,13 @@ function useCycle(props) {
|
|||||||
// query next cycle in the middle of the current
|
// query next cycle in the middle of the current
|
||||||
const cancelFrom = timespan.begin.valueOf();
|
const cancelFrom = timespan.begin.valueOf();
|
||||||
_tone.Transport.cancel(cancelFrom);
|
_tone.Transport.cancel(cancelFrom);
|
||||||
const queryNextTime = (cycle + 1) * cycleDuration - 0.1;
|
// const queryNextTime = (cycle + 1) * cycleDuration - 0.1;
|
||||||
const delta = queryNextTime - _tone.Transport.seconds;
|
const queryNextTime = (cycle + 1) * cycleDuration - 0.5;
|
||||||
if (delta < 0.2) // if calling Tone.Transport.schedule barely before the scheduled time, it sometimes happen that the event is swallowed
|
// if queryNextTime would be before current time, execute directly (+0.1 for safety that it won't miss)
|
||||||
// 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
|
const t = Math.max(_tone.Transport.seconds, queryNextTime) + 0.1;
|
||||||
// so, if the delta is too small (using 0.2 for no specific reason), just schedule directly
|
_tone.Transport.schedule(()=>{
|
||||||
// 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(()=>{
|
|
||||||
query(cycle + 1);
|
query(cycle + 1);
|
||||||
}, queryNextTime);
|
}, t);
|
||||||
// schedule events for next cycle
|
// schedule events for next cycle
|
||||||
events?.filter((event)=>event.part.begin.valueOf() === event.whole.begin.valueOf()
|
events?.filter((event)=>event.part.begin.valueOf() === event.whole.begin.valueOf()
|
||||||
).forEach((event)=>{
|
).forEach((event)=>{
|
||||||
@ -108738,4 +108735,4 @@ exports.default = cx;
|
|||||||
|
|
||||||
},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}]},["3uVTb"], "3uVTb", "parcelRequire94c2")
|
},{"@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>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user