• SONAR
  • CAL scripts seem powerful and efficient. What are they?
2017/01/05 22:13:57
Billy86
Saw a YouTube video about editing MIDI and the guy used a CAL script that apparently comes with Sonar that humanizes a MIDI drum performance by adding random velocities to the entire performance. I got the sense there were other articulations as well. I thought, wow. That beats the arduous task of going in by hand and tweaking every little MIDI event. I could see in his pop up menus that there were a slew of these CAL scripts available to use in Sonar. The names were very arcane. I am intrigued.

What the heck are CAL scripts and is there a list detailing what they do?
2017/01/05 22:24:20
promidi
Cal scripts are a text files with a *.CAL extension that are a basically set of instructions that tell Sonar how to modify MIDI event data that occur in a sequence.  They only modify MIDI event data and cannot manipulate audio data.

If you look in preferences | File | Folder Location and look at the fifth item down, you'll see where Sonar deems your scripts files to be are located. 

They can be written to be quite powerful. For example, I have written one that converts channel aftertouch events to Poly aftertouch events.  You just select the channel aftertouch events and one note event and the script does the rest.

CAL scripts have been available in Sonar for as long as I can remember.  I have used Sonar (or Cakewalk as it was known in the early days) since the mid nineteen nineties and have used CAL scripts since then.
2017/01/06 07:25:46
rogeriodec
CAL Script is a language abandoned by Cakewalk for many years.
Few dinosaurs are left, who know this language very well.
It has several lags in relation to new technologies have been incorporated into Sonar for many years.
It is poorly documented and has a sometimes illogical behavior.
The programming structure is complicated and is not user friendly at all.
I've been programming for over 34 years in many languages, but I'm having a hard time learning CAL Scripts.
But despite all these limitations, this language still makes it possible to cover a number of Sonar deficiencies.
If you have great determination, you can get good results by creating new scripts.
2017/01/06 08:36:58
azslow3
rogeriodec
CAL Script is a language abandoned by Cakewalk for many years.

If was not extended for many years, but it is still there and working. So it is not "abandoned".
 

It is poorly documented and has a sometimes illogical behavior.

Google shows many links, f.e. http://dgcardenas.fpmit.com/cal/
 

The programming structure is complicated and is not user friendly at all.
I've been programming for over 34 years in many languages, but I'm having a hard time learning CAL Scripts.

May be LISP nor something else with (prefix/postfix) Polish notation is not in your list of "many languages"...
Normally programmers can use any language, as musicians normally have no problem to write a song in Dm instead of Am (as long as the music is 12 notes based, computers still have the same ~100 operations as they had 50 years ago).
 
In former times, computer languages was more computer then human oriented. It was important that computers interpret/compile/execute the program fast. That was changed once good programmers become more expensive then computers. As the result, end users benefits from cheap hardware and software but suffer from the quality of both (in terms of execution time and bugs).
 
CAL pro:
1) easy to call in Sonar, can be assigned to some keyboard shortcut
2) can work with several tracks, but there are quite some bugs in this mode
 
CAL cons:
1) offline processing only, it is impossible to tweak parameters in real time listening the result
2) relatively slow execution
 
There are other ways to do MIDI processing, MIDI FX, but pro and cons are reversed. Especially since most MIDI FXes are VST based and can be used as "Synth" only in Sonar (not in MIDI FX bin). But since other DAWs support such plug-ins on tracks, there are plenty of them, including a broad range of scripting languages.
 
There is only one Sonar oriented script based MIDI FX, written by... me Is is Lua based. So far no-one is using it...
 
 
2017/01/06 09:39:52
S.L.I.P.
An invaluable CAL script is split notes to tracks. Great for separating a midi drum track to having each part of the kit on its own track for processing, and mixing.
2017/01/06 10:12:58
dcumpian
Once upon a time, Cakewalk was way ahead of every other DAW in midi support. CAL was one of the things that got them there. The scripts mostly still work, and you can roll your own. I'd prefer to see some or most of the CAL functionality incorporated into the GUI at this point, but until that happens, CAL is still useful.
 
Dan
2017/01/06 12:02:54
Billy86
S.L.I.P.
An invaluable CAL script is split notes to tracks. Great for separating a midi drum track to having each part of the kit on its own track for processing, and mixing.




That's interesting. Do you know the name of the script in the CAL folder?
2017/01/06 12:05:59
rogeriodec
Billy86
S.L.I.P.
An invaluable CAL script is split notes to tracks. Great for separating a midi drum track to having each part of the kit on its own track for processing, and mixing.




That's interesting. Do you know the name of the script in the CAL folder?


Split Note to Tracks.cal
 
2017/01/06 12:06:42
Billy86
Thanks everyone for weighing in. I'm in no way a programmer, and I  have no plans to write any scripts. I just saw one used on a YouTube tutorial on editing midi in Sonar and thought, hmm, what the heck is CAL all about... 
 
Does anyone know if there is a list of what the scripts in Sonar do? For example, S.L.I.P., mentioned one that splits midi drums into separate tracks. Would love to know which one THAT is. Could be some other cool scripts as well... 
 
2017/01/06 12:21:41
Paul P
azslow3
There is only one Sonar oriented script based MIDI FX, written by... me Is is Lua based. So far no-one is using it...

 
For those of you who might be interested in learning more about this, here's the link to Alexey's documentation :
 
AZ Lua MFX plug-in
 
and the Lua reference manual  :  Lua 5.3 Reference Manual
 
 
 
12
© 2026 APG vNext Commercial Version 5.1

Use My Existing Forum Account

Use My Social Media Account