Running Juggling Lab from the command line

To use Juggling Lab from the command line, download and expand the file from the Download section. This file contains command-line scripts for running Juggling Lab on a variety of platforms.

Windows: The batch file jlab.bat is all that's needed to call Juggling Lab from the command line. It will look for the Juggling Lab executable at its usual install location at C:\Program Files\Juggling Lab\Juggling Lab.exe. If your installation location is different, edit the batch file with a text editor and fill in the correct path to Juggling Lab.

Mac OS X: The script file jlab runs Juggling Lab on Mac OS X using the application Juggling Make sure that jlab and Juggling are in the same directory so that the script can find the executable.

Linux and other Unix systems: The same script file jlab runs on other Unix systems too, but since there is no Java runtime bundled with Juggling Lab on these systems you will need to have Java 8 installed on your computer. The script jlab expects to find JugglingLab.jar in the same directory as the script.

Once the script is in place, run it with no arguments to print out a help message. If this works then it is finding the Juggling Lab executable correctly:


Features available from the command line

    jlab start

Starts the application.

    jlab anim <pattern> [<prefs>]

Opens a window with an animation of the given pattern, using the given (optional) animation preferences.

    jlab gen <gen_options> [-out <path>]

Runs the siteswap generator and prints a list of patterns, using the given set of generator options to define the number of objects, etc. Type jlab gen with no options for a help message. The output may optionally be written to a file.

    jlab togif <pattern> [<prefs>] -out <path>

Saves a pattern animation to a file as an animated GIF, using the given (optional) animation preferences.

    jlab tojml <pattern> [-out <path>]

Converts a pattern to JML notation, Juggling Lab's internal XML-based pattern description. This may optionally be written to a file.

<pattern> format: For the <pattern> inputs above, this can take any of three formats:

  1. A pattern in siteswap notation, for example 771 or (6x,4)(4,6x).
  2. A siteswap pattern annotated with additional settings, in a semicolon separated format. These settings are identical in format to that used in the pattern entry panel.
  3. A JML pattern read in from a file, using the format '-jml <path>'.

<prefs> format: The <prefs> is always optional, and is used to override Juggling Lab's default animation preferences. These are given in a semicolon-separated format, identical in format to the animation preferences variables recognized by the GIF server.

Important note: The command line environments on both Windows and Unix treat certain characters in special ways. To avoid confusion, on Windows use double-quotes ("like this") around any command line parameters with non-alphanumeric characters, as in the examples below. On Mac OS X, Linux, and other Unix systems use single quotes ('like this').


    jlab anim "(6x,4)*"
    jlab togif "pattern=3;dwell=1.0;bps=4.0;hands=(-30)(2.5).(30)(-2.5).(-30)(0)." -out mills.gif
    jlab anim -jml my_favorite_pattern.jml
    jlab anim 771 -prefs "stereo=true;width=800;height=600"
    jlab anim 5B -prefs "bouncesound=true"
    jlab gen 5 7 5

Running the siteswap generator

Command-line access is especially useful for running the siteswap generator, where there are no limits on execution time or number of patterns generated as there are in the application version. All of the features in the siteswap generator UI have corresponding options from the command line. (Type "jlab gen" for a summary.) For example you can experiment with these:

    jlab gen 5 7 5
    jlab gen 5 7 5 -g
    jlab gen 5 7 5 -g -n
    jlab gen 5 7 5 -g -no
    jlab gen 5 7 5 -ng -se
    jlab gen 5 7 5 -x 2 3
    jlab gen 5 7 5 -x 23
    jlab gen 5 7 18 -prime

Generating synchronous patterns:

    jlab gen 4 6 6 -s -g

Multiplexing has a number of options designed to filter out less interesting patterns:

    jlab gen 5 6 4 -m 2 -g
    jlab gen 5 6 4 -m 2 -g -mt

Here are some examples involving more than one juggler:

    jlab gen 6 4 1 -j 2
    jlab gen 6 4 2 -j 2 -g -jp -m 2 -d 1 -l 1

Experiment and see what you can discover! The number of possible siteswap patterns is vast, so it's easy to find patterns that have never been tried or even seen before. If you give jlab a task that takes too long to complete, stop it with control-c on the keyboard.