mAirlist and Velleman USB kit?

Do I understand it correctly that mAirlist still doesn’t support the Velleman kit for fader/buttonstart as standard? Only using the script mentioned in this topic?

Correct. I cannot add built-in support unless someone donates a test unit.

The script should work fine though.

I’ve loaded Charlie’s script with CAD’s change and I’m getting an ‘Unexpected file end’, but I can’t seem to locate it…

// The following Notification Script allows mAirList v3.x  to use the Velleman K8055 USB 

Interface
// for remote-control of the Players.

// This script by Torben Weibert and modified by Charlie Davy, October 2010
// Adding further buttons is just a matter of duplicating the commands near the end of this 

script

var
  CurrentStatus: array[1..5] of boolean;  

function OpenDevice(CardAddress: Longint): Longint; external 'OpenDevice@k8055d.dll stdcall';
procedure CloseDevice; external 'CloseDevice@k8055d.dll stdcall';
function ReadDigitalChannel(Channel: Longint): boolean; external 'ReadDigitalChannel@k8055d.dll 

stdcall';

procedure OnLoad;
var
  i: integer;
begin
  for i := 1 to 5 do 
    CurrentStatus[i] := false;

  if OpenDevice(0) < 0 then
    SystemLog('K8055 device not found!')
  else
    EnableTimer(50); // poll interval 50ms
end;

procedure OnUnload;
begin
  CloseDevice;
end;

procedure OnTimer;
var
  i: integer;
  newval: boolean;
begin
  for i := 1 to 5 do 
  begin
    newval := ReadDigitalChannel(i);
    if newval <> CurrentStatus[i] then 
    begin
      CurrentStatus[i] := newval;
      if CurrentStatus[i] = true then
// These are for Buttons 1, 2, 3, 4 and 5
        case i of
	  1 : ExecuteCommand('PLAYER 1-1 START/STOP');
          2 : ExecuteCommand('PLAYER 1-2 START/STOP');
          3 : ExecuteCommand('PLAYER 2-1 START/STOP');
          4 : ExecuteCommand('PLAYER 3-1 START/STOP');
          5 : ExecuteCommand('PLAYER 4-1 START/STOP');
        end;
    end;
  end;
end;

I do see 4 ‘end;’ mentions, when I can only locate 2 open 'begin’s, but I’ve tried reducing them to two, without any success.

Update: I’ve now changed the script for the original by Charlie and now it’s all working fine. However, there is a fraction of a delay, when I press the button start on the console. Is there anything that can be done about that?

Regarding the “Unexpected end of file” error - which you already sorted out, but nevertheless - every notification script needs a final “begin end.” (empty main routine) at the end to make it a proper Pascal program, even though the individual procedures are called directly. Actually, I could make mAirList add that automatically in case it’s missing…

How long is the delay you’re experiencing? The script polls the inputs every 50ms. You can try to reduce this value (change the parameter of the EnableTimer call), but be aware that this might increase the system load.

If the hardware itself causes the delay (or an additional delay, for that matter), there’s not much you can do about it.

You are indeed a hero, Torben. Changed it to 30 and it’s fine now… :wink:

As it’s working now, should I just leave the script as is, or is it better to add Cad’s changes, now I now where the error message comes from?

Cad’s changes are merely cosmetic, I’d say.

Oke, new here so maby it’s nog the right way to ask.

But…

I want to buy mAirlist Home for my homestudio. And have the Velleman kit working on my older software. No i try the demo of mAirlist, and the dll script works but only on pulse. My D&R airmix gives a continue signal.

Can someone help me out?

(sorry for my bad englisch)

Sander

Try this one:

// The following Notification Script allows mAirList v3.x  to use the Velleman K8055 USB 

Interface
// for remote-control of the Players.

// This script by Torben Weibert and modified by Charlie Davy, October 2010
// Adding further buttons is just a matter of duplicating the commands near the end of this 

script

var
  CurrentStatus: array[1..5] of boolean;  

function OpenDevice(CardAddress: Longint): Longint; external 'OpenDevice@k8055d.dll stdcall';
procedure CloseDevice; external 'CloseDevice@k8055d.dll stdcall';
function ReadDigitalChannel(Channel: Longint): boolean; external 'ReadDigitalChannel@k8055d.dll 

stdcall';

procedure OnLoad;
var
  i: integer;
begin
  for i := 1 to 5 do 
    CurrentStatus[i] := false;

  if OpenDevice(0) < 0 then
    SystemLog('K8055 device not found!')
  else
    EnableTimer(50); // poll interval 50ms
end;

procedure OnUnload;
begin
  CloseDevice;
end;

procedure OnTimer;
var
  i: integer;
  newval: boolean;
begin
  for i := 1 to 5 do 
  begin
    newval := ReadDigitalChannel(i);
    if newval <> CurrentStatus[i] then 
    begin
      CurrentStatus[i] := newval;
      if CurrentStatus[i] = true then begin
// These are for Buttons 1, 2, 3, 4 and 5
        case i of
	  1 : ExecuteCommand('PLAYER 1-1 START');
          2 : ExecuteCommand('PLAYER 1-2 START');
          3 : ExecuteCommand('PLAYER 2-1 START');
          4 : ExecuteCommand('PLAYER 3-1 START');
          5 : ExecuteCommand('PLAYER 4-1 START');
        end;
      end
      else begin // CurrentStatus[i] = false
        case i of
  	  1 : ExecuteCommand('PLAYER 1-1 STOP');
          2 : ExecuteCommand('PLAYER 1-2 STOP');
          3 : ExecuteCommand('PLAYER 2-1 STOP');
          4 : ExecuteCommand('PLAYER 3-1 STOP');
          5 : ExecuteCommand('PLAYER 4-1 STOP');
        end;
      end;
    end;
  end;
end;

At the risk of reviving an old thread, however I noticed that the Velleman K8055 now shows in the Remote interfaces as being natively supported. That said, I was looking at if I could use the analog inputs to control the faders on the Voicetrack dialog. Is that do-able or do I need to script it?

I did see VT PLAYER A FADEOUT and VT PLAYER A VOLUME as viable remote controls but couldn’t see what they did when I assigned them to a key!

Thanks

Only the digital inputs are supported by now.

Thanks. Was just an idea :slight_smile:

For remote control I use the Xkeys 20 keypad. ( http://xkeys.com/xkeys/legacy.php )

Planning to migrate to a bigger one soon. ( http://xkeys.com/xkeys/xk60.php )

They work really well with Global Hotkeys.

Only the digital inputs are supported by now!. :smiley:

I look for controlling the output as well, is this feature coming soon in Mairlist of is there a script that i can use?,
For controlling the 8 outputs in mairlist.

Greets,
Frank

Programmers …

Now that the 5 digital inputs on the Vellerman card are supported directly within mAirList, is it possible to alter the outputs through scripts?

Any pointers would be appreciated.

Ron.

I have just uploaded snapshot 2058 which adds scripting/output support for the K8055.

Here’s an example script, pretty straightfoward:

begin
  K8055Remote(0).ClearDigitalChannel(1);
  K8055Remote(0).SetDigitalChannel(3);
  K8055Remote(0).SetDigitalChannel(4);
  // K8055Remote(0).ClearAllDigital;
end.

Digital outputs are working well.

Many thanks for your quick response and implementation.

Ron.