main/alles.c
void parse_adsr(struct event * e, char* message) {
    uint8_t idx = 0;
    uint8_t c = 0;
    // Change only the ones i received
    while(message[c] != 0 && c < MAX_RECEIVE_LEN) {
        if(message[c]!=',') {
            if(idx==0) {
                e->adsr_a = atoi(message+c);
            } else if(idx == 1) {
                e->adsr_d = atoi(message+c);
            } else if(idx == 2) {
                e->adsr_s = atof(message+c);
            } else if(idx == 3) {
                e->adsr_r = atoi(message+c);
            }
        }
        while(message[c]!=',' && message[c]!=0 && c < MAX_RECEIVE_LEN) c++;
        c++; idx++;
    }
}
// Helper to parse the special ADSR string
Helper to parse the special ADSR string
Helper to parse the special ADSR string
void parse_adsr(struct event * e, char* message) {
    uint8_t idx = 0;
    uint8_t c = 0;
    while(message[c] != 0 && c < MAX_RECEIVE_LEN) {
        if(message[c]!=',') {
            if(idx==0) {
                e->adsr_a = atoi(message+c);
            } else if(idx == 1) {
                e->adsr_d = atoi(message+c);
            } else if(idx == 2) {
                e->adsr_s = atof(message+c);
            } else if(idx == 3) {
                e->adsr_r = atoi(message+c);
            }
        }
        while(message[c]!=',' && message[c]!=0 && c < MAX_RECEIVE_LEN) c++;
        c++; idx++;
    }
}
void parse_adsr ( struct event * e , char * message ) { uint8_t idx = 0 ; uint8_t c = 0 ; while ( message [ c ] != 0 && c < MAX_RECEIVE_LEN ) { if ( message [ c ] != ' ' ) { if ( idx == 0 ) { e -> adsr_a = atoi ( message + c ) ; } else if ( idx == 1 ) { e -> adsr_d = atoi ( message + c ) ; } else if ( idx == 2 ) { e -> adsr_s = atof ( message + c ) ; } else if ( idx == 3 ) { e -> adsr_r = atoi ( message + c ) ; } } while ( message [ c ] != ' ' && message [ c ] != 0 && c < MAX_RECEIVE_LEN ) c ++ ; c ++ ; idx ++ ; } }
Helper to parse the special ADSR string
Helper to parse the special ADSR string
// Change only the ones i received