FastLED 3.9.7
Loading...
Searching...
No Matches
animartrix_detail.hpp
1#pragma once
2
3/*
4 ___ _ ___ ______ _____ _
5 / _ \ (_) / _ \ | ___ \_ _| (_)
6/ /_\ \_ __ _ _ __ ___ / /_\ \| |_/ / | |_ __ ___ __
7| _ | '_ \| | '_ ` _ \| _ || / | | '__| \ \/ /
8| | | | | | | | | | | | | | | || |\ \ | | | | |> <
9\_| |_/_| |_|_|_| |_| |_\_| |_/\_| \_| \_/_| |_/_/\_\
10
11by Stefan Petrick 2023.
12
13High quality LED animations for your next project.
14
15This is a Shader and 5D Coordinate Mapper made for realtime
16rendering of generative animations & artistic dynamic visuals.
17
18This is also a modular animation synthesizer with waveform
19generators, oscillators, filters, modulators, noise generators,
20compressors... and much more.
21
22VO.42 beta version
23
24This code is licenced under a Creative Commons Attribution
25License CC BY-NC 3.0
26
27*/
28
29#include "fl/vector.h"
30#include <math.h> // ok include
31#include <stdint.h>
32
33#ifndef ANIMARTRIX_INTERNAL
34#error "This file is not meant to be included directly. Include animartrix.hpp instead."
35#endif
36
37// Copyright Stefen Petrick 2023.
38// Adapted to C++ by Netmindz 2023.
39// Adapted to FastLED by Zach Vorhies 2024.
40// Licensed under the Creative Commons Attribution License CC BY-NC 3.0
41// https://creativecommons.org/licenses/by-nc/3.0/
42// This header is distributed with FastLED but has a different license that limits commercial use.
43// If you include this high quality LED animation library in your project, you must agree to the licensing terms.
44// It is not included by FastLED by default, you must include it manually.
45// Setting FASTLED_ANIMARTRIX_LICENSING_AGREEMENT=1 will indicate that you agree to the licensing terms of the ANIMartRIX library for non commercial use only.
46//
47// Like the rest of FastLED, this header is free for non-commercial use and licensed under the Creative Commons Attribution License CC BY-NC 3.0.
48// If you are just making art, then by all means do what you want with this library and you can stop reading now.
49// If you are using this header for commercial purposes, then you need to contact Stefan Petrick for a commercial use license.
50
51
52
53
54#include "fl/force_inline.h"
55#include "crgb.h"
56#include "fl/namespace.h"
57
58// Setting this to 1 means you agree to the licensing terms of the ANIMartRIX library for non commercial use only.
59#if defined(FASTLED_ANIMARTRIX_LICENSING_AGREEMENT) || (FASTLED_ANIMARTRIX_LICENSING_AGREEMENT != 0)
60#warning "Warning: Non-standard license. This fx header is separate from the FastLED driver and carries different licensing terms. On the plus side, IT'S FUCKING AMAZING. ANIMartRIX: free for non-commercial use and licensed under the Creative Commons Attribution License CC BY-NC-SA 4.0. If you'd like to purchase a commercial use license please contact Stefan Petrick. Github: github.com/StefanPetrick/animartrix Reddit: reddit.com/user/StefanPetrick/ Modified by github.com/netmindz for class portability. Ported into FastLED by Zach Vorhies."
61#endif //
62
63
64#ifndef PI
65#define PI 3.1415926535897932384626433832795
66#endif
67
68#ifdef ANIMARTRIX_PRINT_USES_SERIAL
69#define ANIMARTRIX_PRINT_USES_SERIAL(S) Serial.print(S)
70#else
71#define ANIMARTRIX_PRINT(S) (void)(S)
72#endif
73
74#define num_oscillators 10
75
76namespace animartrix_detail {
77
79
80 // TODO float center_x = (num_x / 2) - 0.5; // center of the matrix
81 // TODO float center_y = (num_y / 2) - 0.5;
82 float center_x = (999 / 2) - 0.5; // center of the matrix
83 float center_y = (999 / 2) - 0.5;
84 float dist, angle;
85 float scale_x = 0.1; // smaller values = zoom in
86 float scale_y = 0.1;
87 float scale_z = 0.1;
88 float offset_x, offset_y, offset_z;
89 float z;
90 float low_limit = 0; // getting contrast by highering the black point
91 float high_limit = 1;
92};
93
94
96
97 float master_speed; // global transition speed
98 float
99 offset[num_oscillators]; // oscillators can be shifted by a time offset
100 float ratio[num_oscillators]; // speed ratios for the individual oscillators
101};
102
103
105
106 float linear[num_oscillators]; // returns 0 to FLT_MAX
107 float radial[num_oscillators]; // returns 0 to 2*PI
108 float directional[num_oscillators]; // returns -1 to 1
109 float noise_angle[num_oscillators]; // returns 0 to 2*PI
110};
111
112
113
114
115struct rgb {
116 float red, green, blue;
117};
118
119
120
121static const uint8_t PERLIN_NOISE[] = {
122 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7,
123 225, 140, 36, 103, 30, 69, 142, 8, 99, 37, 240, 21, 10, 23, 190,
124 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117,
125 35, 11, 32, 57, 177, 33, 88, 237, 149, 56, 87, 174, 20, 125, 136,
126 171, 168, 68, 175, 74, 165, 71, 134, 139, 48, 27, 166, 77, 146, 158,
127 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46,
128 245, 40, 244, 102, 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209,
129 76, 132, 187, 208, 89, 18, 169, 200, 196, 135, 130, 116, 188, 159, 86,
130 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, 5,
131 202, 38, 147, 118, 126, 255, 82, 85, 212, 207, 206, 59, 227, 47, 16,
132 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, 119, 248, 152, 2, 44,
133 154, 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, 129, 22, 39, 253,
134 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104, 218, 246, 97,
135 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51,
136 145, 235, 249, 14, 239, 107, 49, 192, 214, 31, 181, 199, 106, 157, 184,
137 84, 204, 176, 115, 121, 50, 45, 127, 4, 150, 254, 138, 236, 205, 93,
138 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156,
139 180};
140
141FASTLED_FORCE_INLINE uint8_t P(uint8_t x) {
142 const uint8_t idx = x & 255;
143 const uint8_t* ptr = PERLIN_NOISE + idx;
144 return *ptr;
145}
146
148
149 public:
150 int num_x; // how many LEDs are in one row?
151 int num_y; // how many rows?
152
153 float speed_factor = 1; // 0.1 to 10
154
155 float radial_filter_radius = 23.0; // on 32x32, use 11 for 16x16
156
157 bool serpentine;
158
159 render_parameters animation; // all animation parameters in one place
160 oscillators timings; // all speed settings in one place
161 modulators move; // all oscillator based movers and shifters at one place
162 rgb pixel;
163
165 polar_theta; // look-up table for polar angles
167 distance; // look-up table for polar distances
168
169 unsigned long a, b, c; // for time measurements
170
171 float show1, show2, show3, show4, show5, show6, show7, show8, show9, show0;
172
173 ANIMartRIX() {}
174
175 ANIMartRIX(int w, int h) { this->init(w, h); }
176
177 virtual ~ANIMartRIX() {}
178
179 virtual uint16_t xyMap(uint16_t x, uint16_t y) = 0;
180
181 uint32_t currentTime = 0;
182 void setTime(uint32_t t) { currentTime = t; }
183 uint32_t getTime() { return currentTime ? currentTime : millis(); }
184
185
186 void init(int w, int h) {
187 animation = render_parameters();
188 timings = oscillators();
189 move = modulators();
190 pixel = rgb();
191
192 this->num_x = w;
193 this->num_y = h;
194 if (w <= 16) {
195 this->radial_filter_radius = 11;
196 } else {
197 this->radial_filter_radius = 23; // on 32x32, use 11 for 16x16
198 }
199 render_polar_lookup_table(
200 (num_x / 2) - 0.5,
201 (num_y / 2) - 0.5); // precalculate all polar coordinates
202 // polar origin is set to matrix centre
203 // set default speed ratio for the oscillators, not all effects set their own, so start from know state
204 timings.master_speed = 0.01;
205 }
206
212 void setSpeedFactor(float speed) { this->speed_factor = speed; }
213
214 // Dynamic darkening methods:
215
216 float subtract(float &a, float &b) { return a - b; }
217
218 float multiply(float &a, float &b) { return a * b / 255.f; }
219
220 // makes low brightness darker
221 // sets the black point high = more contrast
222 // animation.low_limit should be 0 for best results
223 float colorburn(float &a, float &b) {
224
225 return (1 - ((1 - a / 255.f) / (b / 255.f))) * 255.f;
226 }
227
228 // Dynamic brightening methods
229
230 float add(float &a, float &b) { return a + b; }
231
232 // makes bright even brighter
233 // reduces contrast
234 float screen(float &a, float &b) {
235
236 return (1 - (1 - a / 255.f) * (1 - b / 255.f)) * 255.f;
237 }
238
239 float colordodge(float &a, float &b) { return (a / (255.f - b)) * 255.f; }
240 /*
241 Ken Perlins improved noise - http://mrl.nyu.edu/~perlin/noise/
242 C-port: http://www.fundza.com/c4serious/noise/perlin/perlin.html
243 by Malcolm Kesson; arduino port by Peter Chiochetti, Sep 2007 :
244 - make permutation constant byte, obsoletes init(), lookup % 256
245 */
246
247 float fade(float t) { return t * t * t * (t * (t * 6 - 15) + 10); }
248 float lerp(float t, float a, float b) { return a + t * (b - a); }
249 float grad(int hash, float x, float y, float z) {
250 int h = hash & 15; /* CONVERT LO 4 BITS OF HASH CODE */
251 float u = h < 8 ? x : y, /* INTO 12 GRADIENT DIRECTIONS. */
252 v = h < 4 ? y
253 : h == 12 || h == 14 ? x
254 : z;
255 return ((h & 1) == 0 ? u : -u) + ((h & 2) == 0 ? v : -v);
256 }
257
258
259 float pnoise(float x, float y, float z) {
260
261 int X = (int)floorf(x) & 255, /* FIND UNIT CUBE THAT */
262 Y = (int)floorf(y) & 255, /* CONTAINS POINT. */
263 Z = (int)floorf(z) & 255;
264 x -= floorf(x); /* FIND RELATIVE X,Y,Z */
265 y -= floorf(y); /* OF POINT IN CUBE. */
266 z -= floorf(z);
267 float u = fade(x), /* COMPUTE FADE CURVES */
268 v = fade(y), /* FOR EACH OF X,Y,Z. */
269 w = fade(z);
270 int A = P(X) + Y, AA = P(A) + Z,
271 AB = P(A + 1) + Z, /* HASH COORDINATES OF */
272 B = P(X + 1) + Y, BA = P(B) + Z,
273 BB = P(B + 1) + Z; /* THE 8 CUBE CORNERS, */
274
275 return lerp(w,
276 lerp(v,
277 lerp(u, grad(P(AA), x, y, z), /* AND ADD */
278 grad(P(BA), x - 1, y, z)), /* BLENDED */
279 lerp(u, grad(P(AB), x, y - 1, z), /* RESULTS */
280 grad(P(BB), x - 1, y - 1, z))), /* FROM 8 */
281 lerp(v,
282 lerp(u, grad(P(AA + 1), x, y, z - 1), /* CORNERS */
283 grad(P(BA + 1), x - 1, y, z - 1)), /* OF CUBE */
284 lerp(u, grad(P(AB + 1), x, y - 1, z - 1),
285 grad(P(BB + 1), x - 1, y - 1, z - 1))));
286 }
287
288 void calculate_oscillators(oscillators &timings) {
289
290 double runtime = getTime() * timings.master_speed *
291 speed_factor; // global anaimation speed
292
293 for (int i = 0; i < num_oscillators; i++) {
294
295 move.linear[i] =
296 (runtime + timings.offset[i]) *
297 timings.ratio[i]; // continously rising offsets, returns 0 to
298 // max_float
299
300 move.radial[i] = fmodf(move.linear[i],
301 2 * PI); // angle offsets for continous
302 // rotation, returns 0 to 2 * PI
303
304 move.directional[i] =
305 sinf(move.radial[i]); // directional offsets or factors, returns
306 // -1 to 1
307
308 move.noise_angle[i] =
309 PI *
310 (1 +
311 pnoise(move.linear[i], 0,
312 0)); // noise based angle offset, returns 0 to 2 * PI
313 }
314 }
315
316 void run_default_oscillators(float master_speed = 0.005) {
317 timings.master_speed = master_speed;
318
319 timings.ratio[0] = 1; // speed ratios for the oscillators, higher values
320 // = faster transitions
321 timings.ratio[1] = 2;
322 timings.ratio[2] = 3;
323 timings.ratio[3] = 4;
324 timings.ratio[4] = 5;
325 timings.ratio[5] = 6;
326 timings.ratio[6] = 7;
327 timings.ratio[7] = 8;
328 timings.ratio[8] = 9;
329 timings.ratio[9] = 10;
330
331 timings.offset[0] = 000;
332 timings.offset[1] = 100;
333 timings.offset[2] = 200;
334 timings.offset[3] = 300;
335 timings.offset[4] = 400;
336 timings.offset[5] = 500;
337 timings.offset[6] = 600;
338 timings.offset[7] = 700;
339 timings.offset[8] = 800;
340 timings.offset[9] = 900;
341
342 calculate_oscillators(timings);
343 }
344
345 // Convert the 2 polar coordinates back to cartesian ones & also apply all
346 // 3d transitions. Calculate the noise value at this point based on the 5
347 // dimensional manipulation of the underlaying coordinates.
348
349 float render_value(render_parameters &animation) {
350
351 // convert polar coordinates back to cartesian ones
352
353 float newx = (animation.offset_x + animation.center_x -
354 (cosf(animation.angle) * animation.dist)) *
355 animation.scale_x;
356 float newy = (animation.offset_y + animation.center_y -
357 (sinf(animation.angle) * animation.dist)) *
358 animation.scale_y;
359 float newz = (animation.offset_z + animation.z) * animation.scale_z;
360
361 // render noisevalue at this new cartesian point
362
363 float raw_noise_field_value = pnoise(newx, newy, newz);
364
365 // A) enhance histogram (improve contrast) by setting the black and
366 // white point (low & high_limit) B) scale the result to a 0-255 range
367 // (assuming you want 8 bit color depth per rgb chanel) Here happens the
368 // contrast boosting & the brightness mapping
369
370 if (raw_noise_field_value < animation.low_limit)
371 raw_noise_field_value = animation.low_limit;
372 if (raw_noise_field_value > animation.high_limit)
373 raw_noise_field_value = animation.high_limit;
374
375 float scaled_noise_value =
376 map_float(raw_noise_field_value, animation.low_limit,
377 animation.high_limit, 0, 255);
378
379 return scaled_noise_value;
380 }
381
382 // given a static polar origin we can precalculate
383 // the polar coordinates
384
385 void render_polar_lookup_table(float cx, float cy) {
386 polar_theta.resize(num_x, fl::HeapVector<float>(num_y, 0.0f));
387 distance.resize(num_x, fl::HeapVector<float>(num_y, 0.0f));
388
389 for (int xx = 0; xx < num_x; xx++) {
390 for (int yy = 0; yy < num_y; yy++) {
391
392 float dx = xx - cx;
393 float dy = yy - cy;
394
395 distance[xx][yy] = hypotf(dx, dy);
396 polar_theta[xx][yy] = atan2f(dy, dx);
397 }
398 }
399 }
400
401 // float mapping maintaining 32 bit precision
402 // we keep values with high resolution for potential later usage
403
404 float map_float(float x, float in_min, float in_max, float out_min,
405 float out_max) {
406
407 float result =
408 (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
409 if (result < out_min)
410 result = out_min;
411 if (result > out_max)
412 result = out_max;
413
414 return result;
415 }
416
417 /* unnecessary bloat
418
419 // check result after colormapping and store the newly rendered rgb data
420
421 void write_pixel_to_framebuffer(int x, int y, rgb &pixel) {
422
423 // assign the final color of this one pixel
424 CRGB finalcolor = CRGB(pixel.red, pixel.green, pixel.blue);
425
426 // write the rendered pixel into the framebutter
427 leds[xyMap(x, y)] = finalcolor;
428 }
429 */
430
431 // Avoid any possible color flicker by forcing the raw RGB values to be
432 // 0-255. This enables to play freely with random equations for the
433 // colormapping without causing flicker by accidentally missing the valid
434 // target range.
435
436 rgb rgb_sanity_check(rgb &pixel) {
437
438 // rescue data if possible, return absolute value
439 // if (pixel.red < 0) pixel.red = fabsf(pixel.red);
440 // if (pixel.green < 0) pixel.green = fabsf(pixel.green);
441 // if (pixel.blue < 0) pixel.blue = fabsf(pixel.blue);
442
443 // Can never be negative colour
444 if (pixel.red < 0)
445 pixel.red = 0;
446 if (pixel.green < 0)
447 pixel.green = 0;
448 if (pixel.blue < 0)
449 pixel.blue = 0;
450
451 // discard everything above the valid 8 bit colordepth 0-255 range
452 if (pixel.red > 255)
453 pixel.red = 255;
454 if (pixel.green > 255)
455 pixel.green = 255;
456 if (pixel.blue > 255)
457 pixel.blue = 255;
458
459 return pixel;
460 }
461
462 // find the right led index according to you LED matrix wiring
463
464 void get_ready() { // wait until new buffer is ready, measure time
465 a = micros();
466 logOutput();
467 }
468
469 virtual void setPixelColorInternal(int x, int y, rgb pixel) = 0;
470
471 // virtual void setPixelColorInternal(int index, rgb pixel) = 0;
472
473 void logOutput() { b = micros(); }
474
475 void logFrame() { c = micros(); }
476
477 // Show the current framerate, rendered pixels per second,
478 // rendering time & time spend to push the data to the leds.
479 // in the serial monitor.
480
481 void report_performance() {
482
483 float calc = b - a; // waiting time
484 float push = c - b; // rendering time
485 float total = c - a; // time per frame
486 int fps = 1000000 / total; // frames per second
487 int kpps = (fps * num_x * num_y) / 1000; // kilopixel per second
488
489 ANIMARTRIX_PRINT(fps);
490 ANIMARTRIX_PRINT(" fps ");
491 ANIMARTRIX_PRINT(kpps);
492 ANIMARTRIX_PRINT(" kpps @");
493 ANIMARTRIX_PRINT(num_x * num_y);
494 ANIMARTRIX_PRINT(" LEDs ");
495 ANIMARTRIX_PRINT(round(total));
496 ANIMARTRIX_PRINT(" µs per frame waiting: ");
497 ANIMARTRIX_PRINT(round((calc * 100) / total));
498 ANIMARTRIX_PRINT("% rendering: ");
499 ANIMARTRIX_PRINT(round((push * 100) / total));
500 ANIMARTRIX_PRINT("% (");
501 ANIMARTRIX_PRINT(round(calc));
502 ANIMARTRIX_PRINT(" + ");
503 ANIMARTRIX_PRINT(round(push));
504 ANIMARTRIX_PRINT(" µs) Core-temp: ");
505 // TODO ANIMARTRIX_PRINT( tempmonGetTemp() );
506 //Serial.println(" °C");
507 ANIMARTRIX_PRINT(" °C\n");
508 }
509
510 // Effects
511
512 void Rotating_Blob() {
513
514 get_ready();
515
516 timings.master_speed = 0.01; // speed ratios for the oscillators
517 timings.ratio[0] = 0.1; // higher values = faster transitions
518 timings.ratio[1] = 0.03;
519 timings.ratio[2] = 0.03;
520 timings.ratio[3] = 0.03;
521
522 timings.offset[1] = 10;
523 timings.offset[2] = 20;
524 timings.offset[3] = 30;
525
526 calculate_oscillators(
527 timings); // get linear movers and oscillators going
528
529 for (int x = 0; x < num_x; x++) {
530 for (int y = 0; y < num_y; y++) {
531
532 // describe and render animation layers
533 animation.scale_x = 0.05;
534 animation.scale_y = 0.05;
535 animation.offset_x = 0;
536 animation.offset_y = 0;
537 animation.offset_z = 100;
538 animation.angle = polar_theta[x][y] + move.radial[0];
539 animation.dist = distance[x][y];
540 animation.z = move.linear[0];
541 animation.low_limit = -1;
542 float show1 = render_value(animation);
543
544 animation.angle =
545 polar_theta[x][y] - move.radial[1] + show1 / 512.0;
546 animation.dist = distance[x][y] * show1 / 255.0;
547 animation.low_limit = 0;
548 animation.z = move.linear[1];
549 float show2 = render_value(animation);
550
551 animation.angle =
552 polar_theta[x][y] - move.radial[2] + show1 / 512.0;
553 animation.dist = distance[x][y] * show1 / 220.0;
554 animation.z = move.linear[2];
555 float show3 = render_value(animation);
556
557 animation.angle =
558 polar_theta[x][y] - move.radial[3] + show1 / 512.0;
559 animation.dist = distance[x][y] * show1 / 200.0;
560 animation.z = move.linear[3];
561 float show4 = render_value(animation);
562
563 // colormapping
564 pixel.red = (show2 + show4) / 2;
565 pixel.green = show3 / 6;
566 pixel.blue = 0;
567
568 pixel = rgb_sanity_check(pixel);
569
570 setPixelColorInternal(x, y, pixel);
571 }
572 }
573 }
574
575 void Chasing_Spirals() {
576
577 get_ready();
578
579 timings.master_speed = 0.01; // speed ratios for the oscillators
580 timings.ratio[0] = 0.1; // higher values = faster transitions
581 timings.ratio[1] = 0.13;
582 timings.ratio[2] = 0.16;
583
584 timings.offset[1] = 10;
585 timings.offset[2] = 20;
586 timings.offset[3] = 30;
587
588 calculate_oscillators(
589 timings); // get linear movers and oscillators going
590
591 for (int x = 0; x < num_x; x++) {
592 for (int y = 0; y < num_y; y++) {
593
594 // describe and render animation layers
595 animation.angle =
596 3 * polar_theta[x][y] + move.radial[0] - distance[x][y] / 3;
597 animation.dist = distance[x][y];
598 animation.scale_z = 0.1;
599 animation.scale_y = 0.1;
600 animation.scale_x = 0.1;
601 animation.offset_x = move.linear[0];
602 animation.offset_y = 0;
603 animation.offset_z = 0;
604 animation.z = 0;
605 float show1 = render_value(animation);
606
607 animation.angle =
608 3 * polar_theta[x][y] + move.radial[1] - distance[x][y] / 3;
609 animation.dist = distance[x][y];
610 animation.offset_x = move.linear[1];
611 float show2 = render_value(animation);
612
613 animation.angle =
614 3 * polar_theta[x][y] + move.radial[2] - distance[x][y] / 3;
615 animation.dist = distance[x][y];
616 animation.offset_x = move.linear[2];
617 float show3 = render_value(animation);
618
619 // colormapping
620 float radius = radial_filter_radius;
621 float radial_filter = (radius - distance[x][y]) / radius;
622
623 pixel.red = 3 * show1 * radial_filter;
624 pixel.green = show2 * radial_filter / 2;
625 pixel.blue = show3 * radial_filter / 4;
626
627 pixel = rgb_sanity_check(pixel);
628
629 setPixelColorInternal(x, y, pixel);
630 }
631 }
632 }
633
634 void Rings() {
635
636 get_ready();
637
638 timings.master_speed = 0.01; // speed ratios for the oscillators
639 timings.ratio[0] = 1; // higher values = faster transitions
640 timings.ratio[1] = 1.1;
641 timings.ratio[2] = 1.2;
642
643 timings.offset[1] = 100;
644 timings.offset[2] = 200;
645 timings.offset[3] = 300;
646
647 calculate_oscillators(
648 timings); // get linear movers and oscillators going
649
650 for (int x = 0; x < num_x; x++) {
651 for (int y = 0; y < num_y; y++) {
652
653 // describe and render animation layers
654 animation.angle = 5;
655 animation.scale_x = 0.2;
656 animation.scale_y = 0.2;
657 animation.scale_z = 1;
658 animation.dist = distance[x][y];
659 animation.offset_y = -move.linear[0];
660 animation.offset_x = 0;
661 float show1 = render_value(animation);
662
663 // describe and render animation layers
664 animation.angle = 10;
665
666 animation.dist = distance[x][y];
667 animation.offset_y = -move.linear[1];
668 float show2 = render_value(animation);
669
670 // describe and render animation layers
671 animation.angle = 12;
672
673 animation.dist = distance[x][y];
674 animation.offset_y = -move.linear[2];
675 float show3 = render_value(animation);
676
677 // colormapping
678 pixel.red = show1;
679 pixel.green = show2 / 4;
680 pixel.blue = show3 / 4;
681
682 pixel = rgb_sanity_check(pixel);
683
684 setPixelColorInternal(x, y, pixel);
685 }
686 }
687 }
688
689 void Waves() {
690
691 get_ready();
692
693 timings.master_speed = 0.01; // speed ratios for the oscillators
694 timings.ratio[0] = 2; // higher values = faster transitions
695 timings.ratio[1] = 2.1;
696 timings.ratio[2] = 1.2;
697
698 timings.offset[1] = 100;
699 timings.offset[2] = 200;
700 timings.offset[3] = 300;
701
702 calculate_oscillators(
703 timings); // get linear movers and oscillators going
704
705 for (int x = 0; x < num_x; x++) {
706 for (int y = 0; y < num_y; y++) {
707
708 // describe and render animation layers
709 animation.angle = polar_theta[x][y];
710 animation.scale_x = 0.1;
711 animation.scale_y = 0.1;
712 animation.scale_z = 0.1;
713 animation.dist = distance[x][y];
714 animation.offset_y = 0;
715 animation.offset_x = 0;
716 animation.z = 2 * distance[x][y] - move.linear[0];
717 float show1 = render_value(animation);
718
719 animation.angle = polar_theta[x][y];
720 animation.dist = distance[x][y];
721 animation.z = 2 * distance[x][y] - move.linear[1];
722 float show2 = render_value(animation);
723
724 // colormapping
725 pixel.red = show1;
726 pixel.green = 0;
727 pixel.blue = show2;
728
729 pixel = rgb_sanity_check(pixel);
730
731 setPixelColorInternal(x, y, pixel);
732 }
733 }
734 }
735
736 void Center_Field() {
737
738 get_ready();
739
740 timings.master_speed = 0.01; // speed ratios for the oscillators
741 timings.ratio[0] = 1; // higher values = faster transitions
742 timings.ratio[1] = 1.1;
743 timings.ratio[2] = 1.2;
744
745 timings.offset[1] = 100;
746 timings.offset[2] = 200;
747 timings.offset[3] = 300;
748
749 calculate_oscillators(
750 timings); // get linear movers and oscillators going
751
752 for (int x = 0; x < num_x; x++) {
753 for (int y = 0; y < num_y; y++) {
754
755 // describe and render animation layers
756 animation.angle = polar_theta[x][y];
757 animation.scale_x = 0.07;
758 animation.scale_y = 0.07;
759 animation.scale_z = 0.1;
760 animation.dist = 5 * sqrtf(distance[x][y]);
761 animation.offset_y = move.linear[0];
762 animation.offset_x = 0;
763 animation.z = 0;
764 float show1 = render_value(animation);
765
766 animation.angle = polar_theta[x][y];
767 animation.scale_x = 0.07;
768 animation.scale_y = 0.07;
769 animation.scale_z = 0.1;
770 animation.dist = 4 * sqrtf(distance[x][y]);
771 animation.offset_y = move.linear[0];
772 animation.offset_x = 0;
773 animation.z = 0;
774 float show2 = render_value(animation);
775
776 // colormapping
777 pixel.red = show1;
778 pixel.green = show2;
779 pixel.blue = 0;
780
781 pixel = rgb_sanity_check(pixel);
782
783 setPixelColorInternal(x, y, pixel);
784 }
785 }
786 }
787
788 void Distance_Experiment() {
789
790 get_ready();
791
792 timings.master_speed = 0.01; // speed ratios for the oscillators
793 timings.ratio[0] = 0.2; // higher values = faster transitions
794 timings.ratio[1] = 0.13;
795 timings.ratio[2] = 0.012;
796
797 timings.offset[1] = 100;
798 timings.offset[2] = 200;
799 timings.offset[3] = 300;
800
801 calculate_oscillators(
802 timings); // get linear movers and oscillators going
803
804 for (int x = 0; x < num_x; x++) {
805 for (int y = 0; y < num_y; y++) {
806
807 // describe and render animation layers
808 animation.dist = powf(distance[x][y], 0.5);
809 animation.angle = polar_theta[x][y] + move.radial[0];
810 animation.scale_x = 0.07;
811 animation.scale_y = 0.07;
812 animation.scale_z = 0.1;
813 animation.offset_y = move.linear[0];
814 animation.offset_x = 0;
815 animation.offset_z = 0;
816 animation.z = 0;
817 float show1 = render_value(animation);
818
819 animation.dist = powf(distance[x][y], 0.6);
820 animation.angle = polar_theta[x][y] + move.noise_angle[2];
821 animation.scale_x = 0.07;
822 animation.scale_y = 0.07;
823 animation.scale_z = 0.1;
824 animation.offset_y = move.linear[1];
825 animation.offset_x = 0;
826 animation.offset_z = 0;
827 animation.z = 0;
828 float show2 = render_value(animation);
829
830 // colormapping
831 pixel.red = show1 + show2;
832 pixel.green = show2;
833 pixel.blue = 0;
834
835 pixel = rgb_sanity_check(pixel);
836
837 setPixelColorInternal(x, y, pixel);
838 }
839 }
840 }
841
842 void Caleido1() {
843
844 get_ready();
845
846 timings.master_speed = 0.003; // speed ratios for the oscillators
847 timings.ratio[0] = 0.02; // higher values = faster transitions
848 timings.ratio[1] = 0.03;
849 timings.ratio[2] = 0.04;
850 timings.ratio[3] = 0.05;
851 timings.ratio[4] = 0.6;
852 timings.offset[0] = 0;
853 timings.offset[1] = 100;
854 timings.offset[2] = 200;
855 timings.offset[3] = 300;
856 timings.offset[4] = 400;
857
858 calculate_oscillators(
859 timings); // get linear movers and oscillators going
860
861 for (int x = 0; x < num_x; x++) {
862 for (int y = 0; y < num_y; y++) {
863
864 // describe and render animation layers
865 animation.dist = distance[x][y] * (2 + move.directional[0]) / 3;
866 animation.angle = 3 * polar_theta[x][y] +
867 3 * move.noise_angle[0] + move.radial[4];
868 animation.scale_x = 0.1;
869 animation.scale_y = 0.1;
870 animation.scale_z = 0.1;
871 animation.offset_y = 2 * move.linear[0];
872 animation.offset_x = 0;
873 animation.offset_z = 0;
874 animation.z = move.linear[0];
875 float show1 = render_value(animation);
876
877 animation.dist = distance[x][y] * (2 + move.directional[1]) / 3;
878 animation.angle = 4 * polar_theta[x][y] +
879 3 * move.noise_angle[1] + move.radial[4];
880 animation.offset_x = 2 * move.linear[1];
881 animation.z = move.linear[1];
882 float show2 = render_value(animation);
883
884 animation.dist = distance[x][y] * (2 + move.directional[2]) / 3;
885 animation.angle = 5 * polar_theta[x][y] +
886 3 * move.noise_angle[2] + move.radial[4];
887 animation.offset_y = 2 * move.linear[2];
888 animation.z = move.linear[2];
889 float show3 = render_value(animation);
890
891 animation.dist = distance[x][y] * (2 + move.directional[3]) / 3;
892 animation.angle = 4 * polar_theta[x][y] +
893 3 * move.noise_angle[3] + move.radial[4];
894 animation.offset_x = 2 * move.linear[3];
895 animation.z = move.linear[3];
896 float show4 = render_value(animation);
897
898 // colormapping
899 pixel.red = show1;
900 pixel.green = show3 * distance[x][y] / 10;
901 pixel.blue = (show2 + show4) / 2;
902
903 pixel = rgb_sanity_check(pixel);
904
905 setPixelColorInternal(x, y, pixel);
906 }
907 }
908 }
909
910 void Caleido2() {
911
912 get_ready();
913
914 timings.master_speed = 0.002; // speed ratios for the oscillators
915 timings.ratio[0] = 0.02; // higher values = faster transitions
916 timings.ratio[1] = 0.03;
917 timings.ratio[2] = 0.04;
918 timings.ratio[3] = 0.05;
919 timings.ratio[4] = 0.6;
920 timings.offset[0] = 0;
921 timings.offset[1] = 100;
922 timings.offset[2] = 200;
923 timings.offset[3] = 300;
924 timings.offset[4] = 400;
925
926 calculate_oscillators(
927 timings); // get linear movers and oscillators going
928
929 for (int x = 0; x < num_x; x++) {
930 for (int y = 0; y < num_y; y++) {
931
932 // describe and render animation layers
933 animation.dist = distance[x][y] * (2 + move.directional[0]) / 3;
934 animation.angle = 2 * polar_theta[x][y] +
935 3 * move.noise_angle[0] + move.radial[4];
936 animation.scale_x = 0.1;
937 animation.scale_y = 0.1;
938 animation.scale_z = 0.1;
939 animation.offset_y = 2 * move.linear[0];
940 animation.offset_x = 0;
941 animation.offset_z = 0;
942 animation.z = move.linear[0];
943 float show1 = render_value(animation);
944
945 animation.dist = distance[x][y] * (2 + move.directional[1]) / 3;
946 animation.angle = 2 * polar_theta[x][y] +
947 3 * move.noise_angle[1] + move.radial[4];
948 animation.offset_x = 2 * move.linear[1];
949 animation.z = move.linear[1];
950 float show2 = render_value(animation);
951
952 animation.dist = distance[x][y] * (2 + move.directional[2]) / 3;
953 animation.angle = 2 * polar_theta[x][y] +
954 3 * move.noise_angle[2] + move.radial[4];
955 animation.offset_y = 2 * move.linear[2];
956 animation.z = move.linear[2];
957 float show3 = render_value(animation);
958
959 animation.dist = distance[x][y] * (2 + move.directional[3]) / 3;
960 animation.angle = 2 * polar_theta[x][y] +
961 3 * move.noise_angle[3] + move.radial[4];
962 animation.offset_x = 2 * move.linear[3];
963 animation.z = move.linear[3];
964 float show4 = render_value(animation);
965
966 // colormapping
967 pixel.red = show1;
968 pixel.green = show3 * distance[x][y] / 10;
969 pixel.blue = (show2 + show4) / 2;
970
971 pixel = rgb_sanity_check(pixel);
972
973 setPixelColorInternal(x, y, pixel);
974 }
975 }
976 }
977
978 void Caleido3() {
979
980 get_ready();
981
982 timings.master_speed = 0.004; // speed ratios for the oscillators
983 timings.ratio[0] = 0.02; // higher values = faster transitions
984 timings.ratio[1] = 0.03;
985 timings.ratio[2] = 0.04;
986 timings.ratio[3] = 0.05;
987 timings.ratio[4] = 0.6;
988 timings.offset[0] = 0;
989 timings.offset[1] = 100;
990 timings.offset[2] = 200;
991 timings.offset[3] = 300;
992 timings.offset[4] = 400;
993
994 calculate_oscillators(
995 timings); // get linear movers and oscillators going
996
997 for (int x = 0; x < num_x; x++) {
998 for (int y = 0; y < num_y; y++) {
999
1000 // describe and render animation layers
1001 animation.dist = distance[x][y] * (2 + move.directional[0]) / 3;
1002 animation.angle = 2 * polar_theta[x][y] +
1003 3 * move.noise_angle[0] + move.radial[4];
1004 animation.scale_x = 0.1; // + (move.directional[0] + 2)/100;
1005 animation.scale_y = 0.1; // + (move.directional[1] + 2)/100;
1006 animation.scale_z = 0.1;
1007 animation.offset_y = 2 * move.linear[0];
1008 animation.offset_x = 2 * move.linear[1];
1009 animation.offset_z = 0;
1010 animation.z = move.linear[0];
1011 float show1 = render_value(animation);
1012
1013 animation.dist = distance[x][y] * (2 + move.directional[1]) / 3;
1014 animation.angle = 2 * polar_theta[x][y] +
1015 3 * move.noise_angle[1] + move.radial[4];
1016 animation.offset_x = 2 * move.linear[1];
1017 animation.offset_y = show1 / 20.0;
1018 animation.z = move.linear[1];
1019 float show2 = render_value(animation);
1020
1021 animation.dist = distance[x][y] * (2 + move.directional[2]) / 3;
1022 animation.angle = 2 * polar_theta[x][y] +
1023 3 * move.noise_angle[2] + move.radial[4];
1024 animation.offset_y = 2 * move.linear[2];
1025 animation.offset_x = show2 / 20.0;
1026 animation.z = move.linear[2];
1027 float show3 = render_value(animation);
1028
1029 animation.dist = distance[x][y] * (2 + move.directional[3]) / 3;
1030 animation.angle = 2 * polar_theta[x][y] +
1031 3 * move.noise_angle[3] + move.radial[4];
1032 animation.offset_x = 2 * move.linear[3];
1033 animation.offset_y = show3 / 20.0;
1034 animation.z = move.linear[3];
1035 float show4 = render_value(animation);
1036
1037 // colormapping
1038 float radius = radial_filter_radius; // radial mask
1039
1040 pixel.red = show1 * (y + 1) / num_y;
1041 pixel.green = show3 * distance[x][y] / 10;
1042 pixel.blue = (show2 + show4) / 2;
1043 if (distance[x][y] > radius) {
1044 pixel.red = 0;
1045 pixel.green = 0;
1046 pixel.blue = 0;
1047 }
1048
1049 pixel = rgb_sanity_check(pixel);
1050
1051 setPixelColorInternal(x, y, pixel);
1052 }
1053 }
1054 }
1055
1056 void Lava1() {
1057
1058 get_ready();
1059
1060 timings.master_speed = 0.0015; // speed ratios for the oscillators
1061 timings.ratio[0] = 4; // higher values = faster transitions
1062 timings.ratio[1] = 1;
1063 timings.ratio[2] = 1;
1064 timings.ratio[3] = 0.05;
1065 timings.ratio[4] = 0.6;
1066 timings.offset[0] = 0;
1067 timings.offset[1] = 100;
1068 timings.offset[2] = 200;
1069 timings.offset[3] = 300;
1070 timings.offset[4] = 400;
1071
1072 calculate_oscillators(
1073 timings); // get linear movers and oscillators going
1074
1075 for (int x = 0; x < num_x; x++) {
1076 for (int y = 0; y < num_y; y++) {
1077
1078 // describe and render animation layers
1079 animation.dist = distance[x][y] * 0.8;
1080 animation.angle = polar_theta[x][y];
1081 animation.scale_x = 0.15; // + (move.directional[0] + 2)/100;
1082 animation.scale_y = 0.12; // + (move.directional[1] + 2)/100;
1083 animation.scale_z = 0.01;
1084 animation.offset_y = -move.linear[0];
1085 animation.offset_x = 0;
1086 animation.offset_z = 0;
1087 animation.z = 30;
1088 float show1 = render_value(animation);
1089
1090 animation.offset_y = -move.linear[1];
1091 animation.scale_x = 0.15; // + (move.directional[0] + 2)/100;
1092 animation.scale_y = 0.12; // + (move.directional[1] + 2)/100;
1093 animation.offset_x = show1 / 100;
1094 animation.offset_y += show1 / 100;
1095
1096 float show2 = render_value(animation);
1097
1098 animation.offset_y = -move.linear[2];
1099 animation.scale_x = 0.15; // + (move.directional[0] + 2)/100;
1100 animation.scale_y = 0.12; // + (move.directional[1] + 2)/100;
1101 animation.offset_x = show2 / 100;
1102 animation.offset_y += show2 / 100;
1103
1104 float show3 = render_value(animation);
1105
1106 // colormapping
1107 float linear = (y) / (num_y - 1.f); // radial mask
1108
1109 pixel.red = linear * show2;
1110 pixel.green = 0.1 * linear * (show2 - show3);
1111 pixel.blue = 0;
1112
1113 pixel = rgb_sanity_check(pixel);
1114
1115 setPixelColorInternal(x, y, pixel);
1116 }
1117 }
1118 }
1119
1120 void Scaledemo1() {
1121
1122 get_ready();
1123
1124 timings.master_speed = 0.000001; // speed ratios for the oscillators
1125 timings.ratio[0] = 0.4; // higher values = faster transitions
1126 timings.ratio[1] = 0.32;
1127 timings.ratio[2] = 0.10;
1128 timings.ratio[3] = 0.05;
1129 timings.ratio[4] = 0.6;
1130 timings.offset[0] = 0;
1131 timings.offset[1] = 100;
1132 timings.offset[2] = 200;
1133 timings.offset[3] = 300;
1134 timings.offset[4] = 400;
1135
1136 calculate_oscillators(
1137 timings); // get linear movers and oscillators going
1138
1139 for (int x = 0; x < num_x; x++) {
1140 for (int y = 0; y < num_y; y++) {
1141
1142 // describe and render animation layers
1143 animation.dist = 0.3 * distance[x][y] * 0.8;
1144 animation.angle = 3 * polar_theta[x][y] + move.radial[2];
1145 animation.scale_x = 0.1 + (move.noise_angle[0]) / 10;
1146 animation.scale_y =
1147 0.1 + (move.noise_angle[1]) /
1148 10; // + (move.directional[1] + 2)/100;
1149 animation.scale_z = 0.01;
1150 animation.offset_y = 0;
1151 animation.offset_x = 0;
1152 animation.offset_z = 100 * move.linear[0];
1153 animation.z = 30;
1154 float show1 = render_value(animation);
1155
1156 animation.angle = 3;
1157 float show2 = render_value(animation);
1158
1159 float dist = 1; //(10-distance[x][y])/ 10;
1160 pixel.red = show1 * dist;
1161 pixel.green = (show1 - show2) * dist * 0.3;
1162 pixel.blue = (show2 - show1) * dist;
1163
1164 if (distance[x][y] > 16) {
1165 pixel.red = 0;
1166 pixel.green = 0;
1167 pixel.blue = 0;
1168 }
1169
1170 pixel = rgb_sanity_check(pixel);
1171
1172 setPixelColorInternal(y, x, pixel);
1173 }
1174 }
1175 }
1176
1177 void Yves() {
1178
1179 get_ready();
1180
1181 a = micros(); // for time measurement in report_performance()
1182
1183 timings.master_speed = 0.001; // speed ratios for the oscillators
1184 timings.ratio[0] = 3; // higher values = faster transitions
1185 timings.ratio[1] = 2;
1186 timings.ratio[2] = 1;
1187 timings.ratio[3] = 0.13;
1188 timings.ratio[4] = 0.15;
1189 timings.ratio[5] = 0.03;
1190 timings.ratio[6] = 0.025;
1191 timings.offset[0] = 0;
1192 timings.offset[1] = 100;
1193 timings.offset[2] = 200;
1194 timings.offset[3] = 300;
1195 timings.offset[4] = 400;
1196 timings.offset[5] = 500;
1197 timings.offset[6] = 600;
1198
1199 calculate_oscillators(
1200 timings); // get linear movers and oscillators going
1201
1202 for (int x = 0; x < num_x; x++) {
1203 for (int y = 0; y < num_y; y++) {
1204
1205 animation.dist = distance[x][y];
1206 animation.angle =
1207 polar_theta[x][y] + 2 * PI + move.noise_angle[5];
1208 animation.scale_x = 0.08;
1209 animation.scale_y = 0.08;
1210 animation.scale_z = 0.08;
1211 animation.offset_y = -move.linear[0];
1212 animation.offset_x = 0;
1213 animation.offset_z = 0;
1214 animation.z = 0;
1215 float show1 = render_value(animation);
1216
1217 animation.dist = distance[x][y];
1218 animation.angle =
1219 polar_theta[x][y] + 2 * PI + move.noise_angle[6];
1220 ;
1221 animation.scale_x = 0.08;
1222 animation.scale_y = 0.08;
1223 animation.scale_z = 0.08;
1224 animation.offset_y = -move.linear[1];
1225 animation.offset_x = 0;
1226 animation.offset_z = 0;
1227 animation.z = 0;
1228 float show2 = render_value(animation);
1229
1230 animation.angle = polar_theta[x][y] + show1 / 100 +
1231 move.noise_angle[3] + move.noise_angle[4];
1232 animation.dist = distance[x][y] + show2 / 50;
1233 animation.offset_y = -move.linear[2];
1234
1235 animation.offset_y += show1 / 100;
1236 animation.offset_x += show2 / 100;
1237
1238 float show3 = render_value(animation);
1239
1240 animation.offset_y = 0;
1241 animation.offset_x = 0;
1242
1243 float show4 = render_value(animation);
1244
1245 pixel.red = show3;
1246 pixel.green = show3 * show4 / 255;
1247 pixel.blue = 0;
1248
1249 pixel = rgb_sanity_check(pixel);
1250 setPixelColorInternal(y, x, pixel);
1251 }
1252 }
1253 }
1254
1255 void Spiralus() {
1256
1257 get_ready();
1258
1259 timings.master_speed = 0.0011; // speed ratios for the oscillators
1260 timings.ratio[0] = 1.5; // higher values = faster transitions
1261 timings.ratio[1] = 2.3;
1262 timings.ratio[2] = 3;
1263 timings.ratio[3] = 0.05;
1264 timings.ratio[4] = 0.2;
1265 timings.ratio[5] = 0.03;
1266 timings.ratio[6] = 0.025;
1267 timings.ratio[7] = 0.021;
1268 timings.ratio[8] = 0.027;
1269 timings.offset[0] = 0;
1270 timings.offset[1] = 100;
1271 timings.offset[2] = 200;
1272 timings.offset[3] = 300;
1273 timings.offset[4] = 400;
1274 timings.offset[5] = 500;
1275 timings.offset[6] = 600;
1276
1277 calculate_oscillators(
1278 timings); // get linear movers and oscillators going
1279
1280 for (int x = 0; x < num_x; x++) {
1281 for (int y = 0; y < num_y; y++) {
1282
1283 animation.dist = distance[x][y];
1284 animation.angle = 2 * polar_theta[x][y] + move.noise_angle[5] +
1285 move.directional[3] * move.noise_angle[6] *
1286 animation.dist / 10;
1287 animation.scale_x = 0.08;
1288 animation.scale_y = 0.08;
1289 animation.scale_z = 0.02;
1290 animation.offset_y = -move.linear[0];
1291 animation.offset_x = 0;
1292 animation.offset_z = 0;
1293 animation.z = move.linear[1];
1294 float show1 = render_value(animation);
1295
1296 animation.angle = 2 * polar_theta[x][y] + move.noise_angle[7] +
1297 move.directional[5] * move.noise_angle[8] *
1298 animation.dist / 10;
1299 animation.offset_y = -move.linear[1];
1300 animation.z = move.linear[2];
1301
1302 float show2 = render_value(animation);
1303
1304 animation.angle = 2 * polar_theta[x][y] + move.noise_angle[6] +
1305 move.directional[6] * move.noise_angle[7] *
1306 animation.dist / 10;
1307 animation.offset_y = move.linear[2];
1308 animation.z = move.linear[0];
1309 float show3 = render_value(animation);
1310
1311 float f = 1;
1312
1313 pixel.red = f * (show1 + show2);
1314 pixel.green = f * (show1 - show2);
1315 pixel.blue = f * (show3 - show1);
1316
1317 pixel = rgb_sanity_check(pixel);
1318 setPixelColorInternal(x, y, pixel);
1319 }
1320 }
1321 }
1322
1323 void Spiralus2() {
1324
1325 get_ready();
1326
1327 timings.master_speed = 0.0015; // speed ratios for the oscillators
1328 timings.ratio[0] = 1.5; // higher values = faster transitions
1329 timings.ratio[1] = 2.3;
1330 timings.ratio[2] = 3;
1331 timings.ratio[3] = 0.05;
1332 timings.ratio[4] = 0.2;
1333 timings.ratio[5] = 0.05;
1334 timings.ratio[6] = 0.055;
1335 timings.ratio[7] = 0.06;
1336 timings.ratio[8] = 0.027;
1337 timings.offset[0] = 0;
1338 timings.offset[1] = 100;
1339 timings.offset[2] = 200;
1340 timings.offset[3] = 300;
1341 timings.offset[4] = 400;
1342 timings.offset[5] = 500;
1343 timings.offset[6] = 600;
1344
1345 calculate_oscillators(
1346 timings); // get linear movers and oscillators going
1347
1348 for (int x = 0; x < num_x; x++) {
1349 for (int y = 0; y < num_y; y++) {
1350
1351 animation.dist = distance[x][y];
1352 animation.angle = 5 * polar_theta[x][y] + move.noise_angle[5] +
1353 move.directional[3] * move.noise_angle[6] *
1354 animation.dist / 10;
1355 animation.scale_x = 0.08;
1356 animation.scale_y = 0.08;
1357 animation.scale_z = 0.02;
1358 animation.offset_y = -move.linear[0];
1359 animation.offset_x = 0;
1360 animation.offset_z = 0;
1361 animation.z = move.linear[1];
1362 float show1 = render_value(animation);
1363
1364 animation.angle = 6 * polar_theta[x][y] + move.noise_angle[7] +
1365 move.directional[5] * move.noise_angle[8] *
1366 animation.dist / 10;
1367 animation.offset_y = -move.linear[1];
1368 animation.z = move.linear[2];
1369
1370 float show2 = render_value(animation);
1371
1372 animation.angle = 6 * polar_theta[x][y] + move.noise_angle[6] +
1373 move.directional[6] * move.noise_angle[7] *
1374 animation.dist / 10;
1375 animation.offset_y = move.linear[2];
1376 animation.z = move.linear[0];
1377 animation.dist = distance[x][y] * 0.8;
1378 float show3 = render_value(animation);
1379
1380 float f = 1; //(24-distance[x][y])/24;
1381
1382 pixel.red = f * (show1 + show2);
1383 pixel.green = f * (show1 - show2);
1384 pixel.blue = f * (show3 - show1);
1385
1386 pixel = rgb_sanity_check(pixel);
1387 setPixelColorInternal(y, x, pixel);
1388 }
1389 }
1390 }
1391
1392 void Hot_Blob() { // nice one
1393
1394 get_ready();
1395 run_default_oscillators(0.001);
1396
1397 for (int x = 0; x < num_x; x++) {
1398 for (int y = 0; y < num_y; y++) {
1399
1400 animation.dist = distance[x][y];
1401 animation.angle = polar_theta[x][y];
1402
1403 animation.scale_x = 0.07 + move.directional[0] * 0.002;
1404 animation.scale_y = 0.07;
1405
1406 animation.offset_y = -move.linear[0];
1407 animation.offset_x = 0;
1408 animation.offset_z = 0;
1409
1410 animation.z = 0;
1411 animation.low_limit = -1;
1412 float show1 = render_value(animation);
1413
1414 animation.offset_y = -move.linear[1];
1415 float show3 = render_value(animation);
1416
1417 animation.offset_x = show3 / 20;
1418 animation.offset_y = -move.linear[0] / 2 + show1 / 70;
1419 animation.low_limit = 0;
1420 float show2 = render_value(animation);
1421
1422 animation.offset_x = show3 / 20;
1423 animation.offset_y = -move.linear[0] / 2 + show1 / 70;
1424 animation.z = 100;
1425 float show4 = render_value(animation);
1426
1427 float radius = radial_filter_radius; // radius of a radial
1428 // brightness filter
1429 float radial = (radius - animation.dist) / animation.dist;
1430
1431 float linear = (y + 1) / (num_y - 1.f);
1432
1433 pixel.red = radial * show2;
1434 pixel.green = linear * radial * 0.3 * (show2 - show4);
1435 pixel.blue = 0;
1436
1437 pixel = rgb_sanity_check(pixel);
1438 setPixelColorInternal(x, y, pixel);
1439 }
1440 }
1441 }
1442
1443 void Zoom() { // nice one
1444
1445 get_ready();
1446
1447 run_default_oscillators();
1448 timings.master_speed = 0.003;
1449 calculate_oscillators(timings);
1450
1451 for (int x = 0; x < num_x; x++) {
1452 for (int y = 0; y < num_y; y++) {
1453
1454 animation.dist = (distance[x][y] * distance[x][y]) / 2;
1455 animation.angle = polar_theta[x][y];
1456
1457 animation.scale_x = 0.005;
1458 animation.scale_y = 0.005;
1459
1460 animation.offset_y = -10 * move.linear[0];
1461 animation.offset_x = 0;
1462 animation.offset_z = 0;
1463
1464 animation.z = 0;
1465 animation.low_limit = 0;
1466 float show1 = render_value(animation);
1467
1468 float linear = 1; //(y+1)/(num_y-1.f);
1469
1470 pixel.red = show1 * linear;
1471 pixel.green = 0;
1472 pixel.blue = 0;
1473
1474 pixel = rgb_sanity_check(pixel);
1475 setPixelColorInternal(y, x, pixel);
1476 }
1477 }
1478 }
1479
1480 void Slow_Fade() { // nice one
1481
1482 get_ready();
1483
1484 run_default_oscillators();
1485 timings.master_speed = 0.00005;
1486 calculate_oscillators(timings);
1487
1488 for (int x = 0; x < num_x; x++) {
1489 for (int y = 0; y < num_y; y++) {
1490
1491 animation.dist =
1492 sqrtf(distance[x][y]) * 0.7 * (move.directional[0] + 1.5);
1493 animation.angle =
1494 polar_theta[x][y] - move.radial[0] + distance[x][y] / 5;
1495
1496 animation.scale_x = 0.11;
1497 animation.scale_y = 0.11;
1498
1499 animation.offset_y = -50 * move.linear[0];
1500 animation.offset_x = 0;
1501 animation.offset_z = 0;
1502
1503 animation.z = move.linear[0];
1504 animation.low_limit = -0.1;
1505 animation.high_limit = 1;
1506 float show1 = render_value(animation);
1507
1508 animation.dist = animation.dist * 1.1;
1509 animation.angle += move.noise_angle[0] / 10;
1510 float show2 = render_value(animation);
1511
1512 animation.dist = animation.dist * 1.1;
1513 animation.angle += move.noise_angle[1] / 10;
1514
1515 float show3 = render_value(animation);
1516
1517 float radius = radial_filter_radius; // radius of a radial
1518 // brightness filter
1519 float radial = (radius - distance[x][y]) / distance[x][y];
1520
1521 pixel.red = radial * show1;
1522 pixel.green = radial * (show1 - show2) / 6;
1523 pixel.blue = radial * (show1 - show3) / 5;
1524
1525 pixel = rgb_sanity_check(pixel);
1526 setPixelColorInternal(y, x, pixel);
1527 }
1528 }
1529 }
1530
1531 void Polar_Waves() { // nice one
1532
1533 get_ready();
1534
1535 timings.master_speed = 0.5; // master speed
1536
1537 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1538 // values = faster transitions
1539 timings.ratio[1] = 0.0027;
1540 timings.ratio[2] = 0.0031;
1541
1542 calculate_oscillators(timings);
1543
1544 for (int x = 0; x < num_x; x++) {
1545 for (int y = 0; y < num_y; y++) {
1546
1547 animation.dist = (distance[x][y]);
1548 animation.angle =
1549 polar_theta[x][y] - animation.dist * 0.1 + move.radial[0];
1550 animation.z = (animation.dist * 1.5) - 10 * move.linear[0];
1551 animation.scale_x = 0.15;
1552 animation.scale_y = 0.15;
1553 animation.offset_x = move.linear[0];
1554
1555 float show1 = render_value(animation);
1556 animation.angle =
1557 polar_theta[x][y] - animation.dist * 0.1 + move.radial[1];
1558 animation.z = (animation.dist * 1.5) - 10 * move.linear[1];
1559 animation.offset_x = move.linear[1];
1560
1561 float show2 = render_value(animation);
1562 animation.angle =
1563 polar_theta[x][y] - animation.dist * 0.1 + move.radial[2];
1564 animation.z = (animation.dist * 1.5) - 10 * move.linear[2];
1565 animation.offset_x = move.linear[2];
1566
1567 float show3 = render_value(animation);
1568
1569 float radius = radial_filter_radius; // radius of a radial
1570 // brightness filter
1571 float radial = (radius - distance[x][y]) / distance[x][y];
1572
1573 pixel.red = radial * show1;
1574 pixel.green = radial * show2;
1575 pixel.blue = radial * show3;
1576
1577 pixel = rgb_sanity_check(pixel);
1578 setPixelColorInternal(y, x, pixel);
1579 }
1580 }
1581 }
1582
1583 void RGB_Blobs() { // nice one
1584
1585 get_ready();
1586
1587 timings.master_speed = 0.2; // master speed
1588
1589 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1590 // values = faster transitions
1591 timings.ratio[1] = 0.0027;
1592 timings.ratio[2] = 0.0031;
1593 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
1594 // values = faster transitions
1595 timings.ratio[4] = 0.0036;
1596 timings.ratio[5] = 0.0039;
1597
1598 calculate_oscillators(timings);
1599
1600 for (int x = 0; x < num_x; x++) {
1601 for (int y = 0; y < num_y; y++) {
1602
1603 animation.dist = distance[x][y];
1604 animation.angle = polar_theta[x][y] + move.radial[0] +
1605 move.noise_angle[0] + move.noise_angle[3];
1606 animation.z = (sqrtf(animation.dist)); // - 10 * move.linear[0];
1607 animation.scale_x = 0.1;
1608 animation.scale_y = 0.1;
1609 animation.offset_z = 10;
1610 animation.offset_x = 10 * move.linear[0];
1611 float show1 = render_value(animation);
1612
1613 animation.angle = polar_theta[x][y] + move.radial[1] +
1614 move.noise_angle[1] + move.noise_angle[4];
1615 animation.offset_x = 11 * move.linear[1];
1616 animation.offset_z = 100;
1617 float show2 = render_value(animation);
1618
1619 animation.angle = polar_theta[x][y] + move.radial[2] +
1620 move.noise_angle[2] + move.noise_angle[5];
1621 animation.offset_x = 12 * move.linear[2];
1622 animation.offset_z = 300;
1623 float show3 = render_value(animation);
1624
1625 float radius = radial_filter_radius; // radius of a radial
1626 // brightness filter
1627 float radial = (radius - distance[x][y]) / distance[x][y];
1628
1629 pixel.red = radial * show1;
1630 pixel.green = radial * show2;
1631 pixel.blue = radial * show3;
1632
1633 pixel = rgb_sanity_check(pixel);
1634 setPixelColorInternal(x, y, pixel);
1635 }
1636 }
1637 }
1638
1639 void RGB_Blobs2() { // nice one
1640
1641 get_ready();
1642
1643 timings.master_speed = 0.12; // master speed
1644
1645 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1646 // values = faster transitions
1647 timings.ratio[1] = 0.0027;
1648 timings.ratio[2] = 0.0031;
1649 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
1650 // values = faster transitions
1651 timings.ratio[4] = 0.0036;
1652 timings.ratio[5] = 0.0039;
1653
1654 calculate_oscillators(timings);
1655
1656 for (int x = 0; x < num_x; x++) {
1657 for (int y = 0; y < num_y; y++) {
1658
1659 animation.dist = distance[x][y];
1660 animation.angle = polar_theta[x][y] + move.radial[0] +
1661 move.noise_angle[0] + move.noise_angle[3] +
1662 move.noise_angle[1];
1663 animation.z = (sqrtf(animation.dist)); // - 10 * move.linear[0];
1664 animation.scale_x = 0.1;
1665 animation.scale_y = 0.1;
1666 animation.offset_z = 10;
1667 animation.offset_x = 10 * move.linear[0];
1668 float show1 = render_value(animation);
1669
1670 animation.angle = polar_theta[x][y] + move.radial[1] +
1671 move.noise_angle[1] + move.noise_angle[4] +
1672 move.noise_angle[2];
1673 animation.offset_x = 11 * move.linear[1];
1674 animation.offset_z = 100;
1675 float show2 = render_value(animation);
1676
1677 animation.angle = polar_theta[x][y] + move.radial[2] +
1678 move.noise_angle[2] + move.noise_angle[5] +
1679 move.noise_angle[3];
1680 animation.offset_x = 12 * move.linear[2];
1681 animation.offset_z = 300;
1682 float show3 = render_value(animation);
1683
1684 float radius = radial_filter_radius; // radius of a radial
1685 // brightness filter
1686 float radial = (radius - distance[x][y]) / distance[x][y];
1687
1688 pixel.red = radial * (show1 - show3);
1689 pixel.green = radial * (show2 - show1);
1690 pixel.blue = radial * (show3 - show2);
1691
1692 pixel = rgb_sanity_check(pixel);
1693 setPixelColorInternal(x, y, pixel);
1694 }
1695 }
1696 }
1697
1698 void RGB_Blobs3() { // nice one
1699
1700 get_ready();
1701
1702 timings.master_speed = 0.12; // master speed
1703
1704 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1705 // values = faster transitions
1706 timings.ratio[1] = 0.0027;
1707 timings.ratio[2] = 0.0031;
1708 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
1709 // values = faster transitions
1710 timings.ratio[4] = 0.0036;
1711 timings.ratio[5] = 0.0039;
1712
1713 calculate_oscillators(timings);
1714
1715 for (int x = 0; x < num_x; x++) {
1716 for (int y = 0; y < num_y; y++) {
1717
1718 animation.dist = distance[x][y] + move.noise_angle[4];
1719 animation.angle = polar_theta[x][y] + move.radial[0] +
1720 move.noise_angle[0] + move.noise_angle[3] +
1721 move.noise_angle[1];
1722 animation.z = (sqrtf(animation.dist)); // - 10 * move.linear[0];
1723 animation.scale_x = 0.1;
1724 animation.scale_y = 0.1;
1725 animation.offset_z = 10;
1726 animation.offset_x = 10 * move.linear[0];
1727 float show1 = render_value(animation);
1728
1729 animation.angle = polar_theta[x][y] + move.radial[1] +
1730 move.noise_angle[1] + move.noise_angle[4] +
1731 move.noise_angle[2];
1732 animation.offset_x = 11 * move.linear[1];
1733 animation.offset_z = 100;
1734 float show2 = render_value(animation);
1735
1736 animation.angle = polar_theta[x][y] + move.radial[2] +
1737 move.noise_angle[2] + move.noise_angle[5] +
1738 move.noise_angle[3];
1739 animation.offset_x = 12 * move.linear[2];
1740 animation.offset_z = 300;
1741 float show3 = render_value(animation);
1742
1743 float radius = radial_filter_radius; // radius of a radial
1744 // brightness filter
1745 float radial = (radius - distance[x][y]) / distance[x][y];
1746
1747 pixel.red = radial * (show1 + show3) * 0.5 * animation.dist / 5;
1748 pixel.green = radial * (show2 + show1) * 0.5 * y / 15;
1749 pixel.blue = radial * (show3 + show2) * 0.5 * x / 15;
1750
1751 pixel = rgb_sanity_check(pixel);
1752 setPixelColorInternal(y, x, pixel);
1753 }
1754 }
1755 }
1756
1757 void RGB_Blobs4() { // nice one
1758
1759 get_ready();
1760
1761 timings.master_speed = 0.02; // master speed
1762
1763 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1764 // values = faster transitions
1765 timings.ratio[1] = 0.0027;
1766 timings.ratio[2] = 0.0031;
1767 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
1768 // values = faster transitions
1769 timings.ratio[4] = 0.0036;
1770 timings.ratio[5] = 0.0039;
1771
1772 calculate_oscillators(timings);
1773
1774 for (int x = 0; x < num_x; x++) {
1775 for (int y = 0; y < num_y; y++) {
1776
1777 animation.dist = distance[x][y] + move.noise_angle[4];
1778 animation.angle = polar_theta[x][y] + move.radial[0] +
1779 move.noise_angle[0] + move.noise_angle[3] +
1780 move.noise_angle[1];
1781 animation.z = 3 + sqrtf(animation.dist);
1782 animation.scale_x = 0.1;
1783 animation.scale_y = 0.1;
1784 animation.offset_z = 10;
1785 animation.offset_x = 50 * move.linear[0];
1786 float show1 = render_value(animation);
1787
1788 animation.angle = polar_theta[x][y] + move.radial[1] +
1789 move.noise_angle[1] + move.noise_angle[4] +
1790 move.noise_angle[2];
1791 animation.offset_x = 50 * move.linear[1];
1792 animation.offset_z = 100;
1793 float show2 = render_value(animation);
1794
1795 animation.angle = polar_theta[x][y] + move.radial[2] +
1796 move.noise_angle[2] + move.noise_angle[5] +
1797 move.noise_angle[3];
1798 animation.offset_x = 50 * move.linear[2];
1799 animation.offset_z = 300;
1800 float show3 = render_value(animation);
1801
1802 float radius = 23; // radius of a radial brightness filter
1803 float radial = (radius - distance[x][y]) / distance[x][y];
1804
1805 pixel.red = radial * (show1 + show3) * 0.5 * animation.dist / 5;
1806 pixel.green = radial * (show2 + show1) * 0.5 * y / 15;
1807 pixel.blue = radial * (show3 + show2) * 0.5 * x / 15;
1808
1809 pixel = rgb_sanity_check(pixel);
1810 setPixelColorInternal(y, x, pixel);
1811 }
1812 }
1813 }
1814
1815 void RGB_Blobs5() { // nice one
1816
1817 get_ready();
1818
1819 timings.master_speed = 0.02; // master speed
1820
1821 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1822 // values = faster transitions
1823 timings.ratio[1] = 0.0027;
1824 timings.ratio[2] = 0.0031;
1825 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
1826 // values = faster transitions
1827 timings.ratio[4] = 0.0036;
1828 timings.ratio[5] = 0.0039;
1829
1830 calculate_oscillators(timings);
1831
1832 for (int x = 0; x < num_x; x++) {
1833 for (int y = 0; y < num_y; y++) {
1834
1835 animation.dist = distance[x][y] + move.noise_angle[4];
1836 animation.angle = polar_theta[x][y] + move.radial[0] +
1837 move.noise_angle[0] + move.noise_angle[3] +
1838 move.noise_angle[1];
1839 animation.z = 3 + sqrtf(animation.dist);
1840 animation.scale_x = 0.05;
1841 animation.scale_y = 0.05;
1842 animation.offset_z = 10;
1843 animation.offset_x = 50 * move.linear[0];
1844 float show1 = render_value(animation);
1845
1846 animation.angle = polar_theta[x][y] + move.radial[1] +
1847 move.noise_angle[1] + move.noise_angle[4] +
1848 move.noise_angle[2];
1849 animation.offset_x = 50 * move.linear[1];
1850 animation.offset_z = 100;
1851 float show2 = render_value(animation);
1852
1853 animation.angle = polar_theta[x][y] + move.radial[2] +
1854 move.noise_angle[2] + move.noise_angle[5] +
1855 move.noise_angle[3];
1856 animation.offset_x = 50 * move.linear[2];
1857 animation.offset_z = 300;
1858 float show3 = render_value(animation);
1859
1860 float radius = 23; // radius of a radial brightness filter
1861 float radial = (radius - distance[x][y]) / distance[x][y];
1862
1863 pixel.red = radial * (show1 + show3) * 0.5 * animation.dist / 5;
1864 pixel.green = radial * (show2 + show1) * 0.5 * y / 15;
1865 pixel.blue = radial * (show3 + show2) * 0.5 * x / 15;
1866
1867 pixel = rgb_sanity_check(pixel);
1868
1869 setPixelColorInternal(y, x, pixel);
1870 }
1871 }
1872 }
1873
1874 void Big_Caleido() { // nice one
1875
1876 get_ready();
1877
1878 timings.master_speed = 0.02; // master speed
1879
1880 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1881 // values = faster transitions
1882 timings.ratio[1] = 0.0027;
1883 timings.ratio[2] = 0.0031;
1884 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
1885 // values = faster transitions
1886 timings.ratio[4] = 0.0036;
1887 timings.ratio[5] = 0.0039;
1888
1889 calculate_oscillators(timings);
1890
1891 for (int x = 0; x < num_x; x++) {
1892 for (int y = 0; y < num_y; y++) {
1893
1894 animation.dist = distance[x][y];
1895 animation.angle = 5 * polar_theta[x][y] +
1896 5 * move.noise_angle[0] +
1897 animation.dist * 0.1;
1898 animation.z = 5;
1899 animation.scale_x = 0.05;
1900 animation.scale_y = 0.05;
1901 animation.offset_z = 50 * move.linear[0];
1902 animation.offset_x = 50 * move.noise_angle[0];
1903 animation.offset_y = 50 * move.noise_angle[1];
1904 float show1 = render_value(animation);
1905
1906 animation.angle = 6 * polar_theta[x][y] +
1907 5 * move.noise_angle[1] +
1908 animation.dist * 0.15;
1909 animation.z = 5;
1910 animation.scale_x = 0.05;
1911 animation.scale_y = 0.05;
1912 animation.offset_z = 50 * move.linear[1];
1913 animation.offset_x = 50 * move.noise_angle[1];
1914 animation.offset_y = 50 * move.noise_angle[2];
1915 float show2 = render_value(animation);
1916
1917 animation.angle = 5;
1918 animation.z = 5;
1919 animation.scale_x = 0.10;
1920 animation.scale_y = 0.10;
1921 animation.offset_z = 10 * move.linear[2];
1922 animation.offset_x = 10 * move.noise_angle[2];
1923 animation.offset_y = 10 * move.noise_angle[3];
1924 float show3 = render_value(animation);
1925
1926 animation.angle = 15;
1927 animation.z = 15;
1928 animation.scale_x = 0.10;
1929 animation.scale_y = 0.10;
1930 animation.offset_z = 10 * move.linear[3];
1931 animation.offset_x = 10 * move.noise_angle[3];
1932 animation.offset_y = 10 * move.noise_angle[4];
1933 float show4 = render_value(animation);
1934
1935 animation.angle = 2;
1936 animation.z = 15;
1937 animation.scale_x = 0.15;
1938 animation.scale_y = 0.15;
1939 animation.offset_z = 10 * move.linear[4];
1940 animation.offset_x = 10 * move.noise_angle[4];
1941 animation.offset_y = 10 * move.noise_angle[5];
1942 float show5 = render_value(animation);
1943
1944 pixel.red = show1 - show4;
1945 pixel.green = show2 - show5;
1946 pixel.blue = show3 - show2 + show1;
1947
1948 pixel = rgb_sanity_check(pixel);
1949
1950 setPixelColorInternal(y, x, pixel);
1951 }
1952 }
1953 // show_frame();
1954 }
1955
1956 void SM1() { // nice one
1957
1958 get_ready();
1959
1960 timings.master_speed = 0.02; // master speed
1961
1962 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1963 // values = faster transitions
1964 timings.ratio[1] = 0.0027;
1965 timings.ratio[2] = 0.0031;
1966 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
1967 // values = faster transitions
1968 timings.ratio[4] = 0.0036;
1969 timings.ratio[5] = 0.0039;
1970
1971 calculate_oscillators(timings);
1972
1973 for (int x = 0; x < num_x / 2; x++) {
1974 for (int y = 0; y < num_y / 2; y++) {
1975
1976 animation.dist = distance[x][y];
1977 animation.angle = polar_theta[x][y] + 5 * move.noise_angle[0];
1978 animation.z = 5;
1979 animation.scale_x = 0.1;
1980 animation.scale_y = 0.1;
1981 animation.offset_z = 50 * move.linear[0];
1982 animation.offset_x = 150 * move.directional[0];
1983 animation.offset_y = 150 * move.directional[1];
1984 float show1 = render_value(animation);
1985
1986 animation.dist = distance[x][y];
1987 animation.angle = polar_theta[x][y] + 4 * move.noise_angle[1];
1988 animation.z = 15;
1989 animation.scale_x = 0.15;
1990 animation.scale_y = 0.15;
1991 animation.offset_z = 50 * move.linear[1];
1992 animation.offset_x = 150 * move.directional[1];
1993 animation.offset_y = 150 * move.directional[2];
1994 float show2 = render_value(animation);
1995
1996 animation.dist = distance[x][y];
1997 animation.angle = polar_theta[x][y] + 5 * move.noise_angle[2];
1998 animation.z = 25;
1999 animation.scale_x = 0.1;
2000 animation.scale_y = 0.1;
2001 animation.offset_z = 50 * move.linear[2];
2002 animation.offset_x = 150 * move.directional[2];
2003 animation.offset_y = 150 * move.directional[3];
2004 float show3 = render_value(animation);
2005
2006 animation.dist = distance[x][y];
2007 animation.angle = polar_theta[x][y] + 5 * move.noise_angle[3];
2008 animation.z = 35;
2009 animation.scale_x = 0.15;
2010 animation.scale_y = 0.15;
2011 animation.offset_z = 50 * move.linear[3];
2012 animation.offset_x = 150 * move.directional[3];
2013 animation.offset_y = 150 * move.directional[4];
2014 float show4 = render_value(animation);
2015
2016 animation.dist = distance[x][y];
2017 animation.angle = polar_theta[x][y] + 5 * move.noise_angle[4];
2018 animation.z = 45;
2019 animation.scale_x = 0.2;
2020 animation.scale_y = 0.2;
2021 animation.offset_z = 50 * move.linear[4];
2022 animation.offset_x = 150 * move.directional[4];
2023 animation.offset_y = 150 * move.directional[5];
2024 float show5 = render_value(animation);
2025
2026 pixel.red = show1 + show2;
2027 pixel.green = show3 + show4;
2028 pixel.blue = show5;
2029
2030 pixel = rgb_sanity_check(pixel);
2031 // leds[xyMap(x, y)] = CRGB(pixel.red, pixel.green, pixel.blue);
2032 setPixelColorInternal(x, y, pixel);
2033
2034 setPixelColorInternal((num_x - 1) - x, y, pixel);
2035 setPixelColorInternal((num_x - 1) - x, (num_y - 1) - y, pixel);
2036 setPixelColorInternal(x, (num_y - 1) - y, pixel);
2037 }
2038 }
2039 // show_frame();
2040 }
2041
2042 void SM2() {
2043
2044 get_ready();
2045
2046 timings.master_speed = 0.03; // master speed
2047
2048 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2049 // values = faster transitions
2050 timings.ratio[1] = 0.027;
2051 timings.ratio[2] = 0.031;
2052 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
2053 // values = faster transitions
2054 timings.ratio[4] = 0.0036;
2055 timings.ratio[5] = 0.0039;
2056
2057 calculate_oscillators(timings);
2058
2059 for (int x = 0; x < num_x; x++) {
2060 for (int y = 0; y < num_y; y++) {
2061
2062 animation.dist = distance[x][y] * (move.directional[0]);
2063 animation.angle = polar_theta[x][y] + move.radial[0];
2064 animation.z = 5;
2065 animation.scale_x = 0.09;
2066 animation.scale_y = 0.09;
2067 animation.offset_z = 5 * move.linear[0];
2068 animation.offset_x = 0;
2069 animation.offset_y = 0;
2070 float show1 = render_value(animation);
2071
2072 animation.dist = distance[x][y] * move.directional[1];
2073 animation.angle = polar_theta[x][y] + move.radial[1];
2074 animation.z = 50;
2075 animation.scale_x = 0.07;
2076 animation.scale_y = 0.07;
2077 animation.offset_z = 5 * move.linear[1];
2078 animation.offset_x = 0;
2079 animation.offset_y = 0;
2080 float show2 = render_value(animation);
2081
2082 animation.dist = distance[x][y] * move.directional[2];
2083 animation.angle = polar_theta[x][y] + move.radial[2];
2084 animation.z = 500;
2085 animation.scale_x = 0.05;
2086 animation.scale_y = 0.05;
2087 animation.offset_z = 5 * move.linear[2];
2088 animation.offset_x = 0;
2089 animation.offset_y = 0;
2090 float show3 = render_value(animation);
2091
2092 pixel.red = show1;
2093 pixel.green = show2;
2094 pixel.blue = show3;
2095
2096 pixel = rgb_sanity_check(pixel);
2097
2098 setPixelColorInternal(x, y, pixel);
2099 }
2100 }
2101 // show_frame();
2102 }
2103
2104 void SM3() {
2105
2106 get_ready();
2107
2108 timings.master_speed = 0.02; // master speed
2109
2110 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2111 // values = faster transitions
2112 timings.ratio[1] = 0.027;
2113 timings.ratio[2] = 0.031;
2114 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
2115 // values = faster transitions
2116 timings.ratio[4] = 0.0036;
2117 timings.ratio[5] = 0.0039;
2118
2119 calculate_oscillators(timings);
2120
2121 for (int x = 0; x < num_x; x++) {
2122 for (int y = 0; y < num_y; y++) {
2123
2124 animation.dist = distance[x][y];
2125 animation.angle = polar_theta[x][y];
2126 animation.z = 5;
2127 animation.scale_x = 0.09;
2128 animation.scale_y = 0.09;
2129 animation.offset_z = 0;
2130 animation.offset_x = 0;
2131 animation.offset_y = -20 * move.linear[0];
2132 ;
2133 animation.low_limit = -1;
2134 animation.high_limit = 1;
2135 show1 = render_value(animation);
2136
2137 animation.dist = distance[x][y];
2138 animation.angle = polar_theta[x][y];
2139 animation.z = 500;
2140 animation.scale_x = 0.09;
2141 animation.scale_y = 0.09;
2142 animation.offset_z = 0;
2143 animation.offset_x = 0;
2144 animation.offset_y = -20 * move.linear[0];
2145 ;
2146 animation.low_limit = -1;
2147 animation.high_limit = 1;
2148 show2 = render_value(animation);
2149
2150 animation.dist = distance[x][y];
2151 animation.angle = polar_theta[x][y];
2152 animation.z = 50;
2153 animation.scale_x = 0.09;
2154 animation.scale_y = 0.09;
2155 animation.offset_z = 0;
2156 animation.offset_x = 500 + show1 / 20;
2157 animation.offset_y = -4 * move.linear[0] + show2 / 20;
2158 animation.low_limit = 0;
2159 animation.high_limit = 1;
2160 show3 = render_value(animation);
2161
2162 animation.dist = distance[x][y];
2163 animation.angle = polar_theta[x][y];
2164 animation.z = 50;
2165 animation.scale_x = 0.09;
2166 animation.scale_y = 0.09;
2167 animation.offset_z = 0;
2168 animation.offset_x = 500 + show1 / 18;
2169 animation.offset_y = -4 * move.linear[0] + show2 / 18;
2170 animation.low_limit = 0;
2171 animation.high_limit = 1;
2172 show4 = render_value(animation);
2173
2174 animation.dist = distance[x][y];
2175 animation.angle = polar_theta[x][y];
2176 animation.z = 50;
2177 animation.scale_x = 0.09;
2178 animation.scale_y = 0.09;
2179 animation.offset_z = 0;
2180 animation.offset_x = 500 + show1 / 19;
2181 animation.offset_y = -4 * move.linear[0] + show2 / 19;
2182 animation.low_limit = 0.3;
2183 animation.high_limit = 1;
2184 show5 = render_value(animation);
2185
2186 pixel.red = show4;
2187 pixel.green = show3;
2188 pixel.blue = show5;
2189
2190 pixel = rgb_sanity_check(pixel);
2191
2192 setPixelColorInternal(x, y, pixel);
2193 }
2194 }
2195 }
2196
2197 void SM4() {
2198
2199 get_ready();
2200
2201 timings.master_speed = 0.02; // master speed
2202
2203 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2204 // values = faster transitions
2205 timings.ratio[1] = 0.027;
2206 timings.ratio[2] = 0.031;
2207 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
2208 // values = faster transitions
2209 timings.ratio[4] = 0.0036;
2210 timings.ratio[5] = 0.0039;
2211
2212 calculate_oscillators(timings);
2213
2214 for (int x = 0; x < num_x; x++) {
2215 for (int y = 0; y < num_y; y++) {
2216
2217 animation.dist = distance[x][y];
2218 animation.angle = polar_theta[x][y];
2219 animation.z = 5;
2220 animation.scale_x = 0.09;
2221 animation.scale_y = 0.09;
2222 animation.offset_z = 0;
2223 animation.offset_x = 0;
2224 animation.offset_y = -20 * move.linear[0];
2225 ;
2226 animation.low_limit = 0;
2227 animation.high_limit = 1;
2228 show1 = render_value(animation);
2229
2230 animation.dist = distance[x][y];
2231 animation.angle = polar_theta[x][y];
2232 animation.z = 500;
2233 animation.scale_x = 0.09;
2234 animation.scale_y = 0.09;
2235 animation.offset_z = 0;
2236 animation.offset_x = 0;
2237 animation.offset_y = -40 * move.linear[0];
2238 ;
2239 animation.low_limit = 0;
2240 animation.high_limit = 1;
2241 show2 = render_value(animation);
2242
2243 pixel.red = add(show2, show1);
2244 pixel.green = 0;
2245 pixel.blue = colordodge(show2, show1);
2246
2247 pixel = rgb_sanity_check(pixel);
2248
2249 setPixelColorInternal(x, y, pixel);
2250 }
2251 }
2252 }
2253
2254 void SM5() {
2255
2256 get_ready();
2257
2258 timings.master_speed = 0.03; // master speed
2259
2260 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2261 // values = faster transitions
2262 timings.ratio[1] = 0.027;
2263 timings.ratio[2] = 0.031;
2264 timings.ratio[3] = 0.0053; // speed ratios for the oscillators, higher
2265 // values = faster transitions
2266 timings.ratio[4] = 0.0056;
2267 timings.ratio[5] = 0.0059;
2268
2269 calculate_oscillators(timings);
2270
2271 for (int x = 0; x < num_x; x++) {
2272 for (int y = 0; y < num_y; y++) {
2273
2274 animation.dist = distance[x][y] * (move.directional[0]);
2275 animation.angle = polar_theta[x][y] + move.radial[0];
2276 animation.z = 5;
2277 animation.scale_x = 0.09;
2278 animation.scale_y = 0.09;
2279 animation.offset_z = 5 * move.linear[0];
2280 animation.offset_x = 0;
2281 animation.offset_y = 0;
2282 float show1 = render_value(animation);
2283
2284 animation.dist = distance[x][y] * move.directional[1];
2285 animation.angle = polar_theta[x][y] + move.radial[1];
2286 animation.z = 50;
2287 animation.scale_x = 0.07;
2288 animation.scale_y = 0.07;
2289 animation.offset_z = 5 * move.linear[1];
2290 animation.offset_x = 0;
2291 animation.offset_y = 0;
2292 float show2 = render_value(animation);
2293
2294 animation.dist = distance[x][y] * move.directional[2];
2295 animation.angle = polar_theta[x][y] + move.radial[2];
2296 animation.z = 500;
2297 animation.scale_x = 0.05;
2298 animation.scale_y = 0.05;
2299 animation.offset_z = 5 * move.linear[2];
2300 animation.offset_x = 0;
2301 animation.offset_y = 0;
2302 float show3 = render_value(animation);
2303
2304 animation.dist = distance[x][y] * (move.directional[3]);
2305 animation.angle = polar_theta[x][y] + move.radial[3];
2306 animation.z = 5;
2307 animation.scale_x = 0.09;
2308 animation.scale_y = 0.09;
2309 animation.offset_z = 5 * move.linear[3];
2310 animation.offset_x = 0;
2311 animation.offset_y = 0;
2312 float show4 = render_value(animation);
2313
2314 animation.dist = distance[x][y] * move.directional[4];
2315 animation.angle = polar_theta[x][y] + move.radial[4];
2316 animation.z = 50;
2317 animation.scale_x = 0.07;
2318 animation.scale_y = 0.07;
2319 animation.offset_z = 5 * move.linear[4];
2320 animation.offset_x = 0;
2321 animation.offset_y = 0;
2322 float show5 = render_value(animation);
2323
2324 animation.dist = distance[x][y] * move.directional[5];
2325 animation.angle = polar_theta[x][y] + move.radial[5];
2326 animation.z = 500;
2327 animation.scale_x = 0.05;
2328 animation.scale_y = 0.05;
2329 animation.offset_z = 5 * move.linear[5];
2330 animation.offset_x = 0;
2331 animation.offset_y = 0;
2332 float show6 = render_value(animation);
2333
2334 float radius = radial_filter_radius; // radius of a radial
2335 // brightness filter
2336 float radial = (radius - distance[x][y]) / distance[x][y];
2337
2338 pixel.red = radial * add(show1, show4);
2339 pixel.green = radial * colordodge(show2, show5);
2340 pixel.blue = radial * screen(show3, show6);
2341
2342 pixel = rgb_sanity_check(pixel);
2343
2344 setPixelColorInternal(x, y, pixel);
2345 }
2346 }
2347 }
2348
2349 void SM6() {
2350
2351 get_ready();
2352
2353 timings.master_speed = 0.03; // master speed
2354
2355 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2356 // values = faster transitions
2357 timings.ratio[1] = 0.027;
2358 timings.ratio[2] = 0.031;
2359 timings.ratio[3] = 0.0053; // speed ratios for the oscillators, higher
2360 // values = faster transitions
2361 timings.ratio[4] = 0.0056;
2362 timings.ratio[5] = 0.0059;
2363
2364 calculate_oscillators(timings);
2365
2366 for (int x = 0; x < num_x; x++) {
2367 for (int y = 0; y < num_y; y++) {
2368
2369 float s = 0.7; // zoom factor
2370
2371 animation.dist = distance[x][y] * (move.directional[0]) * s;
2372 animation.angle = polar_theta[x][y] + move.radial[0];
2373 animation.z = 5;
2374 animation.scale_x = 0.09;
2375 animation.scale_y = 0.09;
2376 animation.offset_z = 5 * move.linear[0];
2377 animation.offset_x = 0;
2378 animation.offset_y = 0;
2379 float show1 = render_value(animation);
2380
2381 animation.dist = distance[x][y] * move.directional[1] * s;
2382 animation.angle = polar_theta[x][y] + move.radial[1];
2383 animation.z = 50;
2384 animation.scale_x = 0.07;
2385 animation.scale_y = 0.07;
2386 animation.offset_z = 5 * move.linear[1];
2387 animation.offset_x = 0;
2388 animation.offset_y = 0;
2389 float show2 = render_value(animation);
2390
2391 animation.dist = distance[x][y] * move.directional[2] * s;
2392 animation.angle = polar_theta[x][y] + move.radial[2];
2393 animation.z = 500;
2394 animation.scale_x = 0.05;
2395 animation.scale_y = 0.05;
2396 animation.offset_z = 5 * move.linear[2];
2397 animation.offset_x = 0;
2398 animation.offset_y = 0;
2399 float show3 = render_value(animation);
2400
2401 animation.dist = distance[x][y] * (move.directional[3]) * s;
2402 animation.angle = polar_theta[x][y] + move.radial[3];
2403 animation.z = 5;
2404 animation.scale_x = 0.09;
2405 animation.scale_y = 0.09;
2406 animation.offset_z = 5 * move.linear[3];
2407 animation.offset_x = 0;
2408 animation.offset_y = 0;
2409 float show4 = render_value(animation);
2410
2411 animation.dist = distance[x][y] * move.directional[4] * s;
2412 animation.angle = polar_theta[x][y] + move.radial[4];
2413 animation.z = 50;
2414 animation.scale_x = 0.07;
2415 animation.scale_y = 0.07;
2416 animation.offset_z = 5 * move.linear[4];
2417 animation.offset_x = 0;
2418 animation.offset_y = 0;
2419 float show5 = render_value(animation);
2420
2421 animation.dist = distance[x][y] * move.directional[5] * s;
2422 animation.angle = polar_theta[x][y] + move.radial[5];
2423 animation.z = 500;
2424 animation.scale_x = 0.05;
2425 animation.scale_y = 0.05;
2426 animation.offset_z = 5 * move.linear[5];
2427 animation.offset_x = 0;
2428 animation.offset_y = 0;
2429 float show6 = render_value(animation);
2430
2431 float radius = radial_filter_radius; // radius of a radial
2432 // brightness filter
2433 float radial = (radius - distance[x][y]) / distance[x][y];
2434
2435 show7 = screen(show1, show4);
2436 show8 = colordodge(show2, show5);
2437 show9 = screen(show3, show6);
2438
2439 pixel.red = radial * (show7 + show8);
2440 pixel.green = 0;
2441 pixel.blue = radial * show9;
2442
2443 pixel = rgb_sanity_check(pixel);
2444
2445 setPixelColorInternal(x, y, pixel);
2446 }
2447 }
2448 }
2449
2450 void SM8() {
2451
2452 get_ready();
2453
2454 timings.master_speed = 0.005; // master speed
2455
2456 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2457 // values = faster transitions
2458 timings.ratio[1] = 0.027;
2459 timings.ratio[2] = 0.031;
2460 timings.ratio[3] = 0.0053; // speed ratios for the oscillators, higher
2461 // values = faster transitions
2462 timings.ratio[4] = 0.0056;
2463 timings.ratio[5] = 0.01; // original Reddit post had no radial movement!
2464
2465 calculate_oscillators(timings);
2466
2467 for (int x = 0; x < num_x; x++) {
2468 for (int y = 0; y < num_y; y++) {
2469
2470 // float s = 0.7; // zoom factor
2471
2472 animation.dist = distance[x][y];
2473 animation.angle = 2;
2474 animation.z = 5;
2475 animation.scale_x = 0.15;
2476 animation.scale_y = 0.15;
2477 animation.offset_z = 0;
2478 animation.offset_y = 50 * move.linear[0];
2479 animation.offset_x = 0;
2480 animation.low_limit = 0;
2481 float show1 = render_value(animation);
2482
2483 animation.dist = distance[x][y];
2484 animation.angle = 2;
2485 animation.z = 150;
2486 animation.offset_x = -50 * move.linear[0];
2487 float show2 = render_value(animation);
2488
2489 animation.dist = distance[x][y];
2490 animation.angle = 1;
2491 animation.z = 550;
2492 animation.scale_x = 0.15;
2493 animation.scale_y = 0.15;
2494 animation.offset_x = 0;
2495 animation.offset_y = -50 * move.linear[1];
2496 float show4 = render_value(animation);
2497
2498 animation.dist = distance[x][y];
2499 animation.angle = 1;
2500 animation.z = 1250;
2501 animation.scale_x = 0.15;
2502 animation.scale_y = 0.15;
2503 animation.offset_x = 0;
2504 animation.offset_y = 50 * move.linear[1];
2505 float show5 = render_value(animation);
2506
2507 // float radius = radial_filter_radius; // radius of a radial
2508 // brightness filter float radial =
2509 // (radius-distance[x][y])/distance[x][y];
2510
2511 show3 = add(show1, show2);
2512 show6 = screen(show4, show5);
2513 // show9 = screen(show3, show6);
2514
2515 pixel.red = show3;
2516 pixel.green = 0;
2517 pixel.blue = show6;
2518
2519 pixel = rgb_sanity_check(pixel);
2520
2521 setPixelColorInternal(x, y, pixel);
2522 }
2523 }
2524 }
2525
2526 void SM9() {
2527
2528 get_ready();
2529
2530 timings.master_speed = 0.005; // master speed
2531
2532 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2533 // values = faster transitions
2534 timings.ratio[1] = 0.027;
2535 timings.ratio[2] = 0.031;
2536 timings.ratio[3] = 0.0053; // speed ratios for the oscillators, higher
2537 // values = faster transitions
2538 timings.ratio[4] = 0.0056;
2539 timings.ratio[5] = 0.0059;
2540
2541 calculate_oscillators(timings);
2542
2543 for (int x = 0; x < num_x; x++) {
2544 for (int y = 0; y < num_y; y++) {
2545
2546 animation.dist = distance[x][y];
2547 animation.angle = polar_theta[x][y];
2548 animation.z = 5;
2549 animation.scale_x = 0.09;
2550 animation.scale_y = 0.09;
2551 animation.offset_y = -30 * move.linear[0];
2552 animation.offset_z = 0;
2553 animation.offset_x = 0;
2554 animation.low_limit = -1;
2555 show1 = render_value(animation);
2556
2557 animation.dist = distance[x][y];
2558 animation.angle = polar_theta[x][y];
2559 animation.z = 50;
2560 animation.scale_x = 0.09;
2561 animation.scale_y = 0.09;
2562 animation.offset_y = -30 * move.linear[1];
2563 animation.offset_z = 0;
2564 animation.offset_x = 0;
2565 animation.low_limit = -1;
2566 show2 = render_value(animation);
2567
2568 animation.dist = distance[x][y]; // + show1/64;
2569 animation.angle = polar_theta[x][y] + 2 + (show1 / 255) * PI;
2570 animation.z = 5;
2571 animation.scale_x = 0.09;
2572 animation.scale_y = 0.09;
2573 animation.offset_y = -10 * move.linear[0];
2574 animation.offset_z = 0;
2575 animation.offset_x = 0;
2576 animation.low_limit = 0;
2577 show3 = render_value(animation);
2578
2579 animation.dist = distance[x][y];
2580 animation.angle = polar_theta[x][y] + 2 + (show2 / 255) * PI;
2581 ;
2582 animation.z = 5;
2583 animation.scale_x = 0.09;
2584 animation.scale_y = 0.09;
2585 animation.offset_y = -20 * move.linear[0];
2586 animation.offset_z = 0;
2587 animation.offset_x = 0;
2588 animation.low_limit = 0;
2589 show4 = render_value(animation);
2590
2591 show5 = screen(show4, show3);
2592 show6 = colordodge(show5, show3);
2593
2594 float linear1 = y / 32.f;
2595 float linear2 = (32 - y) / 32.f;
2596
2597 pixel.red = show5 * linear1;
2598 pixel.green = 0;
2599 pixel.blue = show6 * linear2;
2600
2601 pixel = rgb_sanity_check(pixel);
2602
2603 setPixelColorInternal(x, y, pixel);
2604 }
2605 }
2606 }
2607
2608 void SM10() {
2609
2610 get_ready();
2611
2612 timings.master_speed = 0.006; // 0.006
2613
2614 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2615 // values = faster transitions
2616 timings.ratio[1] = 0.027;
2617 timings.ratio[2] = 0.031;
2618 timings.ratio[3] = 0.0053; // speed ratios for the oscillators, higher
2619 // values = faster transitions
2620 timings.ratio[4] = 0.0056;
2621 timings.ratio[5] = 0.0059;
2622
2623 calculate_oscillators(timings);
2624
2625 for (int x = 0; x < num_x; x++) {
2626 for (int y = 0; y < num_y; y++) {
2627
2628 float scale = 0.6;
2629
2630 animation.dist = distance[x][y];
2631 animation.angle = polar_theta[x][y];
2632 animation.z = 5;
2633 animation.scale_x = 0.09 * scale;
2634 animation.scale_y = 0.09 * scale;
2635 animation.offset_y = -30 * move.linear[0];
2636 animation.offset_z = 0;
2637 animation.offset_x = 0;
2638 animation.low_limit = -1;
2639 show1 = render_value(animation);
2640
2641 animation.dist = distance[x][y];
2642 animation.angle = polar_theta[x][y];
2643 animation.z = 50;
2644 animation.scale_x = 0.09 * scale;
2645 animation.scale_y = 0.09 * scale;
2646 animation.offset_y = -30 * move.linear[1];
2647 animation.offset_z = 0;
2648 animation.offset_x = 0;
2649 animation.low_limit = -1;
2650 show2 = render_value(animation);
2651
2652 animation.dist = distance[x][y]; // + show1/64;
2653 animation.angle = polar_theta[x][y] + 2 + (show1 / 255) * PI;
2654 animation.z = 5;
2655 animation.scale_x = 0.09 * scale;
2656 animation.scale_y = 0.09 * scale;
2657 animation.offset_y = -10 * move.linear[0];
2658 animation.offset_z = 0;
2659 animation.offset_x = 0;
2660 animation.low_limit = 0;
2661 show3 = render_value(animation);
2662
2663 animation.dist = distance[x][y];
2664 animation.angle = polar_theta[x][y] + 2 + (show2 / 255) * PI;
2665 ;
2666 animation.z = 5;
2667 animation.scale_x = 0.09 * scale;
2668 animation.scale_y = 0.09 * scale;
2669 animation.offset_y = -20 * move.linear[0];
2670 animation.offset_z = 0;
2671 animation.offset_x = 0;
2672 animation.low_limit = 0;
2673 show4 = render_value(animation);
2674
2675 show5 = screen(show4, show3);
2676 show6 = colordodge(show5, show3);
2677
2678 // float linear1 = y / 32.f;
2679 // float linear2 = (32-y) / 32.f;
2680
2681 pixel.red = (show5 + show6) / 2;
2682 pixel.green = (show5 - 50) + (show6 / 16);
2683 pixel.blue = 0; // show6;
2684
2685 pixel = rgb_sanity_check(pixel);
2686
2687 setPixelColorInternal(x, y, pixel);
2688 }
2689 }
2690 }
2691
2692 void Complex_Kaleido() {
2693
2694 get_ready();
2695
2696 timings.master_speed = 0.009; // master speed
2697
2698 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2699 // values = faster transitions
2700 timings.ratio[1] = 0.027;
2701 timings.ratio[2] = 0.031;
2702 timings.ratio[3] = 0.0053; // speed ratios for the oscillators, higher
2703 // values = faster transitions
2704 timings.ratio[4] = 0.0056;
2705 timings.ratio[5] = 0.0059;
2706
2707 calculate_oscillators(timings);
2708
2709 // float size = 1.5;
2710
2711 for (int x = 0; x < num_x; x++) {
2712 for (int y = 0; y < num_y; y++) {
2713
2714 animation.dist = distance[x][y];
2715 animation.angle = 5 * polar_theta[x][y] + 10 * move.radial[0] +
2716 animation.dist / 2;
2717 animation.z = 5;
2718 animation.scale_x = 0.07;
2719 animation.scale_y = 0.07;
2720 animation.offset_z = 0;
2721 animation.offset_x = -30 * move.linear[0];
2722 animation.offset_y = 0;
2723 animation.low_limit = 0;
2724 show1 = render_value(animation);
2725
2726 animation.dist = distance[x][y];
2727 animation.angle = -5 * polar_theta[x][y] + 12 * move.radial[1] +
2728 animation.dist / 2;
2729 animation.z = 500;
2730 animation.scale_x = 0.07;
2731 animation.scale_y = 0.07;
2732 animation.offset_z = 0;
2733 animation.offset_x = -30 * move.linear[1];
2734 animation.offset_y = 0;
2735 animation.low_limit = 0;
2736 show2 = render_value(animation);
2737
2738 animation.dist = distance[x][y];
2739 animation.angle = -5 * polar_theta[x][y] + 12 * move.radial[2] +
2740 animation.dist / 2;
2741 animation.z = 500;
2742 animation.scale_x = 0.05;
2743 animation.scale_y = 0.05;
2744 animation.offset_z = 0;
2745 animation.offset_x = -40 * move.linear[2];
2746 animation.offset_y = 0;
2747 animation.low_limit = 0;
2748 show3 = render_value(animation);
2749
2750 animation.dist = distance[x][y];
2751 animation.angle = 5 * polar_theta[x][y] + 12 * move.radial[3] +
2752 animation.dist / 2;
2753 animation.z = 500;
2754 animation.scale_x = 0.09;
2755 animation.scale_y = 0.09;
2756 animation.offset_z = 0;
2757 animation.offset_x = -35 * move.linear[3];
2758 animation.offset_y = 0;
2759 animation.low_limit = 0;
2760 show4 = render_value(animation);
2761
2762 show5 = screen(show4, show3);
2763 show6 = colordodge(show2, show3);
2764
2765 // float linear1 = y / 32.f;
2766 // float linear2 = (32-y) / 32.f;
2767
2768 float radius = radial_filter_radius; // radius of a radial
2769 // brightness filter
2770 float radial = (radius - distance[x][y]) / distance[x][y];
2771
2772 pixel.red = radial * (show1 + show2);
2773 pixel.green = 0.3 * radial * show6; //(radial*(show1))*0.3f;
2774 pixel.blue = radial * show5;
2775
2776 pixel = rgb_sanity_check(pixel);
2777
2778 setPixelColorInternal(x, y, pixel);
2779 }
2780 }
2781 }
2782
2783 void Complex_Kaleido_2() {
2784
2785 get_ready();
2786
2787 timings.master_speed = 0.009; // master speed
2788
2789 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2790 // values = faster transitions
2791 timings.ratio[1] = 0.027;
2792 timings.ratio[2] = 0.031;
2793 timings.ratio[3] = 0.0053; // speed ratios for the oscillators, higher
2794 // values = faster transitions
2795 timings.ratio[4] = 0.0056;
2796 timings.ratio[5] = 0.0059;
2797
2798 calculate_oscillators(timings);
2799
2800 float size = 0.5;
2801
2802 for (int x = 0; x < num_x; x++) {
2803 for (int y = 0; y < num_y; y++) {
2804
2805 animation.dist = distance[x][y];
2806 animation.angle = 5 * polar_theta[x][y] + 10 * move.radial[0] +
2807 animation.dist / 2;
2808 animation.z = 5;
2809 animation.scale_x = 0.07 * size;
2810 animation.scale_y = 0.07 * size;
2811 animation.offset_z = 0;
2812 animation.offset_x = -30 * move.linear[0];
2813 animation.offset_y = 0;
2814 animation.low_limit = 0;
2815 show1 = render_value(animation);
2816
2817 animation.dist = distance[x][y];
2818 animation.angle = -5 * polar_theta[x][y] + 12 * move.radial[1] +
2819 animation.dist / 2;
2820 animation.z = 500;
2821 animation.scale_x = 0.07 * size;
2822 animation.scale_y = 0.07 * size;
2823 animation.offset_z = 0;
2824 animation.offset_x = -30 * move.linear[1];
2825 animation.offset_y = 0;
2826 animation.low_limit = 0;
2827 show2 = render_value(animation);
2828
2829 animation.dist = distance[x][y];
2830 animation.angle = -5 * polar_theta[x][y] + 12 * move.radial[2] +
2831 animation.dist / 2;
2832 animation.z = 500;
2833 animation.scale_x = 0.05 * size;
2834 animation.scale_y = 0.05 * size;
2835 animation.offset_z = 0;
2836 animation.offset_x = -40 * move.linear[2];
2837 animation.offset_y = 0;
2838 animation.low_limit = 0;
2839 show3 = render_value(animation);
2840
2841 animation.dist = distance[x][y];
2842 animation.angle = 5 * polar_theta[x][y] + 12 * move.radial[3] +
2843 animation.dist / 2;
2844 animation.z = 500;
2845 animation.scale_x = 0.09 * size;
2846 animation.scale_y = 0.09 * size;
2847 animation.offset_z = 0;
2848 animation.offset_x = -35 * move.linear[3];
2849 animation.offset_y = 0;
2850 animation.low_limit = 0;
2851 show4 = render_value(animation);
2852
2853 show5 = screen(show4, show3);
2854 show6 = colordodge(show2, show3);
2855
2856 // float linear1 = y / 32.f;
2857 // float linear2 = (32-y) / 32.f;
2858
2859 float radius = radial_filter_radius; // radius of a radial
2860 // brightness filter
2861 float radial = (radius - distance[x][y]) / distance[x][y];
2862
2863 pixel.red = radial * (show1 + show2);
2864 pixel.green = 0.3 * radial * show6; //(radial*(show1))*0.3f;
2865 pixel.blue = radial * show5;
2866
2867 pixel = rgb_sanity_check(pixel);
2868
2869 setPixelColorInternal(x, y, pixel);
2870 }
2871 }
2872 }
2873
2874 void Complex_Kaleido_3() {
2875
2876 get_ready();
2877
2878 timings.master_speed = 0.001; // master speed
2879
2880 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2881 // values = faster transitions
2882 timings.ratio[1] = 0.027;
2883 timings.ratio[2] = 0.031;
2884 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
2885 // values = faster transitions
2886 timings.ratio[4] = 0.037;
2887 timings.ratio[5] = 0.038;
2888 timings.ratio[5] = 0.041;
2889
2890 calculate_oscillators(timings);
2891
2892 float size = 0.4 + move.directional[0] * 0.1;
2893
2894 float q = 2;
2895
2896 for (int x = 0; x < num_x; x++) {
2897 for (int y = 0; y < num_y; y++) {
2898
2899 animation.dist = distance[x][y];
2900 animation.angle =
2901 5 * polar_theta[x][y] + 10 * move.radial[0] +
2902 animation.dist / (((move.directional[0] + 3) * 2)) +
2903 move.noise_angle[0] * q;
2904 animation.z = 5;
2905 animation.scale_x = 0.08 * size * (move.directional[0] + 1.5);
2906 animation.scale_y = 0.07 * size;
2907 animation.offset_z = -10 * move.linear[0];
2908 animation.offset_x = -30 * move.linear[0];
2909 animation.offset_y = 0;
2910 animation.low_limit = 0;
2911 show1 = render_value(animation);
2912
2913 animation.dist = distance[x][y];
2914 animation.angle =
2915 -5 * polar_theta[x][y] + 10 * move.radial[1] +
2916 animation.dist / (((move.directional[1] + 3) * 2)) +
2917 move.noise_angle[1] * q;
2918 animation.z = 500;
2919 animation.scale_x = 0.07 * size * (move.directional[1] + 1.1);
2920 animation.scale_y = 0.07 * size * (move.directional[2] + 1.3);
2921 ;
2922 animation.offset_z = -12 * move.linear[1];
2923 ;
2924 animation.offset_x = -(num_x - 1) * move.linear[1];
2925 animation.offset_y = 0;
2926 animation.low_limit = 0;
2927 show2 = render_value(animation);
2928
2929 animation.dist = distance[x][y];
2930 animation.angle =
2931 -5 * polar_theta[x][y] + 12 * move.radial[2] +
2932 animation.dist / (((move.directional[3] + 3) * 2)) +
2933 move.noise_angle[2] * q;
2934 animation.z = 500;
2935 animation.scale_x = 0.05 * size * (move.directional[3] + 1.5);
2936 ;
2937 animation.scale_y = 0.05 * size * (move.directional[4] + 1.5);
2938 ;
2939 animation.offset_z = -12 * move.linear[3];
2940 animation.offset_x = -40 * move.linear[3];
2941 animation.offset_y = 0;
2942 animation.low_limit = 0;
2943 show3 = render_value(animation);
2944
2945 animation.dist = distance[x][y];
2946 animation.angle =
2947 5 * polar_theta[x][y] + 12 * move.radial[3] +
2948 animation.dist / (((move.directional[5] + 3) * 2)) +
2949 move.noise_angle[3] * q;
2950 animation.z = 500;
2951 animation.scale_x = 0.09 * size * (move.directional[5] + 1.5);
2952 ;
2953 ;
2954 animation.scale_y = 0.09 * size * (move.directional[6] + 1.5);
2955 ;
2956 ;
2957 animation.offset_z = 0;
2958 animation.offset_x = -35 * move.linear[3];
2959 animation.offset_y = 0;
2960 animation.low_limit = 0;
2961 show4 = render_value(animation);
2962
2963 show5 = screen(show4, show3) - show2;
2964 show6 = colordodge(show4, show1);
2965
2966 show7 = multiply(show1, show2);
2967
2968 float linear1 = y / 32.f;
2969 // float linear2 = (32-y) / 32.f;
2970
2971 float radius = radial_filter_radius; // radius of a radial
2972 // brightness filter
2973 float radial = (radius - distance[x][y]) / distance[x][y];
2974
2975 show7 = multiply(show1, show2) * linear1 * 2;
2976 show8 = subtract(show7, show5);
2977
2978 // pixel.red = radial*(show1+show2);
2979 pixel.green = 0.2 * show8; //(radial*(show1))*0.3f;
2980 pixel.blue = show5 * radial;
2981 pixel.red = (1 * show1 + 1 * show2) - show7 / 2;
2982
2983 pixel = rgb_sanity_check(pixel);
2984
2985 setPixelColorInternal(x, y, pixel);
2986 }
2987 }
2988 }
2989
2990 void Complex_Kaleido_4() {
2991
2992 get_ready();
2993
2994 timings.master_speed = 0.01; // master speed 0.01 in the video
2995
2996 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2997 // values = faster transitions
2998 timings.ratio[1] = 0.027;
2999 timings.ratio[2] = 0.031;
3000 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3001 // values = faster transitions
3002 timings.ratio[4] = 0.037;
3003 timings.ratio[5] = 0.038;
3004 timings.ratio[6] = 0.041;
3005
3006 calculate_oscillators(timings);
3007
3008 float size = 0.6;
3009
3010 float q = 1;
3011
3012 for (int x = 0; x < num_x; x++) {
3013 for (int y = 0; y < num_y; y++) {
3014
3015 float s = 1 + move.directional[6] * 0.3;
3016
3017 animation.dist = distance[x][y] * s;
3018 animation.angle =
3019 5 * polar_theta[x][y] + 1 * move.radial[0] -
3020 animation.dist / (3 + move.directional[0] * 0.5);
3021 animation.z = 5;
3022 animation.scale_x = 0.08 * size + (move.directional[0] * 0.01);
3023 animation.scale_y = 0.07 * size + (move.directional[1] * 0.01);
3024 animation.offset_z = -10 * move.linear[0];
3025 animation.offset_x = 0; //-30 * move.linear[0];
3026 animation.offset_y = 0;
3027 animation.low_limit = 0;
3028 show1 = render_value(animation);
3029
3030 animation.dist = distance[x][y] * s;
3031 animation.angle =
3032 5 * polar_theta[x][y] + 1 * move.radial[1] +
3033 animation.dist / (3 + move.directional[1] * 0.5);
3034 animation.z = 50;
3035 animation.scale_x = 0.08 * size + (move.directional[1] * 0.01);
3036 animation.scale_y = 0.07 * size + (move.directional[2] * 0.01);
3037 animation.offset_z = -10 * move.linear[1];
3038 animation.offset_x = 0; //-30 * move.linear[0];
3039 animation.offset_y = 0;
3040 animation.low_limit = 0;
3041 show2 = render_value(animation);
3042
3043 animation.dist = distance[x][y];
3044 animation.angle = 1;
3045 animation.z = 500;
3046 animation.scale_x = 0.2 * size;
3047 animation.scale_y = 0.2 * size;
3048 animation.offset_z = 0; //-12 * move.linear[3];
3049 animation.offset_y = +7 * move.linear[3] + move.noise_angle[3];
3050 animation.offset_x = 0;
3051 animation.low_limit = 0;
3052 show3 = render_value(animation);
3053
3054 animation.dist = distance[x][y];
3055 animation.angle =
3056 5 * polar_theta[x][y] + 12 * move.radial[3] +
3057 animation.dist / (((move.directional[5] + 3) * 2)) +
3058 move.noise_angle[3] * q;
3059 animation.z = 500;
3060 animation.scale_x = 0.09 * size * (move.directional[5] + 1.5);
3061 ;
3062 ;
3063 animation.scale_y = 0.09 * size * (move.directional[6] + 1.5);
3064 ;
3065 ;
3066 animation.offset_z = 0;
3067 animation.offset_x = -35 * move.linear[3];
3068 animation.offset_y = 0;
3069 animation.low_limit = 0;
3070 show4 = render_value(animation);
3071
3072 // show5 = screen(show4, show3)-show2;
3073 // show6 = colordodge(show4, show1);
3074
3075 // show7 = multiply(show1, show2);
3076 /*
3077 float linear1 = y / 32.f;
3078 float linear2 = (32-y) / 32.f;
3079 */
3080
3081 float radius = radial_filter_radius; // radius of a radial
3082 // brightness filter
3083 float radial = (radius - distance[x][y]) / distance[x][y];
3084 /*
3085 show7 = multiply(show1, show2) * linear1*2;
3086 show8 = subtract(show7, show5);
3087 */
3088
3089 show5 = ((show1 + show2)) - show3;
3090 if (show5 > 255)
3091 show5 = 255;
3092 if (show5 < 0)
3093 show5 = 0;
3094
3095 show6 = colordodge(show1, show2);
3096
3097 pixel.red = show5 * radial;
3098 pixel.blue = (64 - show5 - show3) * radial;
3099 pixel.green = 0.5 * (show6);
3100 // pixel.blue = show5 * radial;
3101 // pixel.red = (1*show1 + 1*show2) - show7/2;
3102
3103 pixel = rgb_sanity_check(pixel);
3104
3105 setPixelColorInternal(x, y, pixel);
3106 }
3107 }
3108 }
3109
3110 void Complex_Kaleido_5() {
3111
3112 get_ready();
3113
3114 timings.master_speed = 0.01; // master speed
3115
3116 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
3117 // values = faster transitions
3118 timings.ratio[1] = 0.027;
3119 timings.ratio[2] = 0.031;
3120 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3121 // values = faster transitions
3122 timings.ratio[4] = 0.037;
3123 timings.ratio[5] = 0.0038;
3124 timings.ratio[6] = 0.041;
3125
3126 calculate_oscillators(timings);
3127
3128 float size = 0.6;
3129
3130 // float q = 1;
3131
3132 for (int x = 0; x < num_x; x++) {
3133 for (int y = 0; y < num_y; y++) {
3134
3135 float s = 1 + move.directional[6] * 0.8;
3136
3137 animation.dist = distance[x][y] * s;
3138 animation.angle = 10 * move.radial[6] +
3139 50 * move.directional[5] * polar_theta[x][y] -
3140 animation.dist / 3;
3141 animation.z = 5;
3142 animation.scale_x = 0.08 * size;
3143 animation.scale_y = 0.07 * size;
3144 animation.offset_z = -10 * move.linear[0];
3145 animation.offset_x = 0;
3146 animation.offset_y = 0;
3147 animation.low_limit = -0.5;
3148 show1 = render_value(animation);
3149
3150 float radius = radial_filter_radius; // radius of a radial
3151 // brightness filter
3152 float radial = (radius - distance[x][y]) / distance[x][y];
3153
3154 pixel.red = show1 * radial;
3155 pixel.green = 0;
3156 pixel.blue = 0;
3157
3158 pixel = rgb_sanity_check(pixel);
3159
3160 setPixelColorInternal(x, y, pixel);
3161 }
3162 }
3163 }
3164
3165 void Complex_Kaleido_6() {
3166
3167 get_ready();
3168
3169 timings.master_speed = 0.01; // master speed
3170
3171 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
3172 // values = faster transitions
3173 timings.ratio[1] = 0.027;
3174 timings.ratio[2] = 0.031;
3175 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3176 // values = faster transitions
3177 timings.ratio[4] = 0.037;
3178 timings.ratio[5] = 0.0038;
3179 timings.ratio[6] = 0.041;
3180
3181 calculate_oscillators(timings);
3182
3183 for (int x = 0; x < num_x; x++) {
3184 for (int y = 0; y < num_y; y++) {
3185
3186 animation.dist = distance[x][y];
3187 animation.angle = 16 * polar_theta[x][y] + 16 * move.radial[0];
3188 animation.z = 5;
3189 animation.scale_x = 0.06;
3190 animation.scale_y = 0.06;
3191 animation.offset_z = -10 * move.linear[0];
3192 animation.offset_y = 10 * move.noise_angle[0];
3193 animation.offset_x = 10 * move.noise_angle[4];
3194 animation.low_limit = 0;
3195 show1 = render_value(animation);
3196
3197 animation.dist = distance[x][y];
3198 animation.angle = 16 * polar_theta[x][y] + 16 * move.radial[1];
3199 animation.z = 500;
3200 animation.scale_x = 0.06;
3201 animation.scale_y = 0.06;
3202 animation.offset_z = -10 * move.linear[1];
3203 animation.offset_y = 10 * move.noise_angle[1];
3204 animation.offset_x = 10 * move.noise_angle[3];
3205 animation.low_limit = 0;
3206 show2 = render_value(animation);
3207
3208 // float radius = radial_filter_radius; // radius of a radial
3209 // brightness filter float radial =
3210 // (radius-distance[x][y])/distance[x][y];
3211
3212 pixel.red = show1;
3213 pixel.green = 0;
3214 pixel.blue = show2;
3215
3216 pixel = rgb_sanity_check(pixel);
3217
3218 setPixelColorInternal(x, y, pixel);
3219 }
3220 }
3221 }
3222
3223 void Water() {
3224
3225 get_ready();
3226
3227 timings.master_speed = 0.037; // master speed
3228
3229 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
3230 // values = faster transitions
3231 timings.ratio[1] = 0.027;
3232 timings.ratio[2] = 0.031;
3233 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3234 // values = faster transitions
3235 timings.ratio[4] = 0.037;
3236 timings.ratio[5] = 0.1;
3237 timings.ratio[6] = 0.41;
3238
3239 calculate_oscillators(timings);
3240
3241 for (int x = 0; x < num_x; x++) {
3242 for (int y = 0; y < num_y; y++) {
3243
3244 animation.dist =
3245 distance[x][y] +
3246 4 * sinf(move.directional[5] * PI + (float)x / 2) +
3247 4 * cosf(move.directional[6] * PI + float(y) / 2);
3248 animation.angle = 1 * polar_theta[x][y];
3249 animation.z = 5;
3250 animation.scale_x = 0.06;
3251 animation.scale_y = 0.06;
3252 animation.offset_z = -10 * move.linear[0];
3253 animation.offset_y = 10;
3254 animation.offset_x = 10;
3255 animation.low_limit = 0;
3256 show1 = render_value(animation);
3257
3258 animation.dist = (10 + move.directional[0]) *
3259 sinf(-move.radial[5] + move.radial[0] +
3260 (distance[x][y] / (3)));
3261 animation.angle = 1 * polar_theta[x][y];
3262 animation.z = 5;
3263 animation.scale_x = 0.1;
3264 animation.scale_y = 0.1;
3265 animation.offset_z = -10;
3266 animation.offset_y = 20 * move.linear[0];
3267 animation.offset_x = 10;
3268 animation.low_limit = 0;
3269 show2 = render_value(animation);
3270
3271 animation.dist = (10 + move.directional[1]) *
3272 sinf(-move.radial[5] + move.radial[1] +
3273 (distance[x][y] / (3)));
3274 animation.angle = 1 * polar_theta[x][y];
3275 animation.z = 500;
3276 animation.scale_x = 0.1;
3277 animation.scale_y = 0.1;
3278 animation.offset_z = -10;
3279 animation.offset_y = 20 * move.linear[1];
3280 animation.offset_x = 10;
3281 animation.low_limit = 0;
3282 show3 = render_value(animation);
3283
3284 animation.dist = (10 + move.directional[2]) *
3285 sinf(-move.radial[5] + move.radial[2] +
3286 (distance[x][y] / (3)));
3287 animation.angle = 1 * polar_theta[x][y];
3288 animation.z = 500;
3289 animation.scale_x = 0.1;
3290 animation.scale_y = 0.1;
3291 animation.offset_z = -10;
3292 animation.offset_y = 20 * move.linear[2];
3293 animation.offset_x = 10;
3294 animation.low_limit = 0;
3295 show4 = render_value(animation);
3296
3297 // float radius = radial_filter_radius; // radius of a radial
3298 // brightness filter float radial =
3299 // (radius-distance[x][y])/distance[x][y];
3300
3301 // pixel.red = show2;
3302
3303 pixel.blue = (0.7 * show2 + 0.6 * show3 + 0.5 * show4);
3304 pixel.red = pixel.blue - 40;
3305 pixel.green = 0;
3306 // pixel.red = radial*show3;
3307 // pixel.green = 0.9*radial*show4;
3308
3309 pixel = rgb_sanity_check(pixel);
3310
3311 setPixelColorInternal(x, y, pixel);
3312 }
3313 }
3314 }
3315
3316 void Parametric_Water() {
3317
3318 get_ready();
3319
3320 timings.master_speed = 0.003; // master speed
3321
3322 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
3323 // values = faster transitions
3324 timings.ratio[1] = 0.027;
3325 timings.ratio[2] = 0.029;
3326 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3327 // values = faster transitions
3328 timings.ratio[4] = 0.037;
3329 timings.ratio[5] = 0.15; // wave speed
3330 timings.ratio[6] = 0.41;
3331
3332 calculate_oscillators(timings);
3333
3334 for (int x = 0; x < num_x; x++) {
3335 for (int y = 0; y < num_y; y++) {
3336
3337 float s = 4;
3338 float f = 10 + 2 * move.directional[0];
3339
3340 animation.dist = (f + move.directional[0]) *
3341 sinf(-move.radial[5] + move.radial[0] +
3342 (distance[x][y] / (s)));
3343 animation.angle = 1 * polar_theta[x][y];
3344 animation.z = 5;
3345 animation.scale_x = 0.1;
3346 animation.scale_y = 0.1;
3347 animation.offset_z = -10;
3348 animation.offset_y = 20 * move.linear[0];
3349 animation.offset_x = 10;
3350 animation.low_limit = 0;
3351 show2 = render_value(animation);
3352
3353 animation.dist = (f + move.directional[1]) *
3354 sinf(-move.radial[5] + move.radial[1] +
3355 (distance[x][y] / (s)));
3356 animation.angle = 1 * polar_theta[x][y];
3357 animation.z = 500;
3358 animation.scale_x = 0.1;
3359 animation.scale_y = 0.1;
3360 animation.offset_z = -10;
3361 animation.offset_y = 20 * move.linear[1];
3362 animation.offset_x = 10;
3363 animation.low_limit = 0;
3364 show3 = render_value(animation);
3365
3366 animation.dist = (f + move.directional[2]) *
3367 sinf(-move.radial[5] + move.radial[2] +
3368 (distance[x][y] / (s)));
3369 animation.angle = 1 * polar_theta[x][y];
3370 animation.z = 5000;
3371 animation.scale_x = 0.1;
3372 animation.scale_y = 0.1;
3373 animation.offset_z = -10;
3374 animation.offset_y = 20 * move.linear[2];
3375 animation.offset_x = 10;
3376 animation.low_limit = 0;
3377 show4 = render_value(animation);
3378
3379 animation.dist = (f + move.directional[3]) *
3380 sinf(-move.radial[5] + move.radial[3] +
3381 (distance[x][y] / (s)));
3382 animation.angle = 1 * polar_theta[x][y];
3383 animation.z = 2000;
3384 animation.scale_x = 0.1;
3385 animation.scale_y = 0.1;
3386 animation.offset_z = -10;
3387 animation.offset_y = 20 * move.linear[3];
3388 animation.offset_x = 10;
3389 animation.low_limit = 0;
3390 show5 = render_value(animation);
3391
3392 show6 = screen(show4, show5);
3393 show7 = screen(show2, show3);
3394
3395 float radius = 40; // radius of a radial brightness filter
3396 float radial = (radius - distance[x][y]) / radius;
3397
3398 // pixel.red = show6;
3399 // pixel.blue = show7;
3400
3401 pixel.red = pixel.blue - 40;
3402 pixel.green = 0;
3403 pixel.blue = (0.3 * show6 + 0.7 * show7) * radial;
3404
3405 pixel = rgb_sanity_check(pixel);
3406
3407 setPixelColorInternal(x, y, pixel);
3408 }
3409 }
3410 }
3411
3412 void Module_Experiment1() {
3413
3414 get_ready();
3415
3416 timings.master_speed = 0.03; // master speed
3417
3418 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
3419 // values = faster transitions
3420 timings.ratio[1] = 0.0027;
3421 timings.ratio[2] = 0.029;
3422 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3423 // values = faster transitions
3424
3425 calculate_oscillators(timings);
3426
3427 for (int x = 0; x < num_x; x++) {
3428 for (int y = 0; y < num_y; y++) {
3429
3430 animation.dist = distance[x][y] + 20 * move.directional[0];
3431 animation.angle = move.noise_angle[0] + move.noise_angle[1] +
3432 polar_theta[x][y];
3433 animation.z = 5;
3434 animation.scale_x = 0.1;
3435 animation.scale_y = 0.1;
3436 animation.offset_z = -10;
3437 animation.offset_y = 20 * move.linear[2];
3438 animation.offset_x = 10;
3439 animation.low_limit = 0;
3440 show1 = render_value(animation);
3441
3442 pixel.red = 0;
3443 pixel.green = 0;
3444 pixel.blue = show1;
3445
3446 pixel = rgb_sanity_check(pixel);
3447
3448 setPixelColorInternal(x, y, pixel);
3449 }
3450 }
3451 }
3452
3453 void Module_Experiment2() {
3454
3455 get_ready();
3456
3457 timings.master_speed = 0.02; // master speed
3458
3459 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
3460 // values = faster transitions
3461 timings.ratio[1] = 0.0027;
3462 timings.ratio[2] = 0.029;
3463 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3464 // values = faster transitions
3465
3466 calculate_oscillators(timings);
3467
3468 for (int x = 0; x < num_x; x++) {
3469 for (int y = 0; y < num_y; y++) {
3470
3471 animation.dist =
3472 distance[x][y] - (16 + move.directional[0] * 16);
3473 animation.angle = move.noise_angle[0] + move.noise_angle[1] +
3474 polar_theta[x][y];
3475 animation.z = 5;
3476 animation.scale_x = 0.1;
3477 animation.scale_y = 0.1;
3478 animation.offset_z = -10;
3479 animation.offset_y = 20 * move.linear[2];
3480 animation.offset_x = 10;
3481 animation.low_limit = 0;
3482 show1 = render_value(animation);
3483
3484 pixel.red = show1;
3485 pixel.green = show1 - 80;
3486 pixel.blue = show1 - 150;
3487
3488 pixel = rgb_sanity_check(pixel);
3489
3490 setPixelColorInternal(x, y, pixel);
3491 }
3492 }
3493 }
3494
3495 void Module_Experiment3() {
3496
3497 get_ready();
3498
3499 timings.master_speed = 0.01; // master speed
3500
3501 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
3502 // values = faster transitions
3503 timings.ratio[1] = 0.0027;
3504 timings.ratio[2] = 0.029;
3505 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3506 // values = faster transitions
3507
3508 calculate_oscillators(timings);
3509
3510 for (int x = 0; x < num_x; x++) {
3511 for (int y = 0; y < num_y; y++) {
3512
3513 animation.dist =
3514 distance[x][y] - (12 + move.directional[3] * 4);
3515 animation.angle = move.noise_angle[0] + move.noise_angle[1] +
3516 polar_theta[x][y];
3517 animation.z = 5;
3518 animation.scale_x = 0.1;
3519 animation.scale_y = 0.1;
3520 animation.offset_z = -10;
3521 animation.offset_y = 20 * move.linear[2];
3522 animation.offset_x = 10;
3523 animation.low_limit = 0;
3524 show1 = render_value(animation);
3525
3526 pixel.red = show1;
3527 pixel.green = show1 - 80;
3528 pixel.blue = show1 - 150;
3529
3530 pixel = rgb_sanity_check(pixel);
3531
3532 setPixelColorInternal(x, y, pixel);
3533 }
3534 }
3535 }
3536
3537 void Zoom2() { // nice one
3538
3539 get_ready();
3540
3541 run_default_oscillators();
3542 timings.master_speed = 0.003;
3543 calculate_oscillators(timings);
3544
3545 for (int x = 0; x < num_x; x++) {
3546 for (int y = 0; y < num_y; y++) {
3547
3548 animation.dist = (distance[x][y] * distance[x][y]) / 2;
3549 animation.angle = polar_theta[x][y];
3550
3551 animation.scale_x = 0.005;
3552 animation.scale_y = 0.005;
3553
3554 animation.offset_y = -10 * move.linear[0];
3555 animation.offset_x = 0;
3556 animation.offset_z = 0.1 * move.linear[0];
3557
3558 animation.z = 0;
3559 animation.low_limit = 0;
3560 float show1 = render_value(animation);
3561
3562 // float linear = 1;//(y+1)/(num_y-1.f);
3563
3564 pixel.red = show1;
3565 pixel.green = 0;
3566 pixel.blue = 40 - show1;
3567
3568 pixel = rgb_sanity_check(pixel);
3569 setPixelColorInternal(y, x, pixel);
3570 }
3571 }
3572 }
3573
3574 void Module_Experiment4() {
3575
3576 get_ready();
3577
3578 timings.master_speed = 0.031; // master speed
3579
3580 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
3581 // values = faster transitions
3582 timings.ratio[1] = 0.0027;
3583 timings.ratio[2] = 0.029;
3584 timings.ratio[3] = 0.033;
3585 timings.ratio[4] = 0.036; // speed ratios for the oscillators, higher
3586 // values = faster transitions
3587
3588 calculate_oscillators(timings);
3589
3590 for (int x = 0; x < num_x; x++) {
3591 for (int y = 0; y < num_y; y++) {
3592
3593 float s = 0.8;
3594
3595 animation.dist = (distance[x][y] * distance[x][y]) * 0.7;
3596 animation.angle = polar_theta[x][y];
3597 animation.z = 5;
3598 animation.scale_x = 0.004 * s;
3599 animation.scale_y = 0.003 * s;
3600 animation.offset_z = 0.1 * move.linear[2];
3601 animation.offset_y = -20 * move.linear[2];
3602 animation.offset_x = 10;
3603 animation.low_limit = 0;
3604 show1 = render_value(animation);
3605
3606 animation.dist = (distance[x][y] * distance[x][y]) * 0.8;
3607 animation.angle = polar_theta[x][y];
3608 animation.z = 50;
3609 animation.scale_x = 0.004 * s;
3610 animation.scale_y = 0.003 * s;
3611 animation.offset_z = 0.1 * move.linear[3];
3612 animation.offset_y = -20 * move.linear[3];
3613 animation.offset_x = 100;
3614 animation.low_limit = 0;
3615 show2 = render_value(animation);
3616
3617 animation.dist = (distance[x][y] * distance[x][y]) * 0.9;
3618 animation.angle = polar_theta[x][y];
3619 animation.z = 5000;
3620 animation.scale_x = 0.004 * s;
3621 animation.scale_y = 0.003 * s;
3622 animation.offset_z = 0.1 * move.linear[4];
3623 animation.offset_y = -20 * move.linear[4];
3624 animation.offset_x = 1000;
3625 animation.low_limit = 0;
3626 show3 = render_value(animation);
3627
3628 // overlapping color mapping
3629 /*
3630 float r = show1;
3631 float g = show2-show1;
3632 float b = show3-show1-show2;
3633 */
3634
3635 pixel.red = show1 - show2 - show3;
3636 pixel.blue = show2 - show1 - show3;
3637 pixel.green = show3 - show1 - show2;
3638 // pixel.green = b;
3639 // pixel.green = show1 - 80;
3640 // pixel.blue = show1 - 150;
3641
3642 pixel = rgb_sanity_check(pixel);
3643
3644 setPixelColorInternal(x, y, pixel);
3645 }
3646 }
3647 }
3648
3649 void Module_Experiment5() {
3650
3651 get_ready();
3652
3653 timings.master_speed = 0.031; // master speed
3654
3655 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
3656 // values = faster transitions
3657 timings.ratio[1] = 0.0027;
3658 timings.ratio[2] = 0.029;
3659 timings.ratio[3] = 0.33;
3660 timings.ratio[4] = 0.036; // speed ratios for the oscillators, higher
3661 // values = faster transitions
3662
3663 calculate_oscillators(timings);
3664
3665 for (int x = 0; x < num_x; x++) {
3666 for (int y = 0; y < num_y; y++) {
3667
3668 float s = 1.5;
3669
3670 animation.dist = distance[x][y] +
3671 sinf(0.5 * distance[x][y] - move.radial[3]);
3672 animation.angle = polar_theta[x][y];
3673 animation.z = 5;
3674 animation.scale_x = 0.1 * s;
3675 animation.scale_y = 0.1 * s;
3676 animation.offset_z = 0.1 * move.linear[0];
3677 animation.offset_y = -20 * move.linear[0];
3678 animation.offset_x = 10;
3679 animation.low_limit = 0;
3680 show1 = render_value(animation);
3681
3682 pixel.red = show1;
3683 pixel.green = 0;
3684 pixel.blue = 0;
3685
3686 pixel = rgb_sanity_check(pixel);
3687
3688 setPixelColorInternal(x, y, pixel);
3689 }
3690 }
3691 }
3692
3693 void Module_Experiment6() {
3694
3695 get_ready();
3696
3697 timings.master_speed = 0.01; // master speed 0.031
3698
3699 float w = 0.7;
3700
3701 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
3702 // values = faster transitions
3703 timings.ratio[1] = 0.0027;
3704 timings.ratio[2] = 0.029;
3705 timings.ratio[3] = 0.33 * w;
3706 timings.ratio[4] = 0.36 * w; // speed ratios for the oscillators, higher
3707 // values = faster transitions
3708
3709 calculate_oscillators(timings);
3710
3711 for (int x = 0; x < num_x; x++) {
3712 for (int y = 0; y < num_y; y++) {
3713
3714 float s = 0.8;
3715
3716 animation.dist = distance[x][y] +
3717 sinf(0.25 * distance[x][y] - move.radial[3]);
3718 animation.angle = polar_theta[x][y];
3719 animation.z = 5;
3720 animation.scale_x = 0.1 * s;
3721 animation.scale_y = 0.1 * s;
3722 animation.offset_z = 0.1 * move.linear[0];
3723 animation.offset_y = -20 * move.linear[0];
3724 animation.offset_x = 10;
3725 animation.low_limit = 0;
3726 show1 = render_value(animation);
3727
3728 animation.dist = distance[x][y] +
3729 sinf(0.24 * distance[x][y] - move.radial[4]);
3730 animation.angle = polar_theta[x][y];
3731 animation.z = 10;
3732 animation.scale_x = 0.1 * s;
3733 animation.scale_y = 0.1 * s;
3734 animation.offset_z = 0.1 * move.linear[1];
3735 animation.offset_y = -20 * move.linear[1];
3736 animation.offset_x = 10;
3737 animation.low_limit = 0;
3738 show2 = render_value(animation);
3739
3740 /*
3741 pixel.red = show1;
3742 pixel.green = show1 * 0.3;
3743 pixel.blue = show2-show1;
3744 */
3745
3746 pixel.red = (show1 + show2);
3747 pixel.green = ((show1 + show2) * 0.6) - 30;
3748 pixel.blue = 0;
3749
3750 pixel = rgb_sanity_check(pixel);
3751
3752 setPixelColorInternal(x, y, pixel);
3753 }
3754 }
3755 }
3756
3757 void Module_Experiment7() {
3758
3759 get_ready();
3760
3761 timings.master_speed = 0.005; // master speed 0.031
3762
3763 float w = 0.3;
3764
3765 timings.ratio[0] = 0.01; // speed ratios for the oscillators, higher
3766 // values = faster transitions
3767 timings.ratio[1] = 0.011;
3768 timings.ratio[2] = 0.029;
3769 timings.ratio[3] = 0.33 * w;
3770 timings.ratio[4] = 0.36 * w; // speed ratios for the oscillators, higher
3771 // values = faster transitions
3772
3773 calculate_oscillators(timings);
3774
3775 for (int x = 0; x < num_x; x++) {
3776 for (int y = 0; y < num_y; y++) {
3777
3778 float s = 0.7;
3779
3780 animation.dist =
3781 2 + distance[x][y] +
3782 2 * sinf(0.25 * distance[x][y] - move.radial[3]);
3783 animation.angle = polar_theta[x][y];
3784 animation.z = 5;
3785 animation.scale_x = 0.1 * s;
3786 animation.scale_y = 0.1 * s;
3787 animation.offset_z = 10 * move.linear[0];
3788 animation.offset_y = -20 * move.linear[0];
3789 animation.offset_x = 10;
3790 animation.low_limit = 0;
3791 show1 = render_value(animation);
3792
3793 animation.dist =
3794 2 + distance[x][y] +
3795 2 * sinf(0.24 * distance[x][y] - move.radial[4]);
3796 animation.angle = polar_theta[x][y];
3797 animation.z = 10;
3798 animation.scale_x = 0.1 * s;
3799 animation.scale_y = 0.1 * s;
3800 animation.offset_z = 0.1 * move.linear[1];
3801 animation.offset_y = -20 * move.linear[1];
3802 animation.offset_x = 10;
3803 animation.low_limit = 0;
3804 show2 = render_value(animation);
3805
3806 /*
3807 pixel.red = show1;
3808 pixel.green = show1 * 0.3;
3809 pixel.blue = show2-show1;
3810 */
3811
3812 pixel.red = (show1 + show2);
3813 pixel.green = ((show1 + show2) * 0.6) - 50;
3814 pixel.blue = 0;
3815
3816 pixel = rgb_sanity_check(pixel);
3817
3818 setPixelColorInternal(x, y, pixel);
3819 }
3820 }
3821 }
3822
3823 void Module_Experiment8() {
3824
3825 get_ready();
3826
3827 timings.master_speed = 0.01; // master speed 0.031
3828
3829 float w = 0.3;
3830
3831 timings.ratio[0] = 0.01; // speed ratios for the oscillators, higher
3832 // values = faster transitions
3833 timings.ratio[1] = 0.011;
3834 timings.ratio[2] = 0.013;
3835 timings.ratio[3] = 0.33 * w;
3836 timings.ratio[4] = 0.36 * w; // speed ratios for the oscillators, higher
3837 // values = faster transitions
3838 timings.ratio[5] = 0.38 * w;
3839 timings.ratio[6] = 0.0003; // master rotation
3840
3841 timings.offset[0] = 0;
3842 timings.offset[1] = 100;
3843 timings.offset[2] = 200;
3844 timings.offset[3] = 300;
3845 timings.offset[4] = 400;
3846 timings.offset[5] = 500;
3847 timings.offset[6] = 600;
3848
3849 calculate_oscillators(timings);
3850
3851 for (int x = 0; x < num_x; x++) {
3852 for (int y = 0; y < num_y; y++) {
3853
3854 float s = 0.4; // scale
3855 float r = 1.5; // scroll speed
3856
3857 animation.dist =
3858 3 + distance[x][y] +
3859 3 * sinf(0.25 * distance[x][y] - move.radial[3]);
3860 animation.angle = polar_theta[x][y] + move.noise_angle[0] +
3861 move.noise_angle[6];
3862 animation.z = 5;
3863 animation.scale_x = 0.1 * s;
3864 animation.scale_y = 0.1 * s;
3865 animation.offset_z = 10 * move.linear[0];
3866 animation.offset_y = -5 * r * move.linear[0];
3867 animation.offset_x = 10;
3868 animation.low_limit = 0;
3869 show1 = render_value(animation);
3870
3871 animation.dist =
3872 4 + distance[x][y] +
3873 4 * sinf(0.24 * distance[x][y] - move.radial[4]);
3874 animation.angle = polar_theta[x][y] + move.noise_angle[1] +
3875 move.noise_angle[6];
3876 animation.z = 5;
3877 animation.scale_x = 0.1 * s;
3878 animation.scale_y = 0.1 * s;
3879 animation.offset_z = 0.1 * move.linear[1];
3880 animation.offset_y = -5 * r * move.linear[1];
3881 animation.offset_x = 100;
3882 animation.low_limit = 0;
3883 show2 = render_value(animation);
3884
3885 animation.dist =
3886 5 + distance[x][y] +
3887 5 * sinf(0.23 * distance[x][y] - move.radial[5]);
3888 animation.angle = polar_theta[x][y] + move.noise_angle[2] +
3889 move.noise_angle[6];
3890 animation.z = 5;
3891 animation.scale_x = 0.1 * s;
3892 animation.scale_y = 0.1 * s;
3893 animation.offset_z = 0.1 * move.linear[2];
3894 animation.offset_y = -5 * r * move.linear[2];
3895 animation.offset_x = 1000;
3896 animation.low_limit = 0;
3897 show3 = render_value(animation);
3898
3899 show4 = colordodge(show1, show2);
3900
3901 float rad = sinf(PI / 2 +
3902 distance[x][y] / 14); // better radial filter?!
3903
3904 /*
3905 pixel.red = show1;
3906 pixel.green = show1 * 0.3;
3907 pixel.blue = show2-show1;
3908 */
3909
3910 pixel.red = rad * ((show1 + show2) + show3);
3911 pixel.green = (((show2 + show3) * 0.8) - 90) * rad;
3912 pixel.blue = show4 * 0.2;
3913
3914 pixel = rgb_sanity_check(pixel);
3915
3916 setPixelColorInternal(x, y, pixel);
3917 }
3918 }
3919 }
3920
3921 void Module_Experiment9() {
3922
3923 get_ready();
3924
3925 timings.master_speed = 0.03; // master speed 0.031
3926
3927 float w = 0.3;
3928
3929 timings.ratio[0] = 0.1; // speed ratios for the oscillators, higher
3930 // values = faster transitions
3931 timings.ratio[1] = 0.011;
3932 timings.ratio[2] = 0.013;
3933 timings.ratio[3] = 0.33 * w;
3934 timings.ratio[4] = 0.36 * w; // speed ratios for the oscillators, higher
3935 // values = faster transitions
3936 timings.ratio[5] = 0.38 * w;
3937 timings.ratio[6] = 0.0003;
3938
3939 calculate_oscillators(timings);
3940
3941 for (int x = 0; x < num_x; x++) {
3942 for (int y = 0; y < num_y; y++) {
3943
3944 animation.dist = distance[x][y];
3945 animation.angle = polar_theta[x][y] + move.radial[1];
3946 animation.z = 5;
3947 animation.scale_x = 0.001;
3948 animation.scale_y = 0.1;
3949 animation.scale_z = 0.1;
3950 animation.offset_y = -10 * move.linear[0];
3951 animation.offset_x = 20;
3952 animation.offset_z = 10;
3953 animation.low_limit = 0;
3954 show1 = render_value(animation);
3955
3956 pixel.red = 10 * show1;
3957 pixel.green = 0;
3958 pixel.blue = 0;
3959
3960 pixel = rgb_sanity_check(pixel);
3961
3962 setPixelColorInternal(x, y, pixel);
3963 }
3964 }
3965 }
3966
3967 void Module_Experiment10() {
3968
3969 get_ready();
3970
3971 timings.master_speed = 0.01; // master speed 0.031
3972
3973 float w = 1;
3974
3975 timings.ratio[0] = 0.01; // speed ratios for the oscillators, higher
3976 // values = faster transitions
3977 timings.ratio[1] = 0.011;
3978 timings.ratio[2] = 0.013;
3979 timings.ratio[3] = 0.33 * w;
3980 timings.ratio[4] = 0.36 * w; // speed ratios for the oscillators, higher
3981 // values = faster transitions
3982 timings.ratio[5] = 0.38 * w;
3983 timings.ratio[6] = 0.0003; // master rotation
3984
3985 timings.offset[0] = 0;
3986 timings.offset[1] = 100;
3987 timings.offset[2] = 200;
3988 timings.offset[3] = 300;
3989 timings.offset[4] = 400;
3990 timings.offset[5] = 500;
3991 timings.offset[6] = 600;
3992
3993 calculate_oscillators(timings);
3994
3995 for (int x = 0; x < num_x; x++) {
3996 for (int y = 0; y < num_y; y++) {
3997
3998 float s = 0.4; // scale
3999 float r = 1.5; // scroll speed
4000
4001 animation.dist =
4002 3 + distance[x][y] +
4003 3 * sinf(0.25 * distance[x][y] - move.radial[3]);
4004 animation.angle = polar_theta[x][y] + move.noise_angle[0] +
4005 move.noise_angle[6];
4006 animation.z = 5;
4007 animation.scale_x = 0.1 * s;
4008 animation.scale_y = 0.1 * s;
4009 animation.offset_z = 10 * move.linear[0];
4010 animation.offset_y = -5 * r * move.linear[0];
4011 animation.offset_x = 10;
4012 animation.low_limit = 0;
4013 show1 = render_value(animation);
4014
4015 animation.dist =
4016 4 + distance[x][y] +
4017 4 * sinf(0.24 * distance[x][y] - move.radial[4]);
4018 animation.angle = polar_theta[x][y] + move.noise_angle[1] +
4019 move.noise_angle[6];
4020 animation.z = 5;
4021 animation.scale_x = 0.1 * s;
4022 animation.scale_y = 0.1 * s;
4023 animation.offset_z = 0.1 * move.linear[1];
4024 animation.offset_y = -5 * r * move.linear[1];
4025 animation.offset_x = 100;
4026 animation.low_limit = 0;
4027 show2 = render_value(animation);
4028
4029 animation.dist =
4030 5 + distance[x][y] +
4031 5 * sinf(0.23 * distance[x][y] - move.radial[5]);
4032 animation.angle = polar_theta[x][y] + move.noise_angle[2] +
4033 move.noise_angle[6];
4034 animation.z = 5;
4035 animation.scale_x = 0.1 * s;
4036 animation.scale_y = 0.1 * s;
4037 animation.offset_z = 0.1 * move.linear[2];
4038 animation.offset_y = -5 * r * move.linear[2];
4039 animation.offset_x = 1000;
4040 animation.low_limit = 0;
4041 show3 = render_value(animation);
4042
4043 show4 = colordodge(show1, show2);
4044
4045 float rad = sinf(PI / 2 +
4046 distance[x][y] / 14); // better radial filter?!
4047
4048 /*
4049 pixel.red = show1;
4050 pixel.green = show1 * 0.3;
4051 pixel.blue = show2-show1;
4052 */
4053
4054 CHSV(rad * ((show1 + show2) + show3), 255, 255);
4055
4056 pixel = rgb_sanity_check(pixel);
4057
4058 uint8_t a = getTime() / 100;
4059 CRGB p = CRGB(CHSV(((a + show1 + show2) + show3), 255, 255));
4060 rgb pixel;
4061 pixel.red = p.red;
4062 pixel.green = p.green;
4063 pixel.blue = p.blue;
4064 setPixelColorInternal(x, y, pixel);
4065 }
4066 }
4067 }
4068};
4069
4070} // namespace animartrix_detail
void setSpeedFactor(float speed)
Set the Speed Factor 0.1 to 10 - 1 for original speed.
Defines the red, green, and blue (RGB) pixel struct.
Implements the FastLED namespace macros.
#define P(x)
Reads a single byte from the p array.
Definition noise.cpp:42
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition chsv.h:16
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54
uint8_t red
Red channel value.
Definition crgb.h:59
uint8_t blue
Blue channel value.
Definition crgb.h:67
uint8_t green
Green channel value.
Definition crgb.h:63