├── .gitmodules ├── reverb ├── Makefile └── reverb.cpp ├── .github └── workflows │ └── cpp.yml ├── LICENSE └── README.md /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "libDaisy"] 2 | path = libDaisy 3 | url = https://github.com/electro-smith/libDaisy 4 | [submodule "DaisySP"] 5 | path = DaisySP 6 | url = https://github.com/electro-smith/DaisySP 7 | [submodule "Terrarium"] 8 | path = Terrarium 9 | url = https://github.com/PedalPCB/Terrarium 10 | -------------------------------------------------------------------------------- /reverb/Makefile: -------------------------------------------------------------------------------- 1 | # Project Name 2 | TARGET = reverb 3 | 4 | # Sources 5 | CPP_SOURCES = reverb.cpp 6 | 7 | # Library Locations 8 | LIBDAISY_DIR = ../libDaisy 9 | DAISYSP_DIR = ../DaisySP 10 | 11 | # Core location, and generic Makefile. 12 | SYSTEM_FILES_DIR = $(LIBDAISY_DIR)/core 13 | include $(SYSTEM_FILES_DIR)/Makefile 14 | 15 | # Include terrarium.h 16 | C_INCLUDES += -I../Terrarium 17 | 18 | -------------------------------------------------------------------------------- /.github/workflows/cpp.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | env: 14 | PEDAL_NAME: reverb 15 | 16 | steps: 17 | - name: Checkout repository 18 | uses: actions/checkout@v2 19 | with: 20 | submodules: 'recursive' 21 | 22 | - name: Install arm-none-eabi-gcc toolchain 23 | uses: fiam/arm-none-eabi-gcc@v1 24 | with: 25 | release: '9-2019-q4' 26 | 27 | - name: Build Daisy libraries 28 | run: | 29 | make -C libDaisy 30 | make -C DaisySP 31 | 32 | - name: Build binary for pedal 33 | run: | 34 | make -C $PEDAL_NAME 35 | 36 | - name: Upload binary for terrarium 37 | uses: actions/upload-artifact@v2.2.1 38 | with: 39 | name: Binary for terrarium 40 | # A file, directory or wildcard pattern that describes what to upload 41 | path: ${{ env.PEDAL_NAME }}/build/${{ env.PEDAL_NAME }}.bin 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Felix Wiegand 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Reverb 2 | 3 | ![Platform](https://img.shields.io/badge/platform-terrarium-lightgrey) 4 | ![Github Downloads](https://img.shields.io/github/downloads/fxwiegand/terrarium-reverb/total?color=green) 5 | 6 | A basic reverb from the daisy petal examples converted for the [terrarium](https://www.pedalpcb.com/product/pcb351/) from [PedalPCB](https://www.pedalpcb.com). 7 | If you only want to use the reverb simply download the binary `reverb.bin` [here](https://github.com/fxwiegand/terrarium-reverb/releases) and flash your daisy seed with the [web programmer](https://electro-smith.github.io/Programmer/). 8 | 9 | ## Author 10 | 11 | [Felix Wiegand](https://github.com/fxwiegand) 12 | 13 | ## Description 14 | 15 | A reverb with three basic controls and optional modulation of the reverb signal. 16 | 17 | ## Controls 18 | 19 | | Control | Description | Comment | 20 | | --- | --- | --- | 21 | | Knob 1 | Reverb Time | Small room to near-infinite | 22 | | Knob 2 | Reverb Damping | Internal Cutoff filter from about 500Hz to 20kHz | 23 | | Knob 3 | Send Amount | Controls amount of dry signal sent to reverb | 24 | | Knob 4 | Modulation Speed | Controls LFO speed when modulation is engaged | 25 | | Knob 5 | Modulation Intensity | Controls the intensity of the modulation | 26 | | Switch 1 | Reverb Modulation | Activates modulation for wet reverb signal | 27 | | Switch 2 | LFO Waveform | On = Sine / Off = Triangle | 28 | | Footswitch 1 | Bypass | (De-)Activates bypass mode | 29 | -------------------------------------------------------------------------------- /reverb/reverb.cpp: -------------------------------------------------------------------------------- 1 | #include "daisy_petal.h" 2 | #include "daisysp.h" 3 | #include "terrarium.h" 4 | 5 | using namespace daisy; 6 | using namespace daisysp; 7 | using namespace terrarium; 8 | 9 | // Declare a local daisy_petal for hardware access 10 | DaisyPetal hw; 11 | 12 | Parameter vtime, vfreq, vsend, lfo_speed, amplitude; 13 | bool bypass; 14 | ReverbSc verb; 15 | Oscillator lfo; 16 | 17 | Led led1, led2; 18 | 19 | // This runs at a fixed rate, to prepare audio samples 20 | void callback(float *in, float *out, size_t size) 21 | { 22 | float dryl, dryr, wetl, wetr, sendl, sendr; 23 | hw.ProcessAllControls(); 24 | led1.Update(); 25 | led2.Update(); 26 | 27 | lfo.SetFreq(lfo_speed.Process() * 5.0f); 28 | lfo.SetAmp(amplitude.Process()); 29 | 30 | if (hw.switches[Terrarium::SWITCH_2].Pressed()) { 31 | lfo.SetWaveform(Oscillator::WAVE_SIN); 32 | } else { 33 | lfo.SetWaveform(Oscillator::WAVE_TRI); 34 | } 35 | 36 | verb.SetFeedback(vtime.Process()); 37 | verb.SetLpFreq(vfreq.Process()); 38 | 39 | vsend.Process(); 40 | 41 | if(hw.switches[Terrarium::FOOTSWITCH_1].RisingEdge()) 42 | { 43 | bypass = !bypass; 44 | led1.Set(bypass ? 0.0f : 1.0f); 45 | } 46 | 47 | for(size_t i = 0; i < size; i += 2) 48 | { 49 | dryl = in[i]; 50 | dryr = in[i + 1]; 51 | sendl = dryl * vsend.Value(); 52 | sendr = dryr * vsend.Value(); 53 | verb.Process(sendl, sendr, &wetl, &wetr); 54 | 55 | if(bypass) 56 | { 57 | out[i] = in[i]; // left 58 | out[i + 1] = in[i + 1]; // right 59 | } 60 | else 61 | { 62 | if (hw.switches[Terrarium::SWITCH_1].Pressed()) { 63 | out[i] = dryl + (wetl * lfo.Process()); 64 | out[i + 1] = dryr + (wetr * lfo.Process()); 65 | } else { 66 | out[i] = dryl + wetl; 67 | out[i + 1] = dryr + wetr; 68 | } 69 | } 70 | } 71 | } 72 | 73 | int main(void) 74 | { 75 | float samplerate; 76 | 77 | hw.Init(); 78 | samplerate = hw.AudioSampleRate(); 79 | hw.SetAudioBlockSize(12); 80 | 81 | vtime.Init(hw.knob[Terrarium::KNOB_1], 0.6f, 0.999f, Parameter::LOGARITHMIC); 82 | vfreq.Init(hw.knob[Terrarium::KNOB_2], 500.0f, 20000.0f, Parameter::LOGARITHMIC); 83 | vsend.Init(hw.knob[Terrarium::KNOB_3], 0.0f, 1.0f, Parameter::LINEAR); 84 | lfo_speed.Init(hw.knob[Terrarium::KNOB_4], 0.005f, 0.15f, Parameter::LOGARITHMIC); 85 | amplitude.Init(hw.knob[Terrarium::KNOB_5], 0.65f, 0.999f, Parameter::LINEAR); 86 | verb.Init(samplerate); 87 | 88 | lfo.Init(samplerate); 89 | 90 | led1.Init(hw.seed.GetPin(Terrarium::LED_1),false); 91 | led2.Init(hw.seed.GetPin(Terrarium::LED_2),false, 10000.0f); 92 | led1.Update(); 93 | bypass = true; 94 | 95 | hw.StartAdc(); 96 | hw.StartAudio(callback); 97 | while(1) 98 | { 99 | // Show LFO rate with second LED if modulation is on 100 | led2.Set(lfo.Process()); 101 | led2.Update(); 102 | } 103 | } --------------------------------------------------------------------------------