33#ifdef USE_MEMORY_MANAGER
63#ifdef USE_MEMORY_MANAGER
66 p_dsp = DSP::create();
77 DSP::classInit(
cfg.sample_rate);
80 p_dsp->instanceInit(
cfg.sample_rate);
107 p_dsp->instanceClear();
108#ifdef USE_MEMORY_MANAGER
125 switch(
cfg.bits_per_sample){
146 size_t write(
const uint8_t *data,
size_t len)
override {
147 LOGD(
"FaustStream::write: %d", len);
148 switch(
cfg.bits_per_sample){
173 return ui.getValue(label);
179 bool result =
ui.setValue(label, value);
180 LOGI(
"setLabelValue('%s',%f) -> %s", label, value, result?
"true":
"false");
245 int num_outputs =
p_dsp->getNumOutputs();
246 if (
cfg.channels!=num_outputs){
247 cfg.channels = num_outputs;
248 LOGW(
"Updating channels to %d", num_outputs);
252 if (num_outputs==
cfg.channels){
255 LOGE(
"NumOutputs %d is not matching with number of channels %d", num_outputs,
cfg.channels);
258 if (
p_dsp->getNumInputs()!=0 &&
p_dsp->getNumInputs()!=
cfg.channels){
259 LOGE(
"NumInputs is not matching with number of channels");
262 if (
p_dsp->getNumInputs()>0){
266 LOGE(
"Faust expects input - you need to provide and AudioStream in the constructor");
277 T *dataT = (T*) data_out;
278 int frameCount = samples/
cfg.channels;
279 for (
int j=0; j<frameCount; j++){
280 for (
int i=0;i<
cfg.channels;i++){
281 float sample = p_float_in[i][j];
297 T *dataT = (T*) data_in;
298 int frameCount = samples/
cfg.channels;
299 for(
int j=0;j<frameCount;j++){
300 for(
int i=0;i<
cfg.channels;i++){
308 size_t writeT(
const uint8_t *write_data,
size_t len) {
313 int frames = samples /
cfg.channels;
325 result =
p_out->write(write_data, len);
335 for (
int j=0;j<
cfg.channels;j++){
341 for (
int j=0;j<
cfg.channels;j++){
348 const int ch =
cfg.channels;
349 for (
int j=0;j<ch;j++){
356 const int ch =
cfg.channels;
357 for (
int j=0;j<ch;j++){
366 for (
int j=0;j<
cfg.channels;j++){
373 for (
int j=0;j<
cfg.channels;j++){
383 return 440.0 * pow(2.0f, (note-69)/12);
#define FAUSTFLOAT
Definition AudioFaustDSP.h:9
#define DEFAULT_BUFFER_SIZE
Minimum implementation of UI parameters. We only support the setting and getting of values.
Definition AudioFaustDSP.h:52
Memory manager which uses psram when it is available.
Definition AudioFaustDSP.h:181
minimal dsp base class needed by Faust
Definition AudioFaustDSP.h:25