Merge commit '85d3d7392ecfdc985fa8cc93e01846bec0f16dc4' into talk

This commit is contained in:
Felix Roos
2022-07-01 13:05:32 +02:00
53 changed files with 290 additions and 121 deletions
+3 -2
View File
@@ -1229,8 +1229,9 @@ export function pure(value) {
export function isPattern(thing) {
// thing?.constructor?.name !== 'Pattern' // <- this will fail when code is mangled
const is = thing instanceof Pattern || thing._Pattern;
if (!thing instanceof Pattern) {
const is = thing instanceof Pattern || thing?._Pattern;
if (thing?._Pattern && !thing instanceof Pattern) {
console.warn(
`Found Pattern that fails "instanceof Pattern" check.
This may happen if you are using multiple versions of @strudel.cycles/core.
+3
View File
@@ -19,6 +19,9 @@ export const tokenizeNote = (note) => {
// turns the given note into its midi number representation
export const toMidi = (note) => {
if (typeof note === 'number') {
return note;
}
const [pc, acc, oct] = tokenizeNote(note);
if (!pc) {
throw new Error('not a note: "' + note + '"');
+2 -2
View File
File diff suppressed because one or more lines are too long
+2
View File
@@ -356,6 +356,7 @@ function useRepl({ tune, defaultSynth, autolink = true, onEvent, onDraw: onDrawP
}
}, [activeCode, onDrawProp]);
const hideHeader = useMemo(() => activeCode && activeCode.includes('strudel hide-header'), [activeCode]);
// cycle hook to control scheduling
const cycle = useCycle({
onDraw,
@@ -469,6 +470,7 @@ function useRepl({ tune, defaultSynth, autolink = true, onEvent, onDraw: onDrawP
}, []);
return {
hideHeader,
pending,
code,
setCode,
+2
View File
@@ -36,6 +36,7 @@ function useRepl({ tune, defaultSynth, autolink = true, onEvent, onDraw: onDrawP
}
}, [activeCode, onDrawProp]);
const hideHeader = useMemo(() => activeCode && activeCode.includes('strudel hide-header'), [activeCode]);
// cycle hook to control scheduling
const cycle = useCycle({
onDraw,
@@ -151,6 +152,7 @@ function useRepl({ tune, defaultSynth, autolink = true, onEvent, onDraw: onDrawP
}, []);
return {
hideHeader,
pending,
code,
setCode,