Home Page

Functions And Keywords Page

Alphabetical Index

Next Topic

Previous Topic

Sample Programs

Updates And Corrections


Track Menu Functions

When you look at the TRACK view in Cakewalk, you see an array of information specific to each track in the sequence such as the track's name, the patch being used, the MIDI channel for that track, initial volume and pan settings and so on. All of these attributes are settable through CAL, though, sadly, none of them are accessible to CAL once they have been set. This means that by using these TRACK MENU functions, you can name tracks, set their MIDI channel and so on, but you cannot read these settings. This is a real shame! It would be so nice to be able to read a track's initial volume setting for example or read a track's MIDI assignment and then use that information in a CAL program. As it stands, you must have the user enter these values with "getInt" statements in order to account for them in CAL. This flaw aside, these functions are very useful for things like splitting a track into several tracks or cutting certain events from a track and placing them in a new track, and then being able to name these new tracks, assign them MIDI channels, patches, volume settings etc. Check out the package of down-loadable CAL programs that I've written available from the link on the Sample CAL Programs page. One of those programs called "Drumsplt.CAL" makes use of some of these TRACK functions.

Important Considerations In Creating Macros Using CAL Record

When Cakewalk made the grand leap from version 6 to version 7 with emphasis on respecting the Windows 95 User Interface convention, it sent a bit of a monkey wrench into CAL as far as recording track selections within a macro. As it turns out, Cakewalk sends CAL the instruction to select when clicked and deselect when clicked again, but the selection system now has a "Radio Button" property in that if you have tracks selected and you click on another track, unless you are holding down on the CTRL or SHIFT key, the new track becomes the only one selected and the rest are now deselected. The down side is that if this takes place during a macro record, the deselected tracks are never coupled with a corresponding issuance of a deselect CAL instruction. As far as the macro is concerned when it's run, all the tracks, the originals and the newly clicked one are selected and will be equally effected at run time. Another thing is that when using the CAL macro record for capturing track manipulations, they are recorded as effecting all selected tracks, not simply the track you had selected at the time. Thus, If you record the macro to effect track 12 and then when you run it with tracks 1,4 and 7 selected instead of or along with track 12, all instructions originally recorded for track 12 will now effect every selected track. Keep this in mind if you use macro recording to capture track setup macros and fail to properly and carefully follow track selection/deselection protocol as you record the macro or fail to edit them later to become specific to only one track

(TrackName name track)
This function will place the text associated with the "name" variable and place it in the name field of the track pointed to by the variable "track". This name will now appear in the TRACK view, the STAFF view and anywhere the track name is displayed or referenced. To name a track using this function, you must create a text string for the "name" argument either by supplying actual text in quotes, using a string variable that has itself been assigned a text string or by synthesizing a text string using the "format" function. The argument "track" is the track number to be named. Remember, CAL sees track numbers as ranging from 0 through 255 and we see them as 1 through 256. Here is an example for each method of generating a name text string and then assigning the name to track 7. First, using direct text:
 
(TrackName "Bass Line" 6)
Next declaring and using a string variable called "title":
 
(string title "Bass Line")
(TrackName title 6)
Finely generating a name made up of the tracks number and the words "Track Number" as assembled by the "format" function:
 
(int tracknum 0)
(getInt tracknum "Enter a track number " 1 256)
(-- tracknum)
(TrackName (format "Track Number " (++ tracknum)) tracknum)
In this last example, we declared a variable to hold the track number called "tracknum" and initialized it to zero for the sake of good habits. We then asked the user to enter a track number and assigned the input to "tracknum". Next we decrement the value in "tracknum" because CAL expects to use the 0 to 255 range and the value was entered by the user in the 1 to 256 range. Next we call "TrackName" and create the name text with a nested call to the "format" function which generates a text string from "tracknum" and combines the text "Track Number " with the result. As you can see, we had "format" not work directly on "tracknum", but on the result of incrementing "tracknum" by 1 to again place it in the 1 through 256 range.
 
(TrackLoop repetitions track)
In Cakewalk 3, you can set a track to loop during playback thus saving editing time needed to duplicate the segment for as many times as it needs to repeat. In the later versions of Cakewalk, this feature was rendered obsolete due to the ability to work with clips. The "repetitions" argument is the number of times to repeat the segment. The "track" argument is the track number. Running this function in Cakewalk 3 will assign the loop field in the TRACK view of the track referenced by the argument "track" to the value of "repetitions". Attempting to run it in Cakewalk 4 or higher will result in a run time error message stating that "TrackLoop" is an unknown procedure.
 
(TrackActive mode track)
This function is the same as checking or unchecking the mute checkbox in the TRACK view screen. The "mode" argument is 1 to make the track play, 0 to mute the track on -1 to toggle the status. As it stands, a bug has caused the -1 toggle mode to be the only one recognized by versions 7 and 8. This means that CAL programs that issue a mode of 1 or 0 will be ignored by the track, but the action will still be listed in the UNDO history as though it had taken place. As expected, the "track" argument is the track to be acted upon in the 0 to 255 range. If the track value is set to -1, all highlighted tracks will be effected.
 
(TrackArchive mode track)
A track that is archived is ignored by Cakewalk during playback thus reducing the load on the sequencer engine. See the help topic about this menu option for more information. This function works just like the "TrackActive" function above. Set "mode" to 0 to archive, 1 to un-archive and -1 to toggle the current status. Just like with the (TrackActive) function above, a bug has caused the -1 toggle mode to be the only one recognized by versions 7 and 8. This means that CAL programs that issue a mode of 1 or 0 will be ignored by the track, but the action will still be listed in the UNDO history as though it had taken place. The "track" argument is the target track and a value of -1 targets all highlighted tracks. Although this function is recordable in CAL as a macro in my copy of Cakewalk version 3, attempting to run the resulting macro generates an "Unknown Procedure" error.
 
(TrackRecordEnable mode track)
This and the function just below are new as of version 7. Like their siblings above, they mimic the corresponding check boxes in the Track View. The action does seem a bit backwards though. You must set "mode" to 1 to disable recording and 0 to enable it. As expected, -1 will toggle the track's current status. The "track" argument is the target track and -1 targets all highlighted tracks.
 
(TrackSolo mode track)
As you would expect, this function, new for version 7, corresponds to the SOLO check box in the Track View. Like the function above, it also seems backwards. Set "mode" to 1 to un-solo, 0 to solo and -1 to toggle. The "track" argument is the target track and -1 targets all highlighted tracks.
 
(TrackClone events parameters track)
This function mimics the same feature in the TRACK menu which allows you to duplicate an entire track. The source track must be highlighted and the destination track is selected through the "track" variable. The other two variables, "events" and "parameters", allow you to clone the events by setting "events" to 1, and/or the track's settings by setting "parameters" to 1.
 
(TrackKey+ amount track)
I'm sure I don't need to say much about this function. It works just like the transpose box on the screen and the KEY+ option from the TRACK menu. The "amount" argument is the number of half steps you wish to transpose the track and can be from -127 to 127. The "track" argument is the track in the 0 to 255 range to be effected and -1 effects all highlighted tracks.
 
(TrackVel+ amount track)
This function alters the track velocity. As with the functions above, the "amount" argument can be from -127 to 127 and the "track" argument is in the 0 to 255 range with -1 effecting all highlighted tracks.
 
(TrackTime+ amount track)
To shift a track in time without changing the events, use this function the same way as those above. This time, "amount" contains the number of ticks to shift the track either plus or minus. The "track" argument is in the 0 to 255 range with -1 effecting all highlighted tracks.
 
(TrackPort number track)
This function assigns a port number to a track or to all highlighted tracks. Remember that "number" must be in the 0 to 15 range, not the 1 to 16 range. The "track" argument is in the 0 to 255 range with -1 effecting all highlighted tracks.
 
(TrackChan number track)
(TrackChannel number track)
Use this function to set a track's MIDI channel in the 0 to 15 range with the "number" argument. The "track" argument is in the 0 to 255 range with -1 effecting all highlighted tracks. The first form was used in version 3 and was replaced at some point by the second form (Thanks to John Allen for discovering this oddity).
 
(TrackPatch number track)
This function works like the ones above. The "number" argument holds the patch number from 0 to 255 or -1 which means clear the field to display "---" and no patch is explicitly selected. The "track" argument is in the 0 to 255 range with -1 effecting all highlighted tracks.
 
(TrackBank number track)
This works like the other functions in this group. The "number" argument is the patch number and can range from 0 to 16384 or -1 which means no bank is explicitly selected. The "track" argument is in the 0 to 255 range with -1 effecting all highlighted tracks.
 
(TrackVolume amount track)
The "amount" argument can be any volume level from 0 to 127 or -1 which clears the field to "---" and selects no volume setting at all. The "track" argument is in the 0 to 255 range with -1 effecting all highlighted tracks.
 
(TrackPan amount track)
This works just like the "TrackVolume" function above. The "amount" argument is the amount of pan from 0 to 127 with 63 being center pan. Use -1 to clear the field to "---" and select no pan at all. The "track" argument is in the 0 to 255 range with -1 effecting all highlighted tracks.
 
(TrackSelect mode track)
According to the documentation, this function only works for CAL30 EDIT functions as the CAL40 EDIT functions ignore these selections and depend on the user to make all track selections before running the CAL program or offer track number arguments themselves. However, it has been my experience that using this function will indeed cause the track number in the "track" argument to become selected and subject to functions like "EditCut40" and "EditQuantize40" and so on. Keep this in mind! The "mode" argument is set for 1 to select, 0 to de-select and -1 to toggle. The "track" argument is the track number in the 0 to 255 range with -1 denoting all tracks containing data.
 
Next Topic Top Of Page