diff --git a/packages/core/controls.mjs b/packages/core/controls.mjs index 42fa8cba..b6964564 100644 --- a/packages/core/controls.mjs +++ b/packages/core/controls.mjs @@ -400,19 +400,6 @@ export const { loopEnd, loope } = registerControl('loopEnd', 'loope'); * s(",hh*3").fast(2).crush("<16 8 7 6 5 4 3 2>") * */ -// TODO: currently duplicated with "native" legato -// TODO: superdirt legato will do more: https://youtu.be/dQPmE1WaD1k?t=419 -/** - * a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample. - * - * @name legato - * @param {number | Pattern} duration between 0 and 1, where 1 is the length of the whole hap time - * @noAutocomplete - * @example - * "c4 eb4 g4 bb4".legato("<0.125 .25 .5 .75 1 2 4>") - * - */ -// ['legato'], // ['clhatdecay'], export const { crush } = registerControl('crush'); /** @@ -1455,16 +1442,15 @@ export const { val } = registerControl('val'); export const { cps } = registerControl('cps'); /** * Multiplies the duration with the given number. Also cuts samples off at the end if they exceed the duration. - * In tidal, this would be done with legato, [which has a complicated history in strudel](https://github.com/tidalcycles/strudel/issues/111). - * For now, if you're coming from tidal, just think clip = legato. * * @name clip + * @synonyms legato * @param {number | Pattern} factor >= 0 * @example * note("c a f e").s("piano").clip("<.5 1 2>") * */ -export const { clip } = registerControl('clip'); +export const { clip, legato } = registerControl('clip', 'legato'); // ZZFX export const { zrand } = registerControl('zrand'); diff --git a/packages/core/pattern.mjs b/packages/core/pattern.mjs index 3d859728..6efcc758 100644 --- a/packages/core/pattern.mjs +++ b/packages/core/pattern.mjs @@ -2241,21 +2241,6 @@ export const velocity = register('velocity', function (velocity, pat) { return pat.withContext((context) => ({ ...context, velocity: (context.velocity || 1) * velocity })); }); -/** - * - * Multiplies the hap duration with the given factor. - * With samples, `clip` might be a better function to use ([more info](https://github.com/tidalcycles/strudel/pull/598)) - * @name legato - * @memberof Pattern - * @example - * note("c3 eb3 g3 c4").legato("<.25 .5 1 2>") - */ -// TODO - fix -export const legato = register('legato', function (value, pat) { - value = Fraction(value); - return pat.withHapSpan((span) => new TimeSpan(span.begin, span.begin.add(span.end.sub(span.begin).mul(value)))); -}); - ////////////////////////////////////////////////////////////////////// // Control-related functions, i.e. ones that manipulate patterns of // objects diff --git a/website/src/pages/learn/time-modifiers.mdx b/website/src/pages/learn/time-modifiers.mdx index e1226512..1baef9ea 100644 --- a/website/src/pages/learn/time-modifiers.mdx +++ b/website/src/pages/learn/time-modifiers.mdx @@ -34,11 +34,7 @@ Some of these have equivalent operators in the Mini Notation: -## legato - - - -## clip +## clip / legato