Zimmer Bend



  • A little script that bends all held notes to a specified pitch as a selected controller is moved - inspired by something Hans Zimmer mentioned in his masterclass.

    <?xml version="1.0" encoding="UTF-8"?>
    
    <Processor Type="SynthChain" ID="Zimmer Bend Demo" Bypassed="0" Gain="1"
               Balance="0" VoiceLimit="128" KillFadeTime="20" IconColour="0"
               packageName="" views="32.rk1bzA.....A.........DC.g4lakwF.P+Ag77W...."
               currentView="-1">
      <EditorStates BodyShown="0" Visible="1" Solo="0" Folded="0"/>
      <ChildProcessors>
        <Processor Type="MidiProcessorChain" ID="Midi Processor" Bypassed="0">
          <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/>
          <ChildProcessors/>
        </Processor>
        <Processor Type="ModulatorChain" ID="GainModulation" Bypassed="0" Intensity="1">
          <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/>
          <ChildProcessors/>
        </Processor>
        <Processor Type="ModulatorChain" ID="PitchModulation" Bypassed="1" Intensity="0">
          <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/>
          <ChildProcessors/>
        </Processor>
        <Processor Type="EffectChain" ID="FX" Bypassed="0">
          <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/>
          <ChildProcessors/>
        </Processor>
        <Processor Type="SineSynth" ID="Sine Wave Generator" Bypassed="0" Gain="0.25"
                   Balance="0" VoiceLimit="128" KillFadeTime="20" IconColour="0"
                   OctaveTranspose="0" SemiTones="0" UseFreqRatio="0" CoarseFreqRatio="1"
                   FineFreqRatio="0" SaturationAmount="0.31999999">
          <EditorStates BodyShown="1" Visible="1" Solo="0" GainModulationShown="1" Folded="0"/>
          <ChildProcessors>
            <Processor Type="MidiProcessorChain" ID="Midi Processor" Bypassed="0">
              <EditorStates BodyShown="1" Visible="1" Solo="0" Folded="0"/>
              <ChildProcessors>
                <Processor Type="ScriptProcessor" ID="Zimmer Bend" Bypassed="0" Script="//INIT&#10;reg i;&#10;reg interval;&#10;reg events = Engine.createMidiList();&#10;reg intervals = Engine.createMidiList();&#10;&#10;const var noteNames = [];&#10;const var Ccs = [];&#10;&#10;const var cmbTarget = Content.addComboBox(&quot;Target&quot;, 0, 10);&#10;const var btnRandom = Content.addButton(&quot;Randomise&quot;, 150, 10);&#10;const var cmbCC = Content.addComboBox(&quot;Controller&quot;, 300, 10);&#10;&#10;for (i = 0; i &lt; 128; i++)&#10;{&#10;&#9;noteNames.push(Engine.getMidiNoteName(i));&#10;&#9;Ccs.push(i);&#10;}&#10;&#10;cmbTarget.set(&quot;items&quot;, noteNames.join(&quot;\n&quot;));&#10;cmbCC.set(&quot;items&quot;, Ccs.join(&quot;\n&quot;));&#10;&#10;const var knbBend = Content.addKnob(&quot;Bend&quot;, 450, 0);&#10;knbBend.setRange(0, 127, 1);&#10;&#10;const var knbLag = Content.addKnob(&quot;Lag&quot;, 600, 0);&#10;knbLag.setRange(0, 500, 1);&#10;knbLag.set(&quot;defaultValue&quot;, 150);&#10;knbLag.set(&quot;suffix&quot;, &quot; ms&quot;);&#10;&#10;//FUNCTIONS&#10;inline function remapRange(value, oldMin, oldMax, newMin, newMax)&#10;{&#10;    if (oldMax - oldMin == 0)&#10;        return newMin;&#10;    else&#10;    {&#10;        return (((value - oldMin) * (newMax - newMin)) / (oldMax - oldMin)) + newMin;&#10;    }&#10;}&#10;&#10;inline function bendEvent(event, interval)&#10;{&#10;&#9;reg bendAmount;&#10;&#9;reg fraction;&#10;&#10;&#9;if (event != -1)&#10;&#9;{&#10;&#9;&#9;bendAmount = remapRange(knbBend.getValue(), 0, 127, 0, interval);&#10;&#9;&#9;fraction = remapRange(bendAmount - Math.floor(bendAmount), 0, 1, 0, 100);&#10;&#10;&#9;&#9;Synth.addPitchFade(event, knbLag.getValue(), Math.floor(bendAmount), parseInt(fraction));&#10;&#9;}&#10;}&#10;&#10;//CALLBACKS&#10;function onNoteOn()&#10;{&#10;&#9;if (btnRandom.getValue() == 1 &amp;&amp; Synth.getNumPressedKeys() == 1)&#10;&#9;{&#10;&#9;&#9;cmbTarget.setValue(Math.floor(Math.random() * ((Message.getNoteNumber()+12) - (Message.getNoteNumber()-12) + 1)) + (Message.getNoteNumber()-12));&#10;&#9;}&#10;&#10;&#9;interval = Math.abs(Message.getNoteNumber() - (cmbTarget.getValue() - 1));&#10;&#9;if (Message.getNoteNumber() &gt; (cmbTarget.getValue()-1)) interval = -interval; //Flip interval if played note is greater than target&#10;&#10;&#9;intervals.setValue(Message.getNoteNumber(), interval);&#10;&#9;events.setValue(Message.getNoteNumber(), Message.getEventId());&#10;&#10;&#9;bendEvent(Message.getEventId(), interval);&#10;}&#10;&#10;function onNoteOff()&#10;{&#10;&#9;events.setValue(Message.getNoteNumber(), -1);&#10;}&#10;&#10;function onController()&#10;{&#10;&#9;if (Message.getControllerNumber() == cmbCC.getValue()-1)&#10;&#9;{&#10;&#9;&#9;knbBend.setValue(Message.getControllerValue());&#10;&#10;&#9;&#9;for (i = 0; i &lt; 127; i++)&#10;&#9;&#9;{&#10;&#9;&#9;&#9;bendEvent(events.getValue(i), intervals.getValue(i));&#9;&#10;&#9;&#9;}&#9;&#9;&#10;&#9;}&#10;}&#10;&#10;function onTimer()&#10;{&#10;&#9;&#10;}&#10;function onControl(number, value)&#10;{&#10;&#9;if (number == knbBend &amp;&amp; !events.isEmpty())&#10;&#9;{&#10;&#9;&#9;for (i = 0; i &lt; 127; i++)&#10;&#9;&#9;{&#10;&#9;&#9;&#9;bendEvent(events.getValue(i), intervals.getValue(i));&#9;&#10;&#9;&#9;}&#10;&#9;}&#10;}">
                  <EditorStates BodyShown="1" Visible="1" Solo="0" contentShown="1" onInitOpen="0"
                                onNoteOnOpen="0" onNoteOffOpen="0" onControllerOpen="0" onTimerOpen="0"
                                onControlOpen="0"/>
                  <ChildProcessors/>
                  <Content>
                    <Control type="ScriptComboBox" id="Target" value="73"/>
                    <Control type="ScriptButton" id="Randomise" value="0"/>
                    <Control type="ScriptComboBox" id="Controller" value="2"/>
                    <Control type="ScriptSlider" id="Bend" value="0"/>
                    <Control type="ScriptSlider" id="Lag" value="500"/>
                  </Content>
                </Processor>
              </ChildProcessors>
            </Processor>
            <Processor Type="ModulatorChain" ID="GainModulation" Bypassed="0" Intensity="1">
              <EditorStates BodyShown="1" Visible="0" Solo="0"/>
              <ChildProcessors>
                <Processor Type="SimpleEnvelope" ID="DefaultEnvelope" Bypassed="0" Intensity="1"
                           Attack="5" Release="10" LinearMode="1">
                  <EditorStates BodyShown="1" Visible="1" Solo="0"/>
                  <ChildProcessors>
                    <Processor Type="ModulatorChain" ID="Attack Time Modulation" Bypassed="0"
                               Intensity="1">
                      <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/>
                      <ChildProcessors/>
                    </Processor>
                  </ChildProcessors>
                </Processor>
              </ChildProcessors>
            </Processor>
            <Processor Type="ModulatorChain" ID="PitchModulation" Bypassed="0" Intensity="0">
              <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/>
              <ChildProcessors/>
            </Processor>
            <Processor Type="EffectChain" ID="FX" Bypassed="0">
              <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/>
              <ChildProcessors/>
            </Processor>
          </ChildProcessors>
          <RoutingMatrix NumSourceChannels="2" Channel0="0" Send0="-1" Channel1="1" Send1="-1"/>
        </Processor>
      </ChildProcessors>
      <RoutingMatrix NumSourceChannels="2" Channel0="0" Send0="-1" Channel1="1" Send1="-1"/>
      <macro_controls>
        <macro name="Macro 1" value="0" midi_cc="-1"/>
        <macro name="Macro 2" value="0" midi_cc="-1"/>
        <macro name="Macro 3" value="0" midi_cc="-1"/>
        <macro name="Macro 4" value="0" midi_cc="-1"/>
        <macro name="Macro 5" value="0" midi_cc="-1"/>
        <macro name="Macro 6" value="0" midi_cc="-1"/>
        <macro name="Macro 7" value="0" midi_cc="-1"/>
        <macro name="Macro 8" value="0" midi_cc="-1"/>
      </macro_controls>
      <MidiAutomation/>
    </Processor>
    


  • Amazing, the cluster sound when used with the sines that go both up and down really gives that Joker Theme vibe (you just need to replace the sines with cello samples and run it through a guitar amp 🙂


 

1
Online

353
Users

1.1k
Topics

7.5k
Posts