hmm… what i’m attempting to do is this:
if the user has never set a single panning_column value, the panning_column is empty. If the user starts setting panning_column amounts, start from “40” (middle, center) instead of from “00”. This allows for, say, going to row1 and saying “+3 pan” and it is 43 - then going to row 2 and saying “-3 pan” and it is 3D. but if the user goes below 0 in panning, the panning column is wiped (edited to “…”). if the user then starts adding pan or removing pan, they start from 40.
that’s why i’m setting “if panning is “–”, go to 40” on line 1, then on line2 i go "actually here’s some math to carry on from.
do you see what i’m going for?
the chg is +1 -1 +10 -10, and that is used to modify the panning column content. i just want to make sure that when starting from empty panning column data, and one starts the process of adding, subtracting from panning column, that it starts from 40. and returns to “empty” if you get below 0, and then starts from 40.
think of “below 0 to “…”” as “reset to center”, and then the next “oh there’s a “…”, i’m jumping to 40 because that’s center where the number counting starts” as the method for continuing instead of forcing the user to start from hard left pan (00). it’s much more convenient to the workflow.
Ok I understand. Perhaps the best way to do all this is to create two functions, one to add, and another to subtract, and each one will work with a specific keyboard command.
After creating each function, make sure that the command repeats the function, establishing the limits within that function.
Forget the panning_string and focus your attention on the panning value. The panning sub-column accepts values greater than 127, and one of them is 255 (empty).Here is a suggestion and I have not tried the code, but I think it’s fine:
--renoise.song().tracks[].panning_column_visible
--renoise.song().patterns[].tracks[].lines[].note_columns[].panning_value
function panning_up( chg, song, pan )
song = renoise.song()
if ( song.selected_track.panning_column_visible == false ) then
song.selected_track.panning_column_visible = true
end
if ( song.selected_line.selected_note_column.panning_value > 127 or song.selected_line.selected_note_column.panning_value ~= 40 ) then
song.selected_line.selected_note_column.panning_value = 40
end
pan = song.selected_line.selected_note_column.panning_value
if ( pan + chg <= 127 ) then
song.selected_line.selected_note_column.panning_value = pan + chg
end
end
function panning_down( chg, song, pan )
song = renoise.song()
if ( song.selected_track.panning_column_visible == false ) then
song.selected_track.panning_column_visible = true
end
if ( song.selected_line.selected_note_column.panning_value > 127 or song.selected_line.selected_note_column.panning_value ~= 40 ) then
song.selected_line.selected_note_column.panning_value = 40
end
pan = song.selected_line.selected_note_column.panning_value
if ( pan - chg >= 0 ) then
song.selected_line.selected_note_column.panning_value = pan - chg
end
end
You will have to define the “chg” number somewhere, for example, from a valuebox…You can try all these things and choose what you like most.Personally, I would prefer not to jump to 40 when the value is less than 0. I would leave the value at 0 (maximum left).The same with 127.
If you only want to use a keyboard command for both cases and that the value “chg” is positive or negative, you only have to “merge” both functions into one and adapt it to this value.Sometimes, seeing things separately helps you move forward.
Edit:Remember to shield the function to avoid errors (in a group/master/send this will not work).