Write Scale Melody
gen_emit_melodyGenerate 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
| Name | Required | Description | Default |
|---|---|---|---|
| root | No | Scale root pitch with octave (e.g. 'A4', 'C4'). | C4 |
| seed | No | Optional integer random seed for reproducible melodic phrases; omit for a fresh variation each call. | |
| scale | No | Scale name from `gen_list_scales` (e.g. 'minor', 'minor_pent', 'dorian'). | minor |
| channel | Yes | 0-based global Channel Rack index whose Piano Roll will receive the generated notes. | |
| pattern | No | Optional 1-based pattern index to select before writing; omit/None to write into the currently selected pattern. | |
| clear_first | No | If True (default), clear existing notes in the target Piano Roll before writing; set False to append. | |
| length_bars | No | Total melody length in project bars (default 4.0). | |
| octave_range | No | Number of octaves above `root` to draw melody notes from (default 2). | |
| note_duration_bars | No | Nominal rhythmic step / note spacing in project bars (e.g. 0.125 = 8th notes, 0.25 = quarter notes). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||