diff --git a/packages/core/controls.mjs b/packages/core/controls.mjs index 7071387a..b597bbd4 100644 --- a/packages/core/controls.mjs +++ b/packages/core/controls.mjs @@ -320,6 +320,7 @@ export const { fft } = registerControl('fft'); * * @name decay * @param {number | Pattern} time decay time in seconds + * @synonyms dec * @example * note("c3 e3 f3 g3").decay("<.1 .2 .3 .4>").sustain(0) * diff --git a/packages/core/pattern.mjs b/packages/core/pattern.mjs index d59a1285..4d0274c7 100644 --- a/packages/core/pattern.mjs +++ b/packages/core/pattern.mjs @@ -1569,7 +1569,7 @@ export const func = curry((a, b) => reify(b).func(a)); /** * Registers a new pattern method. The method is added to the Pattern class + the standalone function is returned from register. * - * @param {string} name name of the function + * @param {string | string[]} name name of the function, or an array of names to be used as synonyms * @param {function} func function with 1 or more params, where last is the current pattern * @noAutocomplete * diff --git a/packages/tonal/tonal.mjs b/packages/tonal/tonal.mjs index a425782d..7cb98739 100644 --- a/packages/tonal/tonal.mjs +++ b/packages/tonal/tonal.mjs @@ -88,13 +88,14 @@ function scaleOffset(scale, offset, note) { * @returns Pattern * @memberof Pattern * @name transpose + * @synonyms trans * @example * "c2 c3".fast(2).transpose("<0 -2 5 3>".slow(2)).note() * @example * "c2 c3".fast(2).transpose("<1P -2M 4P 3m>".slow(2)).note() */ -export const transpose = register('transpose', function (intervalOrSemitones, pat) { +export const transpose = register(['transpose', 'trans'], function transposeFn(intervalOrSemitones, pat) { return pat.withHap((hap) => { const note = hap.value.note ?? hap.value; if (typeof note === 'number') {