Change the midi message based on button hold | Intech Studio
💬 general General

Change the midi message based on button hold

Dr. Bensmir
Dr. Bensmir · · 15 replies

Hello, I would like to hold a button on my intech device and instantly switch what cc a fader or a knob is sending, how to setup!

Thanks

Replies (15)

0xdb 0xdb ·

hey, you can use a global var and code blocks to do it:

  1. declare global var my_cc with your default CC
  2. switch the default midi block in your encoder/pot/endless with code block midi_send(-1, -1, my_cc, -1)
  3. add a push-release event to your button
  • on push, add a code block my_cc = new value
  • on release, add a code block my_cc = old value
0xdb 0xdb ·

lmk if any of the above don't make sense

Dr. Bensmir Dr. Bensmir ·

sort of

first, I define the global variable in the setup tab like this ?

image.png
Dr. Bensmir Dr. Bensmir ·

no only the second row, to declare that the global variable equal 0 by default

Dr. Bensmir Dr. Bensmir ·

oh, the global variable would actually hold the CC number the encoder is going to send

Dr. Bensmir Dr. Bensmir ·

I was thinking global variable as 0 or 1 and using if blocks, a bit like bome midi translator logic

Dr. Bensmir Dr. Bensmir ·

I think I get it

0xdb 0xdb ·

Yeah, you got it, lmk if you need more help

Dr. Bensmir Dr. Bensmir ·

I almost made it, but my knob is sending reset messages

Dr. Bensmir Dr. Bensmir ·
Capture_decran_2026-01-26_a_01.31.49.png
Dr. Bensmir Dr. Bensmir ·
Capture_decran_2026-01-26_a_01.32.02.png
0xdb 0xdb ·

Maybe use the actual values instead of default -1?

0xdb 0xdb ·

midi_send(0, 176, holdvar, self:encoder_value())

0xdb 0xdb ·

Above example sends control messages (176) to channel 1 (0) with CC (holdvar) and value (switch if not an encoder)

Dr. Bensmir Dr. Bensmir ·

thanks

Discord

View on Discord

This post is from the Intech Studio Discord community.

Open thread →