anp27 Posted January 1, 2022 Share Posted January 1, 2022 (edited) How can I achieve this using Scripter? Basically add a CC7 event with a value of 0 at the end of each note, is this possible? Or maybe using MIDI Transform instead? Edited January 2, 2022 by anp27 Quote Link to comment Share on other sites More sharing options...
fuzzfilth Posted January 1, 2022 Share Posted January 1, 2022 Are you sure you want this ? Because everything after the first note will be silent... Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted January 1, 2022 Share Posted January 1, 2022 (edited) Not really sure why you would want to do this, like fuzzfilth said, but anyway, you could try this midi cc7 gate... (see later post for updated script) Edited January 1, 2022 by Dewdman42 Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted January 1, 2022 Share Posted January 1, 2022 but actually it should probably be a little more complicated then that and only lower CC7 to zero when there are no more notes sustaining... one sec... Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted January 1, 2022 Share Posted January 1, 2022 Use this: var PluginParameters = []; PluginParameters.push({ type: "lin", name: "CC7 control", defaultValue: 100, minValue:0, maxValue: 127, numberOfSteps:127, disableAutomation: false }); var cc = new ControlChange; cc.number = 7; var notes = new Array(128); for(let i=0; i<notes.length; i++) { notes[i] = 0; } function HandleMIDI(event) { if(event instanceof NoteOn) { notes[event.channel]++; cc.channel = event.channel; cc.value = GuiParameters.get(0); cc.send(); event.send(); return; } if(event instanceof NoteOff) { notes[event.channel]--; event.send(); if(notes[event.channel] <= 0) { cc.channel = event.channel; cc.value = 0; cc.send(); } return; } event.send(); } var GuiParameters = { data: [], set: function(id, val) { this.data[id] = val; }, get: function(id) { if(this.data[id] == undefined) { this.data[id] = GetParameter(id); } return this.data[id]; } }; function ParameterChanged(id, val) { GuiParameters.set(id, val); } Quote Link to comment Share on other sites More sharing options...
anp27 Posted January 1, 2022 Author Share Posted January 1, 2022 Use this: THANK YOU SO MUCH! This works PERFECTLY! 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.