Hi there,
I’ve tried a simple code for guitar in and out. I know this is crazy simple. I’m looking to do this before any buffer/attenuation questions arise.
Can anyone correct/provide code to do this.
I have audio in going to pin 16 and audio out going to pin 18. pin 20 and 40 to breadboard ground.
Here is the .cpp
#include “daisysp.h”
#include “daisy_seed.h”using namespace daisysp;
using namespace daisy;static DaisySeed seed;
static void AudioCallback(float *in, float *out, size_t size)
{
for(size_t i = 0; i < size; i += 2)
{
out[i] = in[i];
}
}int main(void)
{
// initialize seed hardware.
seed.Configure();
seed.Init();//set blocksize.
seed.SetAudioBlockSize(48000);// start callback
seed.StartAudio(AudioCallback);while(1) {}
}
do i need the makefile? i have set up as below…
Project Name
TARGET = will_guitar_in_out
Sources
CPP_SOURCES = will_guitar_in_out.cpp
Library Locations
LIBDAISY_DIR = …/…/libdaisy
DAISYSP_DIR = …/…/DaisySPCore location, and generic makefile.
SYSTEM_FILES_DIR = $(LIBDAISY_DIR)/core
include $(SYSTEM_FILES_DIR)/Makefile
Pic of the breadboard
Any help greatly appreciated!
Will