Jump to content

advanced humanization via CAL script

Recommended Posts

Greetings all - 

I compose a lot of MIDI music and use CAL scripts for humanization regularly.  One complication I encounter that requires manual editing is with regard to note duratino and overlap with subsequent notes. Much of my MIDI articulation requires note overlap in order for the articulation to work (legato, hammer-ons etc.)

When using CAL scripts, even with duration adjustments, some of the overlaps are lost (or inadvertantly added). If there is a way to capture EVENT.TIME in an array, I could cusomize code to address this. Is anyone familiar enough with the scripting language to know if this is possible?

Share this post

Link to post
Share on other sites

I've written a few CALs. It's kind of like LISP and not for the faint at heart. I don't recall there being an array feature. 

I'm guessing you are in part changing the start times of the notes to "humanize" them. If it were a single line (with no keyswitches) a CAL script could maintain the overlap by lengthening an advanced note, and lengthening the note preceding a delayed note, both by the amount that you shift the "current" note, for notes that originally overlap. You wouldn't need an array for this. You'd need to save a reference to the modified note event when you move to the next one so you could refer back to it.

If you have keyswitches that need to precede or follow a note for hammer-ons, slides,  voice changes, etc. (like Ample guitars for example), you may need to correct those manually so that they move relative to the notes they are intended to affect. There would also be a much more complex issue with polyphonic passages where overlaps are all over the place.

I'm two-blocked now with other programming but if I get a chance, I'll try to do this.

Share this post

Link to post
Share on other sites

The problem with this is that the events within the range are not acquired on time.
For example, even if "CDEFGAB" is selected, CAL may process in the order like "ECDBGFA".

Measures in my case.
There is no array in CAL. Therefore, create the necessary variables, get the information within the range, and create an array.
Variables can be easily understood by using "array.time00, array.time01, array.key00, array.key01, ..." and so on.
Arrays can be sorted by performing the necessary comparison processing using "while, switch", etc.
By executing (forEachEvent) again and comparing the event information with the array, legato processing etc. can be freely performed.

As a premise, knowledge of programming that can create arrays and sorts is required at a minimum.
It is quite difficult because it is necessary to customize the array processing, especially the comparison processing, for each Cal.
Of course, once you make it, the rest will be easier.

I haven't processed the chords correctly yet.
I would like to know if there is an easier way.

Share this post

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

  • Create New...