Skip to main content
Glama
FL Studio MCP (fLMCP)

FL Studio MCP (fLMCP)

Write Scale Melody

gen_emit_melody
Destructive

Generate an in-key, stepwise melody and write it into a channel's Piano Roll; set a seed to reproduce phrases, or clear/append notes before verifying.

Instructions

Generate a stepwise in-key melody and write it into a channel's Piano Roll.

Use to sketch an instant scale-locked melody idea (supply seed to reproduce); use piano_roll_add_notes for exact hand-crafted melodies, voice_to_piano_roll for hummed melodies, or audio_melody_to_piano_roll for melodies extracted from audio files. Defaults to clear_first=True; verify with piano_roll_read.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "channel": "<channel>"
    },
    "name": "gen_emit_melody"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootNoScale root pitch with octave (e.g. 'A4', 'C4').C4
seedNoOptional integer random seed for reproducible melodic phrases; omit for a fresh variation each call.
scaleNoScale name from `gen_list_scales` (e.g. 'minor', 'minor_pent', 'dorian').minor
channelYes0-based global Channel Rack index whose Piano Roll will receive the generated notes.
patternNoOptional 1-based pattern index to select before writing; omit/None to write into the currently selected pattern.
clear_firstNoIf True (default), clear existing notes in the target Piano Roll before writing; set False to append.
length_barsNoTotal melody length in project bars (default 4.0).
octave_rangeNoNumber of octaves above `root` to draw melody notes from (default 2).
note_duration_barsNoNominal rhythmic step / note spacing in project bars (e.g. 0.125 = 8th notes, 0.25 = quarter notes).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.6.1
    • addedInput schema / properties / channel / description
      Added value: +"0-based global Channel Rack index whose Piano Roll will receive the generated notes."
    • addedInput schema / properties / clear_first / description
      Added value: +"If True (default), clear existing notes in the target Piano Roll before writing; set False to append."
    • addedInput schema / properties / length_bars / description
      Added value: +"Total melody length in project bars (default 4.0)."
    • addedInput schema / properties / note_duration_bars / description
      Added value: +"Nominal rhythmic step / note spacing in project bars (e.g. 0.125 = 8th notes, 0.25 = quarter notes)."
    • addedInput schema / properties / octave_range / description
      Added value: +"Number of octaves above `root` to draw melody notes from (default 2)."
    • addedInput schema / properties / pattern / description
      Added value: +"Optional 1-based pattern index to select before writing; omit/None to write into the currently selected pattern."
    • addedInput schema / properties / root / description
      Added value: +"Scale root pitch with octave (e.g. 'A4', 'C4')."
    • addedInput schema / properties / scale / description
      Added value: +"Scale name from `gen_list_scales` (e.g. 'minor', 'minor_pent', 'dorian')."
    • addedInput schema / properties / seed / description
      Added value: +"Optional integer random seed for reproducible melodic phrases; omit for a fresh variation each call."
  2. First observedv0.6.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and non-idempotent, but the description adds the operational consequence: clear_first defaults to True, so existing notes are wiped unless overridden, and it recommends verifying with piano_roll_read. It also discloses reproducibility semantics via seed. It does not discuss pattern-selection side effects or what happens when the target channel/pattern is empty, which keeps it below a 5.

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

Conciseness5/5

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

Two sentences, front-loaded with the core action, then a compact routing/disambiguation clause and a safety default. No filler and nothing buried.

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

Completeness4/5

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

With an output schema present and full parameter documentation, the description covers purpose, alternatives, the destructive default, and verification. Remaining gaps are minor: no note on how length_bars interacts with existing pattern length, or on failure modes for an invalid channel index.

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

Parameters3/5

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

Schema description coverage is 100%, so all nine parameters are already documented in the schema, including the seed reproducibility note that the description partially restates. The description adds no syntax, range, or interaction detail beyond the schema, so the baseline 3 applies.

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?

States a concrete verb+resource+target: 'Generate a stepwise in-key melody and write it into a channel's Piano Roll.' That is clearly distinguishable from gen_emit_arpeggio, gen_emit_bassline, and the piano_roll_* siblings named in the description.

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

Usage Guidelines5/5

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

Explicitly routes the agent: use this for an instant scale-locked sketch, and names piano_roll_add_notes for hand-crafted melodies, voice_to_piano_roll for hummed input, and audio_melody_to_piano_roll for audio-extracted melodies. It also gives a post-call verification path via piano_roll_read.

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

Deploy Server

Other Tools