Skip to content

Add JS named-parameter API for AMY#700

Merged
bwhitman merged 1 commit intomainfrom
claude/amy-js-api
Mar 3, 2026
Merged

Add JS named-parameter API for AMY#700
bwhitman merged 1 commit intomainfrom
claude/amy-js-api

Conversation

@bwhitman
Copy link
Copy Markdown
Collaborator

@bwhitman bwhitman commented Mar 3, 2026

Summary

  • New build-time codegen script gen_amy_js_api.py reads amy/amy/__init__.py and generates amy_api.generated.js
  • Provides amy_message() and amy_send() — JS equivalents of Python's amy.message() / amy.send()
  • All 56 parameters, 5 type handlers, ctrl_coefs dict/array support, priority ordering
  • Stays in sync with AMY automatically on each build

Usage

amy_send({osc: 0, wave: 1, freq: 440})
amy_send({synth: 1, patch: 257, num_voices: 6})
amy_send({osc: 0, freq: {const: 440, bend: 0.01}})
amy_send({synth: 1, midi_cc: 255})

Test plan

  • Node.js unit tests pass for all parameter types
  • amyboardweb builds cleanly

🤖 Generated with Claude Code

Build-time script (gen_amy_js_api.py) reads amy/amy/__init__.py and
generates amy_api.generated.js with amy_message() and amy_send()
functions that mirror Python's amy.send() syntax:

  amy_send({osc: 0, wave: 1, freq: 440})
  amy_send({synth: 1, patch: 257, num_voices: 6})
  amy_send({osc: 0, freq: {const: 440, bend: 0.01}})

All 56 parameters, 5 type handlers (int, float, string, list,
ctrl_coefs), and priority ordering stay in sync with AMY
automatically on each build.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bwhitman bwhitman merged commit fc5e333 into main Mar 3, 2026
1 check passed
@bwhitman bwhitman deleted the claude/amy-js-api branch March 3, 2026 23:38
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.

1 participant