Accounting for relative and absolute inputs | Intech Studio
💬 general GridGeneral

Accounting for relative and absolute inputs

Posidian
Posidian · · 87 replies

I'm trying to setup buttons and knobs to the same variable, the program I'm using doesn't support relative input. Am I able to use the built in software to combine outputs into a single value managed internally so the program only receives the correct absolute value?

Replies (50)

Greg-Orca Greg-Orca ·

hello, why do you need the midi translator?

Posidian Posidian ·

The program I'm using doesn't support relative and absolute inputs

Greg-Orca Greg-Orca ·

hmm then what is it supports?

Posidian Posidian ·

relative input only.

0xdb 0xdb ·

Hmmm in your post you say it doesn't support relative, only absolute. Then you say it doesn't support either. And now you say relative only...
Both relative and absolute are supported. Supported relative modes are bin offset and complement of 2.
https://docs.intech.studio/wiki/actions/element-settings/encoder-mode/

Posidian Posidian ·

correction. the software im using intech to control doesn't support relative input, only absolute

0xdb 0xdb ·

Great, absolute is the default (0-127)

Posidian Posidian ·

yes but I want to use the knobs in relative not absolute.

Posidian Posidian ·

if i hit 70 on a button then spin the knob I want it to go plus or minus from there, not its own respective last postion

Posidian Posidian ·

I dont ideally, I'd rather keep everything in InTech vs another program

0xdb 0xdb ·

You just need a code block to update the respective encoder value when you hit the button, keep sending absolute from the encoder

Posidian Posidian ·

so I have 4 buttons set to absolute values currently.

Posidian Posidian ·

kind of a 5% 25% 50% and 100% ( out of 127)

0xdb 0xdb ·

Ok, so you're using 2 modules, right? Maybe EN16 + BU16?

Posidian Posidian ·

TEK2

0xdb 0xdb ·

Ok, even easier, no remote messages involved. On the button's push event add a code block similar to this:
element[i]:encoder_value(70)

0xdb 0xdb ·

If you want to revert back to the original encoder value, you can cache it in a self or global var and restore it with another push or whatever suits your flow

Posidian Posidian ·

Sorry but I dont understand this

0xdb 0xdb ·

Do you need to restore the original value (before pushing the button) at all?

Posidian Posidian ·

no, for example the keys are like bookmarks to jump to specific points while scrolling the wheel is just scrolling from the last 1-127 value ( + / - ) last pressed or scrolled to value

Posidian Posidian ·

if the program im using with these supported absolute and varible input everythin would be perfect, im trying to replicate that before it hits the program

0xdb 0xdb ·

Got it, then you only need the snippet above

0xdb 0xdb ·

Var i is the element number for the knob, I don't know it (I don't have that module)

0xdb 0xdb ·

I'm working from my phone, if you still need help I can send you the whole code later tonight

Posidian Posidian ·

Thanks, I will give it a shot I appreicate the help!

Posidian Posidian ·

Sorry for my limited understanding but I am not sure where this should go.

0xdb 0xdb ·

no worries, I created a profile for you: grid-editor://?config-link=NCAqLRcUOuT7CtFr5nYa

0xdb 0xdb ·

I'm not sure if it will work because I don't own a TEK2 to test it, but even if it had some bug it helps explain what you need and where

0xdb 0xdb ·

here's the breakdown of what it does

0xdb 0xdb ·

first we declare on the System's Setup event a function that we will call on each button

image.png
0xdb 0xdb ·

using System makes the function global and available by the time the buttons try to use it

0xdb 0xdb ·

8 and 9 are the element numbers of each endless knob

0xdb 0xdb ·

on each button of the first row we call the function with different values (5, 25, 50, 100) when the button is pressed

image.png
0xdb 0xdb ·

it prevents the function from being called twice (on press and on release)

0xdb 0xdb ·

double triggering doesn't matter in this example, you could keep it simple by only using a code block without the press-release block, it's just for "learning" purposes

0xdb 0xdb ·

@user hope it works and it sort of makes sense now

Posidian Posidian ·

@user I'm sure you're explaining it well and I am trying to understand with my very limited coding understanding. If I get you correctly the code on the button should be _update_endless(8, 50)

Posidian Posidian ·

the 8 referencing the left knob and 50 referencing 50%. I am not seeing an update from the midi monitor to reflect that this is working. I do have the encoder mapped to a midi channel as well

Posidian Posidian ·

if this is too much to get in the weeds over no worries, I can still try and fiure it out from here

0xdb 0xdb ·

Yes, that would be the code if you only want to update one of the encoders instead of both of them

0xdb 0xdb ·

I'll try using my EN16 to debug it

0xdb 0xdb ·

turns out you cannot set an endless pot on an EN16, it errors out, I cannot test it without a TEK2 or a VSN1

0xdb 0xdb ·

wait, are you saying you don't see anything in the midi monitor when you turn the knob? that is unrelated to the code, the encoders should still work properly

0xdb 0xdb ·

if the encoders don't work, can you take a look at debug monitor for errors and share them?

0xdb 0xdb ·

if those work, maybe you're saying you don't see anything in the midi monitor when you press the buttons? if so, the buttons don's send midi, they're bookmarks like you said, press a button and then turn the encoder - e.g., value before pressing button 0 = 123, after pressing button = 5, you still need to turn the knob to send midi

Posidian Posidian ·

Midi updates only when I turn the knob but not when the button is pressed. Is there a way to confirm the button is updating the % of the knob?

0xdb 0xdb ·

Turn the encoder down to zero, then press the button for 100% and start turning down the knob again. In the MIDI monitor you should see it coming down from 127 (not 0 anymore)

Posidian Posidian ·

UPDATE

Posidian Posidian ·

so _update_endless(8, 50) or _update_endless(8, 5) puts the midi at 11

Posidian Posidian ·

update_endless(50) puts it at 64

Discord

View on Discord

This post is from the Intech Studio Discord community.

Open thread →