-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BROKEN VERSION: Added Beat Tunnel Mode
- Loading branch information
1 parent
70799a5
commit ceee4db
Showing
11 changed files
with
231 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# 1 "C:\\Users\\conno\\AppData\\Local\\Temp\\tmpncq9j96b" | ||
#include <Arduino.h> | ||
# 1 "C:/Users/conno/Emotiscope/src/EMOTISCOPE_FIRMWARE.ino" | ||
# 55 "C:/Users/conno/Emotiscope/src/EMOTISCOPE_FIRMWARE.ino" | ||
#define SOFTWARE_VERSION_MAJOR ( 1 ) | ||
#define SOFTWARE_VERSION_MINOR ( 2 ) | ||
#define SOFTWARE_VERSION_PATCH ( 0 ) | ||
|
||
|
||
|
||
|
||
|
||
|
||
#include <PsychicHttp.h> | ||
#include <HTTPClient.h> | ||
#include <ESPmDNS.h> | ||
#include <Ticker.h> | ||
#include <DNSServer.h> | ||
#include <Preferences.h> | ||
#include <Update.h> | ||
#include <WiFi.h> | ||
#include <esp_dsp.h> | ||
#include <esp_wifi.h> | ||
|
||
|
||
#include "global_defines.h" | ||
#include "hardware_version.h" | ||
#include "types.h" | ||
#include "profiler.h" | ||
#include "sliders.h" | ||
#include "toggles.h" | ||
#include "menu_toggles.h" | ||
#include "menu_dropdowns.h" | ||
#include "filesystem.h" | ||
#include "configuration.h" | ||
#include "utilities.h" | ||
#include "system.h" | ||
#include "led_driver.h" | ||
#include "perlin.h" | ||
#include "leds.h" | ||
#include "touch.h" | ||
#include "indicator.h" | ||
#include "ui.h" | ||
#include "microphone.h" | ||
#include "vu.h" | ||
#include "goertzel.h" | ||
#include "tempo.h" | ||
#include "screensaver.h" | ||
#include "standby.h" | ||
#include "light_modes.h" | ||
#include "commands.h" | ||
#include "wireless.h" | ||
#include "ota.h" | ||
|
||
|
||
#include "cpu_core.h" | ||
#include "gpu_core.h" | ||
#include "web_core.h" | ||
# 117 "C:/Users/conno/Emotiscope/src/EMOTISCOPE_FIRMWARE.ino" | ||
void loop(); | ||
void loop_gpu(void *param); | ||
void setup(); | ||
#line 117 "C:/Users/conno/Emotiscope/src/EMOTISCOPE_FIRMWARE.ino" | ||
void loop() { | ||
run_cpu(); | ||
run_web(); | ||
} | ||
|
||
|
||
void loop_gpu(void *param) { | ||
for (;;) { | ||
|
||
run_gpu(); | ||
run_gpu(); | ||
run_gpu(); | ||
run_gpu(); | ||
} | ||
} | ||
|
||
|
||
void setup() { | ||
|
||
init_system(); | ||
|
||
|
||
(void)xTaskCreatePinnedToCore(loop_gpu, "loop_gpu", 4096, NULL, 0, NULL, 0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
CRGBF tunnel_image[NUM_LEDS] = { 0.0 }; | ||
CRGBF tunnel_image_prev[NUM_LEDS] = { 0.0 }; | ||
float angle = 0.0; | ||
|
||
void draw_beat_tunnel(){ | ||
memset(tunnel_image, 0, sizeof(CRGBF)*NUM_LEDS); | ||
|
||
angle += 0.001; | ||
|
||
float spread_speed = (0.125 + 0.875*configuration.speed.value.f32)*(sin(angle))*0.5; | ||
draw_sprite(tunnel_image, tunnel_image_prev, NUM_LEDS, NUM_LEDS, spread_speed, 0.965); | ||
|
||
for(uint16_t i = 0; i < NUM_TEMPI; i++){ | ||
float phase = 1.0 - ((tempi[i].phase + PI) / (2.0*PI)); | ||
|
||
float mag = 0.0; | ||
if( fabs(phase - 0.65) < 0.02 ){ | ||
mag = clip_float(tempi_smooth[i]); | ||
} | ||
|
||
CRGBF tempi_color = hsv( | ||
get_color_range_hue(num_tempi_float_lookup[i]), | ||
configuration.saturation.value.f32, | ||
(mag) | ||
); | ||
|
||
tunnel_image[i].r += tempi_color.r; | ||
tunnel_image[i].g += tempi_color.g; | ||
tunnel_image[i].b += tempi_color.b; | ||
} | ||
|
||
if(configuration.mirror_mode.value.u32 == true){ | ||
for(uint16_t i = 0; i < NUM_TEMPI-2; i++){ | ||
leds[ (NUM_LEDS>>1) + ((i+2)>>1)] = tunnel_image[i]; | ||
leds[((NUM_LEDS>>1)-1) - ((i+2)>>1)] = tunnel_image[i]; | ||
} | ||
} | ||
else{ | ||
memcpy(leds, tunnel_image, sizeof(CRGBF)*NUM_LEDS); | ||
} | ||
|
||
memcpy(tunnel_image_prev, tunnel_image, sizeof(CRGBF)*NUM_LEDS); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
void draw_tempiscope(){ | ||
// Draw the current frame | ||
for(uint16_t i = 0; i < NUM_TEMPI; i++){ | ||
float progress = num_leds_float_lookup[i]; | ||
|
||
float sine = 1.0 - ((tempi[i].phase + PI) / (2.0*PI)); | ||
|
||
float mag = clip_float(tempi_smooth[i] * sine); | ||
|
||
if(mag > 0.005){ | ||
CRGBF color = hsv( | ||
get_color_range_hue(progress), | ||
configuration.saturation.value.f32, | ||
mag | ||
); | ||
|
||
leds[i] = color; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.