Inter-Module Interaction? | Intech Studio
💬 general Grid

Inter-Module Interaction?

Hyperstation Jr.
Hyperstation Jr. · · 21 replies

In plan English, can someone explain to me how to have an element from one module modify the parameters of another?

Ultimately what I’m trying to do is use 8 buttons on a BU16(3) to select one of the 16 MIDI Channels two connected EN16(2) should transmit to.

I figured the best way to do that was to have the buttons go from 1-8 and then use a sort of shift function with another BU16 button, but I’d also be fine with using double presses, so long as only one of those elements are active.

Then I’d want another button on the BU16 to toggle between two (or more) sets of MIDI CCs the EN16s should send.

Does this make sense, and is it possible?

It seems like the same sorts of things other configurations can do, but I can’t figure out how to implement what I want. I’ve read the help files, looked through the forum, and searched here, but haven’t found what I’m looking for. I even tried using ChatGPT to help code it but with no luck.

Can anyone offer any help?

Replies (21)

cecilnick cecilnick ·

have you looked at the 64CTRL profile for EN16? it does some of what you're looking for. curious what parts of it don't work?

Hyperstation Jr. Hyperstation Jr. ·

Yes, and 256CTRL. Both more or less do what I want but WITHIN the same module. I tried using both but I couldn't figure out how to get the BU16 to perform the functions of the buttons the way 64CTRL does.

What I want is basically a variation of 256CTRL, but for the buttons that control it to be on the BU16, and for both of the EN16s I am using to react simultaneously as opposed to independently.

I also looked at MIDIGRADE because that also sort of does some of what I want, but I couldn't make heads or tails of it either.

goatbamf goatbamf ·

I would do this with global variable defined on the BU16 module, e.g. Gch:

Gch = 0

Then on each button:

Gch = self:element_index()
immediate_send(nil, nil, "Gch = self:element_index()")

Honestly in the last snippet having both lines might be redundant, since immediate_send sends to self as well, that might the all you need.

Then on your EN16s you need to handle the MIDI yourself, so remove the MIDI Action because they will conflict.

Then in encoder code you:

midi_send(Gch, 176, self:element_index(), self:encoder_value())

I'm making assumptions about what actual CC you are sending. If you have something very specific you could define the CC for each encoder via a Self action.

Note this is all off the top of my head and untested.

Hyperstation Jr. Hyperstation Jr. ·

Thanks for the reply. So, GCH is making the statement that the midi channel should be 0, then the button code is saying (in laymens terms) "change the midi channel whatever the button/element is (so Element 2 changes the midi channel to 3, 11 changes it to 12, etc.), and then the midi_send code on the encoder Element is saying "read the midi channel that the button sends out"?

Is that about right?

If so, how would I specify if I wanted the midi channel on a particular Element to switch to a particular channel (say Element 5 to midi channel 16, or whatever)? And if I wanted to do that with multiple Elements, say all four on the bottom for or whatever?

Also, is there a way to have a sort of "shift" variable, so that normally, Elements 12-15 change the midi channel of the encoders to 1-4, but if Elemebt 0 is toggled, then Element 12-15 change the encoders to midi channel 5-8?

Lastly, is there anything special I would need to do to avoid jumps while switching channels like that? Could I use reletive mode in this case, and have the encoders pick up whatever the control is?

cecilnick cecilnick ·

I've been wanting to learn immediate_send, so I tried to implement the code you suggested here. However, trying to use any of the self: variables seems to cause this error message.

Screenshot_2025-12-17_at_1.36.56_PM.pngScreenshot_2025-12-17_at_1.37.07_PM.png
cecilnick cecilnick ·

I think the main reason to use self:element_index() is to reduce the amount of hard coding you have to do.

We also have the option of just manually defining the variable on each button — which is how you get a button to send a specific channel.

cecilnick cecilnick ·

"Also, is there a way to have a sort of "shift" variable"

Just have to do it 😅

cecilnick cecilnick ·

so if one button has this

Screenshot_2025-12-17_at_3.26.16_PM.png
cecilnick cecilnick ·

then another could have something like this? minus the print, i was just making sure the shift thing was working.

Screenshot_2025-12-17_at_3.26.42_PM.png
goatbamf goatbamf ·

Sorry I'm late to everybody's replies. @user yes you've got that right, although there was a mistake in my code.
For sending specific or arbitrary channels on a specific button that isn't easily derivable via math or element_index, you'd could of course just write specific code for each button, but that sucks, and you're rather have one button script that you can paste to each button easily and still have this "just work", so...

  1. Add a Self Action to the element's Button tab - this lets you define a variable for just the Button without having to write "code", e.g. channel = 11
  2. Reference that in code immediate_send(nil, nil, 'Gch = ' .. self.channel)

@user I'm not sure why you're getting that error, but you have to understand that immediate_send(nil, nil...) sends to ALL connected grid modules so you need to guard against invalid index queries. It's pretty tricky to only send to the correct module given its position can change etc, I know how, but it's really annoying.

ALSO, my code was incorrect, I had immediate_send(nil, nil, 'Gch = self:element_index()') (note the element index in the string) when it should have been 'Gch = ' .. self:element_index(). My mistake.

Hyperstation Jr. Hyperstation Jr. ·

I appreciate your help, and I get some coding, but this is so far and above what I am comfortable with. I just don't understand this at all, especially the multi-level kind of things I'm interested in doing (like shift commands/elements that effect other elements that effect other elements).

At this point I'd legitimately just pay someone to walk me through this.

Seriously, if someone is interested please reach out. I just don't have the kind of time to spend hours on this sort of thing (and it's already been hours and days).

goatbamf goatbamf ·

If you still need help after the holidays I could probably find some time to help you out assuming it's not that complicated. Sounds like you just want buttons on BU16 to switch what channels and CCs are being used on the EN16? I didn't really understand what you meant by double click though, that sounded strange/hard to me.

Hyperstation Jr. Hyperstation Jr. ·

Primarily, you're correct - the vast majority of what I'm looking to do involves using the BU16 buttons to either change the MIDI channels or the CCs being sent by the EN16s.

Hyperstation Jr. Hyperstation Jr. ·

This is the setup I'd use with software. It has 2 banks - Element 0 would be a toggle that would change which set of CCs is being sent out. Element 1 would change Elements 4-11 which would in turn dictate the MIDI channel the EN16s are sending to, split between Channels 1-8 and 9-16 depending on the state (again a toggle).

I would want it so that only one of the elements between Element 4-11 could be active ideally (though being able to select multiple at the same time in some way could be interesting too... but I digress). This should be pretty straight-forward.

Screenshot_2025-12-21_at_8.34.45_PM.png
Hyperstation Jr. Hyperstation Jr. ·

This would control a hardware synth (Torso Electronics S4). Very similar sort of setup, where there are 3 groups of MIDI CCs, and selecting between Elements 0-10 select a specific group of CCs to a specific MIDI channel. Again, I think this is fairly straight-forward, but beyond what I've been able to do so far.

Screenshot_2025-12-21_at_8.52.03_PM.png
Hyperstation Jr. Hyperstation Jr. ·

This one is also meant to control hardware and is slightly more complicated but does a lot of the same things. Elements 1-3 would select the MIDI CCs on the EN16s, Elements 4-7 select the channel they would be sent to, and Elements 8-15 are actually set up to be specific values of the same CC message, and the channel it sends to is dictated by E4-7. I don't see how to make one Element change the state of another element (so that if E8 is selected, the 11-15 are off), but I know that's possible.

This is also slightly different only because the CC list is not sequential because of how the synth works - certail CCs are preprogrammed and/or skipped, so there's a very specific set of CC#s it uses. Not sure if this makes a difference (didn't look like it in some of the examples I saw), but I figured I'd mention it.

Screenshot_2025-12-21_at_8.28.28_PM.png
Hyperstation Jr. Hyperstation Jr. ·

At any rate, thank you very much for your offer to help. I would take you up on it if you think what I'm trying to do is fairly simple. If you have a venmo or whatever else, I'd happily compensate you too. I do apprecaite your help so far.

I really have put in work on this, I can do HTML and CSS coding, but this is WAY over my head and unfortunately, it's not intuitive to me in terms of how it works.

goatbamf goatbamf ·

Cool. I'm going to DM you about this.

0xdb 0xdb ·

@user in case this is useful to you, I just started looking into inter-comms and I implemented a shift function on BU16 that toggles on double click, in this first step the EN16 encoders have a default avg velocity and switch to low velocity while shift is pressed for finer control (plus high velocity while encoder is pressed to go from 0-127 in a single motion)

0xdb 0xdb ·

this is what my shift button looks like, shift is a global var in all modules and the timer only resets self.click_count = 0

image.png
Discord

View on Discord

This post is from the Intech Studio Discord community.

Open thread →