|
| 1 | +# uzu notation |
| 2 | + |
| 3 | +[](https://alaineymarybelle.pages.dev/csgmiph-uzumaki-anime-release-date-2024-season-photos-qccivln/) |
| 4 | + |
| 5 | +.. or mondo notation, maxi notation ... |
| 6 | + |
| 7 | +we could use this document to collaborate on the fuzzy idea of a new/alternative/unifying notation for patterns. |
| 8 | + |
| 9 | +please feel free to edit any part of this document! |
| 10 | + |
| 11 | +## the scope of this document |
| 12 | + |
| 13 | +what even are we trying to discuss? |
| 14 | +i'm not sure yet, but let's work it out. |
| 15 | +some ideas: |
| 16 | + |
| 17 | +- how can a new tidal notation look like |
| 18 | +- how should we call it? |
| 19 | +- how can we unify the existing tidal dialects |
| 20 | +- how much should we unify? |
| 21 | +- what's the common ground of tidal dialects |
| 22 | +- do we need a "specification"? |
| 23 | + |
| 24 | +## names |
| 25 | + |
| 26 | +there was some discussion about finding a new name for the family of tidal-like languages. |
| 27 | +maybe this name would also be the name of the not-yet-existing, but potentially existing-sometime-in-the-future custom notation we're talking about here? |
| 28 | + |
| 29 | +- uzu https://skdesu.com/en/meaning/%E6%B8%A6-uzu/ |
| 30 | +- I quite like 'uzulang', as a bit of a hat tip to esolang and ixilang |
| 31 | +- ..? |
| 32 | + |
| 33 | +## family tree of uzulangs |
| 34 | + |
| 35 | +Languages that have most or all of: |
| 36 | +- patterns of pure functions of time(spans) |
| 37 | +- combinator library for transformating and combining patterns |
| 38 | +- mini-notation styled after Bol Processor's polymetric expressions |
| 39 | +- GPL compatibility? |
| 40 | +- the author(s) call it an uzulang |
| 41 | + |
| 42 | +Namely: |
| 43 | + |
| 44 | +- [tidal](https://github.com/tidalcycles/Tidal) |
| 45 | +- [vortex](https://github.com/tidalcycles/vortex) |
| 46 | +- [strudel](https://github.com/tidalcycles/strudel) |
| 47 | +- [web tidal](https://github.com/matthewkaney/web-tidal) |
| 48 | +- [zwirn](https://github.com/polymorphicengine/zwirn) |
| 49 | +- [modal](https://github.com/neo451/modal/wiki/Syntax) |
| 50 | +- ...? |
| 51 | + |
| 52 | +## links |
| 53 | + |
| 54 | +- [inter-innards channel](https://discord.com/channels/779427371270275082/1339566754946482287) |
| 55 | +- [mondo channel](https://discord.com/channels/779427371270275082/1309830817739968544) |
| 56 | +- [mondo repo](https://github.com/tidalcycles/mondo) |
| 57 | +- [idea: using ":" for function args](https://discord.com/channels/779427371270275082/1191011773311107153/1308376724840513566) |
| 58 | +- [maxi notation discussion on strudel github](https://github.com/tidalcycles/strudel/discussions/96) |
| 59 | +- [alex's uzumaki musings](https://doc.patternclub.org/87ZlbW8NSbWUrkzRRz0SjA?both#) |
| 60 | +- alignment of elements |
| 61 | + - [algorithmic pattern forum post](https://forum.algorithmicpattern.org/t/aligning-elements/492) |
| 62 | + - [GSOC project by Aravind Mohondas - Formalizing Konnakol](https://dev.to/aravindmohandas/formalizing-konnakol-using-haskell-gsoc-22-ekm) |
| 63 | +- [stepwise patterning in strudel](https://strudel.cc/learn/stepwise/) |
| 64 | +- [Bol Processor polymetric expressions](https://bolprocessor.org/misc/docs/bp2-Polymet.html) |
| 65 | +- [Laurie Spiegel - manipulations of musical patterns](https://www.researchgate.net/publication/266316606_Manipulations_of_Musical_Patterns) |
| 66 | + |
| 67 | +## problem zoo |
| 68 | + |
| 69 | +- Generally in programming languages you have an operator that stands for what something does. In Uzus we also want to notate how the arguments are aligned. This creates a bit of a explosion of possibilities. For example [the retired tidal 2.0 branch](https://github.com/tidalcycles/Tidal/blob/2.0-beatmode-retired/src/Sound/Tidal/Compose.hs) ended up with operators like `||.||.` and `||>=`. We need to find some nice way of notating both the 'how' and 'what'.. (In strudel those would be something like `bor.squeeze` and `gte.squeeze` respectively, which isn't that bad) |
| 70 | +- In workshops, people often try and write somethind like the mondo/uzu notation while trying to learn tidal or strudel. It would be nice if it worked. |
| 71 | +- patterning functions is possible in uzulangs like tidal and strudel, but underexplored. Patterns of functions should be first class citizens! |
| 72 | +- functions like `ply` have nice definitions: `_ply n pat = squeezeJoin $ _fast n . pure <$> pat`. We could probably find useful functions just by exploring all the combinations of all the different joins and the elementary transformations. So making joins/binds more readily notable might make a lot of new functionality obvious that we can then give names. |
| 73 | + |
| 74 | +## ideas |
| 75 | + |
| 76 | +### mini notation features everywhere |
| 77 | + |
| 78 | +the new notation could allow using mini notation syntax anywhere in the pattern, so there would be a single DSL that combines the terse mini notation with the expressiveness of a general purpose programming language like haskell / javascript / etc.. |
| 79 | + |
| 80 | +- does this mean we try to get rid of "classic" mini notation in the long run? |
| 81 | + |
| 82 | +### a simple ast as the common ground |
| 83 | + |
| 84 | +the common ground between different dialects could be a specification of functions that can be composed together. any dialect could then produce such an ast that can be evaluated / interpreted by this set of functions to create a pattern. |
| 85 | +the composable functions could have a set of tests that ensure they work the same across implementations |
| 86 | +examples of such functions: |
| 87 | + |
| 88 | +- fast :: Pattern Time -> Pattern a -> Pattern a |
| 89 | +- ply :: Pattern Int -> Pattern a -> Pattern a |
| 90 | +- s:: Pattern String -> Pattern ? |
| 91 | + |
| 92 | +the ast itself could be stringified to something that looks similar to a lisp: |
| 93 | + |
| 94 | +`(fast 2 (s "bd sd"))` |
| 95 | + |
| 96 | +(the structure could of course be expressed in different formats, s-expressions are just one way) |
| 97 | + |
| 98 | +Multiple input languages could produce this ast, for example: |
| 99 | + |
| 100 | +`s("bd sd").fast(2)` |
| 101 | + |
| 102 | +`fast 2 $ s "bd sd"` |
| 103 | + |
| 104 | +`s "bd sd" > fast 2` |
| 105 | + |
| 106 | + |
| 107 | +explorations: |
| 108 | + |
| 109 | +- [web tidal](https://github.com/matthewkaney/web-tidal) parses haskell style tidal |
| 110 | +- [zwirn](https://github.com/polymorphicengine/zwirn) allows mini notation features everywhere |
| 111 | +- [zilp](https://github.com/felixroos/zilp) allows composing functions with pipes (same order as strudel) |
| 112 | + |
| 113 | +### running tests across implementations |
| 114 | + |
| 115 | +It would be nice to do a kind of test-driven development of multiple implementations. |
| 116 | + |
| 117 | +the specification tests could look like this: |
| 118 | + |
| 119 | +``` |
| 120 | +(fast 2 (seq a b)) |
| 121 | +
|
| 122 | +[ 0/1 → 1/4 | a ] |
| 123 | +[ 1/4 → 2/4 | b ] |
| 124 | +[ 2/4 → 3/4 | a ] |
| 125 | +[ 3/4 → 4/4 | b ] |
| 126 | +``` |
| 127 | + |
| 128 | +here, the first block would be the pattern, expressed as an s-expression, while the second block is the first cycle (or more) of the queried pattern. the syntax for the second block is used like this in the strudel snapshot tests, e.g. [examples.test.mjs.snap](https://raw.githubusercontent.com/tidalcycles/strudel/aabc82bedd0370fa5cf6b616b1340d32b153cea8/test/__snapshots__/examples.test.mjs.snap) |
| 129 | + |
| 130 | +these tests could be parsed and evaluated by any implementation |
| 131 | + |
| 132 | +a simpler and probably more robust approach would be to only declare equivalent patterns (skipping the literal event notation): |
| 133 | + |
| 134 | +``` |
| 135 | +(fast 2 (seq a b)) |
| 136 | +(seq a b a b) |
| 137 | +``` |
| 138 | + |
| 139 | +Note that the above test would fail in a stepcount-aware uzulang, but this would pass: |
| 140 | + |
| 141 | +``` |
| 142 | +(extend 2 (seq a b)) |
| 143 | +(seq a b a b) |
| 144 | +``` |
| 145 | + |
| 146 | +It could be nice to categorise or tag tests with features. In the above example, uzulangs that implement stepwise patterning should fail the first test, but pass the second one. |
| 147 | + |
| 148 | +<details> |
| 149 | + <summary>dialogue about this</summary> |
| 150 | + |
| 151 | +One problem with this is that tidal/strudel also has event fragments. Could add another timespan, but some implementations mind not deal with them. They could just ignore the original/whole timespan though. |
| 152 | + |
| 153 | + |
| 154 | +yes.. i think there's also a notation for that iirc |
| 155 | + |
| 156 | +An alternative or additional approach could just be having a way to supply two patterns that are equivalent. E.g. in the above it could be |
| 157 | + |
| 158 | +(fast 2 (seq a b)) |
| 159 | +(seq a b a b) |
| 160 | + |
| 161 | + |
| 162 | +yep thats an interesting idea. i wonder if some things might be hard to test this way, but maybe not |
| 163 | + |
| 164 | +In some cases I think it would just make the tests more robust.. For some things we might fundamentally change something but the test would still work as it would represent a basic assumption rather than a particular input/output. |
| 165 | + |
| 166 | + |
| 167 | +it would also be a lot easier to implement on the language side. parsing a lisp is very easy + no need to parse the custom event syntax |
| 168 | + |
| 169 | +shall we keep this as a dialogue or digest it back into an idea |
| 170 | + |
| 171 | +maybe we use summary tags for this, let me test |
| 172 | + |
| 173 | +I thought you were going to suggest chatgpt then |
| 174 | + |
| 175 | +haha no just html |
| 176 | + |
| 177 | +</details> |
0 commit comments