beginning of daisy seed support
This commit is contained in:
parent
0f204c3aa9
commit
1972040cb0
1
TODO
1
TODO
@ -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
|
||||
|
16
examples/common/daisy-seed/daisy-seed.mk
Normal file
16
examples/common/daisy-seed/daisy-seed.mk
Normal 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
|
52
examples/common/daisy-seed/fx.cpp
Normal file
52
examples/common/daisy-seed/fx.cpp
Normal 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);
|
||||
}
|
||||
}
|
6
examples/fx_wah/daisy-seed/Makefile
Normal file
6
examples/fx_wah/daisy-seed/Makefile
Normal 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
|
Loading…
Reference in New Issue
Block a user