Merge remote-tracking branch 'origin/HEAD' into vitest

This commit is contained in:
Felix Roos 2022-08-09 22:08:45 +02:00
commit 29009e14f4
12 changed files with 499 additions and 287 deletions

View file

@ -1294,8 +1294,8 @@ export function slowcatPrime(...pats) {
pats = pats.map(reify);
const query = function (state) {
const pat_n = Math.floor(state.span.begin) % pats.length;
const pat = pats[pat_n];
return pat.query(state);
const pat = pats[pat_n]; // can be undefined for same cases e.g. /#cHVyZSg0MikKICAuZXZlcnkoMyxhZGQoNykpCiAgLmxhdGUoLjUp
return pat?.query(state) || [];
};
return new Pattern(query)._splitQueries();
}

View file

@ -53,8 +53,8 @@ export const getPlayableNoteValue = (hap) => {
// if value is number => interpret as midi number as long as its not marked as frequency
if (typeof note === 'number' && context.type !== 'frequency') {
note = fromMidi(hap.value);
} else if (typeof note === 'string' && !isNote(note)) {
throw new Error('not a note: ' + note);
} else if (typeof note !== 'string' || !isNote(note)) {
throw new Error('not a note: ' + JSON.stringify(note));
}
return note;
};