Jump to content

Program Changes to Notes or CC's


Recommended Posts

Hello,

I searched quite a bit and did not found an answer so I decided to ask here as I'm trying to do the opposite: turn Program Changes into notes (or CCs...if that's easier). Is that possible? I tried a little modifying scripts but no luck. (I don't know much about scripts)

thanks in advance

Link to comment
Share on other sites

Hi,

 

I created a new thread from your post.

 

Here's a Program Changes to CC's script. Keep in mind that Program Changes on channel 1 are reserved for controlling channel strip performances, so they don't reach the scripter plug-in.

 

Also, since Program Changes have a single data byte (for the program number) you should specify what you want the CC's second data byte (the CC "value") to be.

 

// Convert incoming Program Changes to CC's.
// MIDI Channel 1 Program Changes will be ignored as they are reserved
// for invoking Channel Strip Performances.

var mChannel = [];

for (var i = 0; i < 16; i++) {
mChannel[i] = String(i + 1);
}

var PluginParameters = [{
    name:"Convert Program Changes to CC's",
    type: "text"
}, {
   name: "MIDI Channel",
   type: "menu",
   valueStrings: mChannel,
   defaultValue: 1
}, {
   name: "Output CC Value",
   type: "lin",
   minValue: 1,
   maxValue: 127,
   numberOfSteps: 126,
   defaultValue: 80
}];

function HandleMIDI(e) {
   if (e instanceof ProgramChange) {
       var cc = new ControlChange();
       cc.number = e.number;
       cc.value = GetParameter("Output CC Value");
       cc.channel = GetParameter("MIDI Channel") + 1;
       cc.send();
       cc.trace();
   } else {
       e.trace();
       e.send();
   }
}

 

J.

Link to comment
Share on other sites

I created another version for notes:

 

//*
var title = "Program Change to Note by EC";
var version = "v0.1";
//*

var NOTES = MIDI._noteNames;

function HandleMIDI(event) {
var bN = GetParameter("Base Note");
var on = new NoteOn;	
if (event instanceof ProgramChange) {

	on.pitch = event.number + bN;
	on.send();
	var off = new NoteOff(on);
	off.sendAfterMilliseconds(100); 
} 
else {
	event.send();
}
}

PluginParameters = [{
	name: title + " (" + version + ")",
	type:"text"
}, {
	name:"Base Note", 
	valueStrings: NOTES,
	defaultValue:0,
	type:"menu"
}]; 

Link to comment
Share on other sites

well,

we can drink a Patagonia beer (I'm writing in english because that's the forum language, but it seems there's room for a spanish one!) or mate if you prefer... at home, without sugar, as with it is traditionally for ladies and children :D

both at the same time will mess your stomach!

but my offer is firm :)

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