GRANULAR LOOPER

A looper pedal that also chops what you play into tiny grains and scatters them into clouds, stutters, glides and shimmers. It is inspired by the Hologram Microcosm style of pedal. A small computer module (the Daisy Seed) does the sound; the board around it handles power, the input and output buffers, the knobs, the switches and the lights.

Read this before ordering boards. The board is fully routed and I made the Gerber and drill files with my own scripts, not KiCad. They pass my own checks (every connection joined, nothing closer than 0.22 mm to a different net, ground plane joined to every ground pad), but no board house has checked them. The Daisy Seed pin numbers come from Electrosmith's datasheet. Nothing here has been built or heard on real hardware. The sound in the simulator below is a software model of the idea, and the firmware file is an untested starting point.

1. Simulator

Press Start sound. Play a few notes on the keyboard or the pads (or press the demo), then use the LOOP footswitch: press once to record, again to play, again to overdub. Turn the knobs and change the mode. Headphones are best.

Keyboard C3 to C5 Click or tap the keys, or use your computer keys: A W S E D F T G Y H U J K (lower octave) and O L P ; (up to the top).
REC PLAY

1b. Record, save and share

Press Record and everything you hear is captured: your notes, the loop, the grains and the arcade noises. Press it again to stop. You get two files: a video (the waveform picture with the sound) and a WAV (sound only). X.com takes video, not sound-only files, so upload the video. X's limit for a normal account is 2 minutes 20 seconds, so recording stops there on its own.

0:00

1c. Arcade noises

Three buttons, made from scratch with the sound engine in your browser (they are look-alike noises, not recordings). Each press plays the next sound in that game's set, and the sound goes through the looper and the grains, so you can record it into a loop and shred it into clouds. Wear headphones.

2. Controls

ControlPartDoes
ACTIVITYRV1 B10kHow many grains per second, from one slow grain a second up to a dense cloud of 40.
SHAPERV2 B10kThe envelope of each grain: sharp attack and soft tail at the left, a slow swell (like a reversed note) at the right.
PITCHRV3 B10kGrain pitch in semitones, plus or minus two octaves, centre = unchanged. The modes add their own notes on top.
SPACERV4 B10kReverb amount and tail length.
MIXRV5 B10kBlend of your dry signal and the grain cloud.
LEVELRV6 B10kOverall output level.
MODEENC1 encoderTurn to choose one of seven grain behaviours. Push = freeze.
LOOPSW1Record, play, overdub, play. While stopped it restarts the loop.
STOP / CLEARSW2Tap = stop or restart the loop. Hold 1.5 seconds = clear it.

3. Schematic

Signal flow: guitar in, buffer U1A, a divider that halves the level for the Daisy input (3.6 V peak-to-peak maximum), the Daisy Seed (analog-to-digital, loop memory, grain engine, digital-to-analog), a coupling capacitor, buffer U1B with a gain of 2, and the output jack. The six knobs are read by the Daisy analog inputs from its own 3.3 V reference. The two footswitches and the encoder go to digital pins, and two LEDs show record and play.

GRANULAR LOOPER - circuit schematic Net-label style: every wire stub carries a net name, and all stubs with the same name are connected. Red labels are power (+9V), blue are signals, a ground symbol means GND. Part numbers match the board and the parts list. 1 POWER: 9 V in, reverse protection, 4.5 V bias for the op-amp J1 9V DC jackpin 1DCPpin 2 D1 1N5817DCP+9V +C1 100uF+9V C2 100nF+9V R1 10k+9VVBIAS R2 10kVBIAS +C3 10uFVBIAS 2 INPUT BUFFER (U1A) AND LEVEL DIVIDER TO THE DAISY INPUT J2 INPUT jackpin 1JINpin 2 U1TL0721OUT1BUFV+8+9V1IN-2BUF2OUT7OUTB1IN+3INP2IN-6INVBV-42IN+5OUTP C4 1uFJININN R3 1MINNVBIAS R4 1kINNINP C5 100nF+9V C6 1uFBUFAINC R5 10kAINCAIN R6 10kAIN 3 DAISY SEED DSP MODULE: loop memory and grain engine, footswitches, encoder, LEDs SW1 LOOP footswitchpin 1SW1Spin 2 SW2 STOP footswitchpin 1SW2Spin 2 ENC1 MODE encoderpin 1ENCApin 2ENCBpin 3ENCSpin 4 U2DAISY SEEDD01SW1SDGND40D12SW2SVIN39+9VD23ENCA3V3 D38NCD34ENCBD3037NCD45ENCSD2936NCD56LED1DA1135NCD67LED2DD2734NCD78NCD2633NCD89NCA1032NCD910NCA931NCD1011NCA830NCD1112NCA729NCD1213NCA628NCD1314NCA527KN6D1415NCA426KN5AUDIO IN L16AINA325KN4AUDIO IN R17NCA224KN3AUDIO OUT L18AOUTA123KN2AUDIO OUT R19NCA022KN1AGND203V3 A21V33 C7 100nFV33 R13 1kLED1DLED1A LED1 LED red 3mmLED1A R14 1kLED2DLED2A LED2 LED green 3mmLED2A 4 KNOBS (read by the Daisy analog inputs, 3.3 V reference) RV1 ACTIVITY B10kpin 1V33pin 2KN1pin 3 RV2 SHAPE B10kpin 1V33pin 2KN2pin 3 RV3 PITCH B10kpin 1V33pin 2KN3pin 3 RV4 SPACE B10kpin 1V33pin 2KN4pin 3 RV5 MIX B10kpin 1V33pin 2KN5pin 3 RV6 LEVEL B10kpin 1V33pin 2KN6pin 3 5 OUTPUT: Daisy output, buffer U1B (gain 2) and jack J3 OUTPUT jackpin 1JOUTpin 2 C8 1uFAOUTOUTC R7 100kOUTCVBIAS R8 100kOUTCOUTP R9 10kOUTBINVB R10 10kINVBGB +C9 10uFGBVBIAS +C10 4.7uFOUTBOUTD R11 1kOUTDJOUT R12 1MOUTD

Schematic (PNG) Schematic (SVG)

4. The board with the parts fitted

The finished board from the top. The purple module is the Daisy Seed, plugged into two rows of sockets; its USB socket faces the bottom edge so you can reach it to load firmware. The black pin strips along the top take the six pots and the encoder; the ones along the bottom take the DC jack, the two audio jacks and the two footswitches.

100uF 100nF 10uF 1uF TL072 100nF 1uF DAISY SEED USB 100nF 1uF 10uF 4.7uF D1 C1 C2 R1 R2 C3 C4 R3 R4 U1 C5 C6 R5 R6 U2 C7 C8 R7 R8 R9 R10 C9 C10 R11 R12 R13 LED1 R14 LED2 ACTIVITY SHAPE PITCH SPACE MIX LEVEL MODE ENC LOOP SW STOP SW 9V DC IN INPUT OUTPUT

Board with parts (PNG) Board with parts (SVG)

4b. Circuit board (routed, ground plane on both layers)

111.8 x 95.3 mm, 2 layers, 1.6 mm, all through-hole, four 3.2 mm mounting holes. Top copper red, bottom copper blue, white is the silkscreen. Ground is a copper pour on both layers with thermal-relief spokes on the ground pads. 13 vias.

Download Gerber files (ZIP) Board drawing (SVG) Netlist (CSV) Parts list (CSV)

Off-board wiring. 9 V DC jack (centre-negative): sleeve to J1 pin 1, tip to J1 pin 2. Audio jack tips to J2 pin 1 (input) and J3 pin 1 (output), sleeves to pin 2. Each pot: pin 1 = 3.3 V (the end that makes the knob go up when turned clockwise), pin 2 = wiper (centre lug), pin 3 = ground. Encoder: pin 1 = A, pin 2 = B, pin 3 = push switch, pin 4 = common (ground); the two outer encoder pins are A and B, the centre one is common. Footswitches: one lug to the pin 1 pad, the other to pin 2 (ground). Programming: fit the Daisy Seed, plug USB into it, hold BOOT, tap RESET, and flash the firmware below. Do not feed the Daisy Seed from USB and a wrongly wired 9 V supply together: the datasheet says VIN and USB together is safe, but check the jack polarity first.

5. Parts list (29 parts on the board, 22 lines)

QtyReferenceValuePackageUse
1D11N5817Axial diode (DO-35)Reverse-polarity protection
1C1100uF 16VRadial electrolytic (2.54 mm)Supply reservoir
3C2, C5, C7100nFCeramic disc / MLCC, leaded (2.54 mm)Supply decoupling
6R1, R2, R5, R6, R9, R1010kAxial 1/4W (10.16 mm pitch)Bias divider (4.5 V)
2C3, C910uF 16VRadial electrolytic (2.54 mm)Bias filter
3C4, C6, C81uF filmBox film (5.08 mm)Input coupling (keeps the lows)
2R3, R121MAxial 1/4W (10.16 mm pitch)Input bias
4R4, R11, R13, R141kAxial 1/4W (10.16 mm pitch)Input stopper
1U1TL072DIP-8 with socketA: input buffer, B: output buffer (gain 2)
1U2Daisy Seed (Rev 4 / 7)2 x 20-pin 2.54 mm female headers, rows 15.24 mm apart (module plugs in)DSP module: loop memory, grain engine, 24-bit codec
2R7, R8100kAxial 1/4W (10.16 mm pitch)Output stage bias
1C104.7uF 16VRadial electrolytic (2.54 mm)Output coupling
1LED1LED red 3mm3 mm LED (2.54 mm)RECORD / OVERDUB indicator
1LED2LED green 3mm3 mm LED (2.54 mm)PLAY indicator
6RV1-RV6Potentiometers 16 mm, B10k linear: ACTIVITY, SHAPE, PITCH, SPACE, MIX, LEVELPanel mountWire to the 3-pin pads (1 = 3.3 V, 2 = wiper, 3 = ground)
1ENC1Rotary encoder with push switch (EC11 type)Panel mountMode select; push = freeze
2SW1, SW2Momentary SPST footswitches (normally open)Panel mountLOOP and STOP/CLEAR
2J2, J31/4 in mono jacksPanel mountInput and output
1J12.1 mm DC jack, centre-negativePanel mount9 V in (at least 300 mA)
1U2Daisy Seed (Electrosmith), with 64 MB SDRAMPlugs into the headersDSP module; program it over USB
1-Enclosure big enough for a 112 x 95 mm board plus the controls-Case
7-Knobs (6 pots, 1 encoder)--

Resistors 1/4 W 1%. Ceramic capacitors 50 V. Use film for the 1 uF coupling capacitors. Fit a socket for U1.

6. Firmware (starting point, untested)

This C++ file uses libDaisy and DaisySP. It matches the board's pin map: LOOP on D0, STOP on D1, encoder on D2, D3 and D4, LEDs on D5 and D6, and the six knobs on A0 to A5. It records up to 30 seconds into the module's external memory and runs the same seven grain modes as the simulator. Download granular-looper.cpp

// Granular Looper - starting-point firmware for the Daisy Seed (libDaisy + DaisySP).
// UNTESTED: written to match the board's pin map. Build it with the Daisy toolchain (make; make program-dfu).
//
// Pin map (matches the netlist):   D0 LOOP switch, D1 STOP switch, D2/D3/D4 encoder A/B/push,
//   D5 REC LED, D6 PLAY LED, A0..A5 (D15..D20) = ACTIVITY, SHAPE, PITCH, SPACE, MIX, LEVEL knobs.
#include "daisy_seed.h"
#include "daisysp.h"
#include <cmath>
using namespace daisy;
using namespace daisysp;

DaisySeed hw;
Switch    swLoop, swStop;
Encoder   enc;
GPIO      ledRec, ledPlay;
ReverbSc  verb;

static const size_t LOOP_MAX = 48000 * 30;           // 30 s loop in external SDRAM
float DSY_SDRAM_BSS loopBuf[LOOP_MAX];
size_t loopLen = 0, ph = 0;
enum { EMPTY, REC, PLAY, OVER } st = EMPTY;
bool stopped = false, frozen = false;
int  mode = 0;                                       // 0 mosaic, 1 haze, 2 glide, 3 strum, 4 tunnel, 5 reverse, 6 arp
float knob[6];
uint32_t rng = 12345;
float rnd() { rng = rng * 1664525u + 1013904223u; return (rng >> 8) / 16777216.0f; }

struct Grain { bool on = false; float pos, inc, dinc; size_t age, len; float attack; int dir; };
Grain grains[24];
float grainCountdown = 0;
int   step = 0;
float frozenPos = 0;
const float SCALE[8] = {0, 2, 4, 7, 9, 12, 9, 7};
const float ARP[6]   = {0, 4, 7, 12, 7, 4};

void SpawnGrain(float rate)
{
    for (auto &g : grains) {
        if (g.on) continue;
        float semis = (knob[2] - 0.5f) * 48.0f;       // PITCH: +/- 24 semitones
        semis = roundf(semis);
        float lenS = fminf(0.7f, fmaxf(0.04f, 2.2f / rate));
        float start = rnd() * loopLen;
        g.dir = 1; g.dinc = 1.0f;
        switch (mode) {
        case 1: semis += (rnd() < 0.5f) ? 0 : ((rnd() < 0.5f) ? 12 : 7); lenS *= 2; break;
        case 2: { float sw = (rnd() < 0.5f ? 12.0f : -12.0f); g.dinc = powf(2.0f, sw / 12.0f / (lenS * 48000.0f)); } break;
        case 3: semis += SCALE[step++ & 7]; break;
        case 4: start = frozen ? frozenPos : (float)ph; break;
        case 5: g.dir = -1; break;
        case 6: semis += ARP[step++ % 6]; break;
        default: break;
        }
        if (frozen && mode != 4) start = frozenPos + rnd() * 2000.0f;
        g.pos = start; g.inc = powf(2.0f, semis / 12.0f); g.age = 0;
        g.len = (size_t)(lenS * 48000.0f); g.attack = 0.02f + 0.96f * knob[1]; g.on = true;
        return;
    }
}

float ReadLoop(float pos)
{
    while (pos >= loopLen) pos -= loopLen;
    while (pos < 0) pos += loopLen;
    size_t i0 = (size_t)pos, i1 = (i0 + 1 >= loopLen) ? 0 : i0 + 1; float f = pos - i0;
    return loopBuf[i0] * (1 - f) + loopBuf[i1] * f;
}

void AudioCallback(AudioHandle::InputBuffer in, AudioHandle::OutputBuffer out, size_t size)
{
    float rate = 1.0f + knob[0] * knob[0] * 39.0f;    // ACTIVITY: grains per second
    for (size_t n = 0; n < size; n++) {
        float x = in[0][n], loopOut = 0, g = 0;
        if (st == REC) { if (loopLen < LOOP_MAX) loopBuf[loopLen++] = x; else { st = PLAY; ph = 0; } }
        if ((st == PLAY || st == OVER) && loopLen > 0) {
            if (!stopped) {
                loopOut = loopBuf[ph];
                if (st == OVER) loopBuf[ph] = tanhf(loopBuf[ph] + 0.9f * x);
                if (++ph >= loopLen) ph = 0;
            }
        }
        if (loopLen > 1000 && st != REC) {            // grains need recorded material
            if ((grainCountdown -= 1.0f) <= 0) { SpawnGrain(rate); grainCountdown = (48000.0f / rate) * (0.6f + 0.8f * rnd()); }
            for (auto &gr : grains) {
                if (!gr.on) continue;
                float t = (float)gr.age / gr.len, w;
                if (t < gr.attack) { w = sinf(1.5708f * t / gr.attack); w *= w; }
                else { w = cosf(1.5708f * (t - gr.attack) / (1.0f - gr.attack)); w *= w; }
                g += ReadLoop(gr.pos) * w;
                gr.pos += gr.dir * gr.inc; gr.inc *= gr.dinc;
                if (++gr.age >= gr.len) gr.on = false;
            }
            g *= 0.8f;
        }
        float wet = loopOut * 0.8f + g * knob[4] * 1.5f;
        float rl, rr; verb.Process(wet, wet, &rl, &rr);
        float y = x * (1.0f - 0.7f * knob[4]) + wet + 0.5f * knob[3] * (rl + rr);
        y = tanhf(y) * (0.2f + 1.3f * knob[5]);
        out[0][n] = y; out[1][n] = y;
    }
}

int main()
{
    hw.Configure(); hw.Init(); hw.SetAudioBlockSize(48);
    AdcChannelConfig adc[6];
    for (int i = 0; i < 6; i++) adc[i].InitSingle(hw.GetPin(15 + i));
    hw.adc.Init(adc, 6); hw.adc.Start();
    swLoop.Init(hw.GetPin(0), 1000); swStop.Init(hw.GetPin(1), 1000);
    enc.Init(hw.GetPin(2), hw.GetPin(3), hw.GetPin(4), 1000);
    ledRec.Init(hw.GetPin(5), GPIO::Mode::OUTPUT); ledPlay.Init(hw.GetPin(6), GPIO::Mode::OUTPUT);
    verb.Init(48000); verb.SetFeedback(0.85f); verb.SetLpFreq(9000.0f);
    hw.StartAudio(AudioCallback);
    while (1) {
        for (int i = 0; i < 6; i++) knob[i] = hw.adc.GetFloat(i);
        swLoop.Debounce(); swStop.Debounce(); enc.Debounce();
        if (swLoop.RisingEdge()) {
            if (stopped) { stopped = false; ph = 0; }
            else if (st == EMPTY) { loopLen = 0; st = REC; }
            else if (st == REC && loopLen > 1000) { ph = 0; st = PLAY; }
            else if (st == PLAY) st = OVER; else if (st == OVER) st = PLAY;
        }
        if (swStop.FallingEdge() && swStop.TimeHeldMs() < 1500) { if (st == PLAY || st == OVER) stopped = !stopped; }
        if (swStop.Pressed() && swStop.TimeHeldMs() > 1500) { st = EMPTY; loopLen = 0; stopped = false; }   // hold = clear
        mode = (mode + enc.Increment() + 7) % 7;
        if (enc.RisingEdge()) { frozen = !frozen; frozenPos = (float)ph; }
        ledRec.Write(st == REC || st == OVER);
        ledPlay.Write((st == PLAY || st == OVER) && !stopped);
        System::Delay(1);
    }
}

7. Next steps to manufacture

  1. Breadboard the audio path first: the Daisy Seed on its own with two jacks, the TL072 buffers and one pot. Confirm the level into the Daisy input is not clipping with your guitar (the divider R5 and R6 sets it).
  2. Load the firmware, listen, and tune the grain modes to taste. The simulator and the firmware are separate code, so they will not sound identical.
  3. Open the Gerber ZIP in a free viewer (the JLCPCB and PCBWay ones work) and run the board house's design check.
  4. Order a few boards, fit the parts, and test.

The audio in the simulator is a software model, not the circuit and not the firmware.