getDuration
  1. sampleName
  2. (optional)

Returns the duration, in seconds, of the given sample. Has optional param n (for instance, the 2 in s("casio:2"))

Note: must be called with await, otherwise you'll get a pending Promise object.

// Set a patterns cycle length to exactly the length of the sample
samples('github:tidalcycles/dirt-samples')
let k = await getDuration('sax')
s("sax").cps(1/k)
parametertype
sampleName
  • string
(optional)
  • number
n