Skip to content

kn1kn1/EuclideanRhythm

Repository files navigation

EuclideanRhythm CircleCI

Euclidean rhythm in Ruby

Based on the JavaScript code publised at

but also add the WORKAROUND of cases steps - pulses == 1 for example,

  • E(2,3)=[x . x]
  • E(3,4)=[x . x x]
  • E(5,6)=[x . x x x x]

Usage

You can find usage in ./euclidean_rhythm_test.rb

require_relative './euclidean_rhythm.rb'

pattern = EuclideanRhythm.euclidean_rhythm(5, 16)

From irb

$ irb
2.3.0 :001 > require_relative './euclidean_rhythm.rb'
 => true
2.3.0 :002 > EuclideanRhythm.euclidean_rhythm(5, 16)
 => [true, false, false, true, false, false, true, false, false, true, false, false, true, false, false, false]
2.3.0 :003 >

About

Euclidean rhythm in Ruby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages