Moontide manual Contents

How it works

This page is for the curious reader. It shows the pieces of Moontide, how they talk to each other, what each tool does, and why it is built this way. You do not need any of it to make music.

Why Moontide exists

Moontide is a personal project, made out of curiosity: how far can an AI assistant go at making real music, not a technical demo, when it is given a good instrument? Strudel is that instrument. It is a live-coding language where a change lands on the next cycle with no cut, and where the music is plain text that both Claude and you can read. So Claude writes the code, and the code stays on screen while it plays.

Moontide does not start from scratch. The music engine is Strudel, the JavaScript port of TidalCycles. Moontide is the bridge between Claude and a Strudel page.

The pieces

 you --talk--> Claude --MCP over stdio--> Moontide server --WebSocket on localhost--> browser page
                                              |                                      Strudel plays the
                                              +-- history file on your disk          code: sound and
                                                                                     Web MIDI out

The server listens on 127.0.0.1 only. The page Network, privacy, credits and license, at the end of this manual, says what leaves your computer.

How a change travels

  1. You ask. Claude writes Strudel code and sends it with a tool.
  2. The server checks it, keeps it in the history, and sends it to the page.
  3. The page evaluates it and the new code takes over on the next cycle, without a cut. If you asked for a change on a bar or phrase line, it waits for the line (see Tempo ramps and Asking Claude).
  4. If the code cannot play, the previous music keeps playing, the page shows a banner, and Claude is told the real reason.

The other direction works too. A right-click in the page sends Claude a request with the context of what you pointed at. Requests reach Claude through a small listener that Claude runs, which wakes it on each request, or they wait and arrive with Claude's next action in Moontide (see Asking from the page).

Why it is built this way

The numbers behind some of these choices are on What was measured.

The tools

Claude has these tools. Each one is listed by its name.

The prompts

Where your Claude offers MCP prompts, three of them are ready to use. In Claude Code they look like this:

There is no prompt for music itself. A prompt's text would steer Claude's taste, so a surprise is asked for in plain words. The tool set_page_requests does the same as the two page-request prompts, for clients that do not offer prompts.

What was verified

Verified:

  • The tool list on this page is checked against the tools the running server offers, in a test, at each change. So is every tool, prompt, topic and number this manual names.
  • The path of a change, the refusals and the history are covered by automated tests, and a drive of the real page in headless Chrome checks the page.

Not verified:

  • That the reasons given here hold up for other uses than the one Moontide was made for.
  • That the page and the server behave the same on Windows and Linux; nobody has played music there yet.