timeworx Posted January 26, 2022 Share Posted January 26, 2022 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? Link to comment Share on other sites More sharing options...
billp Posted January 26, 2022 Share Posted January 26, 2022 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. Link to comment Share on other sites More sharing options...
Toy Posted January 26, 2022 Share Posted January 26, 2022 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. Link to comment Share on other sites More sharing options...
tparker24 Posted January 26, 2022 Share Posted January 26, 2022 I wonder if the free CSHumanize MidiFX Plugin might be of some use. It's also discussed a bit in this thread: 1 1 Link to comment Share on other sites More sharing options...
David Baay Posted August 26, 2023 Share Posted August 26, 2023 Late to the party. I just happened to stumble on this while searching for something else. FWIW, I have written CALs where the modification of an event depends on some parameter of the one before it - or vice versa. Like billp, I have just had to save the the parameter(s) of the one event for use in processing the preceding/following event on the next iteration of the loop. I don't fully understand the issue you have with the order of notes in a chord, but it sounds like you would just need to check for simultaneity of start times (maybe within some user-specified number of ticks if chords aren't hard-quantized) and save the necessary paremeters of several events in a row to be used on the next pass. Bottom line, there is no way to store the infromation in an array. You have to create a sort of facsimile of an array using indexed variables like lastChord1, lastChord2, lastChord3 , etc. 1 Link to comment Share on other sites More sharing options...
Glenn Stanton Posted August 26, 2023 Share Posted August 26, 2023 (edited) i sometimes use the CSHumanize MidiFX Plugin but only for minor velocity changes. i find the timing bits feel too coarse even in small amounts, so for the timing bits i'll either adjust by hand or use the normal quantize tools. it would be really nice if the new CAL was based on Javascript-like scripting so blocks can be explicit, full array, object, and prototype support etc versus depending on the indentation models used in other languages... lol you could then write proper text-formated "libraries" for controlling not only the app but plugins etc... Edited August 26, 2023 by Glenn Stanton Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now