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.
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.
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:001c. 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
| Control | Part | Does |
|---|---|---|
| ACTIVITY | RV1 B10k | How many grains per second, from one slow grain a second up to a dense cloud of 40. |
| SHAPE | RV2 B10k | The envelope of each grain: sharp attack and soft tail at the left, a slow swell (like a reversed note) at the right. |
| PITCH | RV3 B10k | Grain pitch in semitones, plus or minus two octaves, centre = unchanged. The modes add their own notes on top. |
| SPACE | RV4 B10k | Reverb amount and tail length. |
| MIX | RV5 B10k | Blend of your dry signal and the grain cloud. |
| LEVEL | RV6 B10k | Overall output level. |
| MODE | ENC1 encoder | Turn to choose one of seven grain behaviours. Push = freeze. |
| LOOP | SW1 | Record, play, overdub, play. While stopped it restarts the loop. |
| STOP / CLEAR | SW2 | Tap = 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.
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.
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)
5. Parts list (29 parts on the board, 22 lines)
| Qty | Reference | Value | Package | Use |
|---|---|---|---|---|
| 1 | D1 | 1N5817 | Axial diode (DO-35) | Reverse-polarity protection |
| 1 | C1 | 100uF 16V | Radial electrolytic (2.54 mm) | Supply reservoir |
| 3 | C2, C5, C7 | 100nF | Ceramic disc / MLCC, leaded (2.54 mm) | Supply decoupling |
| 6 | R1, R2, R5, R6, R9, R10 | 10k | Axial 1/4W (10.16 mm pitch) | Bias divider (4.5 V) |
| 2 | C3, C9 | 10uF 16V | Radial electrolytic (2.54 mm) | Bias filter |
| 3 | C4, C6, C8 | 1uF film | Box film (5.08 mm) | Input coupling (keeps the lows) |
| 2 | R3, R12 | 1M | Axial 1/4W (10.16 mm pitch) | Input bias |
| 4 | R4, R11, R13, R14 | 1k | Axial 1/4W (10.16 mm pitch) | Input stopper |
| 1 | U1 | TL072 | DIP-8 with socket | A: input buffer, B: output buffer (gain 2) |
| 1 | U2 | Daisy 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 |
| 2 | R7, R8 | 100k | Axial 1/4W (10.16 mm pitch) | Output stage bias |
| 1 | C10 | 4.7uF 16V | Radial electrolytic (2.54 mm) | Output coupling |
| 1 | LED1 | LED red 3mm | 3 mm LED (2.54 mm) | RECORD / OVERDUB indicator |
| 1 | LED2 | LED green 3mm | 3 mm LED (2.54 mm) | PLAY indicator |
| 6 | RV1-RV6 | Potentiometers 16 mm, B10k linear: ACTIVITY, SHAPE, PITCH, SPACE, MIX, LEVEL | Panel mount | Wire to the 3-pin pads (1 = 3.3 V, 2 = wiper, 3 = ground) |
| 1 | ENC1 | Rotary encoder with push switch (EC11 type) | Panel mount | Mode select; push = freeze |
| 2 | SW1, SW2 | Momentary SPST footswitches (normally open) | Panel mount | LOOP and STOP/CLEAR |
| 2 | J2, J3 | 1/4 in mono jacks | Panel mount | Input and output |
| 1 | J1 | 2.1 mm DC jack, centre-negative | Panel mount | 9 V in (at least 300 mA) |
| 1 | U2 | Daisy Seed (Electrosmith), with 64 MB SDRAM | Plugs into the headers | DSP 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
- 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).
- 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.
- Open the Gerber ZIP in a free viewer (the JLCPCB and PCBWay ones work) and run the board house's design check.
- 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.