-
Notifications
You must be signed in to change notification settings - Fork 2
Getting started
You can include this library into your project as a git submodule and only need to reference it in your Makefile. A minimal example could look something like this:
# Makefile
TARGET = example
BOARD = wdsp-dev
include WhateverDSP/libwdsp.mk
Including the WhateverDSP makefile and setting the name of your output sets up everything you need to get you started. In this configuration it would automatically compile an example.c into a ready to flash binary once you invoke make
. For more complex projects you can specify your own dependencies like usual.
Here is what that a simple example effect that just passes through audio would look like:
// example.c
#include <libwdsp.h>
void wdsp_process(float *in_buffer[BLOCK_SIZE], float *out_buffer[BLOCK_SIZE])
{
for (int i = 0; i < BLOCK_SIZE; i++)
{
float l_samp = in_buffer[0][i];
float r_samp = in_buffer[1][i];
out_buffer[0][i] = l_samp;
out_buffer[1][i] = r_samp;
}
}
If you have dfu-util
installed the resulting binary can be flashed onto the board by connecting it to your computer via USB, holding down the "Boot" button while plugging the 9V DC power in, and running make dfu
.