Jump to content

Assign MIDI note to Arpeggiator's rate and mute certain notes


Recommended Posts

I would like to assign certain pitches to certain arpeggiator's rates and then mute the output of those same notes

For example: C-2 would set the rate to 1/4 and would not produce any sound (it's sent to the arp's rate, but not the sequencer). Then C#-2 would set it to 1/8, etc.

I was playing around with some factory presets, but can't seem to understand how to achieve this...

Link to comment
Share on other sites

UPDATE: I noticed that this will not help me achieve what I want, because the arpeggiator is locked to the transport bar. I want an arp that's in sync with the tempo of the project, meaning that a 1/4 arp will be in sync with the BPM, but doesn't "quantize" the note so even if I play between beat 1 and beat 2 (let's say 37% between those 2 beats), it will start right away.

I'm playing around with the Note Repeater preset and it's probably a good starting point, but now I need a few things:

1) The repeats only occur when the note is being pressed so once I release the key, the repeats will stop (similar to an arp)

2) Different pitches will trigger different divisions, as mentioned in the original post.

This is what I have so far by removing what seemed irrelevant without breaking anything:

/* 
    Note Repeater: This script demonstrates how to achieve a similiar 
                   functionality as the MIDI Plug-in "Note Repeater". 
*/

var NeedsTimingInfo = true;

//track the number of notes that are currently being pressed
var numberOfNotes = 0;

//track the number of repeats to perform
var numberOfRepeats = 3;

function HandleMIDI(event) {

    var info = GetTimingInfo();
    
    if (event instanceof NoteOn) {
 
        numberOfNotes++ ;
    
        //only update these variables after the user releases all notes
        //and plays a new set of notes
        if(numberOfNotes == 1) {
            numberOfRepeats = 3;
        }
 
        //originally played note on
 	      event.send();
 	
        //delayed note ons
 	      for(var i=0; i< numberOfRepeats ;i++) {
 	          event.sendAfterBeats((i+1) * getTime(GetParameter("Time")));
 	      }
    	}
}



//get the division for the associated menu index
function getTime(index) {

    var convertedValue = 1;
	
    switch(index) {
        case 0:
            convertedValue = .166; //1/16T
            break;
        case 1:
            convertedValue = .25;  //1/16
            break;
        case 2:
            convertedValue = .375;  //1/16.
            break;
        case 3: 
            convertedValue = .333; //1/8T
            break;
        case 4: 
            convertedValue = .5;  //1/8
            break;
        case 5:
            convertedValue = .75; //1/8.
            break;
        case 6: 
            convertedValue = .666; //1/4T
            break;
        case 7:
            convertedValue = 1; //1/4
            break;
        case 8: 
            convertedValue = 1.5; //1/4.
            break;
        case 9:
            convertedValue = 1.333; //1/2T
            break;
        case 10: 
            convertedValue = 2; //1/2
            break;
        case 11:
            convertedValue = 3; //1/2.
            break;
        default:
            Trace("error in getTime()");
    }
    
    return convertedValue;
}

//define UI parameters 
var PluginParameters = [{name:"Time", type:"menu", 
                        valueStrings:["1/16 T", "1/16", "1/16 .", "1/8 T", "1/8", 
                        "1/8 .", "1/4 T", "1/4", "1/4 .", "1/2 T", "1/2", "1/2 ."],
                         defaultValue:5, numberOfSteps:11}, 
                        ];

 

Edited by Danny Wyatt
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...