The Secrets Of Cakewalk's CAL Programming Feature

By D. Glen Cardenas
(c) 1998 by D. Glen Cardenas


Return home2.gif (20220 bytes)

Start The Tourreturner.gif (1353 bytes)


A Word From The Author

There have been times in my life when I found something so interesting that I just had to take it upon myself to learn as much as I could about it. Most of the time, I've been faced with teaching myself. The reason is that either there wasn't anyone around who I could latch on to and pick their brain on the subject, in which case I had to rely on the bookstores and libraries (and now the internet) for information and insight, or because there simply wasn't much information available, in which case I had to build a new body of knowledge on the subject. My quest of CAL is one example of the latter.

When I discovered CAL in response to a desire to automate some complex editing procedures in Cakewalk version 3, I went to the owner's book and found little to nothing on the subject. My next step was to go to the on-line help and there I did find enough information to get started. This was a challenge, considering the information in the help system was sketchy at best and downright inaccurate at worst. However, in short order I was trying to do things with CAL that seemed to go beyond the samples included with Cakewalk or those I was able to download from various sites around the world. I knew I was in unexplored, or at least undocumented territory. So I started creating my own documentation notes. Before long, I felt I had a good insight into CAL and had created a fair body of information that others might like to share. Thus, the genesis of this tutorial. During my research, I made contact with the folks at Cakewalk. This web site is the results of all of this research along with those contacts. I'm grateful for the support I received from Greg Hendershot, Chris Rice, Alan Myers, Russell Soule, Tom Roussell, Noel Borthwick, Morten Saether, Ron Kuper, Jamie O'Connell and so many others at Cakewalk as well as Jim Aikin at Keyboard Magazine. My deepest thanks to all of them.


An Overview

Over the past few years, producing music on the keyboard has been synonymous with the use of sequencers, particularly PC based sequencer software. With the sophistication of off-the-shelf sequencer packages for the PC, a person need only connect a MIDI or serial keyboard to a computer to start producing professional demos. In fact, the software can even replace the instrument if you are willing to take the time and care to enter notes by hand and edit in the "live" feel. Don't think this can't be done without sounding obviously unperformed. With a bit of time and a creative touch, it's amazing what can be done with a good sound card, a computer running high powered sequencer/editor software and nothing else.

The key to unleashing your creativity using any sequencer is to avail yourself to all of the tools it provides. This is true regardless of how much or how little equipment, time or experience you have. If you want the best results, you must open all of the doors. In this case, open all of the dialog boxes and menu lists. Find out what your sequencer can do and use those tools to their limit. If the music is going to sound right, the editing must be right. However, as flexible as modern PC based sequencers may be, it's impossible for any program to anticipate the needs of each individual musician. Sooner or later you will need to do something that goes beyond the limits of every menu option. Customizing is the next step.

Not every sequencer lets you, the user, create your own custom editing functions. Cakewalk is one that does. Cakewalk is among the most popular and powerful sequencer programs for the PC and the one of choice for many professional and other serious musicians and producers. One of its shining attributes is the CAL (Cakewalk Application Language) feature. It makes possible the writing of custom user defined "programs" that operate on the sequence data. You can then execute these functions like EDIT menu commands. OK, take a deep breath and calm down. Just because you read the word "program" doesn't mean you need to be a certified geek to create one using CAL. Although a background in computer programming will provide you a great jumping off point for learning CAL, all you really need to know are a few basic concepts and have a clear idea of what you want to do to the sequence. Therefore, it is important for the sake of this article that you already have a good understanding of the features of Cakewalk Professional version 3 or above for Windows. For the record, I'm running versions 3.01, 6.01, 7.01 and 8 under Windows 95, and so those of you who have other versions or are running 3.01 under Windows 3.X, there may be some differences that you will have to compensate for. As far as CAL is concerned, what we will be discussing here will apply to all versions of Cakewalk from version 3 through version 8. I will be referencing a lot of Cakewalk's features and will spend little time explaining them. All of this information is in the user's book. Read it first, get used to doing what Cakewalk is already able to do, then come here to learn how to go beyond these built-in functions and enter the world of CAL customizing.

This document focuses on CAL programs as written using functions arranged as program code. It will not spend much time on the subject of using the CAL view window to create macros or "movies" of keystrokes which are then converted into CAL script. The reason is that the creating and use of such macros is rather straight forward, adequately covered in the HELP system and does not require a tutorial to understand. Further, the macros that can be created with CAL "record" are of very limited use and as such, not the stuff of programmers. The only reference to creating macros will be in the discussion of using them to automate the process of setting up the edit function filters.

First Topic Top Of Page