renoise.song().transport.loop_range[] can define the starting line and the ending line that you want to create a loop, for example from line 0 to line 7, or from line 12 to line 20…
The Problem 1
However, at least from the API, (in Renoise it doesn’t seem to fail), when you play the selected loop from the API or from Renoise’s play button (or space key), when the loop plays the last line, it correctly jumps to the first line, but the first line plays it 2 times, and then continues the loop.
That is, listening to the loop hears a repetition of the first line, defined with renoise.song().transport.loop_range[].
The desired behavior
All lines in the loop should play only once on each pass, including the first. @taktik can you check this? It seems that the playback of this type of loop fails by playing the first line of the loop twice each time it makes a pass. It’s possible that with a very small loop of 1 or 2 lines it won’t happen. Obviously, it is necessary to have some note of some existing instrument in the first line of the loop to notice it.
It’s a bit strange and quite annoying. I think I can rule out that the problem derives from the LUA tool, because it also happens if you disable the tool, keeping the loop already defined.
There seems to be another problem with the lines range: renoise.song().transport.loop_range[].
If a pattern has 64 lines (line 0 to line 63), the range can only cover 64 values, for example from 1 to 64, or from 2 to 65. Then there will always be one line missing at the beginning or at the end to cover the entire pattern.
That is, the full valid range for a 64 line pattern should be 1 to 65. That is, it is impossible to select the number of lines of the entire loop of a pattern, there will always be a line missing (at the beginning or at the end). Again it is another problem of limits.
Both of these issues prevent you from using loop control correctly from a Lua tool, using renoise.song().transport.loop_range[].
Just enter the line of code: renoise.song().transport.loop_range = { renoise.SongPos(1, 1), renoise.SongPos(1, 65) }
I run it in a default pattern with 64 lines.
The result is null. I need to increase the value to 65 in the valuebox in the upper left corner of the Pattern Editor for this line of code to work, but it will only select from line 00, to line 64 (a total of 64 lines, except for the last line 65). I think something is wrong with the range.
Yes.
Create a new song.
Create a instrument with a sample to sound.
Insert a C-4 note inside the line 0, inside the first pattern.
Let it play until the loop plays line 0 several times. I notice that line 0 plays two times in succession (it plays line 0 and then returns to the beginning of line 0 before playing line 1). Use a medium value of BPM (100) and LPB (4).
Do the same with another range, for example 16, 24 with your notes. The first line of the loop will play 2 times before playing the next. you just have to listen to the sound…
Maybe I’m confused here and it’s just a visual issue of the marker. Is it possible that the selection does not mark the entire range correctly and the last line is missing?
In a default pattern of 64 lines: renoise.song().transport.loop_range = { renoise.SongPos(1, 1), renoise.SongPos(1, 2 ) } renoise.song().transport:start_at(1)
mark the line 0 (first line “1”). Play line 0 in a loop. Ok.
Then: renoise.song().transport.loop_range = { renoise.SongPos(1, 1), renoise.SongPos(1, 65 ) } renoise.song().transport:start_at(1)
It should select from 0 to 63 (first line “1” to last line “64”) and play it. But this does not happen.
It seems that between the selection and the maximum limit for the reproduction do not coincide.
You’re expecting to see a selection in the pattern editor’s line numbers, don’t you? Such a selection is only visible for fractional loops or block loops.
When a whole pattern is, or multiple patters are selected, there is no such indicator, as there is no fractional loop present. The loop then simply is marked in the sequencer.
When the requested loop range is a possible block loop. This is enabling a block loop instead.
Try adding a few more patterns and watch the sequencer to see what this does.
I admit that this is pretty comfusing, as we do have so many ways to set a loop in Renoise. And all those modes are merged into a single loop_range getter and setter via the Lua API.
Btw: Such fractional loops are can’t be set in Renoise’s GUI apart from doing so in the Lua API. They are only used when syncing the timelines loop with another sequencer via ReWire.
Yes effectively. Ok, knowing how this works I can change my tool code to loop the entire pattern, instead of using a split loop with full selection. This would avoid some confusion.
I think this happens or doesn’t happen depending on the BPM and LPB values.