diff options
Diffstat (limited to 'rotord/src')
| -rw-r--r-- | rotord/src/nodes_maths.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/rotord/src/nodes_maths.h b/rotord/src/nodes_maths.h index 4b080d4..0a10ed0 100644 --- a/rotord/src/nodes_maths.h +++ b/rotord/src/nodes_maths.h @@ -70,6 +70,7 @@ namespace Rotor { #define ARITHMETIC_sin 7 #define ARITHMETIC_cos 8 #define ARITHMETIC_ease 9 +#define ARITHMETIC_jolt 9 class Arithmetic: public Signal_node { public: Arithmetic(){}; @@ -86,6 +87,7 @@ namespace Rotor { if (_op=="sin"||_op=="sine") op=ARITHMETIC_sin; if (_op=="cos"||_op=="cos") op=ARITHMETIC_cos; if (_op=="ease") op=ARITHMETIC_ease; + if (_op=="jolt") op=ARITHMETIC_jolt; } void link_params() { for (auto p:parameter_inputs){ @@ -131,7 +133,10 @@ namespace Rotor { return cos(in); break; case ARITHMETIC_ease: - return sin(in*M_PI); + return ((1.0-value)*in)+(value*(0.5f+((cos((fmod(in,1.0f)+1.0f)*M_PI))*0.5f))); + break; + case ARITHMETIC_jolt: + return ((1.0-value)*in)+(value*(0.5f+((sin((fmod(in,1.0f)+1.0f)*M_PI))*0.5f))); break; } } |
