Controlling ATEM via MIDI Controller - lights and motorized faders help

1 post / 0 new
Offline

Location

Thunder Bay,
Canada
Joined: 19/10/2016
Posts: 9
Controlling ATEM via MIDI Controller - lights and motorized faders help

I am trying to replicated the YOUTUBE example for controlling ATEM via Midi controller. 

I have had success in most areas following the video https://youtu.be/uKedjjtsj6g however I am still not understanding the following two areas.

 

1) I have modified the "GENERIC_MIDI_EVENTS_USER"  code and I can control program/preview as per the example with my X-TOUCH COMPACT midi controller.  I dont understand where I modify the code to have the lights on the midi board represent what is happening on the ATEM switcher software -- ie whats on program, whats on preview. 

 

Midi messages log

09 Jan 21:20:49.309: LUA[$079C4CA0] : X-TOUCH COMPACT.StatusByte=144[90], DataByte1=16[10], DataByte2=127[7F]
09 Jan 21:20:49.313: LUA[$079C4990] : MIDI Note On USER Event Handler: 2,0,16,127
09 Jan 21:20:51.473: LUA[$079C44F8] : X-TOUCH COMPACT.StatusByte=128[80], DataByte1=16[10], DataByte2=0[00]

I know DataByte2 is the light status 127 or 00 -- not sure where to monitor this from or what to do with it? 

 

2) As per the video I also attempted to have my motorized faders represent changes made in the software.... so far with  no luck. 

Script example -- SAMPLES/MIDI SCRIPTS/ BCF Profile 4 to 8 ATEM Audio Faders/Midi_Continously_update_prfoile4_audio_levels --

-- ----------------------------------------------------------------------------------------------------------------------------
--  THIS UNIT REQUIRE GENERIC COMMS TO BE WORKING TOI ENSURE THESE FADERS UPDATE THE MISER VOLUME INPUTS
-- ----------------------------------------------------------------------------------------------------------------------------
-- $$USES "GENERIC_MIDI_SEND"

CLS();

-- ----------------------------------------------------------------------------------------------------------------------------
--  Sets up a two dimension array to hold the Fader references for preset 4, and the last value sent to the panel
-- ----------------------------------------------------------------------------------------------------------------------------
ATEM_MIXER_NUMBER       = 1;
BCF2000_MIDI_DEVICE_NO  = 2
BCF2000_MIDI_CHANNEL_NO = 0;

FaderMap    = {};
FaderMap[1] = {};  FaderMap[1]["ChannelNumber"] = 0; FaderMap[1]["ControllerNumber"] = 00;   FaderMap[1]["Value"] = 0;
FaderMap[2] = {};  FaderMap[2]["ChannelNumber"] = 0; FaderMap[2]["ControllerNumber"] = 01;   FaderMap[2]["Value"] = 0;
FaderMap[3] = {};  FaderMap[3]["ChannelNumber"] = 0; FaderMap[3]["ControllerNumber"] = 02;   FaderMap[3]["Value"] = 0;
FaderMap[4] = {};  FaderMap[4]["ChannelNumber"] = 0; FaderMap[4]["ControllerNumber"] = 03;   FaderMap[4]["Value"] = 0;
FaderMap[5] = {};  FaderMap[5]["ChannelNumber"] = 0; FaderMap[5]["ControllerNumber"] = 04;   FaderMap[5]["Value"] = 0;
FaderMap[6] = {};  FaderMap[6]["ChannelNumber"] = 0; FaderMap[6]["ControllerNumber"] = 05;   FaderMap[6]["Value"] = 0;
FaderMap[7] = {};  FaderMap[7]["ChannelNumber"] = 0; FaderMap[7]["ControllerNumber"] = 06;   FaderMap[7]["Value"] = 0;
FaderMap[8] = {};  FaderMap[8]["ChannelNumber"] = 0; FaderMap[8]["ControllerNumber"] = 07;   FaderMap[8]["Value"] = 0;

-- ----------------------------------------------------------------------------------------------------------------------------
--  Loops forever, or until the Enviroment variable is set to FALSE, simply convert the ATEM Audio Gain value for a channel
--
-- ----------------------------------------------------------------------------------------------------------------------------
EnviroWrite("MONITORING_AUDIO_LEVELS",       "TRUE");
EnviroWrite("MONITORING_AUDIO_LEVELS_RESET", "FALSE");

while ( EnviroRead( "MONITORING_AUDIO_LEVELS" ) == "TRUE" ) do
        Sleep(50);
        if ( EnviroRead("MONITORING_AUDIO_LEVELS_RESET") == "TRUE" ) then
             for FaderNumber = 1, ATEMMixerAudioInputCount( ATEM_MIXER_NUMBER ) do
                 FaderMap[FaderNumber]["Value"] = 0;
             end;
        end;

        for FaderNumber = 1, ATEMMixerAudioInputCount( ATEM_MIXER_NUMBER ) do
            lvAudioInputGain = ATEMMixerAudioGetInputGain( ATEM_MIXER_NUMBER, FaderNumber );
            lvAudioInputGain = math.floor( ( ( lvAudioInputGain + 60 ) / 66 ) * 127 );
            if ( lvAudioInputGain < 0 ) then
                 lvAudioInputGain = 0;
            end;
            if FaderNumber < 9 then
               if ( FaderMap[FaderNumber]["Value"] ~= lvAudioInputGain ) then
                    FaderMap[FaderNumber]["Value"]  = lvAudioInputGain;
                    SendMIDI_ControlChange( BCF2000_MIDI_DEVICE_NO
                                          , FaderMap[FaderNumber]["ChannelNumber"]
                                          , FaderMap[FaderNumber]["ControllerNumber"]
                                          , FaderMap[FaderNumber]["Value"] );
               end;
            end;
        end;

end;
VSLog("END");

 

 

LOG example

09 Jan 21:28:49.662: LUA[$0C94B208] : X-TOUCH COMPACT.StatusByte=176[B0], DataByte1=1[01], DataByte2=11[0B]
09 Jan 21:28:49.666: LUA[$0C94B390] : MIDI Control Change USER Event Handler: Device=2, Channel=0, Control_Index=1, Value =11

 

 

Any help is appreaciated...

Thanks

Jon C.