Jump to content

Changing MIDI channel with the Scripter


t-ride

Recommended Posts

Hi there guys,

 

I have been trying to change the midi channel on note events in the scripter so that I can route notes to different tracks with the channel splitter. However, this does not seem to work because the midi events still are only sent to the channel shown in the event list even though I change the midi channel in the scripter. So my question is basically this: Does it not work to change midi channel in the Scripter??

 

Thanks

// hjalle

Link to comment
Share on other sites

Yes it works. Show us the script you’re trying to use.

 

Thanks for replying. Your're right; I should have posted the script initially. Here it is:

 

So basically I percieve it as if the channel number that is listed in the event-editor is overriding the output of the Scripter, but I am not sure.

 

function HandleMIDI(e) {
	vel = e.velocity;
                 
   if ( e.velocity < 8 ) { e.channel = 1; }
   else if (   8 <= vel && vel <  16 ) { e.channel = 2; }    
   else if (  16 <= vel && vel <  24 ) { e.channel = 3; }
   else if (  24 <= vel && vel <  32 ) { e.channel = 4; }
   else if (  32 <= vel && vel <  40 ) { e.channel = 5; }  
   else if (  40 <= vel && vel <  48 ) { e.channel = 6; }
   else if (  48 <= vel && vel <  56 ) { e.channel = 7; }
   else if (  56 <= vel && vel <  64 ) { e.channel = 8; }
   else if (  64 <= vel && vel <  72 ) { e.channel = 9; }
   else if (  72 <= vel && vel <  80 ) { e.channel = 10;}
   else if (  80 <= vel && vel <  88 ) { e.channel = 11;}    
   else if (  88 <= vel && vel <  96 ) { e.channel = 12;}
   else if (  96 <= vel && vel < 104 ) { e.channel = 13;}
   else if ( 104 <= vel && vel < 112 ) { e.channel = 14;}   
   else if ( 112 <= vel && vel < 120 ) { e.channel = 15;}    
   else if ( 120 <= vel ) { e.channel = 16;    
   }              

e.send();	                      
}

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

×
×
  • Create New...