Get+Change Patternsteps?

been looking through the API to find how to do this. i’m still learning this scripting-stuff, so i might have overlooked it. as mentioned before, the documentation has no real layout and it can be hard to find a specific thing, so i might have missed it. what i want to do is this:

i figured it would come in handy to have a tool that allows you to change the patternsteps (patternlength) of a selection of patterns through the Pattern Matrix. so change multiple patterns at once. i’ve gotten as far as adding the tool to the right-click menu of the Pattern Matrix, and can make a nice dialog with a valuebox and stuff (yes, that’s as far as i got, i told you i’m a noob :).
however, i’m can’t seem to find a property containing the patternsteps (64,128, etc). does this exist? or do i have to use some pattern-iterator-trick to get to this value? and if so, how can i change it?

In: Renoise.Song.API.lua

renoise.song().patterns[].number_of_lines, _observable
-> [number]

Example:

  
renoise.song().patterns[1].number_of_lines = 128  
  

Replace [1] above, with any valid pattern index.

Because Renoise is C++ but the API is Lua, Pattern 0 = Lua 1, Pattern 1 = Lua 2, Pattern 2 = Lua 3…

Good luck,

@conner_bw: thanks a hell of a lot!

this time, i did my homework, seeing that the answer to my previous question could be found in the documentation.

i want to get the selected patterns in the Pattern Matrix. i’ve found these options:

  
-- The currently edited pattern track. Never nil.   
-- Use selected_pattern_index_observable for notifications.  
renoise.song().selected_pattern  
 -> [read-only, renoise.Pattern object]  
  
-- The currently edited pattern track object. Never nil.   
-- Use selected_pattern_index_observable  
-- and selected_track_index_observable for notifications.  
renoise.song().selected_pattern_track  
 -> [read-only, renoise.PatternTrack object]  
  
-- The currently edited pattern index  
renoise.song().selected_pattern_index, [added B6] _observable  
 -> [number]  
  

i am working in the Pattern Matrix for this tool (see my first post for a brief explanation). ‘selected pattern’ in the case of the above properties, really means ‘focused pattern’. when i make a selection (of multiple patterns), this cannot be accessed (as far as i know). also (and this might be the reason), i do not see a lot of scripting stuff pertaining to the Pattern Matrix. can someone please elaborate on this?

(as an aside, i am pretty self-conscious and apologetic about asking these questions. i feel like a newbie that keeps coming up with questions that people read and think ‘my god, stop asking these stupid questions’. i try to keep them to a minimum, but i have even more questions unanswered that i do not ask right now because i fear this entire sub-forum - the scripting q&a part - will be filled with threads by myself, so to speak… is this feeling in any way justified, or should i just ask whatever i want to ask, knowing i did my best searching for it and trying to figure it all out?)

Oh. Indeed. Will remove them from the docs.

In doubt, use

  
oprint(renoise.song())  
-- or oprint(renoise.song().sequencer)  
  

to print available properties and functions for an object. Its queried at runtime, so its always correct and up to date.

If you don’t want to fill up the entire forum with your questions, create a single “rhowaldt’s journey into the Renoise Lua API”-or whatever thread, and post all your questions there. We’ll try to help you and will get a lot of feedback from you back in return. So nothing to worry about.

The Renoise API is not like a OSX or Microsoft API millions of people are using and you can google for. Its also not fixed, not yet settled: It evolves and depends on all your feedback.

haha that is a great idea. however, i don’t think it would be useful for keeping an overview of the different questions.
thank you for the reassurance. it sucks feeling like a noob sometimes, and it is nice to know people appreciate your questions.

i did not even know these existed in the docs. however, instead of removing them from the docs, couldn’t you just add them to the API, as i need them? :slight_smile:

Sorry, I’ve mixed up things here. They used to be in the initial draft of “sequencer” but then didn’t made it into the release. I thought they are still in the docs. Well, simply try to forget my comment about this ;)

Oh. Looks like the ‘delete selection’ function I was going to beef up my custom Del-key script has just become impossible :-\

we want this implemented taktik! we will never forget! you hear me!? NEVER!!!