summaryrefslogtreecommitdiff
path: root/rotord/src
diff options
context:
space:
mode:
authorTim Redfern <tim@herge.(none)>2013-08-07 11:27:06 +0100
committerTim Redfern <tim@herge.(none)>2013-08-07 11:27:06 +0100
commit6bab4bd8f1c96512349281ad3671cb3879b3f4e8 (patch)
treec6d2edb637849b209e144bc63e1c0156fa46c733 /rotord/src
parent88e00292f311c9fabbe74db924f18af8199966ab (diff)
arithmetic_jolt
Diffstat (limited to 'rotord/src')
-rw-r--r--rotord/src/nodes_maths.h7
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;
}
}