Torsten Anders and Graham Percival
This tutorial introduces some fundamental concepts of Strasheela by concrete examples. Strasheela is a highly generic computer aided composition system based on constraint programming.
Warning: This tutorial is still work in progress.
Strasheela provides an interactive tutorial for learning the basics of Oz and Strasheela. If you added the Oz applications to your
PATH environment variable (see the installation instructions), you can just execute
StrasheelaTutorial at the commandline (
StrasheelaTutorial.exe on Windows). Alternatively, at the commandline move to the folder
strasheela/contributions/anders/Tutorial/ and execute
StrasheelaTutorial.exe. It is recommended to start the tutorial from the commandline, because some feedback is printed at the commandline. The application sometimes takes a few seconds to start up (it starts the Oz compiler in the background).
This interactive tutorial supports the direct execution and editing of Oz and Strasheela examples. You don't need to first learn Emacs nor set up an Oz initialisation file — you can directly start and try out Strasheela itself! The text of this tutorial is also provided in HTML format (see links below) in case you prefer reading the examples in a web-browser.
Important: This tutorial is still work-in-progress. Nevertheless, the tutorial is complemented by many examples with extensive explanations in the examples folder. These examples define various musical constraint problems, ranging from relatively simple to quite complex music theories. Also, the rich export facilties to formats like MIDI or Lilypond is demonstrated (ControllingOutput-Examples), and special features like realtime constraint programming (Realtime-Examples) or the use of parallel search with multiple CPUs or computers shown.
The interactive tutorial provides a means to easily test out provided examples. For developing Oz and Strasheela programs, however, the Oz Programming Interface (OPI) is more suitable. The OPI is a powerful environment for editing and executing Oz code, and for interacting with other development tools. Start the OPI by typing (at the commandline)
This opens an editor window with two frames. You can enter Oz source code in the top frame. For example, type the following:
Select this line with the mouse. Then, go to the Oz menu and select
Feed Region (there are other menu entries for feeding the source line in which the cursor is, a paragraph etc.). This feeds the selected code to the Oz compiler which executes it. It opens the Browser window, and the Browser displays
Note the short-cuts shown after the menu entries. For example,
Feed Region has the short-cut C-. C-r (meaning first the keys Control and '.' at the same time, and then Control plus 'r'), and
Feed Line has the short-cut C-M-x (meaning Control-key plus Meta-key plus 'x', the Meta-key is usually the alt-key on your keyboard).
You can also load and save Oz source files using the file menu. Don't get confused by its unconventional design. Create a new
*.oz file by opening a not yet existing file. At the file menu select
Open File..., and watch the lowest line of the OPI (the Minibuffer) where you are prompted to enter a file name.
This little information — together with the Oz menu provided by the OPI — are already enough for doing Oz programming. If you want to learn more, extensive documentation exists for the OPI and for Emacs.