register
  1. name
  2. func
  3. patternify

Registers a new pattern method. The method is added to the Pattern class + the standalone function is returned from register.

const vlpf = register('vlpf', (freq, pat) => {
  return pat.fmap((v) => ({...v, cutoff: freq * (v.velocity ?? 1) }));
})
s("saw").seg(8).velocity(rand).vlpf(800)
parametertype
name
  • string
  • string[]
name of the function, or an array of names to be used as synonyms
func
  • function
function with 1 or more params, where last is the current pattern
patternify
  • bool
defaults to true; if set to false, you will have more control over the arguments to `func` as they will be in their raw form and it will be up to you to patternify them and/or query them for values