diff options
Diffstat (limited to 'rotord')
| -rw-r--r-- | rotord/src/nodes_drawing.h | 2 | ||||
| -rw-r--r-- | rotord/src/nodes_maths.h | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/rotord/src/nodes_drawing.h b/rotord/src/nodes_drawing.h index 0f8eb76..ab204cc 100644 --- a/rotord/src/nodes_drawing.h +++ b/rotord/src/nodes_drawing.h @@ -199,8 +199,6 @@ namespace Rotor { private: }; class Mosaic: public Draw_node { - //the difficulty here is in keeping the pixels centred - //the center of the screen should remain in between pixels public: Mosaic(){ title="Mosaic"; diff --git a/rotord/src/nodes_maths.h b/rotord/src/nodes_maths.h index 6bbccdc..b2aa9c7 100644 --- a/rotord/src/nodes_maths.h +++ b/rotord/src/nodes_maths.h @@ -229,6 +229,9 @@ namespace Rotor { description="Randomises integer part of signal (seedable)"; create_signal_input("signal","Signal"); create_parameter("seed","number","Seed value","Seed",1.0); + create_parameter("frequency","number","Frequency of randomisation","Frequency",1.0); + //kind of a hack + //need to think of a better way to randomise periodically NODEID="1de86932-2d0b-11e3-96d3-77aa4558e6cd"; std::uniform_int_distribution<> d(-9999, 9999); }; @@ -243,9 +246,9 @@ namespace Rotor { o=inputs[0]->get(time); } else o=time.time; - uint32_t m=(int)o; + uint32_t m=(int)(o/parameters["frequency"]->value); PRNG.seed(m^(int)parameters["seed"]->value); - return ((double)(PRNG()&0xffff))+(o-m); + return ((double)(PRNG()&0xffff))+(((o/parameters["frequency"]->value)*parameters["frequency"]->value)-m); //uint32_t seed=Seed+parameters["seed"]->value; //hash the integer part and add the fractional part back on |
