I thought I'd try something. For years I've wanted to build my dream looper. When I first started DIY stompboxes and noise-generators 6-ish years ago, I never in my right mind would I have guessed I'd be doing projects at the complexity I am now! And original ones at that! But still, these last few years, I've been gearing up (mentally) to tackle something huge (to my eyes). Looping is not only an important part of my music, but the ability to manipulate loops on the fly as well. I've tried many loopers. While many were excellent, they all lacked something another had that I thought was fantastic! So here I am now, thinking about how to combine those very best features and add a few of my own.
And I thought I'd start a thread about it, and log it as I make progress.

Complete with a pretentious thread title!
I've only just started, and there will be many firsts for me in this project as well, so I'll try and keep it informative. How I made certain decisions and not others.There isn't a whole lot of information out there when it comes to non-ISD based loopers. Maybe this thread will contribute in some tiny bit. A reference of things that come up for such a project, to others. A mixture of technical and laypersons theory, and I will try and keep the theory to a maximum! But mostly, it will be a curiosity! It will also be a learning experience. I don't claim to be an expert, and I will make mistakes and errors in judgment. I'm learning as I go along with this ambitious project.
So really, what do I want? - Hi-fi. 16bit 44khz is my goal.
- Variable fidelity/sampling rate for stepless time/pitch effects.
- Overdub with variable feedback. No question.
- Resonant LP / HP filter, and an automatic antialiasing filter
- Complete mixer to be able to mix from selectable inputs
- Same-pitch time stretching
- Automatic & manual "scrubbing"
- Ping-pong scrubbing, or "freeze" effects
- Reverse
- Loop cropping / trimming. Defining start-end loop points in realtime.
- Modulation
- Clickless seamsWill not do / not smart enough to do:- Undo
- SD card storage
- Multitrack or stereo
- BPM or time-sensitive quantizationWhat have I done so far:A simple breadboarded setup that can pass 12bit audio at around 100khz!

It doesn't do anything but pass audio, no recording or feature whatsoever. Just raw analog-to-digital conversion and back again. I'm concentrating on getting simple audio right before I do any sort of recording, playback, logic or feature.
What I'm using so far:I've started using MikroC, which is a C compiler for various microcontrollers. This is a very big step for me. Up 'till now, I had been using 8-bit AVRs and Bascom. While great for LFOs, presets and automation, they simply don't have the horsepower to do anything but telephone-quality audio. I've experimented quite a bit with audio on them, but I don't know assembly, so wasn't hitting good samplerates. What I made were fun little glitchy noise boxes that sample and loop, but in no way were they going to satisfy my looping needs. Bascom (basic) only supports AVRs, so I need to learn a new environment, and while I'm at it, language. A common language like C opens up future possibilities for other platforms as well, unlike Basic. So now, I learn. I'm still very much at the beginning of the language fundamentals of C.
Another new thing for me will be heavy use of surfacemount packages. I've done a few before, but with AVRs and most pedal builds, it wasn't really needed. With high-speed audio and data, it will be needed, and often in tiny pitch (0.5mm). I'm considering buying a cheap stereo microscope to aid me in this and other projects.
CPU:A PIC32 board from Mikroelectronica. A little expensive but it's in an easy to use footprint on a DIP40 stamp and packs a punch! The chip on it is 32bit and clocks at 80MHz.
Digital-to-analog:A PT8211 16bit DAC. Same company who make our beloved 2399 delay ic! Easily found for cheap (2 bucks a chip on ebay) and in an easy to use package (DIP8 or SOIC8), and specced to deliver better than CD-quality sound. I've tested it, it sounds good, it's cheap, it's fast, it works, I'm set!
Analog-to-digital:Currently an MCP3201. It's easy to find and cheap, but is "only" 12bit and is quite slow. I can get decent samplerates with it, but data/SPI transfer isn't fast at all, so it doesn't leave the CPU much free time to do logic. I'm using it at the moment because I know it and I had some at hand. Must find something else. I've orded a couple LTC1864 which is, according to the datasheet, an extremely fast 16bit ADC in a nice SOIC8 package! Pretty expensive though, at $14 each. According to how hard my PIC32 is currently chugging, and if my math is right, I will be able to get 200khz sampling speeds at 16bit, just raw audio pass-through! That should leave my PIC32 with tons of time to perform logic and whatnot if I'm aiming for 44khz!
RAM:This was the hard one. I've made some calculations. How much looping time do I want? Well, 10 seconds is a nice round number! Lessee..
- 1 sample at 16bit uses up two bytes.
- At 44khz, 44000-ish samples per second, one second uses up 88000 bytes, or 88KB.
- 10 seconds needs 880KB, or 1MB if we're rounding up for easy findability.I've used Microchips 23k256 RAM ics a few times. They are in nice DIP8 packages, use fast and easy SPI communication, but they are only 32KB. Forget it. So I hop onto Mouser and Digikey to see what my RAM options are. This takes several days of reading datasheets and measuring options, actually. I have to filter out anythign that comes in BGA. So, a few kinds of RAM:
- FRAM. SPI communication, fast, easy package, but still small storage quantity
at 128KB and costs a leg at $28 for that little amount. Scratch that.
- Parallel RAM. Cheap-ish, common, easy to understand, VERY fast as its parallel
instead of serial com, but uses a ton of pins. 8 data pins + 20 address pins + 2-3
extra. I need over 30 free pins on my CPU! If I was using a large PIC32, I could do that,
but I'm not. I'm using a 64-pin micro on a 40-pin stamp, and not all of those 40 pins are
the right "kind". Also, I don't want the headache of routing the PCB for all those traces.
Still... parallel RAM is the de facto standard when it comes to consumer audio looping
and sampling at high-speed. Better order a couple, in case.
- Flash memory. Cheap, easy to use, nice packages, but a little slow, and limited write
cycles. 100,000 or so. If I'd be using this as a traditional looper, that might be enough,
but I have to plan for the time where I set the loop-trimming to 5 milliseconds and hit
record. There, I just burnt through 10% of the chips available rewrites in a second!

Scratch that.
- MRAM. Specifically MR25H40. Hmm... doesn't seem to be a common type of memory.
But oooOOOHH! Look at these specs! Lightning-fast SPI com, zero read/write time, infinite
rewrites, and available as a 512KB! $14 is a bit pricey, but I'm willing to spend that much
if I only have to use one or two of them in the project! But... wait.... ohhhh
effffffffffffffffffffffffffffffff..................................
DFN package. That's nearly as bad as BGA.It's like... THERE ARE NO PINS! The pins are tiny little exposed metal UNDER the 8-pin square. Anyways, I order a couple, ball a bit of solder directly on the "pads", tin a SOIC-to-DIP adapter's pads (same footprint), and melt the balled-DFN onto the tinned adapter. It seems to have worked. Okay, I can do this. The specs make it worth it! Oooohh, data retention under no power even!
Speed test:I have the digital oscilloscope (a cheap 25mhz Owon) hooked up to the circuit. The red lines represent the SPI clock hooked up to the slow 12bit ADC. The yellow lines are the clock on the fast DAC and MRAM. The green line I added represents a single sample. It represents an elapsed time of almost 30us. That's 30 millionths of a second! That's a short amount of time to us humans, but to a 32bit 80MHz microcontroller, a lot can be done in that amount of time. Here is how many millionths of a second my PIC32 hs to work with for each sample:
- 44khz = 23us per sample
- 33khz = 30us per sample
- 22khz = 45us per sampleConsidering that, at the time I took this picture, I guess it was sampling at about 35khz, which in all honesty to my ears, sounds mostly fine.

The two large red blocks represent 8 clock pulses (for a total of 16, which is what the ADC needs to sample a single 12bits). They're just tight together which is why they look like one single huge pulse. The yellow represent the SPI clock hooked up to the much much faster 16bit DAC and MRAM ic! All 8 of the yellow lines have 8 little clock pulses of their own. Just so much more tightly together they appear as a single line! The first two of those blocks (16 pulses) are for the fast 16bit DAC, and the other 6 (48 pulses) for the MRAM.Once I get my new fast ADC, those two large red blocks will shrink to the size of the tiny yellow ones, and the PIC32 will have much more free time for logic/features, and/or will be able to achieve even higher samplerates!
I can measure how long it takes to read or write to the MRAM, about 4us, how long it takes to output to the DAC, 2us, and how long it currently takes to sample from the ADC, 8us.
It's half past midnight so I'll stop now. In a day or three, I'll write about why I chose to use a seperate ADC and DAC rather than use an audio codec chip, which is what's comonly used. Also, what I've learned about antialias filtering! Also, I'll fill in some links to stuff.