Quick automation script

Hi

I hope that this is possible and if possible one of you genious’s are kind enough to write it for me…

I need a script that when a button on my keyboard is pressed it:

1 - turns on automation
2 - acts as automation next
3 - turns of automation

all on with one press of the button.

Hope that makes sense and that if possible one of you could be kind enough to write it for me.

Many Thanks

You don’t need a script for that - you just need to define a HotKey under “Remote” in mAirListConfig :wink: Define your key, and paste the following into the box:

AUTOMATION 1 ON;AUTOMATION 1 NEXT;AUTOMATION 1 OFF

Multiple commands can be chained like this within the SAME instance of mAirList using a semi-colon.

1 Like

awesome. will give it a go.

Thanks for the info

Just tried it and it works PERFECTLY. Thanks for pointing me to that method, didn’t know you could stack up the commands!

Just another quicky… Is it possible to have a button asigned as a “PLAY NEXT” so that it plays whichever is cued up as next - basically so you dont have to assign PLAYER “X” NEXT.

I have scanned the list of commands and can’t seem to find such a command. is there a way of doing this?

many thanks

My example above does exactly that :wink: To keep automation running, you just remove the last command (and semi-colon). My Tipro keyboard has a big green “Next” button which is used to start mAirList “from cold” or during Automation - it contains this command: AUTOMATION 1 ON;AUTOMATION 1 NEXT

hi charlie

what i want mairlist to do is basically, every time i start an item in mairlist i press a button named “GO” which will use the automation bits as mentioned. if i press go again, it will obviously fade an item into another which is great most of the time.

However, on some occasions you would want a longer fade i.e. long quiet intro or something, which in that case means i want to operate it in live assist mode. But, rather than having two buttons (player A & B) for starting and stopping i want 1 button labelled “PLAY NEXT” that simply starts whatever item is selected as NEXT in the playlist, this then gives me the option of having the automation default fading or a manual fade to whatever length i desire as i dont want to mess around changing fade lengths and start next points etc.

Do you think it is possible to have a button that plays whatever is selected as NEXT? is there a hotkey action or would i need a script?

Many Thanks for your help on this one.

I think you would need a small script to do that (which you would then assign to the hotkey or button with a RUNSCRIPT command).

The script would need to check the status of both players (assuming you only have two?), note which one is NOT currently playing, then execute an AUTOMATION OFF, followed by a PLAYER n START.

I don’t know whether an AUTOMATION ON at the end would work. It might stop the ‘other’ player (the one that was playing when you pressed the button), but I don’t know. If not, then AUTOMATION ON can be added to the end of the script.

BFN
CAD

hi, thanks for the response.

Can i just check though, you mentioned about automation being on/off etc. The action i have for the other button would mean that it automation would always be OFF when this PLAY NEXT button is pressed as it simply flicks on to press the automation next and then flicks straight off.

Would that mean that anything to do with automation should be taken out of the equation? Or am i just confusing myself!

Thanks chaps…

Hi lackster:

What I’m thinking about is this: in AUTO mode, clicking NEXT will auto-fade the ‘current’ item. I’m not certain whether perforing the commands: AUTOMATION n ON, AUTO n NEXT, AUTOMATION n OFF will fade the previous track or not (I think it will, which is not what you want: correct?).

If you want the equivalent of a ‘play the next item’ WITHOUT fading the ‘current’ track, I think you would need to avoid AUTO mode completely, which is why I originally said ‘I think you’ll need a script to do that.’

Does that make my reasoning clearer?

BFN
CAD

Hiya.

I think we are both along the same lines at the moment.

Basically i have a button now that with one press turns on automation, does automation next and then turns automation off.
so if a track is playing and i press it, it fades out the track playing when it starts the next.

What i also want though is a button that when pressed starts whichever player is NEXT, without fading out any others, very useful when a quick fade would sound terrible.

It would effectively be Player 1-1 START or Player 1-2 START, but i guess in terms of what it would be is PLAYER (that is set as next) START.

Sorry, im terrible at explaining things like this!

Many thanks for your advice.

OK, yes that would need a (small) script. I’ll have a think about it and will post it here soon.

BFN
CAD

WICKED :slight_smile:

Thank You

Turned out to be quite easy in the end. The version below is tested and can be used on any mAirList system. Change the CONST if you want to apply this to any Playlist other than Playlist 1.

// StartNextPlayer script - starts the Player currently 'NEXT'
//                          Intended to be assigned to a hotkey or other remote comtrol

// Written by Cad Delworth, Clearances Manager, Leith FM, Edinburgh, Scotland
// http://www.leithfm.co.uk

// TIPS: 1) Save this file in your mAirList scripts directory.
//       2) When assigning this script to a hotkey or similar, use the command:
//            RUNSCRIPT scripts\StartNextPlayer.mls

const
  // Change the CONST below to 'scan' a different Playlist
  // Playlists in scripting are numbered from 0 upwards (not 1!).
  PLAYLIST_NUM = 0;

  NO_PLAYER_IS_NEXT = -1;

var
  i, iMax, iNextPlayerNum: integer;
  sCommand, sNextPlayerNum, sPlaylistNum: string;
  pl: IPlayerControl;
  
begin

  // Store the maximum Player number in the specified Playlist
  iMax := PlaybackControl(PLAYLIST_NUM).GetPlayerCount - 1;
  
  // Pre-set iNextPlayerNum to an impossible value
  iNextPlayerNum := NO_PLAYER_IS_NEXT;
  
  // Loop through all Players; store the number of the one which is 'NEXT'
  for i := 0 to iMax do
  begin
    pl := PlaybackControl(PLAYLIST_NUM).GetPlayer(i);
    if pl.GetIsNext = true then
      iNextPlayerNum := i;
  end;
  
  // Check that there IS a 'NEXT' Player before issuing the command
  if iNextPlayerNum > NO_PLAYER_IS_NEXT then
  begin

    // Create 'command string' versions of the Playlist and Player numbers
    sPlaylistNum := intToStr(PLAYLIST_NUM + 1);
    sNextPlayerNum := intToStr(iNextPlayerNum + 1);

    // Build the command string
    sCommand := 'PLAYER '
      + sPlaylistNum
      + '-'
      + sNextPlayerNum
      + ' START';

    // Un-comment the statement below for testing (displays command string in mAirList log)
    // SystemLog(sCommand);

    // Execute the 'Start NEXT Player' command
    ExecuteCommand(sCommand);

  end;
      
end.

Save the above as StartNextPlayer.mls in your mAirList scripts directory, then follow the instructions in the comments at the top of the script.

Enjoy!

BFN
CAD

THATS AWESOME.

Thank you so much for taking the time to do that.

Just off to try it out.

Many Thanks

Just tried it. absolutely “on the money” spot on.

Many thanks again.

P.S. - Can i be the first on this forum to wish you all a merry christmas! :slight_smile:

Please don’t mention the ‘C’ word: I HATE Xmas! :stuck_out_tongue:

But I’m pleased that you liked the script. ;D

BFN
CAD

Hi Cad,

Your script worked for me first time, thank you for posting it.

How difficult would it be to amend the script so that the output of the first cart fades as the second cart starts?

Regards

Andrew

Andrew: not very difficult.

But do you mean Cartwall Player or do you really mean Player?

We can’t see from here how many (Playlist) Players you have, so we can’t guess which you REALLY mean.

BFN
CAD

After a bit of help please.

Im trying to get the StartNextPlayer.mls to work…

It worked fine on an older version of mairlist but now im using v3’s it isnt working for some reason.

The error i get is:

(filename): [Error] (61:1): Unexpected end of file

Many Thanks

Hello, Lackster!

All the script does is build a mAirList command (as a text string) and then it executes the command.

Therefore, there are two possible reasons why the script doesn’t work in v3.

  1. The command it builds has changed in v3. (In v2, the command would be, for example, PLAYER 1-1 START.)
  2. Scripting has been changed and ExecuteCommand is no longer the correct statement.

I don’t use v3 myself, so first you should check the commands available in v3. There are several ways to do this. The easiest is probably to go into Config, Remote Control, Hotkeys and scroll through the list of commands you can assign to a Hotkey. If the command to start a Player is not (for example) PLAYER 1-1 START, you can modify the part of the script which builds the command.

If the correct command in v3 is still (for example) PLAYER 1-1 START, you’ll need to ask Torben what to put in the script instead of the statement ExecuteCommand.

I hope that helps: please let us all know what the answer is!

BFN
CAD