float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* I want to use a counter/timer for PWM and as a rudimentary | |
* millisecond clock. If I initiate the counter in Fast PWM mode, | |
* using a clock speed of 1MHz and a prescale of 8, a millisecond will | |
* elapse every 125 clock ticks. | |
*/ | |
typedef uint32_t millis_t; | |
static volatile millis_t milliseconds = 0; /* 49.71 Days of milliseconds */ |