Running Scripts from the Command Line
Executing Complete Scripts
All above examples were used in a live-coding scenario. The commands were executed in blocks or single lines, step after step. For running a complete script, routines can help to keep the server synchronized. In addition, the server needs to be booted before any server-side operations take place. This can be done with different methods.
Wait for Boot
Server.waitForBoot
boots a server and, when completed, runs the function passed to it as an argument:
Do when Booted
Server.doWhenBooted
need the server to be started with an extra command:
Calling sclang from the Terminal
Once a script is executable as a whole, it can be started using sclang in the command line.
When the above file is stored as sine_example.scd
, it can be started without launching the scide or
any other environment :