I have a script that uses a modulo inside an index. Here is a sample of my code which throws an index out of range error:
previous_note = all_notes[-me.parent(1).digits%4]
In this case, me.parent(1).digits
is 1. If I try this, I don’t get an error:
previous_note = all_notes[-me.parent(1).digits]
I shouldn’t get an error, as 1%4 = 1. For some reason, if I set me.parent(1).digits%4
as a variable, it does work. This code doesn’t throw an error:
index = me.parent(1).digits%4
previous_note = all_notes[-index]
This seems like a bug in the way td interprets modulos.