diff --git a/TODO b/TODO index 7d0cc1f..43dcb64 100644 --- a/TODO +++ b/TODO @@ -41,7 +41,6 @@ code: * better src filter * bw_env_gen process_multi gate const? * c++ get coeffs/state? or public? src nIn/OutSamples case (array vs single value), delay read/write, process1? process single? -* bw_buf invert src dest order? * check unititialized warnings * clearly specify that state is tied to a particular set of coeffs (1:N) * modulation vs process (multi) no update (post 1.0.0)??? diff --git a/examples/fx_chorus/src/bw_example_fx_chorus.c b/examples/fx_chorus/src/bw_example_fx_chorus.c index 5347b40..cde8dbb 100644 --- a/examples/fx_chorus/src/bw_example_fx_chorus.c +++ b/examples/fx_chorus/src/bw_example_fx_chorus.c @@ -32,7 +32,7 @@ void bw_example_fx_chorus_set_sample_rate(bw_example_fx_chorus *instance, float bw_chorus_set_sample_rate(&instance->chorus_coeffs, sample_rate); } -BW_SIZE_T bw_example_fx_chorus_mem_req(bw_example_fx_chorus *instance) { +size_t bw_example_fx_chorus_mem_req(bw_example_fx_chorus *instance) { return bw_chorus_mem_req(&instance->chorus_coeffs); } diff --git a/examples/fx_chorus/src/bw_example_fx_chorus.h b/examples/fx_chorus/src/bw_example_fx_chorus.h index 2de4044..9fa2932 100644 --- a/examples/fx_chorus/src/bw_example_fx_chorus.h +++ b/examples/fx_chorus/src/bw_example_fx_chorus.h @@ -47,7 +47,7 @@ typedef struct _bw_example_fx_chorus bw_example_fx_chorus; void bw_example_fx_chorus_init(bw_example_fx_chorus *instance); void bw_example_fx_chorus_set_sample_rate(bw_example_fx_chorus *instance, float sample_rate); -BW_SIZE_T bw_example_fx_chorus_mem_req(bw_example_fx_chorus *instance); +size_t bw_example_fx_chorus_mem_req(bw_example_fx_chorus *instance); void bw_example_fx_chorus_mem_set(bw_example_fx_chorus *instance, void *mem); void bw_example_fx_chorus_reset(bw_example_fx_chorus *instance); void bw_example_fx_chorus_process(bw_example_fx_chorus *instance, const float** x, float** y, int n_samples); diff --git a/examples/fx_comb/src/bw_example_fx_comb.c b/examples/fx_comb/src/bw_example_fx_comb.c index 431b7f4..4a711ae 100644 --- a/examples/fx_comb/src/bw_example_fx_comb.c +++ b/examples/fx_comb/src/bw_example_fx_comb.c @@ -28,7 +28,7 @@ void bw_example_fx_comb_set_sample_rate(bw_example_fx_comb *instance, float samp bw_comb_set_sample_rate(&instance->comb_coeffs, sample_rate); } -BW_SIZE_T bw_example_fx_comb_mem_req(bw_example_fx_comb *instance) { +size_t bw_example_fx_comb_mem_req(bw_example_fx_comb *instance) { return bw_comb_mem_req(&instance->comb_coeffs); } diff --git a/examples/fx_comb/src/bw_example_fx_comb.h b/examples/fx_comb/src/bw_example_fx_comb.h index 0aa6ebe..35bc99f 100644 --- a/examples/fx_comb/src/bw_example_fx_comb.h +++ b/examples/fx_comb/src/bw_example_fx_comb.h @@ -50,7 +50,7 @@ typedef struct _bw_example_fx_comb bw_example_fx_comb; void bw_example_fx_comb_init(bw_example_fx_comb *instance); void bw_example_fx_comb_set_sample_rate(bw_example_fx_comb *instance, float sample_rate); -BW_SIZE_T bw_example_fx_comb_mem_req(bw_example_fx_comb *instance); +size_t bw_example_fx_comb_mem_req(bw_example_fx_comb *instance); void bw_example_fx_comb_mem_set(bw_example_fx_comb *instance, void *mem); void bw_example_fx_comb_reset(bw_example_fx_comb *instance); void bw_example_fx_comb_process(bw_example_fx_comb *instance, const float** x, float** y, int n_samples); diff --git a/examples/fx_delay/src/bw_example_fx_delay.c b/examples/fx_delay/src/bw_example_fx_delay.c index 5d59278..2304899 100644 --- a/examples/fx_delay/src/bw_example_fx_delay.c +++ b/examples/fx_delay/src/bw_example_fx_delay.c @@ -28,7 +28,7 @@ void bw_example_fx_delay_set_sample_rate(bw_example_fx_delay *instance, float sa bw_delay_set_sample_rate(&instance->delay_coeffs, sample_rate); } -BW_SIZE_T bw_example_fx_delay_mem_req(bw_example_fx_delay *instance) { +size_t bw_example_fx_delay_mem_req(bw_example_fx_delay *instance) { return bw_delay_mem_req(&instance->delay_coeffs); } diff --git a/examples/fx_delay/src/bw_example_fx_delay.h b/examples/fx_delay/src/bw_example_fx_delay.h index 30ee4bd..a6977ef 100644 --- a/examples/fx_delay/src/bw_example_fx_delay.h +++ b/examples/fx_delay/src/bw_example_fx_delay.h @@ -46,7 +46,7 @@ typedef struct _bw_example_fx_delay bw_example_fx_delay; void bw_example_fx_delay_init(bw_example_fx_delay *instance); void bw_example_fx_delay_set_sample_rate(bw_example_fx_delay *instance, float sample_rate); -BW_SIZE_T bw_example_fx_delay_mem_req(bw_example_fx_delay *instance); +size_t bw_example_fx_delay_mem_req(bw_example_fx_delay *instance); void bw_example_fx_delay_mem_set(bw_example_fx_delay *instance, void *mem); void bw_example_fx_delay_reset(bw_example_fx_delay *instance); void bw_example_fx_delay_process(bw_example_fx_delay *instance, const float** x, float** y, int n_samples); diff --git a/examples/fx_flanger/src/bw_example_fx_flanger.c b/examples/fx_flanger/src/bw_example_fx_flanger.c index 9234955..eb094dd 100644 --- a/examples/fx_flanger/src/bw_example_fx_flanger.c +++ b/examples/fx_flanger/src/bw_example_fx_flanger.c @@ -32,7 +32,7 @@ void bw_example_fx_flanger_set_sample_rate(bw_example_fx_flanger *instance, floa bw_chorus_set_sample_rate(&instance->chorus_coeffs, sample_rate); } -BW_SIZE_T bw_example_fx_flanger_mem_req(bw_example_fx_flanger *instance) { +size_t bw_example_fx_flanger_mem_req(bw_example_fx_flanger *instance) { return bw_chorus_mem_req(&instance->chorus_coeffs); } diff --git a/examples/fx_flanger/src/bw_example_fx_flanger.h b/examples/fx_flanger/src/bw_example_fx_flanger.h index d2238a2..96874e3 100644 --- a/examples/fx_flanger/src/bw_example_fx_flanger.h +++ b/examples/fx_flanger/src/bw_example_fx_flanger.h @@ -47,7 +47,7 @@ typedef struct _bw_example_fx_flanger bw_example_fx_flanger; void bw_example_fx_flanger_init(bw_example_fx_flanger *instance); void bw_example_fx_flanger_set_sample_rate(bw_example_fx_flanger *instance, float sample_rate); -BW_SIZE_T bw_example_fx_flanger_mem_req(bw_example_fx_flanger *instance); +size_t bw_example_fx_flanger_mem_req(bw_example_fx_flanger *instance); void bw_example_fx_flanger_mem_set(bw_example_fx_flanger *instance, void *mem); void bw_example_fx_flanger_reset(bw_example_fx_flanger *instance); void bw_example_fx_flanger_process(bw_example_fx_flanger *instance, const float** x, float** y, int n_samples); diff --git a/examples/fx_reverb/src/bw_example_fx_reverb.c b/examples/fx_reverb/src/bw_example_fx_reverb.c index ae1edc2..2c9d3ef 100644 --- a/examples/fx_reverb/src/bw_example_fx_reverb.c +++ b/examples/fx_reverb/src/bw_example_fx_reverb.c @@ -28,7 +28,7 @@ void bw_example_fx_reverb_set_sample_rate(bw_example_fx_reverb *instance, float bw_reverb_set_sample_rate(&instance->reverb_coeffs, sample_rate); } -BW_SIZE_T bw_example_fx_reverb_mem_req(bw_example_fx_reverb *instance) { +size_t bw_example_fx_reverb_mem_req(bw_example_fx_reverb *instance) { return bw_reverb_mem_req(&instance->reverb_coeffs); } diff --git a/examples/fx_reverb/src/bw_example_fx_reverb.h b/examples/fx_reverb/src/bw_example_fx_reverb.h index fa65eee..47b1926 100644 --- a/examples/fx_reverb/src/bw_example_fx_reverb.h +++ b/examples/fx_reverb/src/bw_example_fx_reverb.h @@ -48,7 +48,7 @@ typedef struct _bw_example_fx_reverb bw_example_fx_reverb; void bw_example_fx_reverb_init(bw_example_fx_reverb *instance); void bw_example_fx_reverb_set_sample_rate(bw_example_fx_reverb *instance, float sample_rate); -BW_SIZE_T bw_example_fx_reverb_mem_req(bw_example_fx_reverb *instance); +size_t bw_example_fx_reverb_mem_req(bw_example_fx_reverb *instance); void bw_example_fx_reverb_mem_set(bw_example_fx_reverb *instance, void *mem); void bw_example_fx_reverb_reset(bw_example_fx_reverb *instance); void bw_example_fx_reverb_process(bw_example_fx_reverb *instance, const float** x, float** y, int n_samples); diff --git a/examples/fx_vibrato/src/bw_example_fx_vibrato.c b/examples/fx_vibrato/src/bw_example_fx_vibrato.c index 24fae2c..23ed60a 100644 --- a/examples/fx_vibrato/src/bw_example_fx_vibrato.c +++ b/examples/fx_vibrato/src/bw_example_fx_vibrato.c @@ -31,7 +31,7 @@ void bw_example_fx_vibrato_set_sample_rate(bw_example_fx_vibrato *instance, floa bw_chorus_set_sample_rate(&instance->chorus_coeffs, sample_rate); } -BW_SIZE_T bw_example_fx_vibrato_mem_req(bw_example_fx_vibrato *instance) { +size_t bw_example_fx_vibrato_mem_req(bw_example_fx_vibrato *instance) { return bw_chorus_mem_req(&instance->chorus_coeffs); } diff --git a/examples/fx_vibrato/src/bw_example_fx_vibrato.h b/examples/fx_vibrato/src/bw_example_fx_vibrato.h index 622acf2..36869a9 100644 --- a/examples/fx_vibrato/src/bw_example_fx_vibrato.h +++ b/examples/fx_vibrato/src/bw_example_fx_vibrato.h @@ -45,7 +45,7 @@ typedef struct _bw_example_fx_vibrato bw_example_fx_vibrato; void bw_example_fx_vibrato_init(bw_example_fx_vibrato *instance); void bw_example_fx_vibrato_set_sample_rate(bw_example_fx_vibrato *instance, float sample_rate); -BW_SIZE_T bw_example_fx_vibrato_mem_req(bw_example_fx_vibrato *instance); +size_t bw_example_fx_vibrato_mem_req(bw_example_fx_vibrato *instance); void bw_example_fx_vibrato_mem_set(bw_example_fx_vibrato *instance, void *mem); void bw_example_fx_vibrato_reset(bw_example_fx_vibrato *instance); void bw_example_fx_vibrato_process(bw_example_fx_vibrato *instance, const float** x, float** y, int n_samples); diff --git a/examples/synth_mono/src/bw_example_synth_mono.c b/examples/synth_mono/src/bw_example_synth_mono.c index 19e9577..0dbabe7 100644 --- a/examples/synth_mono/src/bw_example_synth_mono.c +++ b/examples/synth_mono/src/bw_example_synth_mono.c @@ -167,13 +167,13 @@ void bw_example_synth_mono_process(bw_example_synth_mono *instance, const float* bw_pink_filt_process(&instance->pink_filt_coeffs, &instance->pink_filt_state, instance->buf[0], instance->buf[0], n); else bw_pink_filt_reset_state(&instance->pink_filt_coeffs, &instance->pink_filt_state); // FIXME: calling this here is sloppy coding - bw_buf_scale(instance->buf[0], instance->buf[0], 5.f, n); + bw_buf_scale(instance->buf[0], 5.f, instance->buf[0], n); for (int j = 0; j < n; j++) instance->buf[1][j] = instance->mod_wheel * (out[j] + instance->params[p_mod_mix] * (instance->buf[0][j] - out[j])); const float vcf_mod = 0.3f * instance->params[p_vcf_mod] * instance->buf[1][0]; - bw_buf_scale(instance->buf[2], instance->buf[1], instance->params[p_vco1_mod], n); + bw_buf_scale(instance->buf[1], instance->params[p_vco1_mod], instance->buf[2], n); bw_phase_gen_process(&instance->vco1_phase_gen_coeffs, &instance->vco1_phase_gen_state, instance->buf[2], instance->buf[2], instance->buf[3], n); if (instance->params[p_vco1_waveform] >= (1.f / 4.f + 1.f / 2.f)) { bw_osc_tri_process(&instance->vco1_tri_coeffs, instance->buf[2], instance->buf[3], instance->buf[2], n); @@ -187,7 +187,7 @@ void bw_example_synth_mono_process(bw_example_synth_mono *instance, const float* bw_osc_tri_reset_coeffs(&instance->vco1_tri_coeffs); } - bw_buf_scale(instance->buf[1], instance->buf[1], instance->params[p_vco2_mod], n); + bw_buf_scale(instance->buf[1], instance->params[p_vco2_mod], instance->buf[1], n); bw_phase_gen_process(&instance->vco2_phase_gen_coeffs, &instance->vco2_phase_gen_state, instance->buf[1], instance->buf[1], instance->buf[3], n); if (instance->params[p_vco2_waveform] >= (1.f / 4.f + 1.f / 2.f)) { bw_osc_tri_process(&instance->vco2_tri_coeffs, instance->buf[1], instance->buf[3], instance->buf[1], n); @@ -205,16 +205,16 @@ void bw_example_synth_mono_process(bw_example_synth_mono *instance, const float* bw_gain_process(&instance->vco2_gain_coeffs, instance->buf[1], instance->buf[1], n); bw_gain_process(&instance->vco3_gain_coeffs, out, out, n); bw_gain_process(&instance->noise_gain_coeffs, instance->buf[0], instance->buf[0], n); - bw_buf_mix(out, out, instance->buf[1], n); - bw_buf_mix(out, out, instance->buf[2], n); + bw_buf_mix(out, instance->buf[1], out, n); + bw_buf_mix(out, instance->buf[2], out, n); bw_osc_filt_process(&instance->osc_filt_state, out, out, n); const float k = instance->params[p_noise_color] >= 0.5f ? 6.f * bw_noise_gen_get_scaling_k(&instance->noise_gen_coeffs) * bw_pink_filt_get_scaling_k(&instance->pink_filt_coeffs) : 0.1f * bw_noise_gen_get_scaling_k(&instance->noise_gen_coeffs); - bw_buf_scale(instance->buf[0], instance->buf[0], k, n); - bw_buf_mix(out, out, instance->buf[0], n); + bw_buf_scale(instance->buf[0], k, instance->buf[0], n); + bw_buf_mix(out, instance->buf[0], out, n); bw_env_gen_process(&instance->vcf_env_gen_coeffs, &instance->vcf_env_gen_state, instance->gate, NULL, n); float v = instance->params[p_vcf_cutoff] + instance->params[p_vcf_contour] * bw_env_gen_get_y_z1(&instance->vcf_env_gen_state) + vcf_mod; @@ -230,12 +230,12 @@ void bw_example_synth_mono_process(bw_example_synth_mono *instance, const float* bw_svf_process(&instance->vcf_coeffs, &instance->vcf_state, out, out, NULL, NULL, n); bw_env_gen_process(&instance->vca_env_gen_coeffs, &instance->vca_env_gen_state, instance->gate, instance->buf[0], n); - bw_buf_mul(out, out, instance->buf[0], n); + bw_buf_mul(out, instance->buf[0], out, n); bw_phase_gen_process(&instance->a440_phase_gen_coeffs, &instance->a440_phase_gen_state, NULL, instance->buf[0], NULL, n); bw_osc_sin_process(instance->buf[0], instance->buf[0], n); if (instance->params[p_a440] >= 0.5f) - bw_buf_mix(out, out, instance->buf[0], n); + bw_buf_mix(out, instance->buf[0], out, n); bw_gain_process(&instance->gain_coeffs, out, out, n); bw_ppm_process(&instance->ppm_coeffs, &instance->ppm_state, out, NULL, n); diff --git a/examples/synth_poly/src/bw_example_synth_poly.c b/examples/synth_poly/src/bw_example_synth_poly.c index a20db60..21daf28 100644 --- a/examples/synth_poly/src/bw_example_synth_poly.c +++ b/examples/synth_poly/src/bw_example_synth_poly.c @@ -237,7 +237,7 @@ void bw_example_synth_poly_process(bw_example_synth_poly *instance, const float* else for (int j = 0; j < N_VOICES; j++) bw_pink_filt_reset_state(&instance->pink_filt_coeffs, pink_filt_states[j]); // FIXME: calling this here is sloppy coding - bw_buf_scale_multi(b1, (const float **)b1, 5.f, N_VOICES, n); + bw_buf_scale_multi((const float **)b1, 5.f, b1, N_VOICES, n); float vcf_mod[N_VOICES]; for (int j = 0; j < N_VOICES; j++) { @@ -247,7 +247,7 @@ void bw_example_synth_poly_process(bw_example_synth_poly *instance, const float* } for (int j = 0; j < N_VOICES; j++) { - bw_buf_scale(b3[j], b2[j], instance->params[p_vco1_mod], n); + bw_buf_scale(b2[j], instance->params[p_vco1_mod], b3[j], n); bw_phase_gen_process(&instance->voices[j].vco1_phase_gen_coeffs, &instance->voices[j].vco1_phase_gen_state, b3[j], b3[j], b4[j], n); } if (instance->params[p_vco1_waveform] >= (1.f / 4.f + 1.f / 2.f)) { @@ -263,7 +263,7 @@ void bw_example_synth_poly_process(bw_example_synth_poly *instance, const float* } for (int j = 0; j < N_VOICES; j++) { - bw_buf_scale(b2[j], b2[j], instance->params[p_vco2_mod], n); + bw_buf_scale(b2[j], instance->params[p_vco2_mod], b2[j], n); bw_phase_gen_process(&instance->voices[j].vco2_phase_gen_coeffs, &instance->voices[j].vco2_phase_gen_state, b2[j], b2[j], b4[j], n); } if (instance->params[p_vco2_waveform] >= (1.f / 4.f + 1.f / 2.f)) { @@ -282,16 +282,16 @@ void bw_example_synth_poly_process(bw_example_synth_poly *instance, const float* bw_gain_process_multi(&instance->vco2_gain_coeffs, (const float **)b2, b2, N_VOICES, n); bw_gain_process_multi(&instance->vco3_gain_coeffs, (const float **)b0, b0, N_VOICES, n); bw_gain_process_multi(&instance->noise_gain_coeffs, (const float **)b1, b1, N_VOICES, n); - bw_buf_mix_multi(b0, (const float **)b0, (const float **)b2, N_VOICES, n); - bw_buf_mix_multi(b0, (const float **)b0, (const float **)b3, N_VOICES, n); + bw_buf_mix_multi((const float **)b0, (const float **)b2, b0, N_VOICES, n); + bw_buf_mix_multi((const float **)b0, (const float **)b3, b0, N_VOICES, n); bw_osc_filt_process_multi(osc_filt_states, (const float **)b0, b0, N_VOICES, n); const float k = instance->params[p_noise_color] >= 0.5f ? 6.f * bw_noise_gen_get_scaling_k(&instance->noise_gen_coeffs) * bw_pink_filt_get_scaling_k(&instance->pink_filt_coeffs) : 0.1f * bw_noise_gen_get_scaling_k(&instance->noise_gen_coeffs); - bw_buf_scale_multi(b1, (const float **)b1, k, N_VOICES, n); - bw_buf_mix_multi(b0, (const float **)b0, (const float **)b1, N_VOICES, n); + bw_buf_scale_multi((const float **)b1, k, b1, N_VOICES, n); + bw_buf_mix_multi((const float **)b0, (const float **)b1, b0, N_VOICES, n); bw_env_gen_process_multi(&instance->vcf_env_gen_coeffs, vcf_env_gen_states, gates, NULL, N_VOICES, n); for (int j = 0; j < N_VOICES; j++) { @@ -309,16 +309,16 @@ void bw_example_synth_poly_process(bw_example_synth_poly *instance, const float* } bw_env_gen_process_multi(&instance->vca_env_gen_coeffs, vca_env_gen_states, gates, b1, N_VOICES, n); - bw_buf_mul_multi(b0, (const float **)b0, (const float **)b1, N_VOICES, n); + bw_buf_mul_multi((const float **)b0, (const float **)b1, b0, N_VOICES, n); - bw_buf_fill(out, 0.f, n); + bw_buf_fill(0.f, out, n); for (int j = 0; j < N_VOICES; j++) - bw_buf_mix(out, out, b0[j], n); + bw_buf_mix(out, b0[j], out, n); bw_phase_gen_process(&instance->a440_phase_gen_coeffs, &instance->a440_phase_gen_state, NULL, instance->buf, NULL, n); bw_osc_sin_process(instance->buf, instance->buf, n); if (instance->params[p_a440] >= 0.5f) - bw_buf_mix(out, out, instance->buf, n); + bw_buf_mix(out, instance->buf, out, n); bw_gain_process(&instance->gain_coeffs, out, out, n); bw_ppm_process(&instance->ppm_coeffs, &instance->ppm_state, out, NULL, n); diff --git a/examples/synth_simple/src/bw_example_synth_simple.c b/examples/synth_simple/src/bw_example_synth_simple.c index aef0014..4669088 100644 --- a/examples/synth_simple/src/bw_example_synth_simple.c +++ b/examples/synth_simple/src/bw_example_synth_simple.c @@ -73,7 +73,7 @@ void bw_example_synth_simple_process(bw_example_synth_simple *instance, const fl bw_osc_filt_process(&instance->osc_filt_state, out, out, n); bw_svf_process(&instance->svf_coeffs, &instance->svf_state, out, out, NULL, NULL, n); bw_env_gen_process(&instance->env_gen_coeffs, &instance->env_gen_state, instance->note >= 0, instance->buf, n); - bw_buf_mul(out, out, instance->buf, n); + bw_buf_mul(out, instance->buf, out, n); bw_gain_process(&instance->gain_coeffs, out, out, n); bw_ppm_process(&instance->ppm_coeffs, &instance->ppm_state, out, NULL, n); } diff --git a/examples/synthpp_mono/src/bw_example_synthpp_mono.cpp b/examples/synthpp_mono/src/bw_example_synthpp_mono.cpp index 7392622..692f058 100644 --- a/examples/synthpp_mono/src/bw_example_synthpp_mono.cpp +++ b/examples/synthpp_mono/src/bw_example_synthpp_mono.cpp @@ -139,13 +139,13 @@ void bw_example_synthpp_mono_process(bw_example_synthpp_mono *instance, const fl instance->pinkFilt.process({instance->buf[0]}, {instance->buf[0]}, n); else instance->pinkFilt.reset(); // FIXME: calling this here is sloppy coding - bw_buf_scale(instance->buf[0], instance->buf[0], 5.f, n); + bufScale<1>({instance->buf[0]}, 5.f, {instance->buf[0]}, n); for (int j = 0; j < n; j++) instance->buf[1][j] = instance->mod_wheel * (out[j] + instance->params[p_mod_mix] * (instance->buf[0][j] - out[j])); const float vcf_mod = 0.3f * instance->params[p_vcf_mod] * instance->buf[1][0]; - bw_buf_scale(instance->buf[2], instance->buf[1], instance->params[p_vco1_mod], n); + bufScale<1>({instance->buf[1]}, instance->params[p_vco1_mod], {instance->buf[2]}, n); instance->vco1PhaseGen.process({instance->buf[2]}, {instance->buf[2]}, {instance->buf[3]}, n); if (instance->params[p_vco1_waveform] >= (1.f / 4.f + 1.f / 2.f)) { instance->vco1OscTri.process({instance->buf[2]}, {instance->buf[3]}, {instance->buf[2]}, n); @@ -159,7 +159,7 @@ void bw_example_synthpp_mono_process(bw_example_synthpp_mono *instance, const fl instance->vco1OscTri.reset(); } - bw_buf_scale(instance->buf[1], instance->buf[1], instance->params[p_vco1_mod], n); + bufScale<1>({instance->buf[1]}, instance->params[p_vco1_mod], {instance->buf[1]}, n); instance->vco2PhaseGen.process({instance->buf[1]}, {instance->buf[1]}, {instance->buf[3]}, n); if (instance->params[p_vco2_waveform] >= (1.f / 4.f + 1.f / 2.f)) { instance->vco2OscTri.process({instance->buf[1]}, {instance->buf[3]}, {instance->buf[1]}, n); @@ -177,16 +177,16 @@ void bw_example_synthpp_mono_process(bw_example_synthpp_mono *instance, const fl instance->vco2Gain.process({instance->buf[1]}, {instance->buf[1]}, n); instance->vco3Gain.process({out}, {out}, n); instance->noiseGain.process({instance->buf[0]}, {instance->buf[0]}, n); - bw_buf_mix(out, out, instance->buf[1], n); - bw_buf_mix(out, out, instance->buf[2], n); + bufMix<1>({out}, {instance->buf[1]}, {out}, n); + bufMix<1>({out}, {instance->buf[2]}, {out}, n); instance->oscFilt.process({out}, {out}, n); const float k = instance->params[p_noise_color] >= 0.5f ? 6.f * instance->noiseGen.getScalingK() * instance->pinkFilt.getScalingK() : 0.1f * instance->noiseGen.getScalingK(); - bw_buf_scale(instance->buf[0], instance->buf[0], k, n); - bw_buf_mix(out, out, instance->buf[0], n); + bufScale<1>({instance->buf[0]}, k, {instance->buf[0]}, n); + bufMix<1>({out}, {instance->buf[0]}, {out}, n); instance->vcfEnvGen.process({instance->gate}, {nullptr}, n); float v = instance->params[p_vcf_cutoff] + instance->params[p_vcf_contour] * instance->vcfEnvGen.getYZ1(0) + vcf_mod; @@ -202,12 +202,12 @@ void bw_example_synthpp_mono_process(bw_example_synthpp_mono *instance, const fl instance->vcf.process({out}, {out}, {nullptr}, {nullptr}, n); instance->vcaEnvGen.process({instance->gate}, {instance->buf[0]}, n); - bw_buf_mul(out, out, instance->buf[0], n); + bufMul<1>({out}, {instance->buf[0]}, {out}, n); instance->a440PhaseGen.process({nullptr}, {instance->buf[0]}, {nullptr}, n); oscSinProcess<1>({instance->buf[0]}, {instance->buf[0]}, n); if (instance->params[p_a440] >= 0.5f) - bw_buf_mix(out, out, instance->buf[0], n); + bufMix<1>({out}, {instance->buf[0]}, {out}, n); instance->gain.process({out}, {out}, n); instance->ppm.process({out}, {nullptr}, n); diff --git a/examples/synthpp_simple/src/bw_example_synthpp_simple.cpp b/examples/synthpp_simple/src/bw_example_synthpp_simple.cpp index 93c708b..829eba6 100644 --- a/examples/synthpp_simple/src/bw_example_synthpp_simple.cpp +++ b/examples/synthpp_simple/src/bw_example_synthpp_simple.cpp @@ -62,7 +62,7 @@ void bw_example_synthpp_simple_process(bw_example_synthpp_simple *instance, cons instance->oscFilt.process({out}, {out}, n); instance->svf.process({out}, {out}, {nullptr}, {nullptr}, n); instance->envGen.process({instance->note >= 0}, {instance->buf}, n); - bw_buf_mul(out, out, instance->buf, n); + bufMul<1>({out}, {instance->buf}, {out}, n); instance->gain.process({out}, {out}, n); instance->ppm.process({out}, {nullptr}, n); } diff --git a/include/bw_buf.h b/include/bw_buf.h index bac50d0..ba5f418 100644 --- a/include/bw_buf.h +++ b/include/bw_buf.h @@ -31,6 +31,9 @@ *
size_t
instead of
* BW_SIZE_T
.const
specifiers to input
+ * arguments.