Skip to content

Add LLM prompt section for AI-assisted score composition - #353

Merged
simonw merged 1 commit into
mainfrom
claude/zealous-lamport-9o8g3n
Oct 6, 2026
Merged

simonw merged 1 commit into
mainfrom
claude/zealous-lamport-9o8g3n

Conversation

@simonw

@simonw simonw commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Modify scrimshaw jukebox to add a copy-paste prompt that explains the music format, it should be shown at the bottom of the page below the readable instructions, the prompt should be designed to help any LLM tool compose music in the correct format. It should have a copy to clipboard button.

https://claude.ai/code/session_01R3xuRtjVHqHo1GNbget6Tu

Claude Opus 5.5

Summary

This PR adds a new "Compose with an LLM" section to the Scrimshaw jukebox that enables users to generate musical scores using large language models. The feature includes a comprehensive prompt that teaches LLMs the Scrimshaw score format, along with UI controls to copy the prompt.

Key Changes

  • New UI Section: Added a dedicated section with ID prompt containing:

    • Introductory text explaining how to use LLMs for composition
    • A "Copy prompt" button for easy clipboard access
    • A large <pre> element containing the full LLM instruction prompt
  • Comprehensive LLM Prompt: Included detailed documentation covering:

    • Score layout and syntax rules
    • Settings configuration (tempo, beats, steps, swing, reverb)
    • Voice declarations and instrument options (melodic and drum instruments)
    • Pattern definitions and music notation
    • Melodic bar syntax (notes, rests, chords, dynamics, slides)
    • Drum bar notation
    • Arrangement with play/loop directives
    • Bar counting methodology with worked examples
    • A complete example score ("The Lighthouse Keeper")
    • Composing tips and best practices
  • Styling: Added CSS rules for the prompt section:

    • .prompt-intro: Styled introductory paragraph with max-width constraint
    • .prompt-bar: Spacing for the button bar
    • pre.prompt: Scrollable code block with word wrapping and focus styling
  • JavaScript Functionality: Implemented copy-to-clipboard handler for the prompt button:

    • Attempts to use the modern Clipboard API
    • Falls back to text selection for older browsers
    • Provides user feedback with button text changes ("Copied" / "Selected, press copy")
    • Resets button text after 1.6 seconds

Implementation Details

The prompt is designed to be self-contained and comprehensive, allowing users to paste it directly into any LLM chat interface and then describe the music they want composed. The implementation mirrors the existing "Copy score" button pattern for consistency with the rest of the UI.

A new "Compose with an LLM" section below the format guide holds a
self-contained prompt that teaches any LLM the Scrimshaw score format:
settings, voices and options, every instrument and chord suffix, melodic
and drum bar syntax, patterns, arrangement, a step-counting checklist
and a complete example score that compiles without errors. A Copy prompt
button puts it on the clipboard, falling back to selecting the text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R3xuRtjVHqHo1GNbget6Tu
@simonw
simonw merged commit d97b73d into main Oct 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants