Ignore note range



  • Hello guys, can anyone help me create a script to ignore midi events or mute notes based on note ranges? In other words, notes out of the C1-C4 range won't do a sound!



  • @hisefilo

    const var knbMin = Content.addKnob("knbMin", 0, 0);
    knbMin.setRange(0, 127, 1);
    knbMin.set("text", "Low Note");
    
    const var knbMax = Content.addKnob("knbMax", 150, 0);
    knbMax.setRange(0, 127, 1);
    knbMax.set("text", "High Note");
    
    const var btnRelease = Content.addButton("btnRelease", 300, 12);
    btnRelease.set("text", "On Release");function onNoteOn()
    {
    	if (Message.getNoteNumber() < knbMin.getValue() || Message.getNoteNumber() > knbMax.getValue())
        {
            Message.ignoreEvent(true);
        }
    }
    function onNoteOff()
    {
    	if (btnRelease.getValue())
        {
            if (Message.getNoteNumber() < knbMin.getValue() || Message.getNoteNumber() > knbMax.getValue())
            {
                Message.ignoreEvent(true);
            }
        }
    }
    function onController()
    {
    	
    }
    function onTimer()
    {
    	
    }
    function onControl(number, value)
    {
    	
    }
    


  • @d-healey wow that's much more than I expected!!!!!! Thanks David


 

2
Online

353
Users

1.1k
Topics

7.5k
Posts