HISE Logo Forum
    • Categories
    • Register
    • Login

    Multi CC Remapper

    Scheduled Pinned Locked Moved Presets / Scripts / Ideas
    1 Posts 1 Posters 581 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • d.healeyD
      d.healey
      last edited by

      Here's a handy little module that can remap as many CCs as a slider pack can handle and if you need more just load another copy of the script. You can also map a single CC to multiple target CCs. The script also displays the current value of each origin controller and you can move the value sliders to output CC values too.

      /**
       * Title: Multi CC Remapper v1.0.0.js
       * Author: David Healey
       * Date: 30/06/2017
       * Modified: 30/06/2017
       * License: GPLv3 - https://www.gnu.org/licenses/gpl-3.0.en.html
      */
      
      Content.setHeight(275);
      
      const var COUNT = 15; //The number of CCs you want to remap
      
      const var origin = Content.addSliderPack("sliOrigin", 0, 0);
      const var target = Content.addSliderPack("sliTarget", 260, 0);
      const var ccValue = Content.addSliderPack("sliValue", 520, 0);
      
      origin.set("sliderAmount", COUNT);
      target.set("sliderAmount", COUNT);
      ccValue.set("sliderAmount", COUNT);
      origin.set("min", 0);
      target.set("min", 0);
      ccValue.set("min", 0);
      origin.set("max", 127);
      target.set("max", 127);
      ccValue.set("max", 127);
      origin.set("stepSize", 1);
      target.set("stepSize", 1);
      ccValue.set("stepSize", 1);
      origin.set("width", 250);
      target.set("width", 250);
      ccValue.set("width", 250);
      origin.set("height", 200);
      target.set("height", 200);
      ccValue.set("height", 200);
      
      const var lblOrigin = Content.addLabel("Origin", 105, 225);
      const var lblTarget = Content.addLabel("Target", 365, 225);
      const var lblValue = Content.addLabel("Value", 625, 225);
      
      function onNoteOn()
      {
      }
      
      function onNoteOff()
      {
      }
      
      function onController()
      {
      	for (i = 0; i < origin.getNumSliders(); i++)
      	{
      		if (origin.getSliderValueAt(i) == 0) continue; //0 = not used
      
      		if (Message.getControllerNumber() == origin.getSliderValueAt(i))
      		{
      			Message.ignoreEvent(true);
      			if (target.getSliderValueAt(i) > 0)
      			{
      				Synth.sendController(target.getSliderValueAt(i), Message.getControllerValue());
      				ccValue.setSliderAtIndex(i, Message.getControllerValue());
      			}
      		}
      	}
      }
      
      function onTimer()
      {
      }
      
      function onControl(number, value)
      {
      	if (number == ccValue)
      	{
      		if (target.getSliderValueAt(value) > 0)
      		{
      			Synth.sendController(target.getSliderValueAt(value), ccValue.getSliderValueAt(value));
      		}
      	}
      }
      

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public HISE tutorials

      1 Reply Last reply Reply Quote 0
      • First post
        Last post

      12

      Online

      1.7k

      Users

      11.8k

      Topics

      103.2k

      Posts