Skip to content

Commit 2c7813b

Browse files
Final touches
1 parent 432806a commit 2c7813b

File tree

7 files changed

+111
-10
lines changed

7 files changed

+111
-10
lines changed

data/js/spin_ui.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ function setup_landscape_listener() {
2626
dimmer.style.left = '0';
2727
dimmer.style.width = '100%';
2828
dimmer.style.height = '100%';
29-
dimmer.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
29+
dimmer.style.backgroundColor = 'rgba(0, 0, 0, 1.0)';
3030
dimmer.style.display = 'flex';
3131
dimmer.style.alignItems = 'center';
3232
dimmer.style.justifyContent = 'center';
33-
dimmer.style.fontSize = '5em';
33+
dimmer.style.fontSize = '1.5em';
3434
dimmer.style.transition = 'opacity 500ms';
3535
dimmer.style.visibility = 'hidden';
3636
dimmer.style.opacity = '0';
3737
dimmer.style.color = 'var(--accent)';
38-
dimmer.innerHTML = ':(';
38+
dimmer.innerHTML = 'Sorry, portrait mode only!';
3939
document.body.appendChild(dimmer);
4040

4141
// Add event listener for window resize
4242
window.addEventListener('resize', () => {
43-
//toggle_dimmer(is_landscape());
43+
toggle_dimmer(is_landscape());
4444
});
4545

4646
// Initial check in case the page loads in landscape mode
47-
//toggle_dimmer(is_landscape());
47+
toggle_dimmer(is_landscape());
4848
}
4949

5050
// Initialize the listener on page load

data/js/websockets_connection.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ function parse_message(message){
281281
}
282282
);
283283
}
284+
else if(command_type == "version"){
285+
let version = command_data[1];
286+
document.getElementById("version_number").innerHTML = "Version: "+version;
287+
}
284288
else{
285289
console.log(`Unrecognized command type: ${command_type}`);
286290
}
@@ -432,6 +436,8 @@ function open_websockets_connection_to_device(){
432436
ws.onopen = function(e) {
433437
console.log("[open] Connection established");
434438
connection_pending = false;
439+
440+
transmit("get|version");
435441
};
436442

437443
ws.onmessage = function(event) {

data/remote.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@
114114
MAC: LOADING...
115115
</div>
116116
</div>
117+
<div class="menu_item buzz">
118+
<div id="version_number">
119+
VERSION: LOADING...
120+
</div>
121+
</div>
117122
</div>
118123

119124
<div id="menu_stats">

src/EMOTISCOPE_FIRMWARE.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// ############################################################################
1212
// ## SOFTWARE VERSION ########################################################
1313

14-
#define SOFTWARE_VERSION_MAJOR ( 0 )
14+
#define SOFTWARE_VERSION_MAJOR ( 1 )
1515
#define SOFTWARE_VERSION_MINOR ( 0 )
1616
#define SOFTWARE_VERSION_PATCH ( 0 )
1717

@@ -55,7 +55,6 @@
5555
#include "audio_debug.h" // ........ Print audio data over UART
5656
#include "screensaver.h" // ........ Colorful dots play on screen when no audio is present
5757
#include "standby.h" // ............ Handles sleep/wake + animations
58-
//#include "neural.h" // ............. Neural network for notation classification
5958
#include "lightshow_modes.h" // .... Definition and handling of lightshow modes
6059
#include "commands.h" // ........... Queuing and parsing of commands recieved
6160
#include "wireless.h" // ........... Communication with your network and the web-app

src/EMOTISCOPE_FIRMWARE.ino.cpp

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# 1 "C:\\Users\\conno\\AppData\\Local\\Temp\\tmpeghszhws"
2+
#include <Arduino.h>
3+
# 1 "C:/Users/conno/Emotiscope/src/EMOTISCOPE_FIRMWARE.ino"
4+
# 14 "C:/Users/conno/Emotiscope/src/EMOTISCOPE_FIRMWARE.ino"
5+
#define SOFTWARE_VERSION_MAJOR ( 1 )
6+
#define SOFTWARE_VERSION_MINOR ( 0 )
7+
#define SOFTWARE_VERSION_PATCH ( 0 )
8+
9+
10+
11+
12+
13+
14+
#include <PsychicHttp.h>
15+
#include <HTTPClient.h>
16+
#include <ESPmDNS.h>
17+
#include <Ticker.h>
18+
#include <DNSServer.h>
19+
#include <Preferences.h>
20+
#include <Update.h>
21+
#include <WiFi.h>
22+
#include <esp_dsp.h>
23+
#include <esp_wifi.h>
24+
25+
26+
#include "global_defines.h"
27+
#include "hardware_version.h"
28+
#include "types.h"
29+
#include "profiler.h"
30+
#include "sliders.h"
31+
#include "toggles.h"
32+
#include "menu_toggles.h"
33+
#include "filesystem.h"
34+
#include "configuration.h"
35+
#include "utilities.h"
36+
#include "system.h"
37+
#include "led_driver.h"
38+
#include "leds.h"
39+
#include "touch.h"
40+
#include "indicator.h"
41+
#include "ui.h"
42+
#include "microphone.h"
43+
#include "vu.h"
44+
#include "goertzel.h"
45+
#include "tempo.h"
46+
#include "audio_debug.h"
47+
#include "screensaver.h"
48+
#include "standby.h"
49+
#include "lightshow_modes.h"
50+
#include "commands.h"
51+
#include "wireless.h"
52+
#include "ota.h"
53+
54+
55+
#include "cpu_core.h"
56+
#include "gpu_core.h"
57+
#include "web_core.h"
58+
59+
60+
#include "notes.h"
61+
void loop();
62+
void loop_gpu(void *param);
63+
void setup();
64+
#line 75 "C:/Users/conno/Emotiscope/src/EMOTISCOPE_FIRMWARE.ino"
65+
void loop() {
66+
run_cpu();
67+
run_web();
68+
}
69+
70+
71+
void loop_gpu(void *param) {
72+
for (;;) {
73+
run_gpu();
74+
}
75+
}
76+
77+
78+
void setup() {
79+
80+
init_system();
81+
82+
83+
(void)xTaskCreatePinnedToCore(loop_gpu, "loop_gpu", 8192, NULL, 0, NULL, 0);
84+
}

src/commands.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,13 @@ void parse_command(uint32_t t_now_ms, command com) {
267267
transmit_to_client_in_slot(command_string, com.origin_client_slot);
268268
}
269269

270+
// If getting version number
271+
else if (fastcmp(substring, "version")) {
272+
char command_string[80];
273+
snprintf(command_string, 80, "version|%d.%d.%d", SOFTWARE_VERSION_MAJOR, SOFTWARE_VERSION_MINOR, SOFTWARE_VERSION_PATCH);
274+
transmit_to_client_in_slot(command_string, com.origin_client_slot);
275+
}
276+
270277
// Couldn't figure out what to "get"
271278
else{
272279
unrecognized_command_error(substring);

src/vu.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void run_vu(){
2626
max_amplitude_now = clip_float(max_amplitude_now - configuration.vu_floor);
2727
}
2828
else{ // Calibrating
29-
configuration.vu_floor = max(configuration.vu_floor, max_amplitude_now/2.0);
29+
configuration.vu_floor = max(float(configuration.vu_floor), float(max_amplitude_now/2.0));
3030
}
3131

3232
if(max_amplitude_now > max_amplitude_cap){
@@ -39,8 +39,8 @@ void run_vu(){
3939
}
4040
max_amplitude_cap = clip_float(max_amplitude_cap);
4141

42-
if(max_amplitude_cap < 0.0005){
43-
max_amplitude_cap = 0.0005;
42+
if(max_amplitude_cap < 0.005){
43+
max_amplitude_cap = 0.005;
4444
}
4545

4646
float auto_scale = 1.0 / max(max_amplitude_cap, 0.00001f);

0 commit comments

Comments
 (0)