Skip to content

Update scripting examples to current engine helpers#5

Merged
watermann420 merged 1 commit into
mainfrom
codex/fix-build-failure-on-git-suvp65
Feb 2, 2026
Merged

Update scripting examples to current engine helpers#5
watermann420 merged 1 commit into
mainfrom
codex/fix-build-failure-on-git-suvp65

Conversation

@watermann420
Copy link
Copy Markdown
Owner

Motivation

  • Bring documentation examples up to date with the current MusicEngine/MusicEditor scripting helpers and transport model so users can copy-paste working snippets.
  • Replace outdated class constructors and APIs in examples (e.g., SimpleSynth, new Sequencer()) with the engine's current helpers (CreateSynth, Sequencer, CreatePattern).
  • Align inline slider snippets and effect-routing examples with the existing runtime helpers so inline visuals and modulation examples reflect actual APIs.

Description

  • Updated README.md examples to use Sequencer.Bpm/Sequencer.Start(), CreateSynth(), CreatePattern(...), SetParameter(...) and pat.Start() for playback.
  • Updated CONTRIBUTING.md scripting guide and examples to the same helper-style API and replaced legacy constructors and calls (multiple examples converted to CreateSynth/CreatePattern and Sequencer.Start()).
  • Reworked effects example to show vst.load(...) and Engine.AddEffectAfter(...) routing helpers and adjusted inline slider examples to use synth.SetParameter("cutoff", ...) and Sequencer.Bpm.

Testing

  • No automated tests were run because these are documentation updates only.
  • Changes were validated by opening the modified files and verifying examples are consistent with the project’s current helper functions; no runtime execution was performed.

Codex Task

@watermann420 watermann420 merged commit a942594 into main Feb 2, 2026
0 of 2 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c573cd5f63

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CONTRIBUTING.md
Comment on lines +251 to +255
// Add effects chain (use your routing helpers)
var delay = vst.load("Delay");
var reverb = vst.load("Reverb");
if (delay != null) Engine.AddEffectAfter(synth, delay);
if (reverb != null) Engine.AddEffectAfter(synth, reverb);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Replace non-existent Engine.AddEffectAfter helper

The new effects example calls Engine.AddEffectAfter(...), but there is no such helper in the scripting surface; a repo-wide search (rg "AddEffectAfter") finds no definition, while the scripting tooltips only advertise AddEffect(...) as the effect helper (see MusicEngineEditor/Editor/ParameterTooltipService.cs lines 84-87). That means readers who copy this snippet will hit a missing-method/runtime error in the script environment. Consider using the existing AddEffect(...) helper or documenting the actual supported routing API.

Useful? React with 👍 / 👎.

@watermann420 watermann420 deleted the codex/fix-build-failure-on-git-suvp65 branch February 3, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant