npm.io
0.4.0 • Published 11 years ago

beatmath

Licence
ISC
Version
0.4.0
Deps
0
Vulns
0
Weekly
0

beatmath

module is a function that requires two arguments

  • @Number - measure length in beats
  • @Array - list of beats

It returns a function that takes one argument, a @Number, the beat count

var beatmath = require('beatmath')

var beats = beatmath(4, [1,3])
// this will return a function 
// which will return true on the 1st and 3rd
// zero indexed = false

beats(1) // true
beats(2) // false
beats(3) // true
beats(5) // true
npm install beatmath