Cakewalk Application Language (CAL) is an event-processing language that you use to extend Pro Audio and Professional with custom editing commands.
You can write your own CAL program and use or edit CAL programs that other people have written. You also can create CAL programs by recording a series of commands, keystrokes, and mouse actions. Pro Audio and Professional translate and save these actions as CAL programs, which you can use or edit.
The best way to learn how to create CAL files is to analyze existing CAL files. You can find these included with many versions of Cakewalk products. Here are some additional user sites that you can download CAL files from.
Lars Ahlzén's might CAL page
CAL programs for downloading
Here are some internet resources that have additional information on CAL.
CAL Programming InformationWriting CAL Programs
This section outlines the basics of writing CAL programs. Things will be easier if you’ve done at least a little programming, whether in BASIC, C, Pascal, LISP, or another language. (CAL blends elements of C and LISP, in particular.)
For additional information on developing CAL programs:
- The on-line help for CAL contains a complete function reference
- A tutorial called CAL Tutor is available from Clockwork Music
Here is a sample program that illustrates how the CAL language works. This sample program asks the user to enter a value and then adds that value to the velocity parameter of note events.
(int amt 0)
(getInt amt "Amount to add?" -127 127)
(if (== Event.Kind NOTE)
(+= Note.Vel amt)
CAL has a very simple syntax that is similar to LISP. Every statement in CAL is a call to a function, and the function returns a value:
Those of you experienced with C or Pascal programming will find this natural when you think of function calls such as:
(message "Hello, world.")
Here, the function message is passed a string argument. As you might guess, this CAL program displays text on Pro Audio message line.
This syntax is not quite as natural when you realize that arithmetic operations are treated as functions. For example, the addition operator is really a function. To add two numbers, you say:
(+ 1 1)
the result of which is 2. This will be comfortable to LISP hackers, but others may find it a little unnatural at first.
Recording CAL Programs
Most Pro Audio/Professional commands have CAL equivalents. As a result, you can use the macro record capability of the CAL view to create basic CAL programs.
To Record a CAL Program…
- Choose File-New, select CAL Script from the list, and click OK. A new CAL program is displayed in the CAL view.
- Click the record button in the CAL toolbar to start recording.
- Choose File-Open or click Open Project button on the main toolbar to display the Open dialog box.
- Choose any file and click Open.
- Return to the CAL view and click the record button to stop recording.
Pro Audio/Professional creates a simple CAL program that opens the file. To test the program, close the file you just opened, return to the CAL view, and press the play button to replay the program. You can save this program as a CAL file like any other, and even assign a key binding to it using the Key Bindings command.
The CAL on-line help includes a complete listing of Pro Audio/Professional commands that have CAL equivalents