Jump to content

Add MIDI Volume CC7 with a value of 0 to end of notes? [SOLVED]


Recommended Posts

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 by anp27
Mac mini (late 2012 Server) 2.3 Ghz i7, 16GB RAM~2TB Samsung 860 QVO~16GB Ram~macOS Catalina 10.15.7~Logic Pro 10.6.3~Universal Audio Apollo Twin Duo Thunderbolt MKII~KORG microKEY2 61
Link to comment
Share on other sites

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 by Dewdman42

OSX 12.x (Monterey) on OpenCore - Logic Pro 10.6.1, VePro7, Mainstage3

5,1 MacPro 3.46ghz x 12 96gb ram

Link to comment
Share on other sites

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...

OSX 12.x (Monterey) on OpenCore - Logic Pro 10.6.1, VePro7, Mainstage3

5,1 MacPro 3.46ghz x 12 96gb ram

Link to comment
Share on other sites

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);
}

OSX 12.x (Monterey) on OpenCore - Logic Pro 10.6.1, VePro7, Mainstage3

5,1 MacPro 3.46ghz x 12 96gb ram

Link to comment
Share on other sites

Use this:

THANK YOU SO MUCH! This works PERFECTLY!

Mac mini (late 2012 Server) 2.3 Ghz i7, 16GB RAM~2TB Samsung 860 QVO~16GB Ram~macOS Catalina 10.15.7~Logic Pro 10.6.3~Universal Audio Apollo Twin Duo Thunderbolt MKII~KORG microKEY2 61
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.   Paste as plain text instead

  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...