AlexBerty Posted July 17, 2020 Share Posted July 17, 2020 Hello, I'm new to Logic and I need a Midi Plugin. Unfortunately I don't have any Scripter skills... So my hope is that an expert here can help me out. I need the following (for drum sampler hihat): the two incoming midi notes 26 and 46 shall alter after CC4 values. Example: incoming CC4 value range 127 - 111 --> note 26 stays note 26 + note 46 stays note 46 incoming CC4 value range 110 - 91 --> note 26 becomes note 25 + note 46 becomes note 70 incoming CC4 value range 90 - 81 --> note 26 becomes note 24 + note 46 becomes note 71 incoming CC4 value range 80 - 71 --> note 26 becomes note 23 + note 46 becomes note 72 incoming CC4 value range 70 - 61 --> note 26 becomes note 22 + note 46 becomes note 73 incoming CC4 value range 60 - 41 --> note 26 becomes note 21 + note 46 becomes note 74 incoming CC4 value range 40 - 0 --> note 26 becomes note 20 + note 46 becomes note 75 All other note numbers that are not involved here (0 - 19 ; 27 - 45 ; 47 - 69 ; 76 - 127) shall get through without any changes and also other CC numbers (and their values) + polyphonic aftertouch. And it is important that it works without adding latency (it is meant for real time drumming). Is it possible for an expert to write such a script for me? If it works properly I will donate. Thanks in advance! AlexBerty Quote Link to comment Share on other sites More sharing options...
David Nahmani Posted July 20, 2020 Share Posted July 20, 2020 I suppose you may be able to hack it even if you're not a programmer. I'm no scripting expert so hopefully some more helpful Logic user can chime in here. Meanwhile see if those threads can help you get started? viewtopic.php?t=115292 viewtopic.php?t=126947 viewtopic.php?t=128868 Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted July 20, 2020 Share Posted July 20, 2020 (edited) Try this: // pitch remap array var remap = []; // initialize the values for(let i=0;i<=127;i++) { remap[i]=i; } // noteOn queue var sustainingA = []; var sustainingB = []; function HandleMIDI(event) { if(event instanceof ControlChange && event.number == 4) { if(event.value <= 127 && event.value >= 111) { remap[26]=26; remap[46]=46; } else if(event.value <= 110 && event.value >= 91) { remap[26]=25; remap[46]=70; } else if(event.value <= 90 && event.value >= 81) { remap[26]=24; remap[46]=71; } else if(event.value <= 80 && event.value >= 71) { remap[26]=23; remap[46]=72; } else if(event.value <= 70 && event.value >= 61) { remap[26]=22; remap[46]=73; } else if(event.value <= 60 && event.value >= 41) { remap[26]=21; remap[46]=74; } else if(event.value <= 40) { remap[26]=20; remap[46]=75; } // event.send(); // send CC4 through? return; } // NoteOn if(event instanceof NoteOn) { if(event.pitch == 26) { event.pitch = remap[event.pitch]; sustainingA.push(event.pitch); } else if(event.pitch == 46) { event.pitch = remap[event.pitch]; sustainingB.push(event.pitch); } event.send(); return; } // NoteOff if(event instanceof NoteOff) { if(event.pitch == 26) { event.pitch = sustainingA.shift(); } else if(event.pitch == 46) { event.pitch = sustainingB.shift(); } event.send(); return; } // All other events event.send(); } Edited July 20, 2020 by Dewdman42 Quote Link to comment Share on other sites More sharing options...
AlexBerty Posted July 20, 2020 Author Share Posted July 20, 2020 Thanks man, I try to get in contact with the users answering on those threads. I think I'm looking for a pro (as there are many other midi bending requests...). Is here any pro who can provide commissioned work? Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted July 20, 2020 Share Posted July 20, 2020 Unfortunately I do not have time to do that sort of thing..... But perhaps you can use the above example to figure things out... I updated the script just now, found some errors. FYI. Quote Link to comment Share on other sites More sharing options...
AlexBerty Posted July 20, 2020 Author Share Posted July 20, 2020 Try this:... Hey Dewdman42, thanks soooo much! I'll try tomorrow and report back. Quote Link to comment Share on other sites More sharing options...
AlexBerty Posted July 22, 2020 Author Share Posted July 22, 2020 Works so great!!! Thanks Dewdman42!!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.