Implicit Instrument Assignment

If I delete all the instrument values for a track, it looks like Renoise remembers the last one I deleted it sets it implicitly for the track. Is there anyway to see that implicit assignment in the pattern editor and to even change it? I’m trying to use lua to set notes without instrument values and then set the instrument value once for the entire track.

check if
Options => Auto capture instruments from pattern
is checked.

If so, it’s the auto capture feature which does it.

in order to know which instrument is selected, you should use
renoise.song().selected_instrument
which returns an instrument object

Auto capture is not checked. Looks like Renoise has a way of deciding which instrument to use based on which instrument was played last if none is explicitly specified. Probably safest to explicitly specify.