adding the binrhythm function

This commit is contained in:
2023-09-08 16:55:03 +02:00
parent a1cdacda87
commit 49b7b20b20
2 changed files with 24 additions and 1 deletions

View File

@ -182,6 +182,7 @@ rhythm(speed, 7, 12) :: snd('east').n(9).out()
- <ic>bin(iterator: number, n: number): boolean</ic>: a binary rhythm generator. It transforms the given number into its binary representation (_e.g_ <ic>34</ic> becomes <ic>100010</ic>). It then returns a boolean value based on the iterator in order to generate a rhythm.
- <ic>binrhythm(divisor: number, n: number): boolean: boolean</ic>: iterator-less version of the binary rhythm generator.
${makeExample(
"Change the integers for a surprise rhythm!",
@ -192,6 +193,15 @@ mod(.5) && bin($(2), 48) && snd('sd').out()
true
)}
${makeExample(
"binrhythm for fast cool binary rhythms!",
`
binrhythm(.5, 13) && snd('kick').out()
binrhythm(.5, 18) && snd('sd').out()
`,
true
)}
${makeExample(
"Calling 911",
`