add_layer
Add an independent layer (melody, harmony, bass, or drums) to a chiptune project by specifying notes, timing, and optional swing offset for humanization.
Instructions
Add ONE independent layer/channel to the project. Call this tool multiple times to stack as many layers as you want (melody, harmony, bass, drums) — each layer has its own length and rhythm, without needing to match the others in note count.
layer_type accepts: 'melody', 'harmony', 'bass', 'drums'.
Format of 'notes': each item is [pitch_or_piece, start_time_in_beats, duration_in_beats, optional_velocity_0_to_127]. If layer_type='drums', pitch may be a string ('kick', 'snare', 'closed_hihat', 'open_hihat', 'crash', 'ride', 'clap', 'rimshot', 'low_tom', 'mid_tom', 'high_tom') or a GM percussion MIDI number. Portuguese drum names are also accepted.
swing_offset: add a fixed offset (in beats, e.g. 0.02 to 0.08) to every ODD-index note, simulating light swing/humanization. Use 0.0 for straight quantized rhythm (classic chiptune aesthetic). For deliberate off-beats (e.g. hi-hat on 0.5, 1.5, 2.5), place start_time directly in the notes list — no swing_offset needed.
chiptune_program (ignored if layer_type='drums'): 'pulse_lead' (melody, NES pulse timbre, GM 80), 'pulse_harmony' (countermelody, GM 81), 'triangle_bass' (bass, NES triangle approx, GM 38).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | Yes | ||
| layer_name | Yes | ||
| layer_type | Yes | ||
| midi_channel | No | ||
| project_name | Yes | ||
| swing_offset | No | ||
| chiptune_program | No | pulse_lead |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |