renoise.Instrument:delete_phrase_at() behavior nitpick

renoise.song().instruments[]:delete_phrase_at(index) will also change the selected phrase. This isn’t documented or consistent with how other remove methods work.

It’s easy to work around, but you never know what weird stuff people are up to with the API so maybe it’s best to fix.

Do you mean the automatic change of the name of the phrase?

Renoise has an automatic way to rename phrases with the “Phrase XX” format, which I particularly don’t like. When adding or removing phrases, Renoise will rename the names. This is not from the API. But it is confusing. Because it’s actually renaming names that do exist. If you import a phrase with the name “Phrase 12” in the slot of phrase 03, that phrase will automatically be renamed to “Phrase 03”.

No. That’s not what I wrote or what I meant :slight_smile:

Might there be another way to explain it what you mean? How about for somebody like me who doesn’t code in Lua? I’m interested :slight_smile:

If a phrase is removed with the method I mentioned, renoise will change what phrase is currently selected. I’m not sure how to explain it better, but I’m pretty sure taktik knows.

1 Like

Ah ok, I see! I had never experienced this. Renoise selects the index just deleted.

I guess the problem is that it does not previously save the current index to retrieve it later.