Skip to content

Launching

Hervé Bitteur edited this page Jan 24, 2018 · 4 revisions

Launching Audiveris

We can launch Audiveris in different manners.

From a file explorer window, by double-clicking on one of these files located in bin sub-folder of the installation folder:

  • Audiveris.bat

  • Audiveris.sh

    Nota: For a double-click to work, the file extension (here .bat or .sh) must have been registered to point to proper OS application.
    Note also that this Audiveris.sh file is just a renamed copy of Audiveris file located in the bin sub-folder, precisely to benefit from a .sh extension.

From a terminal window, by typing a command like ($> figures the command prompt):

  • $> gradle run (Assuming you are in the development folder)
  • $> path\to\bin\Audiveris.bat (Windows, pointing to file in installation folder)
  • $> path/to/bin/Audiveris (Unix-like, pointing to file in installation folder)

All the commands above will simply launch the application in interactive mode (a basic GUI) and with default parameters.

Passing application arguments

Suppose we want to run Audiveris in batch on an input file named "my file.pdf" and export the result in MusicXML format into a folder named "my output folder". [mind the spaces in input file name and in output folder name!]

We could use this command (syntax is the same for Windows and Unix-like, the optional "--" introduces inputs):

$> path\to\bin\Audiveris.bat -batch -export -output "my output folder" -- "my file.pdf"

However, if the application is launched via the gradle tool (which in turn will run Audiveris application), we need a way to pass some arguments not to gradle but to the application launched by gradle.
We do this by setting the specific project variable cmdLineArgs, as follows:

$> gradle run -PcmdLineArgs="-batch,-export,-output,my output folder,--,my file.pdf"

Notice that for a launch via gradle, the arguments separator is a comma (,), not a space, and the whole argument string must be surrounded by quotes if any argument contains a space.

The space is not a separator, hence we need a comma between -output and my output folder arguments. And no argument should have a heading or trailing space.

Passing JVM arguments

Similarly, JVM arguments can also be provided via the gradle launch, using a -PjvmLineArgs=... construction.

For example, to use 3 gigabytes of memory:

$> gradle run -PjvmLineArgs=-Xmx3g