Welcome to %s forums

BrainModular Users Forum

Login Register

midi cc mapping curve

I need help on a Patch
Post Reply
sm_jamieson
Member
Posts: 553
Contact:

Unread post by sm_jamieson » 20 Feb 2018, 11:45

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

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 20 Feb 2018, 13:47

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
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 29 Jul 2018, 06:50

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;
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 30 Jul 2018, 01:59

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).
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

Post Reply

Who is online

Users browsing this forum: No registered users and 119 guests