beginning of daisy seed support

This commit is contained in:
Stefano D'Angelo 2023-02-03 11:48:37 +01:00
parent 0f204c3aa9
commit 1972040cb0
4 changed files with 75 additions and 0 deletions

1
TODO
View File

@ -26,6 +26,7 @@ code:
* pan process with no out: should just reset coeffs?
* trace calls (debug)
* svf bandpass out polarity too confusing?
* better common config.h (less stuff maybe)
build system:
* make makefiles handle paths with spaces etc

View File

@ -0,0 +1,16 @@
LIBDAISY_DIR := ${ROOT_DIR}/../../../../libDaisy
ifdef SYNTH
CPP_SOURCES = ${ROOT_DIR}/../../common/daisy-seed/synth.cpp
else
CPP_SOURCES = ${ROOT_DIR}/../../common/daisy-seed/fx.cpp
endif
LDFLAGS += -u _printf_float
SYSTEM_FILES_DIR = ${LIBDAISY_DIR}/core
include ${SYSTEM_FILES_DIR}/Makefile
CPPFLAGS += \
-I${ROOT_DIR}/../src \
-I${ROOT_DIR}/../../../include

View File

@ -0,0 +1,52 @@
#include "daisy_seed.h"
#include "config.h"
using namespace daisy;
DaisySeed hardware;
P_TYPE instance;
static void AudioCallback(
AudioHandle::InterleavingInputBuffer in,
AudioHandle::InterleavingOutputBuffer out,
size_t size) {
// set params
// update coeffs ctrl
for (size_t i = 0; i < size; i++)
// update coeffs audio
out[i] = in[i];
}
int main() {
hardware.Configure();
hardware.Init();
// ...
AdcChannelConfig adcConfig;
adcConfig.InitSingle(hardware.GetPin(21));
hardware.adc.Init(&adcConfig, 1);
hardware.adc.Start();
// ...
hardware.SetAudioBlockSize(32);
float sample_rate = hardware.AudioSampleRate();
// init
// set sample rate
hardware.StartLog();
// set params
// reset coeffs
// reset state
hardware.StartAudio(AudioCallback);
while (1) {
//hardware.adc.GetFloat(0);
//hardware.PrintLine("%f",x);
//System::Delay(x);
}
}

View File

@ -0,0 +1,6 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
TARGET = bw_example_fx_wah
CPP_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_wah.c
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk