experimental.euclid

Euclidean pattern generating library

Copied from https://github.com/brianhouse/bjorklund with all due gratitude

Originally written by Brian House (c) 2011. Released under the MIT license

experimental.euclid.generate_euclidean_pattern(steps, pulses, rot=0)

Generates an array indicating the on/off steps of Euclid(k, n)

Parameters
  • steps – The number of steps in the pattern

  • pulses – The number of ON steps in the pattern (must be <= steps)

  • rot – Optional rotation to offset the pattern. Must be in the range [0, steps]

Returns

An int array of length steps consisting of 1 and 0 values only

Raises

ValueError – if pulses or rot is out of range