create_drum_pattern
Create drum patterns in REAPER from step-sequencer shorthand. Specify drum characters, track, and start position to generate a MIDI item.
Instructions
Create a drum pattern from step-sequencer shorthand.
Each line of pattern is one drum lane. Characters map to GM drums:
k=kick, s=snare, h=hi-hat closed, o=hi-hat open, c=crash,
r=ride, t=mid tom, l=low tom, i=high tom, p=clap, b=rimshot.
. or space = rest. Any unknown character is ignored.
Example — standard 16-step rock beat:
k...k...k...k...
....s.......s...
h.h.h.h.h.h.h.h.Defaults: 16 steps per bar = 1/16-note grid. channel=9 = GM drum channel.
Pass item_index=-1 to auto-create a new MIDI item positioned in the
project at start_qn (e.g. bar 5 in 4/4 = start_qn=16.0). Building a
multi-section arrangement on one track? Call this once per section
with item_index=-1 each time and increasing start_qn — each call
creates its own non-overlapping item at the right place, it does NOT
append to a previous item.
Returns the item index and number of notes inserted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | No | ||
| pattern | Yes | ||
| start_qn | No | ||
| velocity | No | ||
| bar_count | No | ||
| item_index | No | ||
| track_index | Yes | ||
| steps_per_bar | No |