Page 1 of 1

Posted: 20 Feb 2018, 11:45
by sm_jamieson
Sorry to seem lazy, but can anyone tell me if there is a module or patch that will allow you to draw a curve and remap midi messages (such as to change the keyboard velocity response curve).

Posted: 20 Feb 2018, 13:47
by x.iso
there's a literal mapper curve module, but it's for data, so you need to do some patching to make it work for velocity (or any other parameter)
I think this should work:
Image

Posted: 29 Jul 2018, 06:50
by woodslanding
If this doesn't work for you (it gave me a bunch of stuck notes when using multi-channel sources) try this script:

Code: Select all

//////////////////////////
// transpose midi example
/////////////////////////
// parameters declaration
var input   : Tparameter;
var output  : Tparameter;
var velocitiesIN : TParameter;


// initialisation : create parameters
procedure init;
begin  
 Input := CreateParam('midi in',ptMidi);
 Output := CreateParam('midi out',ptMidi);
 velocitiesIN := CreateParam('velocities',ptArray);
 
 SetIsInput(Output,false);
 SetIsOutPut(Input,false);
 SetIsOutPut(velocitiesIN,false);
 SetLength(velocitiesIN, 128);


end;
                                                           
// Global variables
var i            : integer;
var nbOfMidi     : integer;
var ReceivedMidi : TMidi;
var newVelocity   : integer;

//////////////////////////////
// main proc
//////////////////////////////
procedure Process;                        
begin
 nbOfMidi := GetLength(input);  // get the number of incoming midi codes  
 if nbOfMidi > 0 
 then begin
    SetLength(outPut,nbOfMidi);      // set the number of output codes
    for i := 0 to nbOfMidi-1         // loop for all input codes, for polyphonic data (chords)
    do begin
      GetMidiArrayValue(input,i,ReceivedMidi); // get each code
      newVelocity := round(getDataArrayValue(velocitiesIN,ReceivedMidi.data2));
      ReceivedMidi.data2 := trunc(newVelocity); // calculate vel
      SetMidiArrayValue(output,i,ReceivedMidi); // set output value     
    end;
 end 
 else SetLength(outPut,0); // nothing received, set out length to 0
end;

Posted: 30 Jul 2018, 01:59
by x.iso
in my example perhaps there's Wait module missing for OFF note, to wait exact or 1 more bloc that note ON have to process (since Note ON have more wiring and modules in between actual input and processed output which amount to bloc latency if I'm correct).