View Single Post
Old 02-26-2020, 09:59 PM   #7046
KroniK907
Human being with feelings
 
Join Date: Mar 2017
Posts: 11
Default

Is there a way to have variables in the MST MIDI hex data?

I know that at least in the case of my mixer, the first bit is the MIDI channel number. Since we set up the midi channel info when setting up a surface, is there a way that could have a channel_in and channel_out variable so that re-writing an mst is not necessary if for some reason you need to change midi channels for your surface?

obviously channel_in and channel_out are long variable names and could be shortened.

Another thought I had was to have variable support in general in the mst file. To make mst files more readable it would be nice to be able to set different hex values to named variables. For a board with a bunch of faders, you will end up needing to copy and paste a ton of stuff and only change a single bit to identify the fader channel.

If instead there were variable support, you could make setup for new surfaces much simpler by only needing to change the values of some standard variables rather than writing out a whole mst file.

I'm imagining something like this:

Code:
//EDIT THESE VALUES 
MCHP = B0  //MIDI Channel Primary
MCHS = B1  //MIDI Channel Secondary

FS = 00   //Fader Strip ID 1
FM = 20   //Fader Mute 1

FMV = 7F   //Fader Max Value
FZV = 00   //Fader Zero Value
NO = 7F    //Note On
NF = 00    //Note Off


Widget CH1_Fader
  Fader7Bit $MCHP $FS $FMV
  FB_Fader7Bit $MCHP $FS $FZV
WidgetEnd

Widget CH2_Fader
  Fader7Bit $MCHP $FS+1 $FMV
  FB_Fader7Bit $MCHP $FS+1 $FZV
WidgetEnd

Widget CH1_Mute
  press $MCHP $FM $NO
  FB_TwoState $MCHP $FM $NO  $MCHP $FM $NF
WidgetEnd

Widget CH2_Mute
  press $MCHP $FM+1 $NO
  FB_TwoState $MCHP $FM+1 $NO  $MCHP $FM+1 $NF
WidgetEnd
If hex math and variables were available to use, it would be way easier to set up an mst for a new surface, and make things much more human readable for easy troubleshooting.

Even better when considering items that repeat with a single value change, it would be cool to simply make a single widget template and then have some syntax where you identify the variable that changes with each widget, and how your widget name changes, and how many widgets you want. Then the plugin extrapolates from there on boot up. Would be very useful for repeating widgets.

Maybe something like:
Code:
WidgetTemplate Faders
  Data
    Fader7Bit B0 $H 7F
    FB_Fader7Bit B0 $H 00
  Settings
    NumWidgets 16
    Name Fader_Ch$I
    IncrementBy 1
    StartVal_H 00
    StartVal_I 1
WidgetTemplateEnd
$H would be some standardized syntax that represents the hex value that will change with each widget.
$I is similar to $H but is an integer rather than hex and would be used to increment widget name values.
NumWidgets describes how many widgets this template will generate
Name describes the widget name and must include $I somewhere which will ensure incrementing widget names
IncrementBy is used to describe the increment value of $H not $I as $I would be incremented by 1 regardless.
StartVal_H is the hex value for $H for the first widget.
StartVal_I is the integer value for $I for the first widget.

I think this would cover just about any use case where you have like 16 faders or 32 knobs or some other similar scenario where you need to make a bunch of widgets where only the faderID or KnobID etc. is changing for each widget.

Last edited by KroniK907; 02-26-2020 at 11:07 PM.
KroniK907 is offline   Reply With Quote