add_notes
Insert a single note or chord at the caret in Dorico, then exit note-input mode cleanly. Use for one insertion; for sequences, use write_score.
Instructions
Input notes at the caret, then leave note-input mode cleanly.
ONE insertion at the current caret. For a SEQUENCE of notes or chords over
time, use ``write_score`` / ``render_to_dorico`` with a ScoreSpec (a chord is
one event with >=2 pitches). Repeated ``add_notes`` calls do NOT chain: each
re-enters note input at the same spot, so successive chords stack on one beat.
Returns:
Result dictionary with the notes and duration entered, the note input mode
they landed in, whether an undo is available, and displaces_existing.
Note:
Read displaces_existing before treating this as an addition. Dorico has an
overwrite note input mode, and in it these notes replace the music already
at the caret instead of pushing it along. The mode belongs to the
application rather than to this call, so it is reported back and not chosen
here. get_status reads it beforehand.
Uses :class:`NoteInputSession`, so note input is always exited even on
error. Success indicates command acceptance (kOK). Verify note placement
via get_status, playback, or score inspection. Do not read can_undo as
that verification: entering note input alone already sets it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | Yes | Pitches in scientific notation, e.g. ['C4', 'E4', 'G4']: a letter, an optional # or b, then the octave number, where C4 is middle C. | |
| as_chord | No | True stacks the pitches into one chord on a single beat. False enters them one after another, each of the given duration. | |
| duration | No | Rhythmic duration, one of: whole, half, quarter, eighth, sixteenth, 32nd, 64th. Case-insensitive. | quarter |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||