Keep MIDI settings on module physical rotation | Intech Studio
💬 general Grid

Keep MIDI settings on module physical rotation

kkerti
kkerti · · 15 replies

Made a profile to keep MIDI settings on module rotation, by adding a rotIndx() calculation to system -> setup.

Find it on profile cloud: Any rotation, same MIDI assignments

This could be also used on other controllers too with minor changes, probably the calculations should be adjusted for PBF4 and EF44 as they have only 8 and 12 control elements. In theory it should work, but it's ot tested.

Replies (15)

kkerti kkerti ·

The logic is rather brute forced, but works:

function rotIndx(ogIndx, rot)
    local row = math.floor(ogIndx / 4)
    local col = ogIndx % 4
    local nRow, nCol
    if rot == 0 then
        nRow = row * 4
        nCol = col
    elseif rot == 1 then
        nRow = 4 - 1 - row
        nCol = col * 4
    elseif rot == 2 then
        nRow = (4 - 1 - row) * 4
        nCol = 4 - 1 - col
    else
        nRow = row
        nCol = (4 - 1 - col) * 4
    end
    return nRow + nCol
end
kkerti kkerti ·

The function above will return always the same index for a control element, no matter the rotation.

kkerti kkerti ·

Checking the profile in detail, all the control elements in the local action block uses the call for the index, because cc is calculated from that.
cc=rotIndx(self.element_index(),module_rotation())

kkerti kkerti ·

Now @user if you want to combine the this profile with the new mouse move thingy, this rotIndx() function should be copied with the other global variables either to the system setup or somewhere on the module under setup.

Demetrisag Demetrisag ·

before I want to combine I dont understand what do I need to change to make a roation lets 90degree CW. is it the encoder offset? make it instead of 16, 8? or something

Demetrisag Demetrisag ·

the rot == 0 in the code block?

kkerti kkerti ·

Make rotation 90 cw? It's automatically detected by Grid, relative to the other module which you connect to...

kkerti kkerti ·

Or is this for a single module?

Demetrisag Demetrisag ·

its just one EN16

Demetrisag Demetrisag ·

I might buy other modules later but for now I want to get the handle of one!

kkerti kkerti ·

To overwrite the rotIndx function to work in the 90cw, I think its enough to add this to the line right after function rotIndx():

rot = 1

kkerti kkerti ·

Didn't try, I'm not at computer right now.

Demetrisag Demetrisag ·

yep I did that! and It worked and then I thought if I put 2 it will 180cw and so on but it didnt 🙂 what should I write to cover all 4 possible rotations? like 90,180,270,360

Demetrisag Demetrisag ·

oh it works now! basically I tried changing the if "rot=" that was already there. then I saw you actually wrote to add rot = 1. then with this it worked also when I typed rot = 2. So I am gonna try copy and paste that block on the setup of another page see if I can rotate those as well!

Demetrisag Demetrisag ·

well basically on the new plage I applied your preset, that I know rotation is working fine. I created a knob that control the mouse movement bascially I copied it from another page and pasted it. and I applied the rotation, as expected everything midi got rotated but the mouse movement knob stayed it where it is

Discord

View on Discord

This post is from the Intech Studio Discord community.

Open thread →