Trevliga Spel forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Translate Channel values for a given profile.

2 posters

Go down

Translate Channel values for a given profile. Empty Translate Channel values for a given profile.

Post by jtints Wed Feb 21, 2024 5:56 pm

It would be really useful if there was a way of creating a translation file for a given profile that will add an offset for channel numbers.

For example, on the Streamdeck Plus, I have a profile that uses channel 1 for buttons, channel 2 for multidials, and channel 3 for shift multidials.

I would like to make another profile that uses all the same CC#s but would like to use channel 4 for buttons, channel 5 for multidials, and channel 6 for shift dials. 

In example of profile 2, I am adding an offset of 3 to the channel values in each case.

jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by Admin Wed Feb 21, 2024 7:02 pm

The plugin doesn't know which profile it is in; Elgato doesn't give us that information.

Do you mean that the translation file itself should include some channel information and that you'd use different translation files for different profiles?
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by jtints Wed Feb 21, 2024 7:27 pm

Yes. If there was a way of specifying the translation file being used from within a profile (some kind of global perhaps?) and providing a way for the translation file to modify channel information would be one idea.

jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by Admin Wed Feb 21, 2024 7:49 pm

So you mean, like, if there were some kind of script language where you could define global variables that other actions could use?   Smile

But even with scripts, it would be impossible to solve this since the buttons don't know which profile they're in. The base information you want everything to be relative to doesn't exist.
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by jtints Wed Feb 21, 2024 7:56 pm

I understand that the base information is not there. I was thinking something along the lines of: if there were to be an initialization button in a given profile that had a script that would init a global variable (@g_translationFile:"somefile") that would state what translation file to use and then the file itself would allow for channel mapping.

jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by jtints Wed Feb 21, 2024 8:00 pm

Another idea would be working with variables in CC actions. If a variable could be used in the {cc:##,###,###} event, I could change the channels based on a global variable assigned on a given profile.

jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by Admin Wed Feb 21, 2024 8:21 pm

jtints wrote:Another idea would be working with variables in CC actions. If a variable could be used in the {cc:##,###,###} event, I could change the channels based on a global variable assigned on a given profile.
Yes, you can do that.
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by jtints Wed Feb 21, 2024 9:19 pm

I thought it was not possible, reading back to a previous exchange I had with you but it was for events and I was trying to use math directly in the cc event.

https://trevligaspel.forumotion.eu/t317-scripting-using-variables-and-math-in-ccs

so I could do something like this?

assign a global on button of each page on a given profile - lets say [(init) {@g_profile:2}], use it to calculate the channel number in local variable and then use that local variable in an action.

ah...as I am writing this I realize why I was interested in the translation files. The dials can't be scripted. 

Anyways. I appreciate you engaging with me on this. I am still trying to avoid manually changing hundreds of dial channels and trying to figure out how to build one profile and then use some method to modify channel number programmatically on other profiles.

jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by Admin Thu Feb 22, 2024 11:23 am

Yes, you can do what you describe.

Dials could possibly be solved with background scripts, but I haven't looked into the details.
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by jtints Thu Feb 22, 2024 4:05 pm

Just looking at BG scripts. This looks like it might be the ticket for me. 

Just so I understand this correctly: 

The BG scripts would receive midi information from a midi port  and then send to another mid port. For example: 

- the SD controller buttons and dials are set up with a midi out channel called sdSend and midi in channel called sdReceive

- the BG script receives midi in from SDsend, processes information and then sends the results to another midi port ... lets call it sdScriptSend. 
- conversely, there would be another BG script that would receive midi from my host environment from a port like sdScriptReceive and output to the Streamdeck on sdReceive.

If this is the case. Do the scripts run in the BG across profiles and devices or would one have a different bg script for each profile/device? I am using 3 devices, each has 4 different profiles. 

Do globals work with BG scripts?

jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by Admin Thu Feb 22, 2024 4:22 pm

Yes, you understand it correctly.

BG script receives on one port and sends to another port. Please note that the BG script action can create "internal ports" that are not available outside the plugin. The benefit is that you don't need to create "real" midi ports, and there is no risk that other programs will intercept and act on messages only meant for the BG scripts.

So, messages between buttons/dials and the BG scripts can be made on internal ports, while the messages between BG scripts and your daw are made on real midi ports.

BG scripts are always active across all profiles and pages, and the variable features are the same as for button scripts. There are some restrictions for BG scripts since they are not associated with a button, but you can read more about that in the doc.
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by jtints Thu Feb 22, 2024 4:26 pm

Amazing. I think my plan would be to add a global flag to each button to let the script know what profile (I'm calling them tracks) the button is coming from and then do the the translation based on the profile flag.

This is super cool functionality!

jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by jtints Thu Feb 22, 2024 7:17 pm

I am working through the bg script here and have come up against a math issue. It seems I cannot add two variables together:

[(cc:*,*,*){@l_channel:#@e_ccchannel+@g_track#}]
[(cc:*,*,*){cc:#@l_channel#,#@e_cc#,#@e_ccvalue#}]
just returns the @e_ccchannel information.

if I do this:
[(cc:*,*,*){@l_channel:#@e_ccchannel+2#}]
[(cc:*,*,*){cc:#@l_channel#,#@e_cc#,#@e_ccvalue#}]
the addition works and it returns @e_ccchannel+2.

I could build this with a series of condition events like this (which works):
Code:
[(cc:*,*,*)(@g_track:1){@l_channel:#@e_ccchannel#}]
[(cc:*,*,*)(@g_track:2){@l_channel:#@e_ccchannel+1#}]
[(cc:*,*,*)(@g_track:3){@l_channel:#@e_ccchannel+2#}]
[(cc:*,*,*)(@g_track:4){@l_channel:#@e_ccchannel+3#}]
[(cc:*,*,*){cc:#@l_channel#,#@e_cc#,#@e_ccvalue#}]

but the math would be simpler.

Is there a way of adding variables together?

jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by Admin Thu Feb 22, 2024 7:30 pm

The additions work when I test. Are you sure @g_track has a value when the command is run?
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by jtints Thu Feb 22, 2024 7:55 pm

Well it's working now. Classic.

Thanks for your feedback. This is all working well. I relabeled the global and for better clarity and put it all into one line.


Code:
[(cc:*,*,*){@l_channel:#@e_ccchannel+@g_trackOffset#}{cc:#@l_channel#,#@e_cc#,#@e_ccvalue#}]


jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Translate Channel values for a given profile. Empty Re: Translate Channel values for a given profile.

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum