Advanced Pattern Matrix Operations

Why not have the ability to use advanced operations in the Pattern Matrix? Select a pattern, flip it. Select Multiple patterns, flip all of them, moving the last line in the last pattern to the first line in the first pattern. Transpose, humanize, quantize, interpolate, etc on the pattern level. Perhaps even flipping and randomizing order!

I for one would love to see this in 3.0.

I’ve been thinking about a tool indeed like the new stuff in ableton, “reverting” and “inverting” notes in track…

That also sounds awesome.

I think it would be pretty cool to do cyclic phase shifting. Lots of simpler sequencers have this (e.g. the nanoloop sequencer and the 303 in audiomulch) and it can be very inspiring. Even better would be phase shifting at the block level.

With this you mean Rotate Pattern tool?

I’ve been fiddling around with this, but for the life of me I can’t seem to find out how to get the current selection in the pattern matrix.

Reading the OP again, this is a really cool idea.
From the API you can not really just “get the selection”, because you can freeform select any combination of slots. So, you can question for every slot whether it is selected. The following routine should make a list of (pattern,track) tuplets which are selected.

  
rs=renoise.song()  
selected = table.create()  
helper_table = {}  
for i, s in ipairs(rs.sequencer.pattern_sequence) do  
 local p = rs.sequencer:pattern(s)  
 helper_table[p] = {}  
 for j, t in ipairs() do  
 if rs.sequencer:track_sequence_slot_is_muted(t, s) and not helper_table[p][t] then  
 helper_table[p][t] = true  
 selected:insert({p,t})  
 end  
 end  
end  
  

Especially, notice the line ```
p = rs.sequencer:pattern(s)

Hmm. Is this not making a list of those which are muted, rather than selected?

  
-- Access to sequencer slot selection states.   
renoise.song().sequencer:track_sequence_slot_is_selected(track_index, sequence_index)  
 -> [boolean]  
renoise.song().sequencer:set_track_sequence_slot_is_selected(  
 track_index, sequence_index, selected)  
  

Ah. This one, right?

yeah exactly :D

I’m probably just missing something silly, but why does

renoise.song().sequencer.pattern_sequence[1] = 2  

do nothing, while

renoise.song().sequencer.pattern_sequence = {2}  

works just fine?

It’s something lua or renoise specific about handling arrays. You cannot just substitute one element of an array like that, most of the time you will have to calculate the whole new array replacing the old one before substituting the whole array at once. It’s also much faster approach (not to mention more stable, when firing a tool like this while renoise keeps playing!) to ‘first get your data ready’.
I think in the documentation this is explained somewhere around lines about modifying the edit_pos/play_pos arrays in renoise.song().transport.

If you want a specific sequence have its pattern assignment changed:

  
local p_sequences = renoise.song().sequencer.pattern_sequence  
p_sequences[1] = 2  
renoise.song().sequencer.pattern_sequence = p_sequences  
  

This is how it works with most objects.

See, there it is. :)

Oh I got it. ^_^ I’ve got a few operations working already, but I’m gonna hold off on posting the tool until I’ve got at least most of the things in there that I want.

Hey man if you wanna share the source code we could work together on this.

I’m down. I’m gonna be busy as all hell for the next couple weeks, but I’ll try to get a github set up for it soon.

Also, I’m moving toward adding operations to both the sequencer and pattern matrix.