New Tool (2.8, 3.0): Flexible Pattern Resizer

Thanks for the very handy tool dblue. :)

Just found a problem, not sure if it’s only me encountering this or it’s a bug: Everytime I try to enter a pattern length manually in the ‘New Pattern Length’ field by double clicking on it and using the keyboard, it returns 01.

How strange! I can confirm that it happens for me as well. After taking a quick look and testing some things, I just added tostring() and tonumber() functions to the valuebox control and now it seems to be working normally again. I thought that I had used the valuebox this way before without the converter functions, but maybe I’m just imagining things.

Seems like tostring() and tonumber() are actually required, even when handling the simplest forms of conversion, for example: from the string “64” to the number 64. This makes sense, but I had assumed that Renoise was handling some of that basic functionality automatically, and if the programmer wanted to do more advanced conversions then they could simply replace those functions.

I guess the behaviour here could possibly be related to this.

Anyway…

v1.03 Update: Fixed this bug mentioned by Ashkan Asgary :)

tostring and fromstring are optional. Nothing should break when not specifying them. Could you provide an example for this so that I could take a deeper look into this?

Found the issue and will fix this for the next update.

Glad I could help. :)

P.s. Here’s also a small suggestion: ‘New Pattern Length’ remembers the last entered value each time the tool starts already, of course it makes sense in one way, but I thought it would also be nice if it returns the current pattern’s length. Not sure if either one is more logical.

Yep. I’ll probably make this optional at some point. There’s still a lot of usability left to figure out.

btw, is it possible to make FlexiblePatternResizer show in the Pattern editor right-click context menu? :)

It’s currently available via Pattern Editor > Pattern > Resize

I wasn’t quite sure what the etiquette was on menu placement, but this seemed like the most sensible place for it?

It could certainly be moved if people feel that it would be better positioned one level higher at Pattern Editor > Resize Pattern, but I’m not sure which is best. I would like to avoid clutter within the context menus, but I’m open to suggestions.

Personally, I’ve just mapped the tool to the key binding LAlt + R, which fits into my workflow a lot better.

Still a great tool.

Feature request: Pass keystrokes to Renoise.

Example: I resize by clicking on the Tool’s interface, I don’t like, I click CTRL-Z to undo and nothing happens. I have to click out to undo. It would be nice if I didn’t have to do this.

I looked at the code. This can be done by changing:

  
 dialog = renoise.app():show_custom_dialog(TOOL_NAME, content)   
  

To:

  
 local function key_handler(dialog, key)  
 return key  
 end  
 dialog = renoise.app():show_custom_dialog(TOOL_NAME, content, key_handler)   
  

Cheers.

can we get shrink/expand selection too.
thanks

Thanks for the great tip! I’m definitely still learning the ins and outs of the API. I will add your suggestion to the next update.

Yep, I already have a few interesting ideas for ways to handle shrinking/expanding selections. Hopefully I will spend some more time with it soon.

v1.04 : Updated for Renoise 2.7

is it me or does this tool only allow you to resize one pattern at a time? from reading the forum thread i figured it would let you change all patterns in the song?

I don’t know where you got that impression from, but at the moment the tool only operates on single patterns.

I’ve already written a bit about this earlier in the thread:

It’s obviously something I hope to address later.

got the impression from the previous page i think, where you mention a request for a tool that… wait… maybe i think you mention a request for a tool that changes pattern length throughout the song, but i have not looked back at that particular request so maybe i was wrong. too lazy now to figure out.

thanks for the quick info and i hope you find some time to build this in someday. often with requests etc that i make it is not because i run into a problem a lot of times, but it’s more based on the situation i am in right at the time. so i rarely have the need to use this tool. so… what i’m trying to say is, don’t go and hurry up for me, or something. BLAH BLAH BLAH (really gotta get back to making music now)

There is a tool from Mogue called LBPx that does what you want for all patterns, can’t find it in the forum atm.

I found it here: Snippet: Convert Song From Lpb4 To Lpb12

@Jonas+danoise: thanks for that. it resizes all patterns indeed, but the only option you have is to multiply the current pattern length by a certain factor. i’d like for just an option to input a value and have all patterns set to that length. but i’ll request that one in the appropriate post.

Yo Dblue,

would this request fit in a remix / update of your pattern resizer tool?

Cheers,

:drummer:

Seems like my prayers have been answered already :)

Thanks for this, patching renoise is totally awesome!