Compare instruments while keeping the original
Ask the explore-selected-instrument prompt for a direction such as “try warmer synths for this part.” An explicitly requested part takes precedence over the displayed clip. For example, “try Analog for Bass verse on Bass” can target that part while another track is selected. Resolve the current track, clip and Session/Arrangement location together from the track and clip lists; a matching name alone or the first result is insufficient. If several parts match, ask one question with the candidates and their locations. The user does not need to change selection. Without an explicit target, use the displayed MIDI clip and its actual owner.
Read notes, timing and devices for the resolved part. Use analyze_midi_parts with that one exact part for configured-scale compatibility and scoped tonal evidence; evidence from a different displayed clip does not describe the target. Preserve insufficient evidence and key ambiguity. Then choose an available instrument together. These comparison tools require the default all tool profile and the updated Remote Script.
For Arrangement material, the exploration workflow also reads the surrounding requested passage with analyze_arrangement_section and includeHarmony: true. Without a separately requested passage, use the target clip's placed timeline boundaries in quarter-note song time, rather than its local loop markers. Resolve named section boundaries before analysis; a locator alone does not establish the end. Include the target when restricting tracks. For Session material, compare only explicitly resolved related clips with analyze_midi_parts; their ranges do not establish simultaneous playback. Limits require a narrower, explicitly chosen scope, not silent sampling.
Keep the target's register and pitch evidence separate from the shared passage, current scale configuration and literal chord candidates. Muted material and exclusions remain visible; sparse notes and template matches do not establish a key, harmonic function or audible mix. Use the evidence and the user's intention to discuss sound directions, then search for instruments actually available in Live. Pitch evidence does not measure timbre or mix masking. This context read preserves selection, content and playback; unavailable analysis tools leave the context unknown.
Prepare an alternative
prepare_instrument_comparison plans a native copy of the exact MIDI track containing the part. The plan names the source track, clip, devices and alternative. Confirmation binds exposed devices, routing, notes, timing and track topology; a changed source requires a fresh plan.
Preparation requires stopped transport and recording off. Pause only when authorized. Live temporarily mutes the source during duplication, then restores its original mute state. The alternative starts muted, unarmed, with solo disabled and input monitoring off. It includes the track's Session and Arrangement material. Exposed device, routing, note and timing readback must match; a failed copy is removed when cleanup succeeds. An incomplete cleanup is reported explicitly.
Insertion shifts subsequent track, clip and device IDs. Use the returned comparisonId with get_instrument_comparison to resolve the actual pair and original part to their current IDs. Do not reuse cached IDs from before the insertion. A missing part has a null clip ID and must be resolved before auditioning.
The source must be an ordinary, unfrozen MIDI track with arm and solo off and no live-input monitoring. Resolve these conditions explicitly before copying. Limits are 128 Session slots plus Arrangement clips, 4096 notes per clip and 16384 notes per track. No partial sample is substituted for larger material. A track cannot participate in two active comparisons.
Try a sound on the copy
For a request to adjust the current instrument's controls, use instrument refinement. It uses the same comparison handle and preserves the original without loading another instrument.
Load only the chosen candidate onto the alternative track through the usual load_browser_item plan and confirmation. Keep the original instrument intact. Read both device chains and complete note/timing baselines before loading, then compare readback afterward. Resolve manual edits with the user rather than overwriting them.
Native track duplication carries the instrument through Live's own copy operation. The bridge verifies exposed state; it cannot independently inspect opaque plug-in state or prove that the copy sounds identical. Parameter snapshots cannot recreate a missing instrument. Listen before judging the sound.
Audition and choose
select_instrument_comparison changes only the pair's mute states in one guarded native step. original unmutes the original and mutes the alternative; variation does the reverse. For a prepared copy, restore returns the original to its mute state from before preparation and mutes the alternative. For an adopted pair, it uses both reported adoption-time restoreMutes. restorationBasis distinguishes these baselines. Selection preserves notes, devices, manual edits, monitoring, routing and unrelated tracks.
Selection does not launch clips or start or stop transport. It refuses recording, frozen tracks, solo conflicts, armed tracks and live-input monitoring. Resolve these states explicitly rather than changing them silently.
For a sequential Session comparison, launch the chosen part with explicit quantization, listen, stop that part, select the other version, and launch its corresponding clip. Separately launched clips are not proven phase aligned. For Arrangement material, use passage audition to resolve explicit boundaries, return the intended ordinary pair tracks and start a guarded loop after playback is authorized. Never send an Arrangement clip ID to launch_clip or clear the whole Set's Session overrides as a shortcut. A mute or playback readback does not establish that audio reached the listener.
When the user chooses a version, pass that choice with finish: true. Both tracks remain with the selected mute states, and the comparison handle ends. Nothing is deleted or saved automatically. Stop playback separately when requested. Rejected alternatives remain until the user requests deletion.
Continue after interruption
Omit comparisonId from get_instrument_comparison to list active comparisons. This can recover the handle after a preparation reply times out or a client reconnects. Read the actual pair before retrying: an already executing native copy can finish after cancellation. Do not blindly create another copy.
Comparison handles are runtime state and are not stored in the Live Set. Reloading scripts or restarting Live may invalidate them. Inspect the existing tracks before beginning again; a missing handle does not mean the tracks were removed. At most 16 comparisons can be active. Finish comparisons to release handles while preserving their tracks.
Once the intended existing pair is explicitly resolved, adopt_instrument_comparison binds a new runtime handle without duplicating tracks or changing notes, instruments, mutes, playback or selection. Supply original and variation, each with its current trackId and clipId, through the usual fresh plan and confirmation. The plan names both parts and their instruments and binds current exposed notes, timing, devices, mixer, routing and track topology. Manual changes invalidate it even if the state version did not change. The two parts may contain different edits; adoption does not assert they are identical copies.
Use actual prior observations and current content to resolve identity; old indices, matching names or a copied summary alone are insufficient. Ask the user when materially different pairs remain. Adoption cannot recover unknown earlier identity, copy history or mute state. Its restore point is the pair's exact mutes at adoption, which may leave the variation enabled. No history is written into the Set. After another restart, inspect and adopt again if needed.
Adoption requires two distinct ordinary MIDI tracks with populated MIDI parts. It refuses frozen, armed, live-input-monitored or already participating tracks, recording, solo conflicts and two currently unmuted tracks. Resolve those states explicitly first. It can bind an otherwise eligible pair during playback without stopping it. The per-part limit is 4096 stored notes; source audio and pending clip launches are refused.
For a user-requested replacement on the original track instead, create a separate saved working Set first. save_live_set with a new absolute .als path performs native Save As. Review its resulting destination, including a new project folder when needed, and require saved:true with the new loaded path before replacing the instrument. It does not collect external samples.