main/alles.c
void add_event(struct event e) { 
    int16_t ew = global.next_event_write;
    if(events[ew].status == SCHEDULED) {
        // We should drop these messages, the queue is full
        printf("queue (size %d) is full at index %d, skipping\n", EVENT_FIFO_LEN, ew);
    } else {
        events[ew].voice = e.voice;
        events[ew].velocity = e.velocity;
        events[ew].volume = e.volume;
        events[ew].filter_freq = e.filter_freq;
        events[ew].resonance = e.resonance;
        events[ew].duty = e.duty;
        events[ew].feedback = e.feedback;
        events[ew].midi_note = e.midi_note;
        events[ew].wave = e.wave;
        events[ew].patch = e.patch;
        events[ew].freq = e.freq;
        events[ew].amp = e.amp;
        events[ew].phase = e.phase;
        events[ew].time = e.time;
        events[ew].status = e.status;
        events[ew].sample = e.sample;
        events[ew].step = e.step;
        events[ew].substep = e.substep;
      
        events[ew].lfo_source = e.lfo_source;
        events[ew].lfo_target = e.lfo_target;
        events[ew].adsr_target = e.adsr_target;
        events[ew].adsr_on_clock = e.adsr_on_clock;
        events[ew].adsr_off_clock = e.adsr_off_clock;
        events[ew].adsr_a = e.adsr_a;
        events[ew].adsr_d = e.adsr_d;
        events[ew].adsr_s = e.adsr_s;
        events[ew].adsr_r = e.adsr_r;

        global.next_event_write = (ew + 1) % (EVENT_FIFO_LEN);
    }
}
// deep copy an event to the fifo
deep copy an event to the fifo
deep copy an event to the fifo
void add_event(struct event e) { 
    int16_t ew = global.next_event_write;
    if(events[ew].status == SCHEDULED) {
        printf("queue (size %d) is full at index %d, skipping\n", EVENT_FIFO_LEN, ew);
    } else {
        events[ew].voice = e.voice;
        events[ew].velocity = e.velocity;
        events[ew].volume = e.volume;
        events[ew].filter_freq = e.filter_freq;
        events[ew].resonance = e.resonance;
        events[ew].duty = e.duty;
        events[ew].feedback = e.feedback;
        events[ew].midi_note = e.midi_note;
        events[ew].wave = e.wave;
        events[ew].patch = e.patch;
        events[ew].freq = e.freq;
        events[ew].amp = e.amp;
        events[ew].phase = e.phase;
        events[ew].time = e.time;
        events[ew].status = e.status;
        events[ew].sample = e.sample;
        events[ew].step = e.step;
        events[ew].substep = e.substep;
        events[ew].lfo_source = e.lfo_source;
        events[ew].lfo_target = e.lfo_target;
        events[ew].adsr_target = e.adsr_target;
        events[ew].adsr_on_clock = e.adsr_on_clock;
        events[ew].adsr_off_clock = e.adsr_off_clock;
        events[ew].adsr_a = e.adsr_a;
        events[ew].adsr_d = e.adsr_d;
        events[ew].adsr_s = e.adsr_s;
        events[ew].adsr_r = e.adsr_r;
        global.next_event_write = (ew + 1) % (EVENT_FIFO_LEN);
    }
}
void add_event ( struct event e ) { int16_t ew = global . next_event_write ; if ( events [ ew ] . status == SCHEDULED ) { printf ( " \n " , EVENT_FIFO_LEN , ew ) ; } else { events [ ew ] . voice = e . voice ; events [ ew ] . velocity = e . velocity ; events [ ew ] . volume = e . volume ; events [ ew ] . filter_freq = e . filter_freq ; events [ ew ] . resonance = e . resonance ; events [ ew ] . duty = e . duty ; events [ ew ] . feedback = e . feedback ; events [ ew ] . midi_note = e . midi_note ; events [ ew ] . wave = e . wave ; events [ ew ] . patch = e . patch ; events [ ew ] . freq = e . freq ; events [ ew ] . amp = e . amp ; events [ ew ] . phase = e . phase ; events [ ew ] . time = e . time ; events [ ew ] . status = e . status ; events [ ew ] . sample = e . sample ; events [ ew ] . step = e . step ; events [ ew ] . substep = e . substep ; events [ ew ] . lfo_source = e . lfo_source ; events [ ew ] . lfo_target = e . lfo_target ; events [ ew ] . adsr_target = e . adsr_target ; events [ ew ] . adsr_on_clock = e . adsr_on_clock ; events [ ew ] . adsr_off_clock = e . adsr_off_clock ; events [ ew ] . adsr_a = e . adsr_a ; events [ ew ] . adsr_d = e . adsr_d ; events [ ew ] . adsr_s = e . adsr_s ; events [ ew ] . adsr_r = e . adsr_r ; global . next_event_write = ( ew + 1 ) % ( EVENT_FIFO_LEN ) ; } }
deep copy an event to the fifo
deep copy an event to the fifo
// We should drop these messages, the queue is full