New Tool (3.4): Grid Pie

I’ve tried it yesterday with my LPD8 and this tool is so awesome!

It’s really great for finding new options while composing… instant remix!

I just uploaded a new version (0.6) to the Tools page that tries to remember the original state of the Pattern Matrix, and will unmute the slots when you close Grid Pie.

http://tools.renoise.com/tools/grid-pie

PS: One of you unlucky souls downloaded a buggy version of Grid Pie. I put it back in quarantine, fixed it, but then when I went to re-upload the patched version Grid Pie was out of quarantine. Damn, that’s super fast service! :) Re-download the tool if this unlucky soul is you.

Version 0.7 released to the Tools page. I got polyrhythms working in Grid Pie. You can now make odd time signature stuff on-the-fly.

[b]To enable, open “com.renoise.GridPie.xrnx/main.lua” in the Script Editor and change line ~6 from :

  
local DISABLE_POLYRHYTHMS = true  
  

To:

  
local DISABLE_POLYRHYTHMS = false  
  
``` [/b]  
  
My problem is I don't want to enable it by default because it's too slow to be any fun. I was wondering if any of you wanted to take a look at this and help me speed it up?  
  
Right now, I'm thinking `copy_and_expand()` should be written in C++ and added to the API; like `tracks[]:copy_from()` is - But, maybe I'm just doing something wrong and you girls/guys can tell me?  
  
An example bad case is combining a 64 line pattern with a 112 pattern from: [indamixx]_jonas_the_plugexpert_-_Savons.xrns (available in our song downloads section) This will create a 448 line pattern and copy+expand everything as optimized as possible, but it's still too slow.   
  
For the record, I have already tried ProcessSlicer and it didn't do the job. It made things worse. Don't let that stop you from trying with it though.

head asplodes

Connor: First, I warm round of applause to you. I think you did a great job.

Since I’d like to integrate the same function (s. here what I got when asking the renoise developers: Renoise Mockup (Live Features))

So I had thought about a lot things that I now know would also make sense. which is:

  • Move a “toggled line ( i will call that ‘sequence’ now” up/down/left/right
  • Rewind Track (maybe also whole pattern? though this can already be done by using arrow up/arrow down)
  • Sample Track and play reverse sample while muting
  • Remember clicked sequences

And so on.

What do you think about that?
If not clear I’ll add some pics.

There is only one thing to know:

Does LUA offer to integrate more than one gui at once?
Because I don’t want to change the interface of gridpie.
But I’d like to add this.

Connor_BW what’s your opinion?

Hey, thanks!

Pictures would be great.

Yes, this is possible AFAIK.

I haven’t tried it myself yet but I have seen scripts with more than one window. (The Duplex settings dialogue, for example.)

made me drooling a bit also! :smashed:

This should do the trick:
2434 GripPieExpandSpeedup.zip
(a patch against the current xrnx svn version - r1068)

Gets rid of doubled “pattern.tracks” and “track.lines” calls and use line(i) and track(i) instead of lines and tracks.
“lines” and “tracks” calls are pretty heavy, cause they do convert all lines of a pattern to Lua first, then only one use of them (the one at “i”). line() only converts a single line to Lua; the one you are interested in.

Definitely faster! Thanks! I had to change it a bit. Committed to SVN.

Some questions

  • You removed OneShotIdleNotifier under “Also expanding track” but not for “Expanding track”, a typo?
  • I had to put back to_line for the automation points. Was this working for you without it? A typo?

I’m still not sure if this is fast enough to enable by default. With complex automations it’s still hurting a bit.

Adventurous people who want to test this, svn upor:

  • Open “com.renoise.GridPie.xrnx/main.lua” in the Script Editor
  • Cut and paste from this revision.
  • Reload Tools

Feedback? Is this fast enough for you?

Yay, the polyrhytmics make this really interesting. Great work, Conner

I’d say yes. Keep your patterns as short/compact as possible (lower the LPB value) and you should have no problems.

Great fun to recombine patterns of 4, 6 and 9 lines, for example.

Another approach could be to output pattern data incrementally over time, instead of being calculated all at once?

Thanks danoise,

I think the automation procedure could be sped up, but I have brain freeze / distracting baby on lap this morning and I’m stuck. E.g.

[luabox]
for i=1, number_of_lines do
for j=1, multiplier do

to_line = i + number_of_lines * j
local source_line = dest_track:line(i)
local dest_line = dest_track:line(to_line)

if not source_line.is_empty then
– Copy the top of pattern to the expanded lines
dest_line:copy_from(source_line)
end
for k,automation in pairs(dest_track.automation) do
local points = table.create(table.rcopy(automation.points))
for _,point in pairs(points) do
if math.floor(point.time) == i then
local decimals = explode(".", point.time)
if (decimals[2] ~= nil) then decimals = tonumber(“0.” … decimals[2])
else decimals = 0 end
dest_track.automation[k]:add_point_at(to_line + decimals, point.value)
elseif math.floor(point.time) > i then
break
end
end
end
end
[/luabox]

Should look something like:

[luabox]
local points= table.create()
for k,automation in pairs(dest_track.automation) do
points[k] = table.create(table.rcopy(automation.points))
end

for i=1, number_of_lines do
for j=1, multiplier do

to_line = i + number_of_lines * j
local source_line = dest_track:line(i)
local dest_line = dest_track:line(to_line)

if not source_line.is_empty then
– Copy the top of pattern to the expanded lines
dest_line:copy_from(source_line)
end
for k,point in pairs(points) do
for _,p in pairs(point) do
if math.floor(p.time) == i then
local decimals = explode(".", p.time)
if (decimals[2] ~= nil) then decimals = tonumber(“0.” … decimals[2])
else decimals = 0 end
dest_track.automation[k]:add_point_at(to_line + decimals, p.value)
elseif math.floor(p.time) > i then
break
end
end
end
end
end
[/luabox]

I’m not sure if this actually speeds things up. Seems to shave off a few milliseconds, but this could just be other factors like my CPU doing other stuff at the time? Any insight on the internals here Taktik?

  
Before:  
Expanding track 5 from 112 to 448 lines  
Time to expand track 5 was: 1.8209999999999  
  
After:  
Expanding track 5 from 112 to 448 lines  
Time to expand track 5 was: 1.6030000000001  
  

I did a few more tests and everything is “good enough for me.”

Version 0.8 has been released to the Tools page. Polyrhythms and odd time signatures are now enabled by default.

http://tools.renoise.com/tools/grid-pie

Patches to speed things up even more are, of course, welcome.

Oh, sorry. Have no tested thoroughly, not even read the whole thing. Result look good to me though.

Main bottleneck is adding the points here, so there’s not really much left to optimize.
Nevertheless have done/fixed what can be fixed. Again only quickly tested, so please only use this as inspiration:
[luabox]
function copy_and_expand(source_pattern, dest_pattern, track_idx, number_of_lines)

local source_track = source_pattern:track(track_idx)
local dest_track = dest_pattern:track(track_idx)

if number_of_lines == nil then
number_of_lines = source_pattern.number_of_lines
end

if source_pattern ~= dest_pattern then
dest_track:copy_from(source_track)
end

if dest_pattern.number_of_lines <= number_of_lines then
return
end

local multiplier = math.floor(dest_pattern.number_of_lines / number_of_lines) - 1

for i=1, number_of_lines do
local source_line = dest_track:line(i)

for j=1, multiplier do
local to_line = i + number_of_lines * j
local dest_line = dest_track:line(to_line)

– Copy the top of pattern to the expanded lines
if not source_line.is_empty then
dest_line:copy_from(source_line)
end

for _,automation in pairs(dest_track.automation) do
for _,point in pairs(automation.points) do
if (math.floor(point.time) == i) then
local dest_time = to_line + point.time - math.floor(point.time)
automation:add_point_at(dest_time, point.value)
elseif math.floor(point.time) > i then
break
end
end
end
end
end

end
[/luabox]

Alright! Thanks Takitk.

Version 0.81 in SVN and released to the Tools page.

http://tools.renoise.com/tools/grid-pie

Cheers.

Me again, last one for a while now. I promise.

Version 0.82 released to the Tools page. Show “poly count combo!” in Renoise’s status bar.

http://tools.renoise.com/tools/grid-pie

Thanks again everyone!

Here I hope you get a glimpse of my intention.

This is one of the originals:

2448 OriginalSequence.png

Button to clear whole “Sequence”:

2443 Cleared.jpg

Right now inserted but playing starts when next measurement / bar is reached (like ableton live standard behaviour I guess)
Maybe done by right(middle mouse button?) click:

2449 PlayNextBar.jpg

Move the whole “Sequence” one line down (compared to next pic):

2450 MoveDown.jpg

Move the whole “Sequence” one line up (compared to previous pic):

2447 MoveUp.jpg

Same as before, but Move it Right:

2446 MoveRight.jpg

Move it left:
2445 MoveLeft.png

Choose from a “saved” sequence:

Hi dr4g0n76,

What controller are you using? For example, when you say “button to clear the sequence” what button are you talking about?

@ Connor_BW:

I’m using a Korg M3 / Radias combination (Radiasboard inside M3)

And what I like to do is to map those yet lacking functions to the m3.
And if you like to I’d integrate them myself and post the code here. No big deal, I guess.

I just fiddled around with ableton live and some dj-ing tools and had an Idea that would you did could be
a real great live-mixing dj-ing tool for renoise. That’s what I see at the horizon, you know?

:wink:

Really great stuff what you did here.

Hope it’s clearer now?!

Hey, that would be great!

I made this as a 24 hour hack, then polished up the concept in my spare time and am happy where it is now. I’m not sure where to take Grid Pie. I’d like to keep it simple but I would love to see other people submit patches, too.

I guess this is what you meant by “second gui”? Like, a separate dialogue for new optional buttons? I don’t think the coding is really hard to do. It’s just that I don’t own any grid controller except the LPD8 and I don’t really enjoy coding stuff I don’t use. It would be a lot more fun for me to integrate patches (code). I appreciate feature suggestions, but you can understand that it gets boring fast to field feature requests that don’t benefit me personally, right? :)

Cheers.