This might help a a lot. I have made parametric custom curve maker.
It receives several input parameter arrays:
curve type index - each curve type has it's own index, we may add new custom curve types
list of Y's of points - list of points that will be interpolated by the custom curves. Also the end point must be given
X distances between points in samples
parameter per curve - each curve type may receive a parameter that further defines the shape. The range of this parameter and it's effect is unique per curve type
The module has no gui yet. It is SSE compatible, so the channels are calculated completely separately. Also there is a smart Assembly code that works sort of like a selector - only currently selected curve type is calculated (or multiple types if different curve types are requested per channel) so adding additional curve types will not increase CPU usage.
There is also a way, to add additional custom curve shapes. 3 curve types are already there and their Code block versions are present in the "curve types" module.
To add new curve type you may write it in Code Block and it must fit following standard:
1. The inputs and outputs must be following
Code: Select all
streamin Start;
streamin End;
streamin Par;
streamin phase;
streamout amp;
Where
Start and
End are the Y values the two interpolated points.
Par is is the parameter input for your curve type - it is optional and also it's range and effect is defined by you
phase is the interpolation X value in range 0-1. For 0 the curve output is "Start" value and for 1 the "End" value
amp is the curve output
2. You cannot use variable of a name
STATE or
Type because they is used internally to switch between curve types
3. the code can be only in stage(2). Using other stages requires quite a lot of assembly skills to implement and also using a lot of unique variable names and complicates adding new curve types.
Once you have your code working connect it to a text primitive to extract the assembly code.
Copy all your variables that were declared into the "custom curve" assembler block (double check if the new added variables weren't added before, if so, you shouldn't have them doubled or FS may crash. I recommend doing this part with the "custom curve" assembler disconnected ). Do NOT copy the streamin and streamout declarations!!!
Now copy the execution part of your assembly code into following code scheme:
Code: Select all
movaps xmm0,Type;
cmpps xmm0,F<index of your curve type>,0; //is equal?
movaps STATE,xmm0;
mov eax,STATE[0];
add eax,STATE[1];
add eax,STATE[2];
add eax,STATE[3];
cmp eax,0; //false if all Temp are false
jz Skip<your curve name>;
//add code of the custom curve in this gap:
//updates ampOUT
movaps xmm0,amp;
andps xmm0,STATE;
addps xmm0,ampOUT;
movaps ampOUT,xmm0;
Skip<You curve name>:
Do not forget to replace text in < > with your custom values (unique curve type name and index). Also check if the
F<index of your curve type> is declared - if not do so in the declaration part.
Now copy you new updated code at the very bottom of the "custom curve" assembler block.
Your new custom curve type should now be supported( or crash flowstone if you've done something wrong).
P.S. I hope I had not forgotten anything
