From 376db2f7c2b97e843dac65ede308469d0a0cfd69 Mon Sep 17 00:00:00 2001 From: "Jade (Rose) Rowland" Date: Tue, 17 Jun 2025 15:00:27 +0200 Subject: [PATCH] li --- packages/core/pattern.mjs | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/packages/core/pattern.mjs b/packages/core/pattern.mjs index 72caf5d8f..576be09df 100644 --- a/packages/core/pattern.mjs +++ b/packages/core/pattern.mjs @@ -1,6 +1,6 @@ /* pattern.mjs - Core pattern representation for strudel -Copyright (C) 2025 Strudel contributors - see +Copyright (C) 2025 Strudel contributors - see This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ @@ -21,7 +21,7 @@ import { numeralArgs, parseNumeral, pairs, - noteToMidi + noteToMidi, } from './util.mjs'; import drawLine from './drawLine.mjs'; import { logger } from './logger.mjs'; @@ -1815,9 +1815,9 @@ export const { fastGap, fastgap } = register(['fastGap', 'fastgap'], function (f const newWhole = !hap.whole ? undefined : new TimeSpan( - newPart.begin.sub(begin.sub(hap.whole.begin).div(factor)), - newPart.end.add(hap.whole.end.sub(end).div(factor)), - ); + newPart.begin.sub(begin.sub(hap.whole.begin).div(factor)), + newPart.end.add(hap.whole.end.sub(end).div(factor)), + ); return new Hap(newWhole, newPart, hap.value, hap.context); }; return pat.withQuerySpanMaybe(qf).withHap(ef).splitQueries(); @@ -3342,12 +3342,10 @@ export const { beat } = register( __beat((x) => x.innerJoin()), ); - - const __quantizeBy = (lens, scale, pat) => { // Supports ':' list syntax in mininotation scale = (Array.isArray(scale) ? scale.flat() : [scale]).flatMap((val) => - typeof val === 'number' ? val : noteToMidi(val) - 48 + typeof val === 'number' ? val : noteToMidi(val) - 48, ); return pat.withHap((hap) => { @@ -3374,8 +3372,7 @@ const __quantizeBy = (lens, scale, pat) => { return hap.withValue(() => (isObject ? { ...hap.value, note } : note)); }); -} - +}; /** * Snap note values to a chosen array of notes within a 12 note/octave scale @@ -3383,8 +3380,6 @@ const __quantizeBy = (lens, scale, pat) => { * @example * note(irand(35).add(48).seg(16).quantize("d:a:a#:f")).s("pulse") */ -export const { quantize } = register( - ['quantize'], - (scale, pat) => { return __quantizeBy(12, scale, pat) }, -); - +export const { quantize } = register(['quantize'], (scale, pat) => { + return __quantizeBy(12, scale, pat); +});