Welcome to %s forums

BrainModular Users Forum

Login Register

mapper curve module with bell shape

Tell us what you'd like Usine to do
Post Reply
User avatar
oli_lab
Member
Posts: 1266
Location: Brittany, France
Contact:

Unread post by oli_lab » 17 Nov 2014, 20:43

http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

User avatar
senso
Site Admin
Posts: 4425
Location: France
Contact:

Unread post by senso » 21 Nov 2014, 13:44

gaussian, hanning, etc
the list can be long?
for very specific curves, the solution could be to create a script?

User avatar
oli_lab
Member
Posts: 1266
Location: Brittany, France
Contact:

Unread post by oli_lab » 22 Nov 2014, 10:20

I'll try that, no worries.

Code: Select all

//////////////////////////////////////////////////////
// bipolar bell shape
//////////////////////////////////////////////////////

//////////////////////////////////////////////////////
// Paramters declaration
//////////////////////////////////////////////////////
var input, tau, mu : Tparameter;
var output: Tparameter;
                                         
//////////////////////////////////////////////////////
// initialisation procedure
//////////////////////////////////////////////////////
procedure init;
begin 
SetModuleColor($800000+302060);  
 input := CreateParam('input',ptDatafader);
 SetIsOutput(input,false);
 SetMin(input,0);
 SetMax(input,1);
                                           
                                                         
 tau := CreateParam('tau',ptDatafader);
 SetIsOutput(tau,false);                     
 SetMin(tau,0);
 SetMax(tau,1);
 SetValue(tau,1);

 mu := CreateParam('mu',ptDatafader);
 SetIsOutput(mu,false);
 SetMin(mu,-5);
 SetMax(mu,5);                                               
                       
 output := CreateParam('output',ptDataFader );
 SetIsInput(output,false);  
 SetMin(output,-5);
 SetMax(output,5);                                               
                

end;

// Global Variables
var inval, tauval, muval : single;
                             
//////////////////////////////////////////////////////
// Main Loop procedure
//////////////////////////////////////////////////////
Procedure Process;
begin

 inval  := 10 * getValue(input); 
 inval  := inval - 5; 
 tauval := getValue(tau); 
 muval  := getValue(mu);  
 muval  := power(inval - muval,2);   
 muval  := (-muval) / (2*tauval*tauval); 
 inval  := power(2.718281828459045,muval); 
 inval  := inval / (tauval *  2.5066282746);
 setvalue(output, 2.5*inval); 
                             
end;
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

User avatar
senso
Site Admin
Posts: 4425
Location: France
Contact:

Unread post by senso » 24 Nov 2014, 09:15

perfect!!!

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests