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
en 16 global cc assign and channel assign
Replies (50)
(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...
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```And a [momentary] button that works a bit like this:
send_g_loff(1)
else
send_g_loff(0)
end```You can use a function like this:
return (g_loff * 16) + num
end```So that an encoder with a cc local variable like this:
e_cc(self:element_index())
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)
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.]
And also, of course, that you could just as easily shift midi channels by adapting the logic, instead of shifting CC ranges.
Hi, check out this porfile in profilecloud: 64CTRL v2.2
I want something like that but I only want to change the channel. as everything is channel 1 now, make them channel 2
I'd rather skip the profile load unless its a single button!
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.)
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
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```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.)
Alternatively, go into the encoder turn local variables and change the code for cc to read as: e_cc(self:element_index())
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.
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.
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?
I think I managed to turn it into a toggle using this on system
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())```ohh I needed to tell it g_state=0! damn me this coding! I have no literally no idea!
alright now I need to make the same for key notes for when the knobs are pressed! 😂
Sounds like you’re on your way, which is great!
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!
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
Any pointers on that?
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.
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
ok i’ll look into that. i will need to learn the code stuff in order to customize it
i was able to load the cloud profile but no idea how to use it lol
Load the profile, store it on the module and press the encoder buttons to change the MIDI CC.
You can open the MIDI Monitor in the bottom left corner—it helps to check what MIDI messages are being sent.
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**
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
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.
no it’s ok. i want to learn
i’m grateful for the friendly resources
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?
the encoder code block will only work to change state of that specific encoder?
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. 😆
ahaha i’m using the grid to control multiple parameters of amp sims lol
digital amp guy that wants a quality of life stuff lolol. so excessive
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
What daw are you working in?
lol. reaper has lots of scripting i have never looked at or tried to do anything with
reaper
Can’t help you there, but can try to help out with the grid side
yea that’s all i need help with right now
View on Discord
This post is from the Intech Studio Discord community.