Custom Pattern Navigation - throws error in 3.2

I looked around the Renoise forums for a tools that would allow me to jump custom line amounts on the page up and down control and was super happy when i found the custom pattern navigator plugin. But sadly after installing 3.2 it throws an error whenever it gets to the bottom of a row.

I dont know if this is the right place to ask, but is there anyway to try and fix it myself or is such source code only available for the owner? … or is there a way to report the bug to him so he might fix it or ? … well like i said im kinda new here so not sure this is the right place to ask.

Welcome. Just to make sure you mean this tool(?) → Custom Pattern Navigation | Renoise

I think the person who wrote the tool is @vvoois (Personally if it was me I’d modify the tool to try and get it to work under 3.2 and go from there if you want to try and get in contact etc…)

P.S. taktik could of modified slightly the behaviour of renoise.SongPos in 3.2 possibly due to this thread → renoise.Transport.song_length.line off by one but that’s just some quick speculation on my part if that is now causing error in the tool.

I have never used this tool, nor have I seen the code. You are probably using “number_of_lines”. But the code must ensure that it is in the correct sequence at the time of using it to establish the limit and mathematical operation. You may confuse the value of the number_of_lines of another pattern if the code does not correctly differentiate the sequence from what a pattern is. That is, the sequence index and the pattern index do not have to match. And a pattern can be in several sequences.

I comment on these details because when I started to learn, it was common for me to fail here. But I don’t know if this is the cause…

The correct thing is that the author of the tool solves this problem. But I should explain exactly what the problem is. A screenshot of the error, for example.

Ah good idea! … Thank you guys for the feedback … Here is the error code i am getting when i get to the end of the pattern. As long as i dont get to the end there is no error, but when i get there this error shows up on my screen.
@vvoois do you think you can make an update to fix this issue as i really like the tool very much :slight_smile:

error

Quick modification, don’t know if it helps. (Just for the lines mode btw, not Lines*LPB or length/factor.)

com.renoise.CustomPatternNavigation.xrnx (2.4 KB)

Thank you :smiley:

i tried it but its not quite stable, not all things work as they should. Seems i cant use it in record mode while recording or playing back … and it can still fail sometimes… so i think i better just revert back to either 3.1 or go back to the normal way of doing things for now :slight_smile: … but thank you very much for trying to help :slight_smile:

Can you explain to me exactly what you need to do? What kind of jumps do you need?

Simply jump a number of lines between patterns? What would be the maximum jump number?

In this type of tools (line break) there are only two problems to deal with:

  1. The sequence index can include any pattern index.
  2. Each pattern can have a variable number of lines (1 to 512).

And three annotations:

  1. The sequence index is linear (the next one is always the previous one plus 1).
  2. A pattern can be repeated in a multitude of sequence slots.
  3. The maximum number of the sequence index is 1000 (until 1000 patterns, one for each sequence slot). But the correct thing is to always use the maximum number of the existing sequence in the song.

Given all this, with a well-done iteration function with conditions it can jump many lines in a single operation even if there are many patterns with a single line or there are repeated patterns in the same jump.

Finally, the function in charge of jumping forward will not be the same as the function of jumping backwards. It is necessary to create one for each case.

I think it’s an API bug in the renoise.Transport.edit_pos line assertion? (and possibly other objects using the renoise.SongPos class?)

In a song with one pattern of 64 lines, it only accepts line 63 as the maximum line. Another small off-by-one error, @taktik?

--works:
renoise.song().transport.edit_pos = renoise.SongPos(1, 63)

--not works and error:
renoise.song().transport.edit_pos = renoise.SongPos(1, 64)
1 Like

The other thing to just mention is that under a certain condition (rare) I can get that tool version 3.1 under Renoise 3.1 to throw a ‘invalid_playback_pos’ error anyway, so it probably is just best to have a rethink/redo that. As for what Mikkel is doing I’m not sure myself.

The tool uses one offset based on one of two different position markers depending on which mode is currently active while you push the pgup or pgdown key.

if (switch_pos_mode_index == POS_MODE_PLAYBACK) then
  new_pos = song.transport.playback_pos
end

if (switch_pos_mode_index == POS_MODE_EDIT) then
  new_pos = song.transport.edit_pos
end

I suspect the issue occurs when using the pagedown key.

For the new position calculation, the new position is first determined and then compared if it falls inside the actual defined scopes of the song constraints:

new_pos.line = new_pos.line + jump_steps
if new_pos.line > song.selected_pattern.number_of_lines then
  
  if song.selected_sequence_index+1 <= #song.sequencer.pattern_sequence then
    #Loads of calculation to fit the next position into either next pattern of the following sequence
    new_pos.sequence = song.selected_sequence_index +1
  else 
    #Or simply fit to the end of the current pattern if there is no following sequence
    new_pos.line = song.selected_pattern.number_of_lines
  end

Then the new position is being set.

if (switch_pos_mode_index == POS_MODE_PLAYBACK) then
  song.transport.playback_pos = new_pos
end

if (switch_pos_mode_index == POS_MODE_EDIT) then
  song.transport.edit_pos = new_pos
end

The best thing to find out is to print the new_pos.line and new_pos.sequence before new_pos is transferred back to song.transport.edit_pos or .playback_pos.

If something changed to “switch_pos_mode_index” or how it is determined, this may form an issue as well.

I am currently not in position to access private equipment to adjust and test this script. But for as far as i can see its current state, checks for boundaries are not done any different than for how it worked with previous versions of Renoise so it might be a bug with the limitation boundaries between different script key variables as other users pointed out: Max lines are defined from 1-64 in one key variable where it is 0 to 63 in the one the value has to be transferred to. Having shifted and inconsistent boundaries will never work fine and shall always remain a source of confusement.

Yes, that’s obviously wrong. Will fix that.

So… I’m curious if the original tool works bug free again with the new 3.2.1 beta?

Just wanted to @ping anyone who had problems to try it out again.

It does not come with an error anymore when using the original tool with the 3.2.1 :slight_smile:

But when going into edit mode and then using it the screen does not follow the playhead like Renoise normally does. It does when set to Edit mode, but then you cannot use it while the track is playing back… so it does not work quite as it normally does sadly, so ive swithced back to the normal 16 lines.