Instrument numbers of previous column are overwritten

When using this method from the API to go from 2 columns to 1, the following occurs

renoise.song():track(foo).visible_note_columns = bar  

3941 set track bug 1.JPG

goes to:

3942 set track bug 2.JPG

The instrument number is deleted and the M0 command shifted left. I would guess the M0 should remain in column 2 but hidden and that the C-4`s 00 instrument number should stay in tact?

Just testing this, this is in fact not an API issue but a default renoise behaviour issue.

Using the keyboard shortcut Ctrl-Shift-left arrow, the same thing occurs. The M0 shifts left and the instrument number on the c-4 is cleared. It is worth noting that if it is a numerical panning value and not the M0 value in the panning column, things work as expected . 

The m0 is a midi command for the specific instrument (in your case “no instrument”) and belongs to the effect column, hence it moves along to the left if you remove the last note-column.
In your case:Renoise simply retains the midi command value for that instrument and superseeds the original instrument-number of the first column. I’m not sure if that is the purpose, but if you don’t want that to happen, remove the Midi command meanwhile.

This observation came out of a bug report on one of my tools here from Dark Shadow:
http://forum.renoise…post__p__291032

Im not sure of the ins and outs of the MIDI commands as I dont use them but it still seems strange behaviour that other pattern data can get over-written in an expand/collapse operation. The operation also affects all patterns in a song so I imagine you could end up with several of these un-intended consequences in your track if you do use MIDI commands.

Still seems a bit buggy to me…