en 16 global cc assign and channel assign | Intech Studio
💬 general Grid

en 16 global cc assign and channel assign

briandsdrh
briandsdrh · · 193 replies

hello. in lieu of creating new pages i’m curious if can use an encoder press to reassign encoder CCs and Midi Channel in batches, i.e. press encoder button and reassign encoder CCs from 1-16 to 17-32 or midi channel 1 to midi channel 2

Replies (50)

mvdirty mvdirty ·

(I'm just an end user like you but...) Absolutely! Let's see if I can paste in some snippets from my setup to get you going...

mvdirty mvdirty ·

Starting with some system setup like this:

function set_g_loff(loff)
    g_loff = loff
end
function send_g_loff(loff)
    immediate_send(nil, nil, 'set_g_loff(' .. loff .. ')')
end```
mvdirty mvdirty ·

And a [momentary] button that works a bit like this:

        send_g_loff(1)
    else
        send_g_loff(0)
    end```
mvdirty mvdirty ·

You can use a function like this:

    return (g_loff * 16) + num
end```
mvdirty mvdirty ·

So that an encoder with a cc local variable like this:

mvdirty mvdirty ·

e_cc(self:element_index())

mvdirty mvdirty ·

Can do a CC send like this (either as code or as the midi block from which I generated this code) :
midi_send(ch, 176, cc, val)

mvdirty mvdirty ·

Note that the immediate_send and send vs set stuff is in there so that you can choose one [shift] button on a multi-module grid and have this shifting occur across the entire grid [as long as you have the relevant bits in the system setup on all modules.]

mvdirty mvdirty ·

And also, of course, that you could just as easily shift midi channels by adapting the logic, instead of shifting CC ranges.

Greg-Orca Greg-Orca ·

Hi, check out this porfile in profilecloud: 64CTRL v2.2

Demetrisag Demetrisag ·

I want something like that but I only want to change the channel. as everything is channel 1 now, make them channel 2

Demetrisag Demetrisag ·

I'd rather skip the profile load unless its a single button!

mvdirty mvdirty ·

If referring to my example code, just use the offset to change how ch is determined rather than cc. (It’s actually how that code started out, even.)

Demetrisag Demetrisag ·

Is it possible to use this on a single knob and have it toggle between two channels? e.g each time I press it it will switch between ch.1 and channel.2. I don't mind keeping the cc as well as it gives more flexibility

Demetrisag Demetrisag ·

I am not sure where everything goes. This is going to system:

function set_g_loff(loff)
    g_loff = loff
end
function send_g_loff(loff)
    immediate_send(nil, nil, 'set_g_loff(' .. loff .. ')')
end```

This is going to my chosen knob on the button section

```   if self:button_state() > 0 then
        send_g_loff(1)
    else
        send_g_loff(0)
    end```

Where is this going?

```function e_cc(num)
    return (g_loff * 16) + num
end```
mvdirty mvdirty ·

For your current use case, just plug the (g_loff * 16) + num part into the encoder turn local variables, replacing the code there for the cc variable. I’m on my phone and away from the grid editor right now, so… if that doesn’t work then try replacing the num in that with self:element_index() (from memory. Sorry if I’m making any errors.)

mvdirty mvdirty ·

Alternatively, go into the encoder turn local variables and change the code for cc to read as: e_cc(self:element_index())

mvdirty mvdirty ·

That’ll be the cleaner way for maintaining the setup over time, since you’ll be able to centrally adjust its logic, eg the * 16 part, by editing the e_cc function’s code in the system element setup code block.

mvdirty mvdirty ·

Oh, just to get specific about something you asked which I only eluded to just above: you should put that e_cc function in your system element setup code block. That’ll be the best place for letting it be used by all of the encoder elements on the module.

Demetrisag Demetrisag ·

ok, I get it to work in its original settings you wrote! do you know how I can I make it a toggle? instead of momentary?

Demetrisag Demetrisag ·

I think I managed to turn it into a toggle using this on system

Demetrisag Demetrisag ·
    g_state = 1 - g_state
    send_g_state(g_state)
end
function send_g_state(state)
    immediate_send(nil, nil, 'set_g_state(' .. state .. ')')
end
function e_cc(num)
    return (g_state * 16) + num
end```

and this on a button

```if self:button_state() > 0 then
    toggle_g_state()
end```

but now it doesnt work cause I think its telling me it cant multiply cause it doesnt have a numer to add

I used on all encoders that

```e_cc(self:element_index())```
Demetrisag Demetrisag ·

ohh I needed to tell it g_state=0! damn me this coding! I have no literally no idea!

Demetrisag Demetrisag ·

alright now I need to make the same for key notes for when the knobs are pressed! 😂

mvdirty mvdirty ·

Sounds like you’re on your way, which is great!

Demetrisag Demetrisag ·

I made it! I finally made it! The perfect page! I use one knob to toggle everything Notes for buttons and CC for encoders and in the system knob I can also rotate it however I like cause I move it all the time until I decide where I really want it! The perfect profile!

Demetrisag Demetrisag ·

Ok it's not perfect yet , I still need to figure out how to change the led colours when I press the knob I have assigned as bank change

Demetrisag Demetrisag ·

Any pointers on that?

mvdirty mvdirty ·

Take a look at an encoder element setup. You can replace the code in the local variables for red green and blue, or can go down into the layer one and layer two color blocks and customize them instead or as well.

briandsdrh briandsdrh ·

oh man i don’t understand any of this code at all. i just got my unit in the mail and will have sometime soon to start getting it setup. i do want to work on including colors on leds for different schemes of controls in the layout. is there any place to learn some basics of programming the unit? i.e. g_loff

briandsdrh briandsdrh ·

ok i’ll look into that. i will need to learn the code stuff in order to customize it

briandsdrh briandsdrh ·

i was able to load the cloud profile but no idea how to use it lol

Greg-Orca Greg-Orca ·

Load the profile, store it on the module and press the encoder buttons to change the MIDI CC.

Greg-Orca Greg-Orca ·

You can open the MIDI Monitor in the bottom left corner—it helps to check what MIDI messages are being sent.

Demetrisag Demetrisag ·

I have a profile set after about 2 or 3 days of fighting with gpt! What would you like to do with yours? Tell me just in case it matches any of my needs I could help you with yours**@user**

briandsdrh briandsdrh ·

mine is going to be used to control various different vst parameters. going to be setting up for different banks per row with paging and swapping led colors. so i’ll be changing CCs per row not for the whole unit. for example the bottom row i want for my 8 channel graphic eq. right knob will “page up” so i get the back half and left knob will “page down” so i get the front half

mvdirty mvdirty ·

g_loff, and most of the other code I showed, is my custom stuff and assumes some level of lua and grid knowledge. Sorry for throwing you in the deep end without realizing.

briandsdrh briandsdrh ·

no it’s ok. i want to learn

briandsdrh briandsdrh ·

i’m grateful for the friendly resources

briandsdrh briandsdrh ·

my understanding so far is that if i would like to apply changes across multiple encoders that the variables need to be stored in system init block?

briandsdrh briandsdrh ·

the encoder code block will only work to change state of that specific encoder?

mvdirty mvdirty ·

I’ve been pounding my head against a combination of grid scripting and Bitwig controller scripting for the last few days pretty much solid. I have apparently found yet another hobby that creates busywork instead of music. 😆

briandsdrh briandsdrh ·

ahaha i’m using the grid to control multiple parameters of amp sims lol

briandsdrh briandsdrh ·

digital amp guy that wants a quality of life stuff lolol. so excessive

mvdirty mvdirty ·

So I totally understand the lost feeling. Less so now on the grid stuff, though I had to muddle my way through some discoveries, but man oh man the bitwig scripting story is nuts. Loads of deprecated portions, should-be-deprecated options, and a very particular model in mind for how controllers should work, most of it essentially undocumented. lol

mvdirty mvdirty ·

What daw are you working in?

briandsdrh briandsdrh ·

lol. reaper has lots of scripting i have never looked at or tried to do anything with

briandsdrh briandsdrh ·

reaper

mvdirty mvdirty ·

Can’t help you there, but can try to help out with the grid side

briandsdrh briandsdrh ·

yea that’s all i need help with right now

Discord

View on Discord

This post is from the Intech Studio Discord community.

Open thread →