Product icon Help book icon Sound Mill X3 : User's Guide

Automation Overview

How automation works

Sound Mill automation can manage the following:

  • Playing multiple Sound Items.
  • Running and controlling automation Scripts.
  • Starting External Programs.
  • Scheduling Scripts to run at a Time Of Day with the Scheduler .

A Script is composed of one or more command Steps which execute in sequence or can be timed to fire at a specified time. You can run a Script manually by pressing Run Script button in the Automator window (Figure 2). To get started with Scripts, read this page and look at the Script samples .

Automation Scripts

An automation Script is a set of instructions (Steps) to execute. (ex Listing 1)


Script capabilities
  • A Script will execute its Step commands in sequence or individual Steps can be timed to execute.
  • It can run once, run a set number of times, or loop continously until stopped.
  • It can run other Scripts by executing a Run Script Step. (ex Run Script(My_Playlist))
  • It can be scheduled to execute at a specified time of day. Individual steps can be scheduled as well. (when run under the Scheduler)
  • There are many more capabilities. See the Script Editor section for details.

Step Types: See the Script Editor section for a list of Step types available.

Listing 1. Script example
Script Name: My_Playlist
Steps:
1. Play (Sound_Item1)
2. Play (Sound_Item2)
3. Play (Sound_Item3)

Step Time Controls

Script Steps execute in one of these modes:

  • Sequential order - Each Step executes in sequence, waiting for the previous Step to complete. (when no time control is enabled).
  • Offset Time - The Step executes after a specified delay (offset) from the instant that the containing Script starts to run. Offset Times can be set to Auto Reset causing its timer to be reset everytime the Step executes. Timer auto-resets continue until the Script is stopped.
  • Scheduled Time - The Step executes at a specified time of day. This is only used by the Scheduler..

Using time controls and time behavior

  • Offset Time: A Step will execute after a specified amount of time from the instant its containing Script starts to run. This is the best method for making sounds play concurrently. For example, set Offset Time to 2 seconds then the Step will execute 2 seconds after the Script starts to run.
  • Schedule Time: A Scheduled Step will execute at its specified time of day. It is ONLY executed by the Scheduler. It is not added to the Scheduler Plan until its containing Script starts to run. It is ignored when you run the Script manually.
  • A Step is treated as a simple sequential Step, when neither Offset Time nor Schedule Time are enabled.
  • Steps with equivalent Offset Times will start to execute simultaneously.
  • Steps with an Offset Time of zero (0) will execute immediately when the Script starts.
  • Pausing a Script that has Offset Timed Steps, will cause timing of those Steps will be invalidated. The timing of Step execution is not recalculated for the pause duration. When a Script is 'Paused', any Offset timed Steps that time out (Offset expires) are lost (not executed) Unexpected results are likely but the Script will continue to run when 'Resume' is clicked.
  • A Delay Steps are always executed as sequential Steps.
  • Play Step (looping): Playing a Sound Item that is setup to Loop (in the Play Modifiers) is a special case. A looping sound never finishes until you manually hit the Stop button. So it will prevent any subsequent Steps from executing. If you use a Looping sound, you will need to Stop the Script manually.

Runaway Script Error Condition

If a Script is detected repeating itself rapidly in a very short time span, the Automator will assume it is in a Runaway condition and abort it.

Under certian conditions, you could create a Script that spins out of control, repeating itself as rapidly as your CPU can process it. This is usually associated with a Script set to Loop or Repeat and composed of timed Steps (ex Offset Timed Steps). The Script Editor detects and warns about obvious cases, but not all problems can be detected at edit time.

Script Recursion Error Condition

If a Script is detected as running in an infinite Recursion loop, the Automator will abort it.

This can happen if you are not careful with 'Run Script' Steps in your Scripts. For example, if you run Script A in Listing 2, it would cause a Recursion loop (A runs B; B runs A; A runs B; ad infinitum...). If not stopped, the two Scripts would continue to run each other until the computer runs out of memory.

Figure 1. Script Recursion
Figure 1. Script Recursion
Listing 2. Recursive Scripts
Name: Script A
Steps:
1. Run Script (Script B)

Name: Script B
Steps:
1. Run Script (Script A)

Figure 2.  Automator main window
Figure 2. Automator main window