Browse Source

Update calfbox

master
Nils 2 years ago
parent
commit
d6960c0b14
  1. 9
      template/calfbox/dspmath.h
  2. 4
      template/calfbox/fluid.c

9
template/calfbox/dspmath.h

@ -92,8 +92,7 @@ static inline float sanef(float v)
static inline void sanebf(float *buf)
{
int i;
for (i = 0; i < CBOX_BLOCK_SIZE; i++)
for (int i = 0; i < CBOX_BLOCK_SIZE; ++i)
buf[i] = sanef(buf[i]);
}
@ -102,6 +101,12 @@ static inline void copybf(float *to, float *from)
memcpy(to, from, sizeof(float) * CBOX_BLOCK_SIZE);
}
static inline void zerobf(float *to)
{
for (int i = 0; i < CBOX_BLOCK_SIZE; ++i)
to[i] = 0.f;
}
static inline float cent2factor(float cent)
{
return powf(2.0, cent * (1.f / 1200.f)); // I think this may be optimised using exp()

4
template/calfbox/fluid.c

@ -241,7 +241,9 @@ void fluidsynth_process_block(struct cbox_module *module, cbox_sample_t **inputs
float *fx_outputs[4];
for (int i = 0; i < 4; i++)
fx_outputs[i] = outputs[2 * m->output_pairs + i];
fluid_synth_process(m->synth, CBOX_BLOCK_SIZE, 2, fx_outputs, m->output_pairs, outputs);
for (int i = 0; i < 2 * (2 + m->output_pairs); i++)
zerobf(outputs[i]);
fluid_synth_process(m->synth, CBOX_BLOCK_SIZE, 4, fx_outputs, 2 * m->output_pairs, outputs);
#endif
}
}

Loading…
Cancel
Save