ReaJS script to turn Mono-Pressure into Poly-AT

A new version of my script is available and I have included it in the attached zip file, together with the old one.
The new version is called “midipressuretopolylag”. I have added smooth transitions of the poly-AT values both when going to zero (i.e. when a new note is pressed) and when going up from zero. The algorithm simulates the response of a one-pole RC low-pass filter. The smooth transitions are active if “Reset Held Notes” is on.

New parameters have been added to control the behavior of the script:
Attack and release time constans (in ms): the transitions can last up to ~2 seconds (500 ms time constant)
AT update period: during the transitions, a new poly-AT message is sent every AT-period samples. Increasing this parameter, decreases the amount of poly-AT messages sent for given attack and release times.

The zip file also contains two txt files, explaining the behavior of the two scripts.

The image shows the poly-AT messages generated (as a function of time in seconds) when C4, C5 and C6 are pressed one after the other. The first transition happens as normally expected. When the second key is pressed, the AT of the first goes to zero exponentially and the AT of the second goes up in the same way (flipped exponential). When the last note is released, we see first the AT going down, as finger pressure on the key diminishes…then a small exponential decay can be seen at the end when the note off message is generated.
C4_C5_C6_attack220ms_release500ms_update256samples

Cheers!
Gabriel

P.S. Many many thanks to @Ade who put the new script to some stress before release. Any remaining bug is my fault not his! :wink:

Update: A new zip file with updated txt files is available down below in this same thread. The scripts are the same in both zip files.

Update2: The latest versions of the scripts (including bug fixes and new features) will always be found at the bottom of the thread. Please ignore intermediate versions.

midipressure_to_polyAT.zip (6.4 KB)

5 Likes