Page 1 of 1

Posted: 17 Nov 2014, 20:43
by oli_lab

Posted: 21 Nov 2014, 13:44
by senso
gaussian, hanning, etc
the list can be long?
for very specific curves, the solution could be to create a script?

Posted: 22 Nov 2014, 10:20
by oli_lab
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;

Posted: 24 Nov 2014, 09:15
by senso
perfect!!!