Skip to content

Commit

Permalink
Complete the lib rename
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwellmattryan committed Nov 12, 2024
1 parent 2d28c36 commit d6cf959
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 81 deletions.
37 changes: 0 additions & 37 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,3 @@
```
- Please write a list of changes
```

## Testing

### Instructions

> Please describe relevant instructions, configurations, etc. for testing your changes.
...

### Platforms

> Please select any platforms where your changes have been tested.
- **Desktop**
- [ ] MacOS
- [ ] Linux
- [ ] Windows
- **Mobile**
- [ ] iOS
- [ ] Android
- **Web**
- [ ] Chrome
- [ ] Firefox
- [ ] Brave
- [ ] Safari

## Checklist

> Please tick the following boxes that are relevant to your changes.
- [ ] I have followed the contribution guidelines for this project
- [ ] I have performed a self-review of my changes
- [ ] I have added or modified tests, proving my changes work as intended
- [ ] I have added comments to my code for hard-to-understand areas
- [ ] I have verified that new and existing unit tests pass locally with my changes
- [ ] I have verified that my latest changes pass CI workflows for testing and linting
- [ ] I have made corresponding changes to the documentation
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Flora

[![Build](https://github.com/blackboxaudio/flora/actions/workflows/ci.build.yml/badge.svg)](https://github.com/blackboxaudio/flora/actions/workflows/ci.build.yml)
[![License](https://img.shields.io/badge/License-MIT-yellow)](https://github.com/blackboxaudio/cortex/blob/develop/LICENSE)
[![License](https://img.shields.io/badge/License-MIT-yellow)](https://github.com/blackboxaudio/neuron/blob/develop/LICENSE)

> Collection of C++ patches for the Electrosmith Daisy 🌱
## Overview

Welcome to Flora! This is a collection of C++ patches for the Electrosmith Daisy platform.

It uses an underlying DSP library, [Cortex](https://github.com/blackboxaudio/cortex), for constructing
It uses an underlying DSP library, [Neuron](https://github.com/blackboxaudio/neuron), for constructing
the processing chains for different patches.

## Getting Started
Expand Down Expand Up @@ -70,11 +70,11 @@ To write your own patch, you can simply modify an example or copy an example fol

Here is an example of a simple oscillator patch:
```c++
#include "cortex.h"
#include "neuron.h"
#include "daisy_seed.h"

using namespace daisy;
using namespace cortex;
using namespace neuron;

DaisySeed hardware;
Oscillator oscillator;
Expand Down
10 changes: 5 additions & 5 deletions patches/init/kudzu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ CPP_SOURCES = kudzu.cpp

# Library Directories
LIBDAISY_DIR = ../../../vendor/libDaisy
LIBCORTEX_DIR = ../../../lib/cortex
LIBNEURON_DIR = ../../../lib/neuron

# Include Cortex library
C_INCLUDES += -I$(LIBCORTEX_DIR)/src
LIBS += -lcortex
LIBDIR += -L$(LIBCORTEX_DIR)/target/release
# Include Neuron library
C_INCLUDES += -I$(LIBNEURON_DIR)/src
LIBS += -lneuron
LIBDIR += -L$(LIBNEURON_DIR)/target/release

# Include Daisy library Makefile
SYSTEM_FILES_DIR = $(LIBDAISY_DIR)/core
Expand Down
10 changes: 5 additions & 5 deletions patches/init/kudzu/kudzu.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#include "cortex.h"
#include "daisy_patch_sm.h"
#include "neuron.h"

using namespace daisy;
using namespace patch_sm;

DaisyPatchSM hardware;
Switch toggle;

cortex::Saturator saturator;
cortex::Wavefolder wavefolder;
cortex::Filter filter;
neuron::Saturator saturator;
neuron::Wavefolder wavefolder;
neuron::Filter filter;

void AudioCallback(AudioHandle::InterleavingInputBuffer in,
AudioHandle::InterleavingOutputBuffer out,
Expand All @@ -30,7 +30,7 @@ void AudioCallback(AudioHandle::InterleavingInputBuffer in,
wavefolder.SetInputGain((driveKnob * 6.0f) + 1.0f);
wavefolder.SetSymmetry(1.0f - symmetryKnob);

filter.SetCutoffFrequency(cortex::map(toneKnob, 1000.0f, cortex::FILTER_CUTOFF_FREQ_MAX, cortex::Mapping::LOG));
filter.SetCutoffFrequency(neuron::map(toneKnob, 1000.0f, neuron::FILTER_CUTOFF_FREQ_MAX, neuron::Mapping::LOG));

for (size_t idx = 0; idx < size; idx++) {
float originalSample = in[idx];
Expand Down
10 changes: 5 additions & 5 deletions patches/init/lotus/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ CPP_SOURCES = lotus.cpp

# Library Directories
LIBDAISY_DIR = ../../../vendor/libDaisy
LIBCORTEX_DIR = ../../../lib/cortex
LIBNEURON_DIR = ../../../lib/neuron

# Include Cortex library
C_INCLUDES += -I$(LIBCORTEX_DIR)/src
LIBS += -lcortex
LIBDIR += -L$(LIBCORTEX_DIR)/target/release
# Include Neuron library
C_INCLUDES += -I$(LIBNEURON_DIR)/src
LIBS += -lneuron
LIBDIR += -L$(LIBNEURON_DIR)/target/release

# Include Daisy library Makefile
SYSTEM_FILES_DIR = $(LIBDAISY_DIR)/core
Expand Down
10 changes: 5 additions & 5 deletions patches/init/lotus/lotus.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#include "cortex.h"
#include "daisy_patch_sm.h"
#include "neuron.h"

using namespace daisy;
using namespace patch_sm;

DaisyPatchSM hardware;
Switch toggle;

cortex::Oscillator leader;
cortex::Oscillator follower;
cortex::Oscillator lfo;
neuron::Oscillator leader;
neuron::Oscillator follower;
neuron::Oscillator lfo;

const float MAX_DETUNE_AMOUNT = 20.0f;

Expand All @@ -30,7 +30,7 @@ void AudioCallback(AudioHandle::InterleavingInputBuffer in, AudioHandle::Interle
leader.DetachFollower();
}

float leaderFrequency = cortex::map(tuneKnob, 65.406f, 261.626f, cortex::Mapping::LOG);
float leaderFrequency = neuron::map(tuneKnob, 65.406f, 261.626f, neuron::Mapping::LOG);
leader.SetFrequency(leaderFrequency);

float followerDetune = MAX_DETUNE_AMOUNT * ((detuneKnob * 2.0f) - 1.0f);
Expand Down
8 changes: 4 additions & 4 deletions patches/pod/lily/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ CPP_SOURCES = lily.cpp

# Library Directories
LIBDAISY_DIR = ../../../vendor/libDaisy
LIBCORTEX_DIR = ../../../lib/cortex
LIBNEURON_DIR = ../../../lib/cortex

# Include Cortex library
C_INCLUDES += -I$(LIBCORTEX_DIR)/src
# Include Neuron library
C_INCLUDES += -I$(LIBNEURON_DIR)/src
LIBS += -lcortex
LIBDIR += -L$(LIBCORTEX_DIR)/target/release
LIBDIR += -L$(LIBNEURON_DIR)/target/release

# Include Daisy library Makefile
SYSTEM_FILES_DIR = $(LIBDAISY_DIR)/core
Expand Down
10 changes: 5 additions & 5 deletions patches/seed/blink/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ CPP_SOURCES = blink.cpp

# Library Directories
LIBDAISY_DIR = ../../../vendor/libDaisy
LIBCORTEX_DIR = ../../../lib/cortex
LIBNEURON_DIR = ../../../lib/neuron

# Include Cortex library
C_INCLUDES += -I$(LIBCORTEX_DIR)/src
LIBS += -lcortex
LIBDIR += -L$(LIBCORTEX_DIR)/target/release
# Include Neuron library
C_INCLUDES += -I$(LIBNEURON_DIR)/src
LIBS += -lneuron
LIBDIR += -L$(LIBNEURON_DIR)/target/release

# Include Daisy library Makefile
SYSTEM_FILES_DIR = $(LIBDAISY_DIR)/core
Expand Down
10 changes: 5 additions & 5 deletions patches/seed/daisy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ CPP_SOURCES = daisy.cpp

# Library Directories
LIBDAISY_DIR = ../../../vendor/libDaisy
LIBCORTEX_DIR = ../../../lib/cortex
LIBNEURON_DIR = ../../../lib/neuron

# Include Cortex library
C_INCLUDES += -I$(LIBCORTEX_DIR)/src
LIBS += -lcortex
LIBDIR += -L$(LIBCORTEX_DIR)/target/release
# Include Neuron library
C_INCLUDES += -I$(LIBNEURON_DIR)/src
LIBS += -lneuron
LIBDIR += -L$(LIBNEURON_DIR)/target/release

# Include Daisy library Makefile
SYSTEM_FILES_DIR = $(LIBDAISY_DIR)/core
Expand Down
4 changes: 2 additions & 2 deletions patches/seed/daisy/daisy.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "cortex.h"
#include "daisy_seed.h"
#include "neuron.h"

using namespace daisy;
using namespace cortex;
using namespace neuron;

DaisySeed hardware;
Oscillator oscillator(DEFAULT_CONTEXT, 110.0f);
Expand Down
8 changes: 4 additions & 4 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash

CORTEX_DIR=$PWD/lib/cortex
NEURON_DIR=$PWD/lib/neuron
DAISY_DIR=$PWD/vendor/libDaisy

printf "Building Cortex...\n"
cd $CORTEX_DIR; make -s clean; make -j -s
printf "Building Neuron...\n"
cd $NEURON_DIR; make -s clean; make -j -s
if [ $? -ne 0 ]; then
printf "Failed to compile Cortex library\n"
printf "Failed to compile Neuron library\n"
exit 1
fi

Expand Down

0 comments on commit d6cf959

Please sign in to comment.