Filtering Midi velocity
What do you mean by filtering velocity? Velocity is part of the note-on message and you can't filter just a part of a message.
You can however create split points (velocity cross switching between eg 2 midi channels) or filter out notes with a velocity of some value, and possibly convert those notes into some other message.
Or do you mean to have all notes have the same velocity regardless of hard you hit the keys?
Whatever you're after, I suppose it shouldn't be to hard to accomplish. If you're lucky, maybe Vincent - the forum's very own remap-every-possible-midi-message guru - will help when he probably logs on tonight.
You can however create split points (velocity cross switching between eg 2 midi channels) or filter out notes with a velocity of some value, and possibly convert those notes into some other message.
Or do you mean to have all notes have the same velocity regardless of hard you hit the keys?
Whatever you're after, I suppose it shouldn't be to hard to accomplish. If you're lucky, maybe Vincent - the forum's very own remap-every-possible-midi-message guru - will help when he probably logs on tonight.
Bjørn S
-
Vincent
Hello neufena!
Be aware, guru speaking! But if you need hard-scripting, the master of the masters was/is/always will be bsork!
Well, that's true that I've tried many stuffs with MIDI messages filtering and done a too-big patch for my keyboard.
About velocity, it's less easy to filter than to simply apply a ratio, but I think it may be easy to route midi notes to different "Midi Outs" or channels or midi ports according to their velocity range without any script.
Is that what you're looking for?
I also use Usine to replace all the racks. It's great because you can tweak everything in real-time with the sequencer or the conductor. The matter is to find the good virtual machines... That could be a full sub-forum topic... Senso was thinking about something like "Usine's bests friends", I think it's a great idea to which we all should contribute!
To develop sophisticated patches, if you don't write your own stuff in C++ or Delphi (my case), the very first good friend is SynthEdit. It's free, very easy to patch, and allow you do your own VST.
Be aware, guru speaking! But if you need hard-scripting, the master of the masters was/is/always will be bsork!
Well, that's true that I've tried many stuffs with MIDI messages filtering and done a too-big patch for my keyboard.
About velocity, it's less easy to filter than to simply apply a ratio, but I think it may be easy to route midi notes to different "Midi Outs" or channels or midi ports according to their velocity range without any script.
Is that what you're looking for?
I also use Usine to replace all the racks. It's great because you can tweak everything in real-time with the sequencer or the conductor. The matter is to find the good virtual machines... That could be a full sub-forum topic... Senso was thinking about something like "Usine's bests friends", I think it's a great idea to which we all should contribute!
To develop sophisticated patches, if you don't write your own stuff in C++ or Delphi (my case), the very first good friend is SynthEdit. It's free, very easy to patch, and allow you do your own VST.
Hi,
bsork is right, I just want to have all notes the same velocity regardless of how hard or soft I play. I began on synths with no velocity sensing and find i play softly, expecting the notes to all be the same!
Any help with archiving this would be great,
Thanks
bsork is right, I just want to have all notes the same velocity regardless of how hard or soft I play. I began on synths with no velocity sensing and find i play softly, expecting the notes to all be the same!
Any help with archiving this would be great,
Thanks
don't know if i can do it only with usine modules
but i'm sure i can do a little vst for you if needed...
but i'm sure i can do a little vst for you if needed...
-
Vincent
Hi, neufena!
I'm not sure I really help you in doing such a script! I mean, considering expressiveness! Well, as in music all can be considered...
I wrote a small script allowing you to set all your velocities to any value from 0 to 127. Here is the code:
As it comes from a bigger code of mine I use, it was very simple to do it. It works on my system. Perhaps that Bjørn will have some remarks to do, let me know, they are welcome!
Here is how to proceed:
1. open the patch in which you have your first Midi In
2. drop there a "Script/Empty Script.script" module
3. double-click on it to edit the script in itself
4. delete all the code it contains
5. paste the entire code you find in the code frame of this post
6. save the script file as "Set Velocity.script" in your library
7. to make it clean, you can delete this false "Empty Script" and re-drop here the real "Set Velocity" script (don't forget to rescan your library with a right click)
8. easy connect!
You can connect your pedal to the Velocity fader with MidiLearn!
I think it would be better to have a script that apply a ratio to the velocities, and remap them between a min and a max value... I've tried to do that, just tried. It never worked!
The one I use applies a ratio from 0% to 200% to the initial velo values, but only checks not to be over 127. Very useful when playing two very different instruments on two splits.
You can also find MFX plugins, or ask to nay-seven's genius crew!
Check this too: NDC Midi plugins.
Always many solutions!
I'm not sure I really help you in doing such a script! I mean, considering expressiveness! Well, as in music all can be considered...
I wrote a small script allowing you to set all your velocities to any value from 0 to 127. Here is the code:
Code: Select all
/////////////////////////////
// Set Velocity
/////////////////////////////
// This script sets all midi note velocity to a choosen value from 0 to 127
// Connect Midi In to 'Midi In'
// Connect Midi Out to 'Midi Out'
// Connect a fader with range set from 0 to 127 to 'Velocity'
/////////////////////////////
// parameters declaration
var Input : Tparameter;
var Vel : TParameter;
var Output : Tparameter;
// initialisation : create parameters
procedure init;
begin
Input := CreateParam('Midi In',ptMidi);
Vel := CreateParam('Velocity',ptDataFader);
Output := CreateParam('Midi Out',ptMidi);
SetIsOutPut(Input,false);
SetIsOutPut(Vel,false);
SetFormat(Vel,'%.0f'); SetMin(Vel,0); SetMax(Vel,127); SetDefaultValue(Vel,100); SetValue(Vel,100);
SetIsInput(Output,false);
end;
// Global variables
var i : integer;
var nbMidiIn : integer;
var SetVelo : byte;
var ReceivedMidi : TMidi;
// main proc
begin
SetVelo := trunc(getValue(Vel)); // new velocity value
nbMidiIn := GetLength(Input); // get the number of incoming midi codes
SetLength(outPut,nbMidiIn); // sets the number of outgoing midi codes
if nbMidiIn > 0 then // if notes are recieved
begin
for i := 0 to nbMidiIn-1 // loops each note of polyphonic data
do begin
GetMidiArrayValue(Input,i,ReceivedMidi); // get individual midi data
ReceivedMidi.data2 := SetVelo; // sets the velocity
SetMidiArrayValue(Output,i,ReceivedMidi); // sets output value
end;
end
end.
/////////////////////////////
// 20-04-2007
// Vincent MICHEL
/////////////////////////////Here is how to proceed:
1. open the patch in which you have your first Midi In
2. drop there a "Script/Empty Script.script" module
3. double-click on it to edit the script in itself
4. delete all the code it contains
5. paste the entire code you find in the code frame of this post
6. save the script file as "Set Velocity.script" in your library
7. to make it clean, you can delete this false "Empty Script" and re-drop here the real "Set Velocity" script (don't forget to rescan your library with a right click)
8. easy connect!
You can connect your pedal to the Velocity fader with MidiLearn!
I think it would be better to have a script that apply a ratio to the velocities, and remap them between a min and a max value... I've tried to do that, just tried. It never worked!
The one I use applies a ratio from 0% to 200% to the initial velo values, but only checks not to be over 127. Very useful when playing two very different instruments on two splits.
You can also find MFX plugins, or ask to nay-seven's genius crew!
Check this too: NDC Midi plugins.
Always many solutions!
The script looks OK to me under one condition: That it only receives NOTEONs with velocity > 0.
Otherwise you will create a mess with the other message types, and if the incoming NOTEONs have vel=0 - which I really think is the most common way of sending NOTEOFFs - you'll end up with a BIG chord or silence depending on SetVelo value...
I haven't got time to delve into details right now (deadlines at work...), and the easiest way of getting what neufena wants depends on a lot of factors. If it's simple to make the synths in question ignore velocity, do that. I also suppose that you find what you want in some plug-in. If you want to use Usine modules, do the following:
MidiIn.midi > MidiFilter.in. Set filter to NOTEON.
MidiFilter.chan > CreateMidi.chan.
MidiFilter.code1 > CreateMidi.code.
MidiFilter.send > CreateMidi.create.
Set CreateMidi.msg = NOTEON, and put a velocity value directly into CreateMidi.code2 or connect a fader to it. Connect CreateMidi.out to your VST input or a MidiOutput.
For the other message types (NOTEOFFS, PITCHBEND, etc), create separate filters and connect them between the MidiIn and the VST or MidiOut.
Otherwise you will create a mess with the other message types, and if the incoming NOTEONs have vel=0 - which I really think is the most common way of sending NOTEOFFs - you'll end up with a BIG chord or silence depending on SetVelo value...
I haven't got time to delve into details right now (deadlines at work...), and the easiest way of getting what neufena wants depends on a lot of factors. If it's simple to make the synths in question ignore velocity, do that. I also suppose that you find what you want in some plug-in. If you want to use Usine modules, do the following:
MidiIn.midi > MidiFilter.in. Set filter to NOTEON.
MidiFilter.chan > CreateMidi.chan.
MidiFilter.code1 > CreateMidi.code.
MidiFilter.send > CreateMidi.create.
Set CreateMidi.msg = NOTEON, and put a velocity value directly into CreateMidi.code2 or connect a fader to it. Connect CreateMidi.out to your VST input or a MidiOutput.
For the other message types (NOTEOFFS, PITCHBEND, etc), create separate filters and connect them between the MidiIn and the VST or MidiOut.
Bjørn S
-
Vincent
Hi neufena, hi Bjørn,
Yes, Bjørn, you're right. I forgot to insert a midi filter for NOTEON/NOTEOFF/BEND between the Midi In and the script.
That means that if the keyboard sends other midi data, they will be stopped there, which can be a problem...
Neufena, that means you have also to put other midi filters to get only those data and remix them with the NoteOn and NoteOff msgs coming from my script... Hem... Not so simple, but really feasible.
Yes, neufena, perhaps first try to make your synth ignore velocity...
ut the interest of my script was that you could have some control on velocity by using your expression pedal.
Second point about incoming NOTEOFF having velo=0.
Since my keyboard sends real NOTEOFF msg, I forgot that eventuality. But it seems to be simple. I just have to add one line in my code to change it in a real NOTEOFF msg. What do you think, Bjørn?
cheers!
Yes, Bjørn, you're right. I forgot to insert a midi filter for NOTEON/NOTEOFF/BEND between the Midi In and the script.
That means that if the keyboard sends other midi data, they will be stopped there, which can be a problem...
Neufena, that means you have also to put other midi filters to get only those data and remix them with the NoteOn and NoteOff msgs coming from my script... Hem... Not so simple, but really feasible.
Yes, neufena, perhaps first try to make your synth ignore velocity...
ut the interest of my script was that you could have some control on velocity by using your expression pedal.
Second point about incoming NOTEOFF having velo=0.
Since my keyboard sends real NOTEOFF msg, I forgot that eventuality. But it seems to be simple. I just have to add one line in my code to change it in a real NOTEOFF msg. What do you think, Bjørn?
cheers!
an other way...

here a little vst i've made ,
you can specify a constant velocity or draw a response curve ( maybe useful to humanize drums..)
( all credits gone to D.haupt who made the module...)
here some explainations :
MIDI Out - MIDI input stream with Note On velocities scaled according to the user-defined velocity response graph.
The horizontal axis represents the input velocity (0 - 127), and the vertical axis represents the output velocity (0 - 127).
The grid initially appears with a diagonal line that represents a linear response: the output velocity = the input velocity at all levels.
You adjust the response by adding nodes to the line. Add a node by double-clicking on any point. You can add as many nodes as you need to create the response curve you want.
Nodes can be dragged above the diagonal line to make the output velocity higher at a given horizontal input velocity, or below the diagonal line to make the output velocity less than the input velocity. The input and output values are shown in the upper left corner as you drag a node.
To delete a node, click on it while pressing the Ctrl key.
The drawn response curves can be saved as part of a patch.
Download
hope this help...

here a little vst i've made ,
you can specify a constant velocity or draw a response curve ( maybe useful to humanize drums..)
( all credits gone to D.haupt who made the module...)
here some explainations :
MIDI Out - MIDI input stream with Note On velocities scaled according to the user-defined velocity response graph.
The horizontal axis represents the input velocity (0 - 127), and the vertical axis represents the output velocity (0 - 127).
The grid initially appears with a diagonal line that represents a linear response: the output velocity = the input velocity at all levels.
You adjust the response by adding nodes to the line. Add a node by double-clicking on any point. You can add as many nodes as you need to create the response curve you want.
Nodes can be dragged above the diagonal line to make the output velocity higher at a given horizontal input velocity, or below the diagonal line to make the output velocity less than the input velocity. The input and output values are shown in the upper left corner as you drag a node.
To delete a node, click on it while pressing the Ctrl key.
The drawn response curves can be saved as part of a patch.
Download
hope this help...
-
Vincent
Hello Yan!
Great stuff, this velocity control, works exactly like a compressor.
I'll download it right now.
Usine and SynthEdit must be married for life. And have many children.
Thanks!
Great stuff, this velocity control, works exactly like a compressor.
I'll download it right now.
Usine and SynthEdit must be married for life. And have many children.
Thanks!
Vincent: If you've put a NOTEON filter before the input, you only need to set the minimum of the Vel input to 1 instead of 0. BTW, you can make do with one common input/output parameter for the midi stream.
...
I think we all forgot that the simplest solution for a constant velocity from a keyboard is often within the keyboard itself; it's not uncommon for controllers to have a choice of velocity response curves, and one of these is most likely a constant - perhaps with user selectable value. If it's not selectable, it will most probably have a value of 64.
...
I think we all forgot that the simplest solution for a constant velocity from a keyboard is often within the keyboard itself; it's not uncommon for controllers to have a choice of velocity response curves, and one of these is most likely a constant - perhaps with user selectable value. If it's not selectable, it will most probably have a value of 64.
Bjørn S
-
Vincent
You're right. My scripts are a bit too specialized for my personal usage... as soon as they work for me, I stop thinking about them!bsork wrote:Vincent: If you've put a NOTEON filter before the input, you only need to set the minimum of the Vel input to 1 instead of 0. BTW, you can make do with one common input/output parameter for the midi stream.
Same remark, since I cannot do that on my keyboard! You're right, and you did not forget this simplest solution.bsork wrote:I think we all forgot that the simplest solution for a constant velocity from a keyboard is often within the keyboard itself
Who is online
Users browsing this forum: No registered users and 86 guests
