Collection of C++ patches for the Electrosmith Daisy 🌱
Welcome to Flora! This is a collection of C++ patches for the Electrosmith Daisy platform.
It uses an underlying DSP library, Neuron, for constructing the processing chains for different patches.
Follow the official guide from Electrosmith to setup your development environment.
Clone this repository including the necessary submodules:
git clone --recurse-submodules https://github.com/blackboxaudio/flora
cd flora/
Build the required external libraries:
./scripts/build.sh
To load a specific patch to the device, first navigate to that patches directory (e.g. flora/patches/seed/blink
). Then just run a few make
commands:
# Clean the previous build's output (unnecessary for first time)
make clean
# Compiles the patch's source code
make
# Flashes the Daisy device with binaries
make program-dfu
For an easier way to flash your patches, use flash.sh
located in the scripts folder:
./scripts/flash.sh <PLATFORM> <PATCH>
There are a number of existing patches, which have already been designed:
- Init
- Pod
- Lily - A simple binaural oscillator, overlapping frequencies and phases
- Seed
To write your own patch, you can simply modify an example or copy an example folder and re-write the code as necessary.
Here is an example of a simple oscillator patch:
#include "neuron.h"
#include "daisy_seed.h"
using namespace daisy;
using namespace neuron;
DaisySeed hardware;
Oscillator oscillator;
void AudioCallback(AudioHandle::InterleavingInputBuffer in,
AudioHandle::InterleavingOutputBuffer out,
size_t size)
{
for (size_t idx = 0; idx < size; idx += 2) {
auto sample = (float)oscillator.Generate();
out[idx] = sample;
out[idx + 1] = sample;
}
}
int main(void)
{
hardware.Configure();
hardware.Init();
hardware.SetAudioBlockSize(4);
hardware.adc.Start();
hardware.StartAudio(AudioCallback);
while (1) { }
}