# Non-euclidean geometry

**URL:** <https://uzu.lurk.org/t/non-euclidean-geometry/5050>\
**Category:** TidalCycles\
**Tags:** innards\
**Created:** [13 January 2024 14:41 UTC](https://uzu.lurk.org/t/non-euclidean-geometry/5050 "2024-01-13T14:41:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwaldmann](https://uzu.lurk.org/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jwaldmann](https://uzu.lurk.org/u/jwaldmann)\
**Post date:** [13 January 2024 14:41 UTC](https://uzu.lurk.org/t/non-euclidean-geometry/5050/1 "2024-01-13T14:41:29Z")

</div>

yeah the title is click-bait-y, what I really mean is: complements of Euclidean patterns. For example:

```haskell
euclid 3 8 = [1,0,0,1,0,0,1,0]  
euclid 5 8 = [1,0,1,1,0,1,1,0]

```

Since 3 + 5 = 8, we have eight 1 events in total (over both patterns).

Now: when we shift the second pattern to the left (one step)

```haskell
euclid 3 8 = [1,0,0,1,0,0,1,0] 
euclidOff 5 8 7 = [0,1,1,0,1,1,0,1]

```

then events are disjoint (and their union is the full set). Can you prove that this always works? E.g., formalized like this:

For each `0 <= k <= n`, there exists an offset `s` such that events in  
`euclid k n` and `euclidOff (n-k) n s` are disjoint?

I think one can construct an answer from the facts that 1. Euclidean (that is, evenly spaced) sequences are essentially unique (that is, up to rotation); and 2. that Bjorklund's algorithm does produce the lexicographically smallest such sequence (I assume this is well-known - but I can't access some paywalled papers).

[EDIT] "lex. smallest" - of all rotations that start with 1.

NB - current implementation [https://hackage.haskell.org/package/tidal-1.9.4/docs/src/Sound.Tidal.UI.html#\_euclid](https://hackage.haskell.org/package/tidal-1.9.4/docs/src/Sound.Tidal.UI.html#_euclid) computes the complementary pattern directly. The above exercise (if true) would give an alternate implementation.

---

<div class="post-metadata">

**Author:** ![jwaldmann](https://uzu.lurk.org/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jwaldmann](https://uzu.lurk.org/u/jwaldmann)\
**Post date:** [19 January 2024 17:15 UTC](https://uzu.lurk.org/t/non-euclidean-geometry/5050/2 "2024-01-19T17:15:42Z")

</div>

Yes, this is known, e.g., Emmanuel Amiot: David Lewin and maximally even sets, 2007, [https://doi.org/10.1080/17459730701654990](https://doi.org/10.1080/17459730701654990) , cited in Toussaint: Geometry of Musical Rhythm.
