I have been working on this script for several weeks, consuming dozens of hours of work, mainly to adapt a complex logic from POLYNOMIAL BICUBIC INTERPOLATION to all the technical limitations of CAL Script, besides all the time to learn this language.
But now the first version is ready.
The idea behind this script is to give more flexibility and more power to the humanization of MIDI tracks.
Unlike the original "HUMANIZE.CAL", this script does not work with a percentage but mainly based on ticks.
This is because working with percentages generates many distortions. For example: Applying 10% on a long note and a short note creates absurdly different widths on the notes.
Also, one technique I intruded on was the random creation of controls (ModWheel or CC) during a group of notes. This allows small (or large) variations of pitch and expression.
This is also especially useful when you work with several similar instruments in unison. For example, 4 French Horns. If you simply duplicate the same track from 1 horn to 2 or more, this will result in phasing. In this case, a good "humanization" accessible via MIDI is to make small random changes of pitch, expression, note position, note width, etc. Of course, several other aspects will help to avoid phasing, such as handling the timbre of the instrument, position within a virtual stage, impulse response, etc. But that's not the point here.
So let's get down to business.
HUMANIZE PLUS.CAL has the following features:
- Changes the note velocity, time and/or length, based on an informed random range;
- Slides any current CC (1 = modulation, 11 = expression, etc) time and changes its values based on informed parameters;
... or ... - Creates a random sequence of ModWheel or CC which are interpolated by an algorithm of POLYNOMIAL BICUBIC INTERPOLATION.
So from this:
You can get this:
Starting as an example, first, the parameters are dynamic, that is, depending on the value entered in one parameter, other parameters can be requested or not.
Here are all parameters (regardless of the choices between one parameter and another):
- The script basically works with two types of events: Notes and Controls. To modify only notes (velocity, width, value), choose 1. To create or modify controls (ModWheel, CC), choose 2. To modify both, choose 3...

- If you chose 1 or 3, the following parameters will be displayed:



If the value zero is entered in any of the parameters, nothing will be changed referring to the corresponding parameter. - If you chose 2 or 3 in the first parameter, the following parameter will be displayed:

In this case, if you enter -1, the script will generate a random series of ModWheel. For values from 1 to 126, CC will be generated with their corresponding numbers. Ex: 11 will generate (or modify) a CC#11 series. Note: CC#127 is not allowed as this is used internally in the script for logic controls. - If you chose some CC number, the following parameter will be displayed:

Option 1 will create a random series of the CC previously chosen, within each block of notes found, and will interpolate them with the bicubic algorithm already mentioned. Important: In this option, the existing CCs will be erased, within the selected sequence.
Option 0 can be used if you want to move a series of CC that already exists and still optionally change its values. - If option 0 (update current CC) is chosen, the following parameters will be requested:

Here you can enter the number of ticks to move the existing CCs (negative shifts to the left and positive shifts to the right).
For example, by choosing -1000, ALL the CCs chosen will be shifted 1000 ticks to the left.

This number will be added (or subtracted, if negative) from the value of each CC found.
For example, if you already have a passage with multiple CC#11:

... entering -1000 in the "Slide Time" parameter and -30 in "Number to Add / Subtract", all CC#11 found within the selected notes will be shifted 1000 ticks to the left and their values will be subtracted by 30:

- If option 1 (Create new CC random series) is chosen, the following parameters will be requested:


This will create a new random series of CCs, bicubically interpolated, within the reported minimum and maximum values.


- If you previously chose -1 (ModWheel), the following parameters will be displayed:


They work in the same way as the last two CC parameters explained above, however, within the minimum and maximum values allowed by ModWheel. - Finally, if you initially opted for -1 (Modwheel) or by the parameter "(1) Create new CC random series", the following parameters will be shown:

This will determine the space (in ticks) between the random control points within the selected notes.
For faster variations, enter a smaller value. For slower variations, enter a larger value.

This will determine how many ModWheel or CC events will be generated as interpolation between one control point and another. 1, it will generate the maximum of possible controls, that is, 1 control per tick. Larger values will generate fewer controls.
You can download both files at once
here, or directly from
GitHub.
There are 2 files, which must be in the
same folder:
- HUMANIZE PLUS.CAL: The main script; <<<----- You should only run this file...
- HUMANIZE PLUS-inc.CAL: The included script, used internally.