Round Robin + Humaniser + Velocity Curve Master Control



  • This is a kind of master front panel control for use with my round robin and humaniser scripts. If you have more than one RR or humaniser script present and you want to give the user an interface to control all of those script in one go then use this. It will look through the instrument for all script processors with round robin or humanise in their name and forward the values of the controls to those scripts. I've also added a table for editing the velocity curve which is applied in the on note callback. This script is probably best placed in the master container. Feel free to edit this to meet your needs.

    <?xml version="1.0" encoding="UTF-8"?>
    
    <Processor Type="ScriptProcessor" ID="Settings" Bypassed="0" Script="/**&#10; * Round Robin + Humaniser + Velocity Curve Master Control&#10; * Author: David Healey&#10; * Date: 11/01/2017&#10; * Modified:&#10; * License: GPLv3 - https://www.gnu.org/licenses/gpl-3.0.en.html&#10; */&#10;&#10;//Includes &#10;&#10;//Init&#10;&#10;Content.makeFrontInterface(650, 200);&#10;&#10;const var scriptProcessors = Synth.getIdList(&quot;Script Processor&quot;);&#10;const var rrProcessors = [];&#10;const var humaniserProcessors = [];&#10;const var ccNumbers = [];&#10;&#10;for (i = 0; i &lt; 129; i++)&#10;{&#10;&#9;ccNumbers[i] = i;&#10;}&#10;&#10;for (scriptProcessor in scriptProcessors)&#10;{&#10;&#9;if (Engine.matchesRegex(scriptProcessor, &quot;(?=.*ound)(?=.*obin)&quot;)) rrProcessors.push(Synth.getMidiProcessor(scriptProcessor)); //Array of RR processors&#10;&#9;if (Engine.matchesRegex(scriptProcessor, &quot;(umanise|umanize)&quot;)) humaniserProcessors.push(Synth.getMidiProcessor(scriptProcessor)); //Array of humaniser processors&#10;}&#10;&#10;//GUI&#10;//VELOCITY CURVE TABLE&#10;const var tblVel = Content.addTable(&quot;tblVel&quot;, 600, 100);&#10;tblVel.set(&quot;width&quot;, 200);&#10;tblVel.set(&quot;height&quot;, 90);&#10;&#10;//ROUND ROBIN&#10;//RR Type and Mode Combo Boxes&#10;const var cmbType = Content.addComboBox(&quot;Type&quot;, 0, 10);&#10;cmbType.set(&quot;items&quot;, [&quot;Off&quot;, &quot;Real&quot;, &quot;Synthetic&quot;, &quot;Hybrid&quot;].join(&quot;\n&quot;));&#10;&#10;const var cmbMode = Content.addComboBox(&quot;Mode&quot;, 150, 10);&#10;cmbMode.set(&quot;items&quot;, [&quot;Cycle&quot;, &quot;Random&quot;, &quot;Random No Repeat&quot;, &quot;Random Full Cycle&quot;].join(&quot;\n&quot;));&#10;&#10;//Reset timeout knob&#10;const var knbReset = Content.addKnob(&quot;Reset Time&quot;, 300, 0);&#10;knbReset.setRange(0, 60, 1);&#10;&#10;//HUMANISER&#10;const var knbNoteOn = Content.addKnob(&quot;Note On&quot;, 0, 50);&#10;knbNoteOn.setRange(0, 100, 0.1);&#10;knbNoteOn.set(&quot;suffix&quot;, &quot;ms&quot;);&#10;knbNoteOn.set(&quot;tooltip&quot;, &quot;Note On: adds random delay (0 ms - 100 ms) to the Note On of each note.&quot;);&#10;&#10;const var knbNoteOff = Content.addKnob(&quot;Note Off&quot;, 150, 50);&#10;knbNoteOff.setRange(0, 100, 0.1);&#10;knbNoteOff.set(&quot;suffix&quot;, &quot;ms&quot;);&#10;knbNoteOff.set(&quot;tooltip&quot;, &quot;Note Off: adds random delay (0 ms - 100 ms) to the Note Off of each note.&quot;);&#10;&#10;const var knbVelocity = Content.addKnob(&quot;Velocity&quot;, 300, 50);&#10;knbVelocity.setRange(0, 100, 1);&#10;knbVelocity.set(&quot;suffix&quot;, &quot;%&quot;);&#10;knbVelocity.set(&quot;tooltip&quot;, &quot;Velocity: adds or subtracts random value in selected +-range of played velocity.&quot;);&#10;&#10;const var knbFineTune = Content.addKnob(&quot;FineTuning&quot;, 450, 50);&#10;knbFineTune.setRange(0, 100, 1);&#10;knbFineTune.set(&quot;tooltip&quot;, &quot;Fine Tuning: detunes each note randomly in the selected +-range - up to 1 semi-tone.&quot;);&#10;&#10;const var knbVolume = Content.addKnob(&quot;Volume&quot;, 600, 50);&#10;knbVolume.setRange(0, 8, 0.1);&#10;knbVolume.set(&quot;suffix&quot;, &quot;dB&quot;);&#10;knbVolume.set(&quot;tooltip&quot;, &quot;Volume: changes the volume of each note randomly from -8db to +8 db.&quot;);&#10;&#10;const var cmbCC1 = Content.addComboBox(&quot;CC 1&quot;, 0, 110);&#10;cmbCC1.set(&quot;items&quot;, ccNumbers.join(&quot;\n&quot;));&#10;cmbCC1.set(&quot;text&quot;, &quot;First CC&quot;);&#10;cmbCC1.set(&quot;tooltip&quot;, &quot;First CC Number: Select a CC number to humaniser.&quot;);&#10;&#10;const var knbCC1 = Content.addKnob(&quot;First CC&quot;, 150, 100);&#10;knbCC1.setRange(0, 100, 1);&#10;knbCC1.set(&quot;suffix&quot;, &quot;%&quot;);&#10;knbCC1.set(&quot;tooltip&quot;, &quot;First CC: adjusts the CC value by a random percentage in the +-range selected.&quot;);&#10;&#10;const var cmbCC2 = Content.addComboBox(&quot;CC 2&quot;, 300, 110);&#10;cmbCC2.set(&quot;items&quot;, ccNumbers.join(&quot;\n&quot;));&#10;cmbCC2.set(&quot;text&quot;, &quot;Second CC&quot;);&#10;cmbCC2.set(&quot;tooltip&quot;, &quot;Second CC Number: Select a CC number to humaniser.&quot;);&#10;&#10;const var knbCC2 = Content.addKnob(&quot;Second CC&quot;, 450, 100);&#10;knbCC2.setRange(0, 100, 1);&#10;knbCC2.set(&quot;suffix&quot;, &quot;%&quot;);&#10;knbCC2.set(&quot;tooltip&quot;, &quot;Second CC: adjusts the CC value by a random percentage in the +-range selected.&quot;);&#10;&#10;//Functions&#10;&#10;//Callbacks&#10;function onNoteOn()&#10;{&#10;&#9;//Scale velocity based on the velocity table curve - min 1, max 126&#10;&#9;Message.setVelocity(1 + Math.floor((125 / 100) * (tblVel.getTableValue(Message.getVelocity()) * 100)));&#10;}&#10;&#10;function onNoteOff()&#10;{&#10;&#9;&#10;}&#10;function onController()&#10;{&#10;&#9;&#10;}&#10;function onTimer()&#10;{&#10;&#9;&#10;}&#10;function onControl(number, value)&#10;{&#10;&#9;switch (number)&#10;&#9;{&#10;&#9;&#9;case cmbType: //RR Type&#10;&#9;&#9;&#9;for (rrProcessor in rrProcessors)&#10;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;rrProcessor.setAttribute(0, value);&#10;&#9;&#9;&#9;}&#10;&#9;&#9;break; &#10;&#10;&#9;&#9;case cmbMode: //RR Mode&#10;&#9;&#9;&#9;for (rrProcessor in rrProcessors)&#10;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;rrProcessor.setAttribute(1, value);&#10;&#9;&#9;&#9;}&#10;&#9;&#9;break;&#10;&#10;&#9;&#9;case knbReset: //RR Reset&#10;&#9;&#9;&#9;for (rrProcessor in rrProcessors)&#10;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;rrProcessor.setAttribute(4, value);&#10;&#9;&#9;&#9;}&#10;&#9;&#9;break;&#10;&#10;&#9;&#9;case knbNoteOn:&#10;&#9;&#9;&#9;for (humaniserProcessor in humaniserProcessors)&#10;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;humaniserProcessor.setAttribute(0, value);&#10;&#9;&#9;&#9;}&#10;&#9;&#9;break;&#10;&#10;&#9;&#9;case knbNoteOff:&#10;&#9;&#9;&#9;for (humaniserProcessor in humaniserProcessors)&#10;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;humaniserProcessor.setAttribute(1, value);&#10;&#9;&#9;&#9;}&#10;&#9;&#9;break;&#10;&#10;&#9;&#9;case knbVelocity:&#10;&#9;&#9;&#9;for (humaniserProcessor in humaniserProcessors)&#10;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;humaniserProcessor.setAttribute(2, value);&#10;&#9;&#9;&#9;}&#10;&#9;&#9;break;&#10;&#10;&#9;&#9;case knbFineTune:&#10;&#9;&#9;&#9;for (humaniserProcessor in humaniserProcessors)&#10;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;humaniserProcessor.setAttribute(3, value);&#10;&#9;&#9;&#9;}&#10;&#9;&#9;break;&#10;&#10;&#9;&#9;case knbVolume:&#10;&#9;&#9;&#9;for (humaniserProcessor in humaniserProcessors)&#10;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;humaniserProcessor.setAttribute(4, value);&#10;&#9;&#9;&#9;}&#10;&#9;&#9;break;&#10;&#10;&#9;&#9;case cmbCC1:&#10;&#9;&#9;&#9;for (humaniserProcessor in humaniserProcessors)&#10;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;humaniserProcessor.setAttribute(5, value);&#10;&#9;&#9;&#9;}&#10;&#9;&#9;break;&#10;&#10;&#9;&#9;case knbCC1:&#10;&#9;&#9;&#9;for (humaniserProcessor in humaniserProcessors)&#10;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;humaniserProcessor.setAttribute(6, value);&#10;&#9;&#9;&#9;}&#10;&#9;&#9;break;&#10;&#10;&#9;&#9;case cmbCC2:&#10;&#9;&#9;&#9;for (humaniserProcessor in humaniserProcessors)&#10;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;humaniserProcessor.setAttribute(7, value);&#10;&#9;&#9;&#9;}&#10;&#9;&#9;break;&#10;&#10;&#9;&#9;case knbCC2:&#10;&#9;&#9;&#9;for (humaniserProcessor in humaniserProcessors)&#10;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;humaniserProcessor.setAttribute(8, value);&#10;&#9;&#9;&#9;}&#10;&#9;&#9;break;&#10;&#9;}&#10;}">
      <EditorStates BodyShown="1" Visible="1" Solo="0" contentShown="1" onInitOpen="0"
                    onNoteOnOpen="0" onNoteOffOpen="0" onControllerOpen="0" onTimerOpen="0"
                    onControlOpen="0" Folded="0"/>
      <ChildProcessors/>
      <Content>
        <Control type="ScriptTable" id="tblVel" value="49" data="24...............vO...f+....9C...vO"/>
        <Control type="ScriptComboBox" id="Type" value="1"/>
        <Control type="ScriptComboBox" id="Mode" value="1"/>
        <Control type="ScriptSlider" id="Reset Time" value="0"/>
        <Control type="ScriptSlider" id="Note On" value="0"/>
        <Control type="ScriptSlider" id="Note Off" value="0"/>
        <Control type="ScriptSlider" id="Velocity" value="0"/>
        <Control type="ScriptSlider" id="FineTuning" value="0"/>
        <Control type="ScriptSlider" id="Volume" value="0"/>
        <Control type="ScriptComboBox" id="CC 1" value="1"/>
        <Control type="ScriptSlider" id="First CC" value="0"/>
        <Control type="ScriptComboBox" id="CC 2" value="1"/>
        <Control type="ScriptSlider" id="Second CC" value="0"/>
      </Content>
    </Processor>
    

 

1
Online

353
Users

1.1k
Topics

7.6k
Posts