I’ve been working with a similar concept for basic clip-like functionality. Could probably even be combined with this approach!
So, do you imagine that the Grid is organized into 4 vertical columns, with each column representing a choice among 4 options?
Very similar to the idea I proposed when the possibility of scripting was first announced. Anything that makes live more fun, easy or interesting is worth exploring in my book
Here is some code to figure out the resulting pattern length (lowest common multiplier)
Hint: those tracks above would result in a pattern with 1040 lines…IOW, not an optimal fit.
-- greatest common divisor
function gcd(m,n)
while n ~= 0 do
local q = m
m = n
n = q % n
end
return m
end
-- least common multiplier (2 args)
function lcm(m,n)
return ( m ~= 0 and n ~= 0 ) and m * n / gcd( m, n ) or 0
end
-- find least common multiplier with N args
function least_common(...)
local cm = arg[1]
for i=1,#arg-1,1 do
cm = lcm(cm,arg[i+1])
end
return cm
end
-- the following will output "1040"
print(least_common(80,40,13))
I can’t reproduce it anymore so it seems fine.
It was as simple as: open renoise>drag grid pie onto it>load beat slice tutorial song>execute grid pie.
great tool btw, lot’s of potential.
anyway here is what my log said about the incident:
Error Message: 'C:\Users\Paul\AppData\Roaming\Renoise\V2.7.2\Scripts\Tools\com.renoise.GridPie.xrnx\' failed to execute in one of its menu entry functions.
Error Message: Please contact the author (Dac Chartrand [dac@renoise.com]) for assistance...
Error Message: std::logic_error: 'ViewBuilder: invalid value for valuebox: '2'. value must be [1 - 1].'
Error Message: stack traceback:
Error Message: [C]: in function 'valuebox'
Error Message: main.lua:237: in function 'build_interface'
Error Message: main.lua:326: in function <321><br>```
</321>
thanks for this one its great idea! just the 4x4 is very small 8x8 and playable with launchpad would be great i think it would be also helpful to jump 4 positions (or 8 in an 8x8 matrix)on the x and y axis - this really have potential!!
local matrix_width = table.count(renoise().song.tracks) – add an observable event on track addition
local matrix_height = anyNumberThatCouldBeComingFromAValueBox
I’ve had problems making dynamic grids in the past. Too many Lua errors last time I tried. I’m sure it’s possible, somehow, but I won’t be the one to do it. Patches welcome.
Hey, thanks.
What I will do for the next version is a menu. Something like
* Tools -> Grid Pie -> 4 x 4...
* Tools -> Grid Pie -> 8 x 8...
* Tools -> Grid Pie -> Custom...
But like you said, it’s possible now by looking at the Lua.
The most important hurdle to tackle is the MIDI mapping stuff. It’s pretty straightforward. I just didn’t have time (or a controller to test with) during the Music Hack Day. The stubs are already in place. It’s just a matter of finding more free time. Patchers look near line ~435 for:
--------------------------------------------------------------------------------
-- MIDI Mappings
--------------------------------------------------------------------------------
renoise.tool():add_midi_mapping{
name = "Grid Pie:X Axis",
invoke = function(message)
-- TODO
-- vb.views.gp_x.value = FOO
end
}
renoise.tool():add_midi_mapping{
name = "Grid Pie:Y Axis",
invoke = function(message)
-- TODO
-- vb.views.gp_x.value = BAR
end
}
for x = 1, matrix_width do
for y = 1, matrix_height do
renoise.tool():add_midi_mapping{
name = "Grid Pie:Slice " .. x .. "," .. y,
invoke = function(message)
-- TODO
-- toggler(x, y)
end
}
end
end
(PS: I added the functions/procedures that will need to be called, not in code as I type this)
Inspire yourself with the code snippet from: this example.
I won’t have time to mess around with this script for a couple of weeks. But that doesn’t mean you guys/girls can’t have a go at it. Post your hacks?