I do not understand this.I mean, I do not know what you want to do here.
Hi. So, I’ve got keyboard shortcuts that allow for controlling of Effect Column content, which is really nice. But now I am attempting to go from a simple script that does +1/-1/+10/-10 (depending on the amount specific when calling the function via shortcuts or buttons) to “use a slider on this”. So I’m hoping to make it so that I have, say, a couple of midicontroller sliders, and those output, to Renoise, data 0…127 and that is mapped to the effect column space 0-FF (in the case of amount_column). so i’m wondering how to use this math so that a slider can be, functionally, mapped to this method of writing.
this is what the shortcut looks like:
function effectamount(amount,effectname)
-- massive thanks to pandabot for the optimization tricks!
local s=renoise.song()
local counter=nil
for i=s.selection_in_pattern.start_line,s.selection_in_pattern.end_line
do
s:pattern(s.selected_pattern_index):track(s.selected_track_index):line(i):effect_column(1).number_string=effectname
counter=s:pattern(s.selected_pattern_index):track(s.selected_track_index):line(i):effect_column(1).amount_value+amount
if counter > 255 then counter=255 end
if counter < 1 then counter=0 end
s:pattern(s.selected_pattern_index):track(s.selected_track_index):line(i):effect_column(1).amount_value=counter
end
end
A slider (viewbuilder) can have a custom range. So you could configure your slider to accept the MIDI input range (0-127) and then scale the result before applying it to the parameter.
But - be aware that you’ll need to instantiate your own MIDI port connections if you want to roam freely around and control parameters.
(I know, it’s not part of the code you posted - but wanted to point this out in any case. The MIDI mapping dialog in Renoise (CTRL+M) binds to a single, specific parameter)…
Hi. So, I’ve got keyboard shortcuts that allow for controlling of Effect Column content, which is really nice. But now I am attempting to go from a simple script that does +1/-1/+10/-10 (depending on the amount specific when calling the function via shortcuts or buttons) to “use a slider on this”. So I’m hoping to make it so that I have, say, a couple of midicontroller sliders, and those output, to Renoise, data 0…127 and that is mapped to the effect column space 0-FF (in the case of amount_column). so i’m wondering how to use this math so that a slider can be, functionally, mapped to this method of writing.
this is what the shortcut looks like:
function effectamount(amount,effectname)
-- massive thanks to pandabot for the optimization tricks!
local counter=nil
for i=renoise.song().selection_in_pattern.start_line,renoise.song().selection_in_pattern.end_line
do
renoise.song():pattern(renoise.song().selected_pattern_index):track(renoise.song().selected_track_index):line(i):effect_column(1).number_string=effectname
counter=renoise.song():pattern(renoise.song().selected_pattern_index):track(renoise.song().selected_track_index):line(i):effect_column(1).amount_value+amount
if counter > 255 then counter=255 end
if counter < 1 then counter=0 end
renoise.song():pattern(renoise.song().selected_pattern_index):track(renoise.song().selected_track_index):line(i):effect_column(1).amount_value=counter
end
end
PS : I’m waiting for Raul to point out that you really should avoid all those renoise.song() statements
A slider (viewbuilder) can have a custom range. So you could configure your slider to accept the MIDI input range (0-127) and then scale the result before applying it to the parameter.
But - be aware that you’ll need to instantiate your own MIDI port connections if you want to roam freely around and control parameters.
(I know, it’s not part of the code you posted - but wanted to point this out in any case. The MIDI mapping dialog in Renoise (CTRL+M) binds to a single, specific parameter)…
Well, thankfully I’m not using the LUI GUA viewbuilder at all for now, just direct CMD-M -bindable midimapping and keymapping, for now. I do have some eventual plans, once I figure out how to use for-loops to build GUI Viewbuilder buttons - as making them all by hand was really slow 5 years ago - considering i hardly knew what i was doing then - even now…
Anyway, I would be using external midi controller sliders to send 0…127 and am just trying to see how much I’d have to change to be able to directly write to selection_in_effect_column (even tho I’d mostly be in note_column) and, if no selection, then “current_row_effect_column”.
PS : I’m waiting for Raul to point out that you really should avoid all those renoise.song() statements
Who me? You must’ve quoted me with a previous, older edit check now