# [Solved] How To Talk To _Only_ X Or Y Of Effectcolumn?

hi, how would i go about only entering x or y of amount_string/amount_value so that i could cycle through 0-F on x and 0-F on y.

i’ve already got 00-FF (xy) scrolling with keyboard shortcuts, which is neat, but i’m looking for more. i don’t understand how to talk to only “Xy” or “xY” in the amountstring, please.
i would really appreciate some help Maths.

How would you do it if it was decimal (base10)?

value=xy --eg 35. Say you want to set x to 5.
y=value mod 10 – Taking the modulus when the divider is the base of the number system (so 10 in my example, 16 for the hexadecimal used by Renoise) gives you y
x=value-y – Can be left out for calculating changes to y, in which case you would substitute it for x below.
z=5-x – Remember 5 is just out example case.
new_value=value+z

Sorry I can’t remember exactly how LUA approaches the modulus command but know I have used it at least once. Had a quick look at the manual page but it didn’t really help. Think it was that Programming LUA site I must of used to aide me before. Too tires to search and read though.

i dont know how i’d do it if it was decimal. i have “amount” as a local that talks to xy, but dividing that into x and y and having amount talk to only x or only y, and retain the y, i don’t know how to do that.
i don’t know what a modulus is

``````x,y = math.modf (renoise.song().selected_effect_column.amount_value/16)
y=y*16

print (x,y)

``````

Hmm, kinda. I now get 10, 10 if the effectcolumn is AA . now, how would i go about changing x or y?

I’ve pretty much given you the steps above, although I think I made a mistake in the recombining process there.

You know have x and y. From your comment I’m going to assume you have a single valbox and two buttons to choose where to push the value to (activate different routines)

For x:

``````x=amount --(For y use y=amount)
renoise.song().selected_effect_column.amount_value=16*x +y
``````

i can jury-rig a y-controller (which is max 0-15) and that works for xY but the Xy i dont grok. we’ll see what happens.

I hope you noticed I hadn’t commented out with – the comment in the first line. I assume it wouldn’t of been happy if you didn’t.

If I read you right you want to make an XY type controller (or even two knobs/faders), with each axis doing one of the values of a 00xy type pattern command. Haven’t got anything to try but would be something like this.

x1=midix
y1=midiy

``````function.dx() --called by a change to the x1 value from midi or whatever your actual control is.
y = renoise.song().selected_effect_column.amount_value%16
renoise.song().selected_effect_column.amount_value=16*x1 +y
end

function.dy() --as above for y.
x,y = math.modf (renoise.song().selected_effect_column.amount_value/16)
renoise.song().selected_effect_column.amount_value=16*x +y1
end
``````

just looking for shortcuts. midi would be nice but not required until shortcuts work.
i’ve got +1/-1 for Xy and +1/-1 for xY. with some help from a mate who came over, we got it up to being able to cycle Xy 0-F or xY 0-F but after that it breaks nicely. let’s see what happens before dinner

ok, xy works. retrig, note cut, vibrato, tremolo, arpeggio all work.
ace.

Sounds like you just need some sanity checks to make sure you are not out of range and decide whether to hold the value at the extremities or too loop around. Should of realised it’s keyboard shortcuts with your current big project but your wording confused me yeah once i figure out how to make midimaps out of keybinds automatically, i’ll start doing that, but not much interest in midimapping these functions as paketti is my package’o’fun