device_action
Manage device structure in Ableton Live: insert, delete, duplicate, move, call methods, and edit rack macros, variations, or drum pads in one undo step.
Instructions
Change device structure. action: insert (address of a track, return track, master or rack chain; name as in Live's browser, e.g. 'EQ Eight', 'Drum Rack', 'Audio Effect Rack'; optional position, default end; Live refuses bad placements such as effects before an instrument and says why), delete (address of a device; expect {name} mandatory), duplicate (a device; the copy goes right after it), move (address of a device, to a track or chain, optional position; returns where it landed), save_ab (store the current preset in the A/B compare slot), and for racks: insert_chain (optional position), add_macro, remove_macro, randomize_macros, store_variation, recall_variation (index selects the variation first; else the selected one; which last = the last recalled), delete_variation (index or the selected one; Live does nothing when none is selected, so this refuses), re_enable_automation (address of a parameter whose playing clip automation was overridden, by hand or by any write through this bridge such as set_properties or ramp_parameter, or 'song' for all: hands it back to the automation), call (address of a device or of a Simpler's '.../sample': method and args object, one of the methods get_device lists for it: crop, reverse, warp_as, replace_sample on a Simpler; insert_slice, move_slice, remove_slice on its sample; record, overdub, stop, clear, export_to_clip_slot on a Looper; set_modulation_value on a Wavetable), copy_pad (Drum Rack: from_note and to_note), clear_pad (address of a drum pad, e.g. 'tracks/1/devices/0/drum_pads/36'; expect {name} mandatory). Returns the new address where one is created. One undo step. DESTRUCTIVE for delete, clear_pad, remove_macro, delete_variation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | move: the track or chain to move the device into | |
| args | No | call: the method arguments by name | |
| name | No | insert: device name | |
| index | No | recall_variation, delete_variation: variation to select first (0-based) | |
| which | No | recall_variation: default selected | |
| action | Yes | What to do | |
| expect | No | Guard for delete and clear_pad: {"name": "..."} must match | |
| method | No | call: the method name | |
| address | Yes | Track/chain (insert), device (delete, duplicate, move, save_ab, rack actions) or drum pad (clear_pad) | |
| to_note | No | copy_pad: destination pad note | |
| position | No | insert, move, insert_chain: index, -1 or omitted = end | |
| from_note | No | copy_pad: source pad note |