Introducing Xi, moonscript/lua port of Tidal

Hey, there, Tidal community, here is a little something to try out, it is a moonscript port of Tidal.

You can find it here: GitHub - noearc/xi: moonscript port of tidal

moonscript is a very beautiful language that I discovered when I was writting the parser for Tranquility: Tidalcycles in Lua, the pure lua port.

I was very excited about that project' future, I mean lua runs everywhere, and a lua port seems to be the answer to run Tidal everywhere.

But it is a language that is very minimalisitic in design, so it does not play well with very functional ideas, making code base very verbose. Plus heavily nested code is bad for performance.

So moonscript came to the rescue! It compiles to lua, and has lots of cool language features good for both the source code and user code.

here is a little taste of the user code, it is actually in a moonscript dialect with pipe operaters, called yuescript. (not very important, will be replace in the future)

note scale "ritusen", "[0|0|1] <4(3,8)/2 5(5,8)/3 8(3,9)/2>"
  |> apply s"superpiano", _
  |> jux rev, _
  |> apply vowel"<a e i o u>", _
  |> apply room"<0.1!!!! 0.5>", _
  |> apply delay"<0.1 0.2 0.4 0.8>", _
  |> degradeBy 0.2, _
  |> d2

In terms of functionality, I took about three weeks by now and ported at least 60% of the tidal components: most of the mini-notation , most of the core functions, some common transformations, chords, scales and control patterns ...

Although everything still is very shaky and unstable, It has reached the stage where I can play around with it in a quick and dirty neovim plugin I wrote, and it continue to surprise me with its possibilities.

So I just want to drop this to get some feedback, this is very much a last second decision before going to bed, so the docs might not be complete to get everyone started, tell me if you have any problems!

ps: the name Xi comes from 汐 from Chinese, means the evening tides, since lua is Brazilian name for moon, and the user code parser that I used was written by a Chinese as well, yuescript, has 月(yue)in it (guess what, it also means the moon lol). Hence the name :smiley:

5 Likes