This commit is contained in:
Felix Roos
2022-03-13 11:48:08 +01:00
parent 5d8ccdff25
commit 225f6c7785
6 changed files with 20 additions and 13 deletions
@@ -42450,7 +42450,7 @@ class Pattern {
_opleft(other, func) {
return this.fmap(func).appLeft(reify(other));
}
_asNumber() {
_asNumber(silent = false) {
return this._withEvent((event)=>{
const asNumber = Number(event.value);
if (!isNaN(asNumber)) return event.withValue(()=>asNumber
@@ -42466,8 +42466,10 @@ class Pattern {
...event.context,
type: 'midi'
});
throw new Error('cannot parse as number: "' + event.value + '"');
});
if (!silent) throw new Error('cannot parse as number: "' + event.value + '"');
return event.withValue(()=>undefined
); // silent error
})._removeUndefineds();
}
add(other) {
return this._asNumber()._opleft(other, (a)=>(b)=>a + b
@@ -136201,7 +136203,9 @@ _strudelMjs.Pattern.prototype.draw = function(callback, cycleSpan, lookaheadCycl
cycle = currentCycle;
const begin = currentCycle * cycleSpan;
const end = (currentCycle + lookaheadCycles) * cycleSpan;
events = this.add(0).query(new State(new TimeSpan(begin, end)));
events = this._asNumber(true) // true = silent error
.query(new State(new TimeSpan(begin, end))).filter((event)=>event.part.begin.valueOf() === event.whole.begin.valueOf()
);
}
}
callback(ctx, events, t, cycleSpan, time);
@@ -171654,7 +171658,7 @@ function useCycle(props) {
).forEach((event)=>{
_tone.getTransport().schedule((time)=>{
const toneEvent = {
time: event.part.begin.valueOf(),
time: event.whole.begin.valueOf(),
duration: event.whole.end.sub(event.whole.begin).valueOf(),
value: event.value,
context: event.context
@@ -182991,4 +182995,4 @@ exports.default = cx;
},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}]},["3uVTb"], "3uVTb", "parcelRequire94c2")
//# sourceMappingURL=index.a8828e57.js.map
//# sourceMappingURL=index.5025d817.js.map
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -11,6 +11,6 @@
<body>
<div id="root"></div>
<noscript>You need to enable JavaScript to run this app.</noscript>
<script src="/tutorial/index.a8828e57.js" defer=""></script>
<script src="/tutorial/index.5025d817.js" defer=""></script>
</body>
</html>