Skip to content
Snippets Groups Projects
Commit 5e3e04f1 authored by moon2's avatar moon2 :speech_balloon:
Browse files

bl00mbox: minor fixes (concurrency issue, faster delay)

parent 557f61de
No related branches found
No related tags found
1 merge request!613bl00mbox: minor fixes (concurrency issue, faster delay)
Pipeline #9413 passed
......@@ -709,7 +709,7 @@ bool bl00mbox_channel_bud_set_signal_value(uint8_t channel, uint32_t bud_index,
while(bud->is_being_rendered) {};
if(value == -32678){
sig->value = 0;
sig->value = -32767;
} else {
sig->value = value;
}
......
......@@ -76,7 +76,7 @@ typedef struct _radspa_signal_t{
// buffer full of samples, may be NULL.
int16_t * buffer;
// static value to be used when buffer is NULL for input signals only
int16_t value;
volatile int16_t value;
// when the signal has last requested to render its source
uint32_t render_pass_id;
} radspa_signal_t;
......
......@@ -34,10 +34,16 @@ void delay_run(radspa_t * delay, uint16_t num_samples, uint32_t render_pass_id){
static int16_t ret = 0;
uint32_t buffer_size = delay->plugin_table_len;
uint32_t time = radspa_signal_get_value(time_sig, 0, render_pass_id);
if(time > data->max_delay) time = data->max_delay;
int16_t fb = radspa_signal_get_value(feedback_sig, 0, render_pass_id);
int16_t level = radspa_signal_get_value(level_sig, 0, render_pass_id);
int16_t dry_vol = radspa_signal_get_value(dry_vol_sig, 0, render_pass_id);
int16_t rec_vol = radspa_signal_get_value(rec_vol_sig, 0, render_pass_id);
for(uint16_t i = 0; i < num_samples; i++){
uint32_t time = radspa_signal_get_value(time_sig, i, render_pass_id);
if(time > data->max_delay) time = data->max_delay;
data->write_head_position++;
while(data->write_head_position >= buffer_size) data->write_head_position -= buffer_size; // maybe faster than %
......@@ -56,12 +62,6 @@ void delay_run(radspa_t * delay, uint16_t num_samples, uint32_t render_pass_id){
int16_t dry = radspa_signal_get_value(input_sig, i, render_pass_id);
int16_t wet = buf[data->read_head_position];
int16_t fb = radspa_signal_get_value(feedback_sig, i, render_pass_id);
int16_t level = radspa_signal_get_value(level_sig, i, render_pass_id);
int16_t dry_vol = radspa_signal_get_value(dry_vol_sig, i, render_pass_id);
int16_t rec_vol = radspa_signal_get_value(rec_vol_sig, i, render_pass_id);
if(rec_vol){
buf[data->write_head_position] = radspa_add_sat(radspa_mult_shift(rec_vol, dry), radspa_mult_shift(wet,fb));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment