moontide-mcp 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -383
- package/dist/ask.js +12 -4
- package/dist/catalog.js +118 -9
- package/dist/instruments.js +83 -9
- package/dist/mcp.js +3 -3
- package/dist/midi-state.js +43 -1
- package/dist/protocol.js +80 -3
- package/dist/reference.js +12 -0
- package/dist/vocabulary.js +420 -0
- package/package.json +3 -2
- package/page/ask-view.js +77 -2
- package/page/ask.js +57 -4
- package/page/bar-model.js +1 -0
- package/page/index.html +2 -0
- package/page/instruments-model.js +50 -3
- package/page/instruments-view.js +14 -2
- package/page/main.js +348 -7
- package/page/midi-in.js +407 -0
- package/page/midi-out.js +552 -46
- package/page/midi-plan.js +42 -6
- package/page/midi-rig.js +286 -13
- package/page/midi-settings.js +507 -0
- package/page/played-buffer.js +208 -0
- package/page/scratch-gesture.js +239 -0
- package/page/scratch-listen.js +260 -0
- package/page/scratch-model.js +1696 -0
- package/page/scratch-view.js +2176 -0
- package/page/style.css +842 -0
- package/page/views.js +5 -5
- package/reference/midi.md +2 -0
- package/reference/motif.md +83 -0
- package/reference/settings.md +161 -0
package/README.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
> The moon guides the tide.
|
|
4
4
|
|
|
5
|
+
**Early:** Moontide is young and has known bugs, and its Scratchpad is early experimental (see the
|
|
6
|
+
[known limits](https://konni-arcadia.github.io/moontide/troubleshooting.html#known-limits)).
|
|
7
|
+
|
|
5
8
|
**A hobby project: Claude plays live music for you. Describe a mood, a theme or an idea, and
|
|
6
9
|
Claude writes [Strudel](https://strudel.cc) code that plays in your browser and changes without
|
|
7
10
|
ever stopping.**
|
|
@@ -20,389 +23,74 @@ written by an AI coding assistant working under my direction. I set the goals, l
|
|
|
20
23
|
every change, tried it on my own instruments, judged the results by ear, and made the
|
|
21
24
|
decisions. I am responsible for what is here, errors included.
|
|
22
25
|
|
|
23
|
-
## Why
|
|
24
|
-
|
|
25
|
-
Curiosity. I wanted to see how far an AI assistant can go at making real music, not a
|
|
26
|
-
technical demo, when it is given a good instrument. Strudel is that instrument: a live-coding
|
|
27
|
-
language where a change lands on the next cycle, with no cut, and where the music is plain text
|
|
28
|
-
that both of us can read.
|
|
29
|
-
|
|
30
|
-
So Claude writes the code, and the code stays on screen while it plays. You can watch it, edit
|
|
31
|
-
it by hand, go back to any earlier version, or point at something in the page and ask for a
|
|
32
|
-
change.
|
|
33
|
-
|
|
34
26
|
## What it does
|
|
35
27
|
|
|
36
28
|
- You talk ("start something dreamy in D minor", "darker", "add a bass"). Claude writes
|
|
37
|
-
Strudel code, and a browser page plays it at once
|
|
38
|
-
of a second, without stopping the music.
|
|
29
|
+
Strudel code, and a browser page plays it at once, without stopping the music.
|
|
39
30
|
- The code is always visible and editable. Every version that played is kept, and Claude can
|
|
40
31
|
bring any of them back.
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
the scale on a piano or a guitar. When the notes fit several scales, the jam view proposes
|
|
45
|
-
one and says why.
|
|
32
|
+
- The page shows the music in several views: a timeline of named tracks where you can edit
|
|
33
|
+
notes, a Song grid, the history, a mixer and a jam view with the scale on a piano or a guitar.
|
|
34
|
+
- A right-click on anything in the page sends Claude a request with that context.
|
|
46
35
|
- Claude can move the tempo up or down over a number of bars, instead of jumping.
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
- The same code can play real MIDI instruments from the page, and a
|
|
37
|
+
[Scratchpad](https://konni-arcadia.github.io/moontide/scratchpad.html) (early experimental) lets you draw or play in a motif and send
|
|
38
|
+
it to Claude.
|
|
39
|
+
- On an instrument whose model describes them, Claude can set tone, part and scene
|
|
40
|
+
[settings](https://konni-arcadia.github.io/moontide/synth-settings.html) that no program change carries, written in the code like a sound
|
|
41
|
+
or a control. Moontide stores none of them. The models that describe settings are files of your own;
|
|
42
|
+
none ships with Moontide.
|
|
50
43
|
|
|
51
44
|
Moontide does not start from scratch. The music engine is
|
|
52
45
|
**[Strudel](https://strudel.cc)**, the JavaScript port of TidalCycles by Felix Roos, Alex McLean and the
|
|
53
46
|
Strudel contributors. Moontide is the bridge between Claude and a Strudel page.
|
|
54
47
|
|
|
55
|
-
## How it works
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
you ──talk──► Claude ──MCP (stdio)──► Moontide ──WebSocket (localhost)──► browser page
|
|
59
|
-
│ Strudel plays
|
|
60
|
-
└─ history file on your disk the code, sound
|
|
61
|
-
and Web MIDI out
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
1. Moontide runs as an MCP server that Claude connects to. It starts nothing until you ask
|
|
65
|
-
for music or say "start Moontide".
|
|
66
|
-
2. It then opens a page in your browser with a Strudel editor.
|
|
67
|
-
3. Claude writes the code, the page plays it, and you watch the code come alive.
|
|
68
|
-
4. Claude can stop the music at any point. The page has its own Play and Stop button too.
|
|
69
|
-
5. Right-click anything in the page to ask Claude about it. A right-click on the Timeline also
|
|
70
|
-
sends the moment under the pointer: the cycle and the beat, the version that was playing, and
|
|
71
|
-
the notes sounding there or starting in the same sixteenth, with their velocities and, for a
|
|
72
|
-
MIDI track, its instrument and channel. The Session drawer (the Session button in the top
|
|
73
|
-
bar) says whether page requests are live (they reach Claude right away) or wait for Claude
|
|
74
|
-
(they reach it with its next action). Its (i) explains how to switch.
|
|
75
|
-
|
|
76
|
-
The **Requests** button in the top bar counts the requests still in flight and opens a list:
|
|
77
|
-
one row per request, with what happened to it and how long ago. A request reads Sent, then
|
|
78
|
-
Waiting for Claude's next action or Received, then Claude has started on it, which means
|
|
79
|
-
Claude made a call after the request arrived. A change made for it reads Waiting for its
|
|
80
|
-
line while it waits for the next bar or phrase, then Applied as v12 (the version in the
|
|
81
|
-
History view); a change that failed reads Failed with the error, and one that a newer change
|
|
82
|
-
replaced or Stop canceled says so. A request Claude answers in words reads Answered or
|
|
83
|
-
Declined, with Claude's sentence. A request shows as applied only when Claude names it with
|
|
84
|
-
its change, never from timing alone. After 30 seconds without news a row reads No change yet
|
|
85
|
-
and keeps counting: that is not a failure. If the page loses its connection, open rows read
|
|
86
|
-
Connection lost. Click a row to see the whole request and what its
|
|
87
|
-
state means. Finished rows move to a short Recent list after 30 seconds. Nothing is kept
|
|
88
|
-
after the Moontide server stops.
|
|
89
|
-
|
|
90
48
|
## Install
|
|
91
49
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
claude mcp add --scope user moontide -- npx -y moontide-mcp
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Then start a new Claude session and ask for music. The steps below explain each part.
|
|
99
|
-
|
|
100
|
-
### 1. What you need
|
|
101
|
-
|
|
102
|
-
- **Node 22 or later**, with npm and npx (they come with Node).
|
|
103
|
-
- **Claude Code or Claude Desktop.** Moontide is an MCP server: Claude talks to it.
|
|
104
|
-
- **Chrome**, the browser Moontide was tried with. For MIDI (Web MIDI), use Chrome or Edge.
|
|
105
|
-
- **Internet access**: Strudel and its sounds load from the web.
|
|
106
|
-
- **Speakers or headphones.**
|
|
107
|
-
|
|
108
|
-
### 2. Check Node
|
|
109
|
-
|
|
110
|
-
In a terminal, run:
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
node --version
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
It must print `v22` or higher. If Node is missing or older, install the LTS version from
|
|
117
|
-
[nodejs.org](https://nodejs.org). On macOS with Homebrew, `brew install node` works too. Open a
|
|
118
|
-
new terminal afterwards and check again.
|
|
119
|
-
|
|
120
|
-
### 3. Get Claude
|
|
121
|
-
|
|
122
|
-
Install Claude Code or Claude Desktop from [claude.com](https://claude.com/claude-code) and sign
|
|
123
|
-
in once. Moontide works with either; Claude Code is the one tried most.
|
|
124
|
-
|
|
125
|
-
### 4. Add Moontide to Claude
|
|
126
|
-
|
|
127
|
-
<details open>
|
|
128
|
-
<summary>Claude Code (tested on macOS; Linux untested)</summary>
|
|
129
|
-
|
|
130
|
-
In a terminal, run:
|
|
50
|
+
What you need: **Node 22 or later**, **Claude Code or Claude Desktop**, **Chrome** (Chrome or Edge
|
|
51
|
+
for MIDI), internet access (Strudel and its sounds load from the web), and speakers or headphones.
|
|
131
52
|
|
|
132
53
|
```bash
|
|
133
54
|
claude mcp add --scope user moontide -- npx -y moontide-mcp
|
|
134
55
|
```
|
|
135
56
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
Keep the name `moontide`. The page-request commands below use it.
|
|
141
|
-
|
|
142
|
-
Check the install with:
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
claude mcp get moontide
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
The same line is meant for Linux. It is untested there.
|
|
149
|
-
|
|
150
|
-
</details>
|
|
151
|
-
|
|
152
|
-
<details>
|
|
153
|
-
<summary>Claude Desktop (tested on macOS; Windows untested)</summary>
|
|
154
|
-
|
|
155
|
-
Open Settings, then Developer, then Edit Config. The file is:
|
|
156
|
-
|
|
157
|
-
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
158
|
-
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
159
|
-
|
|
160
|
-
Add Moontide to it:
|
|
161
|
-
|
|
162
|
-
```json
|
|
163
|
-
{
|
|
164
|
-
"mcpServers": {
|
|
165
|
-
"moontide": {
|
|
166
|
-
"command": "npx",
|
|
167
|
-
"args": ["-y", "moontide-mcp"]
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
If the file already has an `mcpServers` block, add the `moontide` entry inside it. Quit Claude
|
|
174
|
-
Desktop fully and start it again. Claude Desktop has no Linux version.
|
|
175
|
-
|
|
176
|
-
</details>
|
|
177
|
-
|
|
178
|
-
<details>
|
|
179
|
-
<summary>Windows with Claude Code (untested)</summary>
|
|
180
|
-
|
|
181
|
-
From PowerShell or Command Prompt (not Git Bash), run:
|
|
182
|
-
|
|
183
|
-
```bash
|
|
184
|
-
claude mcp add --scope user moontide -- cmd /c npx -y moontide-mcp
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
Check it with `claude mcp get moontide`. The command must read `cmd` with `/c npx -y moontide-mcp`. If it shows `C:/` instead of `/c`, edit the `moontide` entry in the `.claude.json` file of your user folder so it reads `"command": "cmd", "args": ["/c", "npx", "-y", "moontide-mcp"]`.
|
|
188
|
-
|
|
189
|
-
This form comes from community reports. It has not been tried here.
|
|
190
|
-
|
|
191
|
-
</details>
|
|
57
|
+
Then start a new Claude session and ask for music. Claude Desktop, Windows, running from the
|
|
58
|
+
source code, updating and uninstalling are on the manual's
|
|
59
|
+
[Install page](https://konni-arcadia.github.io/moontide/install.html).
|
|
192
60
|
|
|
193
|
-
|
|
194
|
-
<summary>From the source code</summary>
|
|
195
|
-
|
|
196
|
-
To run Moontide from a copy of this repository instead of npm:
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
git clone https://github.com/konni-arcadia/moontide.git
|
|
200
|
-
cd moontide
|
|
201
|
-
npm ci
|
|
202
|
-
npm run build
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
Then add it with the full path of `dist/index.js`, written here as `<folder>`:
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
claude mcp add --scope user moontide -- node <folder>/dist/index.js
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
`npm test` runs the test suite. The real-browser checks (`npm run probe:page`) need Chrome.
|
|
212
|
-
|
|
213
|
-
</details>
|
|
214
|
-
|
|
215
|
-
### 5. First music
|
|
61
|
+
## First music
|
|
216
62
|
|
|
217
63
|
1. Start a new Claude session. Nothing opens yet: Moontide waits until you want it.
|
|
218
|
-
2. Ask for music, for example "Play something calm to start the day"
|
|
219
|
-
groove". Or say "start Moontide". In Claude Code, `/mcp__moontide__start` does the same.
|
|
64
|
+
2. Ask for music, for example "Play something calm to start the day". Or say "start Moontide".
|
|
220
65
|
3. The page opens in a new tab at http://localhost:5757, or on another port when 5757 is busy.
|
|
221
|
-
Claude's replies name the address. The tab title names the folder Claude runs in and the
|
|
222
|
-
port, for example "Moontide · my-project · 5757".
|
|
223
66
|
4. Click once anywhere in the page. Browsers start sound only after a click.
|
|
224
67
|
5. Ask for changes: "darker", "add a bass", "slower".
|
|
225
68
|
|
|
226
|
-
|
|
227
|
-
address from Claude's reply yourself.
|
|
228
|
-
|
|
229
|
-
### Update
|
|
230
|
-
|
|
231
|
-
To see the version that runs, run `npx -y moontide-mcp --version`. Releases are listed in
|
|
232
|
-
[CHANGELOG.md](https://github.com/konni-arcadia/moontide/blob/main/CHANGELOG.md). npx can keep
|
|
233
|
-
using a copy it already downloaded; to move to the newest release, add Moontide again with
|
|
234
|
-
`@latest`:
|
|
235
|
-
|
|
236
|
-
```bash
|
|
237
|
-
claude mcp remove moontide --scope user
|
|
238
|
-
claude mcp add --scope user moontide -- npx -y moontide-mcp@latest
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
### Uninstall
|
|
242
|
-
|
|
243
|
-
```bash
|
|
244
|
-
claude mcp remove moontide --scope user
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
In Claude Desktop, remove the `moontide` entry from the config file and restart it. Moontide
|
|
248
|
-
keeps its history and settings in your data folder (see History); delete that folder if you
|
|
249
|
-
want them gone too.
|
|
250
|
-
|
|
251
|
-
### MIDI instruments (optional)
|
|
252
|
-
|
|
253
|
-
Moontide can play MIDI instruments from the code through Web MIDI. It ships ready models for the
|
|
254
|
-
Roland MT-32 and SC-55. You can describe your own instruments and models, add sound catalogs and
|
|
255
|
-
send MIDI clock. The setup is in
|
|
256
|
-
[docs/midi.md](https://github.com/konni-arcadia/moontide/blob/main/docs/midi.md).
|
|
257
|
-
|
|
258
|
-
## Page requests without a permission prompt
|
|
259
|
-
|
|
260
|
-
In the Code tab of the Claude app, ask Claude to turn page requests on or off. Claude calls
|
|
261
|
-
Moontide's `set_page_requests` tool. In Claude Code in a terminal, type
|
|
262
|
-
`/mcp__moontide__page-requests-on` to make them live or `/mcp__moontide__page-requests-off` to
|
|
263
|
-
make them wait. Live, Claude starts a monitor, which lasts at most 30 minutes and is started
|
|
264
|
-
again when a tool reply asks. Waiting, tool replies stop offering to start it until page
|
|
265
|
-
requests are turned on again. Page requests need an open page, so start Moontide first. These
|
|
266
|
-
names assume the server was added as `moontide`.
|
|
267
|
-
|
|
268
|
-
Claude Code asks permission before it starts the monitor for page requests, because it runs a
|
|
269
|
-
command. You can approve it each time. If you want a narrower permission rule instead, see the
|
|
270
|
-
permissions section of the Claude Code documentation. Do not allow broad `node` commands.
|
|
271
|
-
|
|
272
|
-
## Musical reference
|
|
273
|
-
|
|
274
|
-
Claude gets a factual reference of the exact Strudel version the page runs, through the
|
|
275
|
-
`get_strudel_reference` tool (also offered as MCP resources), covering nine topics: Strudel
|
|
276
|
-
vs TidalCycles, mini-notation, pattern functions, effects and sound controls, the sound
|
|
277
|
-
palette, music theory in Strudel, transitions, song structure, and MIDI output. It holds facts only: what
|
|
278
|
-
exists and how to write it. Moontide ships no mood vocabulary, no style material and no model
|
|
279
|
-
pieces; Claude translates your words with its own knowledge of music theory, then tells you in
|
|
280
|
-
one line what it chose. Ask for a surprise in your own words: there is no menu command for it.
|
|
281
|
-
Set a frame for the session, for example gradual changes, and Claude follows it for every
|
|
282
|
-
change until you lift it. Say what matters to you (a melody, a rhythm) and Claude keeps it,
|
|
283
|
-
and asks before a full rewrite.
|
|
284
|
-
|
|
285
|
-
## Small edits and harmony
|
|
286
|
-
|
|
287
|
-
Claude can change a few lines of a long piece without sending it again, through the
|
|
288
|
-
`edit_code` tool; a change that waits for its bar is edited, and your hand edits are kept.
|
|
289
|
-
|
|
290
|
-
The code can say which harmony it means with one top-level line, for example
|
|
291
|
-
`const harmony = 'C:minor'`, placed above the patterns. It plays nothing and is never a
|
|
292
|
-
track. The Jam view then shows two lines, "Declared:" and "Heard:", side by side.
|
|
293
|
-
|
|
294
|
-
When the notes fit several scales, the Jam view proposes one and says why in a sentence, for
|
|
295
|
-
example "Proposed: C major, C is the note heard most." It takes the declared scale of the playing
|
|
296
|
-
section when that scale is among the ones that fit, and otherwise the scale the notes support
|
|
297
|
-
most. Warnings stay on. "Scales that fit, click to switch:" lists them, and one click or Enter
|
|
298
|
-
switches the whole view. Your pick holds while the same scales fit, and is forgotten on reload.
|
|
299
|
-
When the scales differ in their notes and the code declares none of them, warnings are off: the
|
|
300
|
-
view says why and lists the scales without a switch. The piano is coloured like the guitar, with
|
|
301
|
-
the same legend, and every role also has a shape or text cue, so it reads without colour.
|
|
302
|
-
|
|
303
|
-
## Song structure
|
|
304
|
-
|
|
305
|
-
Every new piece Claude writes starts with one `const song` at the top. It names the sections
|
|
306
|
-
with their lengths in cycles, says which version (variation) of each track plays in each section
|
|
307
|
-
or that the track rests, and may put tracks into groups. It is still ordinary Strudel, and the
|
|
308
|
-
same code plays in plain Strudel. A small request on an older piece is made in place and does not
|
|
309
|
-
restructure it. A piece without a song plays and looks as before.
|
|
310
|
-
|
|
311
|
-
For a piece with a song, the Parts view is called **Song**. The Song grid shows the tracks under
|
|
312
|
-
foldable groups, with one column per section and the playing section marked.
|
|
313
|
-
|
|
314
|
-
- Click a section header to launch that section on the next line the toolbar names: the end of
|
|
315
|
-
the playing section, the next phrase or the next bar. Click again to cancel.
|
|
316
|
-
- Click a cell to pick another variation for that track and section, or a rest. It takes over
|
|
317
|
-
with your usual hand-edit timing.
|
|
318
|
-
- A fixed variation says whether its notes fit the section's harmony: fits, does not fit, or
|
|
319
|
-
cannot check. It only says; it never blocks.
|
|
320
|
-
- Play after Stop starts from the first section. The Jam view's Declared line follows the
|
|
321
|
-
playing section.
|
|
69
|
+
More in [First music](https://konni-arcadia.github.io/moontide/first-music.html).
|
|
322
70
|
|
|
323
|
-
The
|
|
324
|
-
group's M or S mutes or solos every track below it, as one change. There is no group fader,
|
|
325
|
-
because plain Strudel has no gain for a group. A small light on each strip and each group blinks
|
|
326
|
-
when its note is heard. With motion off in the Session drawer, a light stays lit while notes come.
|
|
71
|
+
## The manual
|
|
327
72
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
Two buttons change its velocity by a tenth. The page checks an edit before it writes it, says
|
|
331
|
-
first when one edit changes the note in several places, and uses your hand-edit timing. A note
|
|
332
|
-
the page cannot edit says why. Your gesture then opens the Ask box with a ready-made request,
|
|
333
|
-
and it goes to Claude only when you press Enter. Drag across one lane, or hold Shift and press
|
|
334
|
-
Left or Right, to select a range of whole cycles, and use "Ask Claude" to send it.
|
|
73
|
+
The manual is at [https://konni-arcadia.github.io/moontide/](https://konni-arcadia.github.io/moontide/). It is written in plain words,
|
|
74
|
+
and every page ends with a box that says what was checked and what was not.
|
|
335
75
|
|
|
336
|
-
|
|
76
|
+
- Getting started: [Install](https://konni-arcadia.github.io/moontide/install.html),
|
|
77
|
+
[First music](https://konni-arcadia.github.io/moontide/first-music.html) and
|
|
78
|
+
[the page and its views](https://konni-arcadia.github.io/moontide/the-page.html).
|
|
79
|
+
- Working with Claude: [asking Claude](https://konni-arcadia.github.io/moontide/asking-claude.html),
|
|
80
|
+
requests from the page, small edits, song structure, tempo ramps and history.
|
|
81
|
+
- MIDI gear: [instruments and the setup file](https://konni-arcadia.github.io/moontide/midi-instruments.html),
|
|
82
|
+
[sounds and catalogs](https://konni-arcadia.github.io/moontide/midi-sounds.html),
|
|
83
|
+
[tone, part and scene settings](https://konni-arcadia.github.io/moontide/synth-settings.html),
|
|
84
|
+
[the Scratchpad](https://konni-arcadia.github.io/moontide/scratchpad.html),
|
|
85
|
+
[keyboard input](https://konni-arcadia.github.io/moontide/keyboard-input.html) and
|
|
86
|
+
[sending a motif](https://konni-arcadia.github.io/moontide/sending-a-motif.html).
|
|
87
|
+
- Troubleshooting: [problems and known limits](https://konni-arcadia.github.io/moontide/troubleshooting.html).
|
|
88
|
+
- How it works: [the pieces and the tools](https://konni-arcadia.github.io/moontide/how-it-works.html),
|
|
89
|
+
what was measured, and
|
|
90
|
+
[network, privacy, credits and license](https://konni-arcadia.github.io/moontide/privacy-and-credits.html).
|
|
337
91
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
Ask Claude to speed up or slow down over a number of bars, for example "bring it up to 140 over
|
|
341
|
-
eight bars". Claude sends the new code with the tempo to reach and `glideBars`, a whole number
|
|
342
|
-
of bars from 1 to 64, on `set_code` or `edit_code`. The tempo then moves from the tempo that
|
|
343
|
-
plays to the one in the code in equal small steps, and ends exactly on it. It starts at once, or
|
|
344
|
-
at the line when the change waits for the next bar or phrase.
|
|
345
|
-
|
|
346
|
-
While it runs, the tempo in the top bar shows the live tempo, an arrow and the tempo to reach.
|
|
347
|
-
Hover it to see how many bars are left.
|
|
348
|
-
|
|
349
|
-
Your Mixer moves, Song grid cells, Timeline edits and hand edits keep the ramp going. Code with
|
|
350
|
-
another tempo cancels it, and that tempo plays at once. Code with no tempo cancels it, and the
|
|
351
|
-
tempo stays where it was. A new `glideBars` replaces it. Stop cancels it too, and the next Play
|
|
352
|
-
starts at the code's tempo. A reload, or another tab taking over, ends it. There is no cancel
|
|
353
|
-
button of its own.
|
|
354
|
-
|
|
355
|
-
A ramp is refused, and nothing changes, when nothing plays, when the code sets no tempo, or when
|
|
356
|
-
it sets the tempo that already plays. A ramp is never a version: it writes nothing into the code
|
|
357
|
-
or the history.
|
|
358
|
-
|
|
359
|
-
The MIDI clock follows every step of a ramp. How hardware that follows the clock, such as an
|
|
360
|
-
arpeggiator or a step sequencer, reacts to a ramp has not been verified.
|
|
361
|
-
|
|
362
|
-
## History
|
|
363
|
-
|
|
364
|
-
Every version that plays is kept: Claude's own changes and your Ctrl+Enter edits, each with
|
|
365
|
-
its time, who made it and a short label. Failed code and stops are not versions.
|
|
366
|
-
|
|
367
|
-
Ask Claude things like "go back to the previous version", "the one from 3 changes ago", "the
|
|
368
|
-
one with the bass", or "keep this one, call it Take two", and "list my favorites". The
|
|
369
|
-
Session drawer shows the number of the version that is playing, in its Last change card, for
|
|
370
|
-
example `v42`.
|
|
371
|
-
|
|
372
|
-
The history file lives in your OS's per-user data folder:
|
|
373
|
-
|
|
374
|
-
- macOS: `~/Library/Application Support/moontide/history.jsonl`
|
|
375
|
-
- Linux: `$XDG_DATA_HOME/moontide/history.jsonl`, or `~/.local/share/moontide/history.jsonl`
|
|
376
|
-
- Windows: `%APPDATA%\moontide\history.jsonl`
|
|
377
|
-
|
|
378
|
-
Set `MOONTIDE_DATA_DIR` to use another folder. The history is one text file with one entry
|
|
379
|
-
per line, and survives the end of the Claude session.
|
|
380
|
-
|
|
381
|
-
The history keeps the last 1000 versions; older ones are dropped in batches and Claude is
|
|
382
|
-
told. Favorites are never dropped.
|
|
383
|
-
|
|
384
|
-
If a line of the file cannot be read, Claude is told which lines; they stay in the file
|
|
385
|
-
untouched. If the file cannot be read or written at all, the music keeps working and Claude
|
|
386
|
-
is told.
|
|
387
|
-
|
|
388
|
-
Run one Moontide at a time with the same history file. Two at once can give two versions the
|
|
389
|
-
same number.
|
|
390
|
-
|
|
391
|
-
## Troubleshooting
|
|
392
|
-
|
|
393
|
-
**"Failed to connect" right after installing.** The first start downloads the package, and Claude Code gives up after 30 seconds. Wait a little and check again with `claude mcp list`. If it keeps failing, start Claude Code with a longer limit: `MCP_TIMEOUT=60000 claude`. In PowerShell, use `$env:MCP_TIMEOUT = "60000"; claude`.
|
|
394
|
-
|
|
395
|
-
**Moontide is missing in another folder.** It was added without `--scope user`. Add it again with the Install line.
|
|
396
|
-
|
|
397
|
-
**The page did not open.** Claude's replies name its address. Open it yourself, or ask Claude to start Moontide again: it gives the address and opens a new tab when no page is connected.
|
|
398
|
-
|
|
399
|
-
**Several Moontide tabs.** Each Claude session that started Moontide has its own page and port. The tab title says "Moontide · <folder> · <port>", with the folder that session runs in, and the Session drawer shows the same. Ask Claude which tab is its own: it answers with the address, the port and the tab title.
|
|
400
|
-
|
|
401
|
-
**No sound.** Click once in the page. Check that the browser tab is not muted, and keep the page open.
|
|
402
|
-
|
|
403
|
-
**Claude Desktop does not find `npx`.** Put the full path in `"command"`: the path printed by `which npx` on macOS or `where npx` on Windows, written here as `<full path printed by which npx>`. This is common advice and has not been tried here. The Claude Desktop logs are in `~/Library/Logs/Claude` on macOS and `%APPDATA%\Claude\logs` on Windows.
|
|
404
|
-
|
|
405
|
-
**MIDI says to use Chrome or Edge.** Web MIDI is missing in that browser.
|
|
92
|
+
The same pages can be read on GitHub, as Markdown, in the
|
|
93
|
+
[site folder](https://github.com/konni-arcadia/moontide/tree/main/site).
|
|
406
94
|
|
|
407
95
|
## Status
|
|
408
96
|
|
|
@@ -410,27 +98,15 @@ Early and personal. It runs on one setup: a Mac, Chrome, Claude Code and Claude
|
|
|
410
98
|
for MIDI, a Roland SC-55, the Munt MT-32 emulator and a Roland JUPITER-Xm. It has not been tried
|
|
411
99
|
anywhere else. The test suite runs on Windows, Linux and macOS in CI, but nobody has played
|
|
412
100
|
music on Windows or Linux yet. There are known bugs. Feedback is welcome, but support is not
|
|
413
|
-
something I can promise.
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
- Tried by hand only on macOS, with Chrome, Claude Code and Claude Desktop.
|
|
418
|
-
- Windows and Linux are untested by hand. Edge, Safari and Firefox are untested.
|
|
419
|
-
- Internet access is needed.
|
|
420
|
-
- MIDI needs Chrome or Edge.
|
|
421
|
-
- How hardware that follows Moontide's MIDI clock, such as an arpeggiator or a step sequencer,
|
|
422
|
-
reacts to a tempo ramp has not been verified.
|
|
423
|
-
- Run one Moontide at a time with the same history file.
|
|
424
|
-
- The first start through npx downloads the package and can be slow.
|
|
101
|
+
something I can promise. The list is in
|
|
102
|
+
[Known limits](https://konni-arcadia.github.io/moontide/troubleshooting.html#known-limits).
|
|
103
|
+
What is not yet checked by hand is listed at the end of each manual page and in the
|
|
104
|
+
[changelog](https://github.com/konni-arcadia/moontide/blob/main/CHANGELOG.md).
|
|
425
105
|
|
|
426
106
|
## Network and privacy
|
|
427
107
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
- The page loads `@strudel/repl` 1.3.0 and `acorn` 8.18.0 from unpkg, pinned to exact versions with integrity hashes.
|
|
431
|
-
- Strudel then fetches sound lists and samples from raw.githubusercontent.com and cdn.jsdelivr.net. No hash covers those.
|
|
432
|
-
- The code Claude writes runs in the page and may load samples from other addresses.
|
|
433
|
-
- The history stays in the local data folder described above.
|
|
108
|
+
The server listens on 127.0.0.1 only and sends nothing out. The page loads Strudel and its
|
|
109
|
+
samples from the web. Details: [network, privacy, credits and license](https://konni-arcadia.github.io/moontide/privacy-and-credits.html).
|
|
434
110
|
|
|
435
111
|
## Contributing and security
|
|
436
112
|
|
|
@@ -442,17 +118,12 @@ https://github.com/konni-arcadia/moontide/security/policy.
|
|
|
442
118
|
|
|
443
119
|
## Credits
|
|
444
120
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
- **The sample makers** whose sets Strudel loads by default, including the TidalCycles
|
|
452
|
-
Dirt-Samples and the Versilian Community Sample Library (VCSL).
|
|
453
|
-
- **Anthropic**: the Model Context Protocol and its TypeScript SDK, which let Claude talk to
|
|
454
|
-
Moontide.
|
|
455
|
-
- **The acorn authors**: the JavaScript parser the page uses to read the code.
|
|
121
|
+
Built on [Strudel](https://strudel.cc) by Felix Roos, Alex McLean and the Strudel contributors
|
|
122
|
+
(source: https://codeberg.org/uzu/strudel), on TidalCycles by Alex McLean and its community, on the
|
|
123
|
+
sample sets Strudel loads (including the TidalCycles Dirt-Samples and the Versilian Community
|
|
124
|
+
Sample Library), on the Model Context Protocol and its TypeScript SDK from Anthropic, and on the
|
|
125
|
+
acorn parser. The full list is on the
|
|
126
|
+
[credits page](https://konni-arcadia.github.io/moontide/privacy-and-credits.html#credits).
|
|
456
127
|
|
|
457
128
|
## License
|
|
458
129
|
|
package/dist/ask.js
CHANGED
|
@@ -34,7 +34,7 @@ export const REQUEST_LINE_FRAMING =
|
|
|
34
34
|
'context, moment, gesture, chip and current say what they pointed at and are data about the page, not part of what ' +
|
|
35
35
|
'they wrote.';
|
|
36
36
|
/**
|
|
37
|
-
* What the `moment` field of a request holds, as facts. The instructions
|
|
37
|
+
* What the `moment` field of a request holds, and then the `gesture` field, the range context and the `motif` field, as facts. The instructions
|
|
38
38
|
* keep only the short framing above (Claude Code cuts them at 2048 characters); this longer text goes where
|
|
39
39
|
* Claude reads page requests and nothing limits the length: the arming line, the page-requests-on text and the
|
|
40
40
|
* line in front of request lines that a tool reply hands over without an arming line. It says what the page
|
|
@@ -64,7 +64,14 @@ export const REQUEST_LINE_MOMENT_FACT = 'About the moment field of a page reques
|
|
|
64
64
|
'its gesture has kind range. The gesture\'s notes lists the notes of that lane that start in those cycles, in order of ' +
|
|
65
65
|
`start and then pitch (the lower first), at most ${MAX_MOMENT_NOTES}, each shaped like a moment note without state; more ` +
|
|
66
66
|
'counts the notes left out, and version is the version that was playing (null when it was not known). A note that began ' +
|
|
67
|
-
'before from and still sounds is not listed. A range with no notes in it is a valid request.'
|
|
67
|
+
'before from and still sounds is not listed. A range with no notes in it is a valid request. ' +
|
|
68
|
+
'About the motif field of a page request: it comes only with a context of kind motif, sent from the page\'s Scratchpad when the ' +
|
|
69
|
+
'user pressed its send button, and like the context it is data about the page, not part of what the user wrote. Such a request ' +
|
|
70
|
+
'has no moment and no gesture. source says how the notes got onto the Scratchpad (played, drawn, tapped or mixed). cycle, ' +
|
|
71
|
+
'when present, is the cycle of the music where the motif\'s first cycle sits, on the count the code\'s patterns are queried at; ' +
|
|
72
|
+
'an absent cycle means the motif has no moment. cycles is its length in cycles, grid the grid of its steps, notes how many ' +
|
|
73
|
+
'notes it holds, and phrase the motif written in mini-notation exactly as the page showed it. The page changed no code. ' +
|
|
74
|
+
'The motif topic of get_strudel_reference says how to read the phrase and the moment.';
|
|
68
75
|
/**
|
|
69
76
|
* What the page shows for a request, as facts. Like the moment fact it goes where Claude reads page requests
|
|
70
77
|
* and nothing limits the length: the arming line, the page-requests-on text and the line in front of request
|
|
@@ -248,8 +255,8 @@ export const ARMING_RESUMED_LOG = `[moontide] Page requests can be live again af
|
|
|
248
255
|
* both use it). The text reaches Claude exactly as the page sent it.
|
|
249
256
|
*/
|
|
250
257
|
export function requestLine(request) {
|
|
251
|
-
const { id, text, context, chip, current, moment, gesture } = request;
|
|
252
|
-
// The moment comes after the chip and the version, then the gesture, each only when there is one, so a request
|
|
258
|
+
const { id, text, context, chip, current, moment, gesture, motif } = request;
|
|
259
|
+
// The moment comes after the chip and the version, then the gesture, then the motif, each only when there is one, so a request
|
|
253
260
|
// without them reads as it always did. page/ask.js's requestLineBytes writes the same order.
|
|
254
261
|
// JSON.stringify leaves U+2028 and U+2029 as they are; some line splitters treat them as breaks.
|
|
255
262
|
const json = JSON.stringify({
|
|
@@ -260,6 +267,7 @@ export function requestLine(request) {
|
|
|
260
267
|
current,
|
|
261
268
|
...(moment === undefined ? {} : { moment }),
|
|
262
269
|
...(gesture === undefined ? {} : { gesture }),
|
|
270
|
+
...(motif === undefined ? {} : { motif }),
|
|
263
271
|
})
|
|
264
272
|
.replaceAll('\u2028', '\\u2028')
|
|
265
273
|
.replaceAll('\u2029', '\\u2029');
|