Skip to content
Snippets Groups Projects
Select Git revision
  • 805b6e08238d4c4f9e3c4d97d527ebd7022fb1f8
  • main default protected
  • 1.1.0
  • 1.0
4 results

daisy-looper.ino

Blame
  • daisy-looper.ino 7.38 KiB
    
    
    // Title: moogladder
    // Description: Sweeps the cutoff with an lfo
    // Hardware: Daisy Seed
    // Author: Ben Sergentanis
    
    #include "DaisyDuino.h"
    #include <SPI.h>
    #include <Wire.h>
    #include <Adafruit_GFX.h>
    #include <Adafruit_SH110X.h>
    #include <CpuLoadMeter.h>
    
    #include "leds.h"
    #include "potentiometers.h"
    #include "buttons.h"
    #include "looper.h"
    #include "env_follower.h"
    #include "helpers.h"
    #include "ui.h"
    
    
    #define BUFFER_LENGTH_SECONDS 5
    
    static const size_t buffer_length = 48000 * BUFFER_LENGTH_SECONDS;
    static float DSY_SDRAM_BSS buffer[buffer_length];
    
    // Create instances of audio stuff
    atoav::Looper looper;
    static atoav::EnvelopeFollower input_envelope_follower;
    DelayLine<float, 24000> delayline;
    DSY_SDRAM_BSS ReverbSc reverb;
    static Compressor compressor;
    Oscillator lfo;
    static SampleHold sample_and_hold;
    static WhiteNoise noise;
    static Metro tick;
    
    // Initialize Buttons
    Button button_1 = Button(D7);
    Button button_2 = Button(D8);
    Button button_3 = Button(D9);
    Button button_4 = Button(D10);
    Button button_5 = Button(D13);
    Button button_6 = Button(D14);
    
    // Initialize Potentiometers
    Potentiometer pot_1 = Potentiometer(A0);
    Potentiometer pot_2 = Potentiometer(A1);
    Potentiometer pot_3 = Potentiometer(A3);
    Potentiometer pot_4 = Potentiometer(A2);
    Potentiometer pot_5 = Potentiometer(A4);
    Potentiometer pot_6 = Potentiometer(A5);
    Potentiometer pot_7 = Potentiometer(A6);
    
    // RGB LED               R    G    B
    RGBLed rgb_led = RGBLed(A10, A9, A11);
    
    
    // OLED Display
    #define SCREEN_WIDTH 128 // OLED display width, in pixels
    #define SCREEN_HEIGHT 64 // OLED display height, in pixels
    #define OLED_RESET -1   //   QT-PY / XIAO
    Adafruit_SH1106G display = Adafruit_SH1106G(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
    
    // User Interface
    Ui ui;
    
    // Daisy