Skip to content

Commit

Permalink
working juno6 (at least 6 poly) on alles
Browse files Browse the repository at this point in the history
  • Loading branch information
bwhitman committed Jun 9, 2024
1 parent d61c681 commit f26fe96
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
11 changes: 5 additions & 6 deletions alles.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,19 @@ def flush(retries=1):
transmit(send_buffer)
send_buffer = ""

def send(retries=1, **kwargs):
def alles_send(message, retries=1):
global send_buffer
m = message(**kwargs)
if(buffer_size > 0):
if(len(send_buffer + m) > buffer_size):
if(len(send_buffer + message) > buffer_size):
transmit(send_buffer, retries=retries)
send_buffer = m
send_buffer = message
else:
send_buffer = send_buffer + m
else:
transmit(m,retries=retries)
transmit(message,retries=retries)

# We override AMY's send function to send out to the mesh instead of locally
amy.override_send = send
amy.override_send = alles_send



Expand Down
4 changes: 2 additions & 2 deletions main/alles_desktop.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ uint8_t status = RUNNING;
uint8_t debug_on = 0;

// AMY synth states
extern struct state global;
extern struct state amy_global;
extern uint32_t event_counter;
extern uint32_t message_counter;
extern int16_t amy_device_id;
Expand All @@ -29,7 +29,7 @@ int main(int argc, char ** argv) {
sync_init();
amy_start();
amy_reset_oscs();
global.latency_ms = ALLES_LATENCY_MS;
amy_global.latency_ms = ALLES_LATENCY_MS;

// For now, indicate ip address via commandline
local_ip = (char*)malloc(sizeof(char)*1025);
Expand Down
8 changes: 4 additions & 4 deletions main/alles_esp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ TaskHandle_t idle_1_handle;
#define ALLES_RENDER_TASK_NAME "alles_r_task"
#define ALLES_FILL_BUFFER_TASK_NAME "alles_fb_task"
#define ALLES_TASK_STACK_SIZE (4 * 1024)
#define ALLES_PARSE_TASK_STACK_SIZE (4 * 1024)
#define ALLES_PARSE_TASK_STACK_SIZE (8 * 1024)
#define ALLES_RECEIVE_TASK_STACK_SIZE (4 * 1024)
#define ALLES_RENDER_TASK_STACK_SIZE (8 * 1024)
#define ALLES_FILL_BUFFER_TASK_STACK_SIZE (8 * 1024)
Expand Down Expand Up @@ -473,15 +473,15 @@ void app_main() {
create_multicast_ipv4_socket();

// Create the task that waits for UDP messages, parses them and puts them on the sequencer queue (core 1)
xTaskCreatePinnedToCore(&esp_parse_task, "parse_task", 4096, NULL, (ESP_TASK_PRIO_MIN +2), &parseTask, 0);
xTaskCreatePinnedToCore(&esp_parse_task, ALLES_PARSE_TASK_NAME, ALLES_PARSE_TASK_STACK_SIZE, NULL, ALLES_PARSE_TASK_PRIORITY, &parseTask, ALLES_PARSE_TASK_COREID);
// Create the task that listens fro new incoming UDP messages (core 2)
xTaskCreatePinnedToCore(&mcast_listen_task, "mcast_task", 4096, NULL, (ESP_TASK_PRIO_MIN + 3), &mcastTask, 1);
xTaskCreatePinnedToCore(&mcast_listen_task, ALLES_RECEIVE_TASK_NAME, ALLES_RECEIVE_TASK_STACK_SIZE, NULL, ALLES_RECEIVE_TASK_PRIORITY, &mcastTask, ALLES_RECEIVE_TASK_COREID);

// Schedule a "turning on" sound
bleep();

// Print free RAm
//heap_caps_print_heap_info(MALLOC_CAP_INTERNAL);
heap_caps_print_heap_info(MALLOC_CAP_INTERNAL);

// Spin this core until the power off button is pressed, parsing events and making sounds
while(status & RUNNING) {
Expand Down

0 comments on commit f26fe96

Please sign in to comment.