Lixie-Labs / Emotiscope

Let your eyes enjoy the music too ✨ Extremely low-latency audio processing lets LEDs perfectly synchronize to your music's notation and tempo.
https://emotiscope.rocks/
GNU General Public License v3.0
27 stars 5 forks source link

Screensaver #39

Closed github-actions[bot] closed 4 months ago

github-actions[bot] commented 4 months ago

When ever the GPU hits this point in the loop, check if the total luminosity is below a small threshold value,

and if so, use 4 reserved draw_dots() in the same color palette as your current mode, and some sine functions

to make them "spin around" in a 1-D sense.

This can be randomized in fun ways, so that when your album finishes and the room is quiet, the display slowly

goes into a slow resting state that still indicates that it's on.

Definitely get's it's own toggle in the app in case I hate it

render_debug_value(t_now_ms); // (leds.h)

*really* slowing down the LPF when it's set to 1.0.

This is a super hacky way to fake a true fade transition between modes

at hundreds of frames per second

To anyone who reads this: hobbyist microcontrollers are fucking insane now.

When I got into all this in 2012, I had a 16MHz single core AVR

The DMA and SIMD-style stuff inside the ESP32-S3 is some pretty crazy shit.

uint16_t fastled_profiler_index \= start_function_timing("FastLED.show()");

Quantize the image buffer with dithering,

output to the 8-bit LED strand

watch_gpu_fps(t_now_us); // (system.h)

https://github.com/Lixie-Labs/Emotiscope/blob/d86b5e6b51d8d961487226109ad7624e71e13e05/src/gpu_core.h#L56


    // Save this frame for the next loop
    // save_leds_to_last(); // (leds.h)

    // TODO: Screensaver
    // When ever the GPU hits this point in the loop, check if the total luminosity is below a small threshold value,
    // and if so, use 4 reserved draw_dots() in the same color palette as your current mode, and some sine functions
    // to make them "spin around" in a 1-D sense.
    // This can be randomized in fun ways, so that when your album finishes and the room is quiet, the display slowly
    // goes into a slow resting state that still indicates that it's on.
    //
    // Definitely get's it's own toggle in the app in case I hate it

    apply_brightness();

    // Render the current debug value as a dot
    render_debug_value(t_now_ms);  // (leds.h)

    // This value decays itself non linearly toward zero all the time, 
    // *really* slowing down the LPF when it's set to 1.0.
    // This is a super hacky way to fake a true fade transition between modes
    lpf_drag *= 0.995;

    // Apply a low pass filter to every color channel of every pixel on every frame
    // at hundreds of frames per second
    // 
    // To anyone who reads this: hobbyist microcontrollers are fucking insane now.
    // When I got into all this in 2012, I had a 16MHz single core AVR
    // 
    // The DMA and SIMD-style stuff inside the ESP32-S3 is some pretty crazy shit.
    float lpf_cutoff_frequency = 0.5 + (1.0-configuration.melt)*9.5;
    lpf_cutoff_frequency = lpf_cutoff_frequency * (1.0 - lpf_drag) + 0.5 * lpf_drag;
    apply_image_lpf(lpf_cutoff_frequency);

    // Quantize the image buffer with dithering, 
    // output to the 8-bit LED strand
    transmit_leds();

    // Update the FPS_GPU variable
    watch_gpu_fps(t_now_us);  // (system.h)
connornishijima commented 4 months ago

Added