Skip to main content
Glama

Play Live Pattern

play-live-pattern
Read-only

Live-code music patterns using TidalCycles mini-notation in JavaScript. Layer drums, synths, and bass with stack(). Choose from 71 drum machine banks, 128 GM instruments, built-in synths, and a full effects chain. Patterns play in a REPL the user can edit directly. Add .pianoroll() to a pattern to show a live piano-roll animation in the widget (or .punchcard()/.scope()/.spectrum() — one draw method per pattern). For a custom animated background, start the code with await initHydra() and write Hydra shader code — H(pattern) locks it to the sequence, and () => a.fft[0] makes it react to the audio itself (Strudel's output, not the mic); see get-strudel-guide topic 'hydra'. Rather not hand-write one? visuals picks a ready-made animation for code that has none (pianoroll/punchcard/scope/spectrum, or hydra-kaleid/pulse/wash/feed). theme sets the code-editor colour scheme, which also tints the visuals — match it to the mood (teletext chiptune, sonicPink synthwave, nord ambient, gruvboxDark lofi). Each call creates a NEW player rather than updating the last one — for a tweak, send the whole revised pattern and ask the user to stop the previous one. Use get-strudel-guide for genre templates, sound references, and advanced features like arrangement and sample loading.

The Strudel REPL renders inline with an editable code editor, visualizations, and playback controls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bpmNoTempo in BPM (40-300). Converts to setcps() automatically.
codeYesStrudel pattern code. Uses TidalCycles mini-notation in JavaScript. Use stack() to layer drums, bass, and melody. Set tempo with setcps(bpm/60/4) or use the bpm parameter. The REPL plays the LAST expression: setup lines (await initHydra(), all(), setcps()) go BEFORE the pattern. Double quotes are mini-notation — use single quotes for plain strings and URLs. One draw method per pattern; pass a.fft values as functions (() => a.fft[0]).
themeNoEditor colour theme; the visuals stage and its readability scrim are derived from it, so it also decides whether a shader sits on a dark or light ground — prefer a dark one when the visual is the point (e.g. 'nord', 'sonicPink', 'tokyoNight'). Not carried into share links or the browser fallback.
titleNoPattern title displayed in the widget header (e.g. 'Midnight Rain').
visualsNoReady-made visual, for when the code has none of its own. pianoroll/punchcard/scope/spectrum draw onto the 2D canvas behind the code; hydra-kaleid (rotating kaleidoscope), hydra-pulse (shape driven by a rhythm), hydra-wash (slow ambient noise) and hydra-feed (the piano roll mirrored and trailed) are WebGL shader backgrounds. A preset fills the MISSING layer: a hydra preset is skipped only if the code already calls initHydra(), a 2D preset only if the code already has a draw method — so hydra-wash layers happily under your own .pianoroll(). Hydra presets are dropped for viewers who prefer reduced motion. Writing your own visual is still the better result (draw methods: topic 'visuals'; shaders: topic 'hydra').
autoplayNoStart playing immediately (default: true). May require user click due to browser autoplay policy.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / code / description
      Previous value: -"Strudel pattern code. Uses TidalCycles mini-notation in JavaScript. Use stack() to layer drums, bass, and melody. Set tempo with setcps(bpm/60/4) or use the bpm parameter."New value: +"Strudel pattern code. Uses TidalCycles mini-notation in JavaScript. Use stack() to layer drums, bass, and melody. Set tempo with setcps(bpm/60/4) or use the bpm parameter. The REPL plays the LAST expression: setup lines (await initHydra(), all(), setcps()) go BEFORE the pattern. Double quotes are mini-notation — use single quotes for plain strings and URLs. One draw method per pattern; pass a.fft values as functions (() => a.fft[0])."
    • changedInput schema / properties / theme / description
      Previous value: -"Editor colour theme — pick to match the mood (e.g. 'nord', 'sonicPink', 'githubLight')."New value: +"Editor colour theme; the visuals stage and its readability scrim are derived from it, so it also decides whether a shader sits on a dark or light ground — prefer a dark one when the visual is the point (e.g. 'nord', 'sonicPink', 'tokyoNight'). Not carried into share links or the browser fallback."
    • changedInput schema / properties / visuals / description
      Previous value: -"Ready-made visual, for when the code has none of its own. pianoroll/punchcard/scope/spectrum draw onto the 2D canvas behind the code; hydra-kaleid (rotating kaleidoscope), hydra-pulse (shape driven by a rhythm), hydra-wash (slow ambient noise) and hydra-feed (the piano roll mirrored and trailed) are WebGL shader backgrounds. Ignored if the code already visualises itself — writing your own .pianoroll() or initHydra() shader is still the better result (see get-strudel-guide topic 'visuals')."New value: +"Ready-made visual, for when the code has none of its own. pianoroll/punchcard/scope/spectrum draw onto the 2D canvas behind the code; hydra-kaleid (rotating kaleidoscope), hydra-pulse (shape driven by a rhythm), hydra-wash (slow ambient noise) and hydra-feed (the piano roll mirrored and trailed) are WebGL shader backgrounds. A preset fills the MISSING layer: a hydra preset is skipped only if the code already calls initHydra(), a 2D preset only if the code already has a draw method — so hydra-wash layers happily under your own .pianoroll(). Hydra presets are dropped for viewers who prefer reduced motion. Writing your own visual is still the better result (draw methods: topic 'visuals'; shaders: topic 'hydra')."
  2. Changed3 schema fields changed
    • addedInput schema / properties / code / maxLength
      Added value: +65536
    • addedInput schema / properties / theme
      Added value: +{
      +  "description": "Editor colour theme — pick to match the mood (e.g. 'nord', 'sonicPink', 'githubLight').",
      +  "enum": [
      +    "strudelTheme",
      +    "algoboy",
      +    "archBtw",
      +    "androidstudio",
      +    "atomone",
      +    "aura",
      +    "bbedit",
      +    "blackscreen",
      +    "bluescreen",
      +    "bluescreenlight",
      +    "CutiePi",
      +    "darcula",
      +    "dracula",
      +    "duotoneDark",
      +    "eclipse",
      +    "fruitDaw",
      +    "githubDark",
      +    "githubLight",
      +    "greenText",
      +    "gruvboxDark",
      +    "gruvboxLight",
      +    "sonicPink",
      +    "materialDark",
      +    "materialLight",
      +    "monokai",
      +    "noctisLilac",
      +    "nord",
      +    "redText",
      +    "solarizedDark",
      +    "solarizedLight",
      +    "sublime",
      +    "teletext",
      +    "tokyoNight",
      +    "tokyoNightDay",
      +    "tokyoNightStorm",
      +    "vscodeDark",
      +    "vscodeLight",
      +    "whitescreen",
      +    "xcodeLight"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / visuals
      Added value: +{
      +  "description": "Ready-made visual, for when the code has none of its own. pianoroll/punchcard/scope/spectrum draw onto the 2D canvas behind the code; hydra-kaleid (rotating kaleidoscope), hydra-pulse (shape driven by a rhythm), hydra-wash (slow ambient noise) and hydra-feed (the piano roll mirrored and trailed) are WebGL shader backgrounds. Ignored if the code already visualises itself — writing your own .pianoroll() or initHydra() shader is still the better result (see get-strudel-guide topic 'visuals').",
      +  "enum": [
      +    "none",
      +    "pianoroll",
      +    "punchcard",
      +    "scope",
      +    "spectrum",
      +    "hydra-kaleid",
      +    "hydra-pulse",
      +    "hydra-wash",
      +    "hydra-feed"
      +  ],
      +  "type": "string"
      +}
  3. First observed

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses key behavioral aspects: autoplay may require user click, each call spawns a new player (not updating the last), and visuals are skipped under certain conditions (e.g., hydra presets for reduced motion). It does not explicitly mention read-only or side-effect status, but the new-player note gives useful transparency. No contradiction with annotations detected.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but well-structured, covering all necessary aspects without redundancy. It is information-dense, but some sentences are lengthy and could be broken down for easier scanning. However, the level of detail is appropriate given the tool's complexity, and the structure flows logically.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite lacking an output schema, the description explains what the REPL returns to the user (inline editor, visualizations, playback controls) and sets expectations about player creation and theming. It also references companion tools for further guidance, giving a complete picture of how the tool fits into the broader ecosystem.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already describes parameters well, and the description adds substantial extra meaning: explains bpm conversion to setcps(), provides detailed notes on code syntax (double vs single quotes, last expression rule, draw method limits), clarifies theme impact on visuals, and elaborates on each visual preset's behavior (what gets skipped, layering). This goes far beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's primary function: live-coding music patterns with Strudel/TidalCycles mini-notation. It enumerates key features (layering, visuals, themes, REPL behavior) and distinguishes itself from siblings like play-sheet-music and convert-abc-to-strudel by focusing on interactive performance.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides practical usage guidance: explains the REPL's last-expression behavior, notes that each call creates a new player (with a recommendation to send revised code and ask user to stop previous), and directs users to get-strudel-guide for advanced features. However, it does not explicitly contrast when to use this tool versus convert-abc-to-strudel or play-sheet-music, leaving room for ambiguity.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.