Hoping to generate some feedback for my dual digital delay project

Hey, I alluded to working on a dual digital delay not long ago. Unfortunately at the moment I’ve run out of money so I can’t get a prototype board made just yet, but I want to push out some details and plans at this stage to get things out there. I may be way off-base here, and maybe not. Hoping to get feedback or assistance.

Eagle schematics

The design is a microcontroller- controlled dual digital delay with inputs & feedback paths switchable (any input or output can be routed to either delay input, or shut off entirely.) Mix, delay time, and feedback amount are all controlled by the MCU via a digital sextet potentiometer. The UI includes six pots, eight switches, 8 LEDs. (the pots are either for directly controlling the potentiometer values, or by pressing one of the switches, for controlling one or more values of automated, algorithmic control over those parameters. The additional two switches would be for switching through different “patches” or for shift-key functionality, or whatever is dreamt up. The design uses an ATMega328, and is intended to be arduino-compatible: that is, you should be able to write/modify the code for the algorithms & UI in arduino and upload it to the board or transplant an ATMega328/168/etc from an arduino. I’m hoping the code might be made approachable by non-c-wizards.

My other hope is that I might design several PCB’s that might be directly interfaced with the shruti-1 or the WTPA sampler from narrat1ve.com (note the cross-posting, heh), as well as PCB designs for a standalone unit. The schematic represents the standalone design, minus power supply & input jack stuff…

I was hoping that the Shruthi-1 hardware design might include access to the power adapter, or the normal/tip of the output jacks, so I could shoehorn one of these right into an enclosure… It should fit on a shruthi-sized PCB… In fact, it could even be digitally controlled by Shruthi-1 though that would require supporting an SPI bus somehow, as well as obvious and large firmware changes.

My questions at this moment are:

First, am I way off-base somewhere here?

w/r/t Generating VCC/2 - will 2 10K resistors + cap provide a stiff enough voltage source for the 6 inverting op-amps, 2 non-inverting op-amps, and the pull-up at the feedback 4066? Is that resistor even necessary? (4066’s have least switching noise when biased to 1/2vcc)

Is a voltage follower a good configuration for the output buffer without any further addition? Is it a bad idea to leave the output at fixed gain and control only the input & feedback amplification?

Feedback is controlled via resistance from 100k resistors going into 0-100k from the digi pot, summed with the input stage. I’m not sure if this is going to be acceptable, and I have yet to breadboard the delays with the proper resistor network for feedback & inputs…

Caps – I’m not sure about what type of caps to use, where - specifically in the PT2399 delay. here’s the datasheet with more info. Ceramic & electro for bypassing, but then there are the caps connected to op1/op2, the 2 lopass filter caps, as well as the two fairly substantial polarized ones at in & out (NP electro?)

Also the mod/demod pins are a mystery to me, but I’m very curious. Wish I could find some info on this somewhere…

Do what you want with these plans. I’ve got PCB layouts in the works, and I’m still breadboarding and testing things. At the moment I can’t even afford the $40 or so to even get the prototype made, so it’s sitting for a little while. It’s supposed to fit in Eagle Light, and for that reason uses SMD components.

Some notes:

  • Programming? Will you allow for on-board programming? If so, will this be with an ISP connector or by having a connector exposing RX/TX and RST + the standard arduino Stk500 bootloader? (If you aim at compatibility with arduino-land, the second might be a must).
  • Not sure why you don’t use the I/O pins of the MAX7301 to drive the LEDS?
  • I’m not an expert at midrail DC biasing/debiasing acrobatics (hence the naive use of switched capacitor converters on the Shrut(h)i) ; but it reminds me of the input stages of the WTPA. Looks like all the points at VCC/2 are connected to op-amp inputs, so they shouldn’t draw any current. One more robust thing I toyed with is a TLE2426 + a buffer. Looks like a question for Todd :smiley:
  • Regarding the output stage, a fairly common thing I see on audio circuit is a small value R to have a moderate output impedance. Another common thing: take advantage of the last buffer to use it as an active low-pass with a high cutoff (20kHz) to attenuate any HF digital crap. I wish I had done that on the Shruti.
  • Regarding the output gain, I have personally never soldered pots on the Shrut(h)i - it’s easier for me to reach for the pot on my soundcard in case things go out of control. But imagine that something very loud and nasty gets trapped in the delay line during a live performance… You’d want to be able to kill it rapidly before checking whether it’s the input gain which is too high, or maybe the feedback spiraling out of control.
  • In/Out caps are there to remove the DC. NP / “Audio grade” electrolytic.
  • The filter circuit is really wild. I’d go with polyester/film for the 10/5.6nF and ceramic for the rest. Most of the OTA-C filters circuits I had a look at used polyester/film caps for the C.
  • I had a look at the datasheet for the PT2399. Is it still produced? My bet about the MOD/DEMOD? You’re going to have some DAC/ADC inside the chip to push samples into a digital delay line, right? I suspect the modulator/modulator in the datasheet are indeed the DAC/ADC and those might need external caps. This is one of the worst datasheet I’ve ever seen, besides the coolaudio ones.

Oh and I have an unused UART on the Shruthi-1! So far, I mostly used it for printing stuff to a console while debugging, but this could be a way of controlling your delay, maybe using a protocol as standard as… MIDI? So maybe you could make sure you leave the pins of the UART free on your design, so it could be used for some kind of internal MIDI communication between your board and the Shruthi-1. I think the WTPA also has an unused UART. Not that I don’t like SPI, but the pins for SPI tend to overlap with other useful things (PWM!) so I don’t think I can do SPI from the Shruthi board.

Programming: I planned on using an ISP header, but you’re right about exposing RX/TX. It’s still easy to program a MCU on the arduino, pop it out, and toss it on the board, but that sounds even better. As it stands I only have the RX pin available.

I/O - Unfortunately I wasn’t able to locate a chip that had pins assignable as inputs or outputs, as well as the ability to do hardware PWM. All the individually-addressable PWM-able chips I could find were LED drivers/outputs only and not configurable as inputs. I’m sure I can do it with software, but I was hoping to be able to use the native Arduino PWM pins as output and be able to call analogWrite(). Easier for me, and easier for someone who wanted to make it do something besides what I had intended, which is a big design parameter for me.

1/2 rail - Yeah, just the inverting op-amp inputs, plus the 4 1meg biasing resistors. I think it should be fine. I tried a rail-splitter and it worked very well but I think it’s overkill. And the reason why it reminds you of the input stages of the WTPA is because I grabbed it more or less verbatim from the WTPA. Why mess with a good thing?

I think you’re right about the small-valued resistors - I think that also may help ensure that the two channels have the same impedance and are properly mixed. The filter I should probably put in the prototype, and can try with it omitted as well. Can’t hurt. I do know that the LPF’s in that thing are pretty aggressive, and it ends up sounding more ‘analog’ partly because the highs are pretty buried in filter.

Output gain: I was thinking a “true bypass” switch for each channel (a couple of 3p2t’s) might be a better solution than an output level for mitigating weird feedback/overload issues. Currently you’d have to first ensure that both dry/wet knobs were in “manual” mode and then you could dial both of them back to 100% dry, and/or adjust the gain for each channel… It’s kind of a complicated thing to quickly work your way out of, unfortunately. However, because I’ve got so many unused I/O expander pins available I’m considering using them as additional switch inputs for situations like those. A ‘panic’ button, for example.

I figured the output caps were for the DC. Haven’t tried it yet but I believe they can probably be omitted since everything else is biased at 2.5v. Presumably the filter is as well… As long as the DC isn’t amplified or attenuated anywhere, and I don’t believe it is. That does remind me, though, to remove the DC at the output… I think I can avoid 4 electro’s at the in/out of the delay that way!

There’s an even more intolerable datasheet floating around for the PT2399… This is the one link I found with the block diagram. As far as I know it’s still being produced. Futurlec sells them for $1.40, Tayda Electronics (reccommended) has them for $.54, Small Bear for $4. Can’t find them at the big distributors but they seem to be fairly plentiful… The cheapness and relatively few external parts required were what led me to it… No need for external memory, and of course the single-supply…

Also, I believe that one can use a current sink at the VCO ctrl pin and get additional control over delay time… Haven’t tried that, and I’m rapidly running out of board space!

The news of the unused UART is great! I think the MIDI control is a great idea; I don’t think I can fit the additional opto & resistors necessary for it, but that could be added easily off-board, or it could just use the Shruthi’s UART at MIDI rates, and data could be forwarded from Shruthi’s ins or generated and sent. I love that idea.

Also BTW the ONE ADDITIONAL PWM I needed to have 6 simple, straightforward dimmable LEDs was taken up because of SPI. arrrrrrrrrrrrrrrrrrrr…

Thanks for the feedback, though! Very very much appreciated!

Also my dual-input design seems like it would make the most sense with 2 poly chained shruti’s :wink:

Though perhaps it would also be cool to grab the 2nd input from the Shruthi’s audio in jack…

I don’t think an “internal” MIDI connection between two boards (UART to UART) would really require opto-isolation. Also, LEDs and eyes are really slow - software PWM is not going to be very costly CPU-wise since you can bit-bang at 100 Hz and still get a decent dimming effect.

Couldn’t resist and ordered a bunch of those too! I’m thinking of a board with a minimal filter / VCA (MS-20-like or SSM2044+SSM2164) + a voltage controlled version of this delay chip. A simple current sink like the opposite of the one I used for the Shruthi’s VCAs might work on the VCO pin.

Cool! Yeah, I figured you weren’t implying opto-isolation with the board-to-board stuff. PWM at 100Hz is fine for the eyes but I’m also trying to avoid excessive low-frequency noise… I’m sure it can be avoided but since I want to integrate tact switches & LEDs onto the board itself for front-panel mounting, I’m concerned that these PWM lines are going to be running all over the board… Since I haven’t had boards printed before I’m a bit nervous about capacitive coupling and proper care with grounds… I guess I should have a ground plane around all of the digital stuff, and of course a separate analog ground for the opamps & some of the pt2399 circuitry.

My mind’s been turning about the MIDI control possibility. I think it could be really fantastic, having the same data the synth has, i.e. knowing when a new note (AND which note) has been triggered… I’ve had some really crazy ideas about how this could be used for weird modulation/gating effects with the 4066, but I’m thinking you could even have a feedback loop which, on a new note, gets cranked back to 0% feedback, and shortest delay time for a moment to clear the delay and start a new note… And of course there are billions of other ideas. I think this chip could be used to do a LOT more than just straightforward delays – chorus, for example, where the two delays could have differing modulation rates… or possibly a pseudo reverb, though that might be asking a lot out of two delays…

Also, trying to think of a clever way to drive bicolor LED’s without using 8 extra I/O pins. I was thinking that green and red could be used to visually show you what “mode” you’re in and represent the current value being sent to that channel of the digi pot…

ALSO - YES to the MS-20 style filter. I love mine to tears!

Perhaps you’re thinking of the Frostwave Resonator. I’ve had that one for years and it’s fantastic. HP+LP filters, and CV inputs for HP & LP freq, and HP & LP cutoff.

I have checked out the andromeda space rockers stuff. It’s interesting stuff but i’m not quite sure how it would help – those are pretty minimal designs, which I think is totally to their benefit. Unfortunately, I’m not so versed in analog design. And the IR sync is kind of pointless in this case, if I’ve got a much more detailed & common method like MIDI to synchronize with other circuits…

What I’m doing uses more components and is kind of a “brute force” method of automating these delays. Basically I’m just replacing the pots with digitally controlled potentiometers, and adding analog switches so I can move stuff around, all powered by a way-overkill ATMega. I think it’s pretty hacked together, and I’m beginning to realize, the further I get into board layout, that I’m REALLY pushing it with the amount of stuff I’m trying to put on the board…

this is where it’s at currently, just tossed it into the autorouter for an example:

Olivier, one more question for you – you said there’s some >20kHz noise on the Shruti that you wish you had filtered out with the output op-amp – What was the source of the noise?

First, there’s a tiny bit of HF whine from the DC/DC converter. On the Shruti, its frequency is around 35kHz ; on the Shruthi it’s way up at 68kHz (I switched to a different chip with frequency control: LT1054) to make it easier to filter. But it’s really small…

And then, there’s the dirty “secret” of the Shrut(h)i: it does not use DACs but PWM for the oscillators and control signals. So the signal has a high-pitched partial at the PWM frequency (31.25kHz on the Shruti, 39kHz on the Shruthi). This is not a big deal for the oscillators signals since it goes into a steep low-pass anyway. But the control signals should be cleaned too. The Shruti-1 does not have a filter on the VCA control signal (unless you did the capacitor mod), so there’s still a 31.25kHz component. I fine-tuned this more thoroughly on the Shruthi by picking the lowest possible cutoff that matched the control signals refresh rate.

I prefered packing more synthesis options than paying the overhead of driving an SPI DAC. I might do something different for my next synth designs - either take a big break to learn another platform (NXP ARM), or use a 328p doing nothing but running the synthesis code, with a R2R DAC (my only concern is the firmware update produce - this is going to be messy if the firmware is distributed on different chips).

Olivier: I see. Yeah, the PWM is no secret… and it works really well, considering. I’ve NEVER seen such amazing DSP come out of an AVR. What I’m wondering, though, is whether you can still get away with a single-MCU design that would dedicate a port to an R2R dac (or use a parallel DAC). Would you have enough time to get away with SPI or I2C communication to talk to an analog mux or I/O expander or whatever you need? Or have you looked at larger AVR’s with more I/O? Flashing multiple MCU’s does seem like a huge hassle, if you expect that your end-user is not going to have a programmer.

basstrings: Dwarfcraft loop mangler looks like it’s probably dead-simple inside. The input goes to both send jacks. One pot in the joystick is probably a voltage divider between the clean and the wiper of the other pot, with the two sides of the 2nd pot connected to the two returns from the pedals. The feedback is probably just a switch linking output to input, between the variable resistance provided by the pot. That’s just my guess, though… I should get in touch with those guys though, since they’re really close to me.

The high-frequency whine we’re talking about doesn’t really have anything to do with offset. The PWM noise is from the 5v-0v swing of the output of the MCU. It can be passively or actively filtered, but filters have slopes, and they end up cutting out the high frequencies you DO want. The noise from the convertor is the high-speed switching needed to charge a capacitor in the right way, to get the negative rail. You end up with dirty supply lines, which can be mitigated somewhat with capacitors. DC offset is really unrelated to either of these – any noise ends up riding on the DC voltage you produced (if you’re generating your DC offset with a simple voltage divider).

So basically, the Shruti has a positive and a negative rail, and a ground. The opamps are powered by the positive and negative rails, and can swing between the two, and use ground as its reference, which splits the difference between the two. My design is uni-polar – just 5v and ground. I did this because the delay chips and the digital pots run off of a single supply, so they’re already looking for something that doesn’t swing around 0, but rather something that swings around 2.5v, which is where the DC biasing becomes necessary. So pretty much the entire course of audio through my circuit will be riding around 2.5v, which gets blocked by a capacitor at the output. Does that make sense?

Maybe if I had to start something like the Shrut(h)is from scratch I would dedicate a full port for a R2R DAC like you suggest, and generate the control signals with a quad SPI DAC and do all the “user interface” IO with an I/O expander. Maybe… Sound quality would be better this way (or the resulting lack of grunginess would make it sound dull?). However, this is not something I plan to do, for the simple reason that I feel that I’ve pretty much explored everything that came to my mind in the space of “cheap synthesis algorithms that run on an 8-bit AVR at 20MHz”. A third iteration of the concept would only be a small leap…

I see two paths, indeed:
1/ I stay faithful to the through-hole, kit-ey, world, and come up with a nice multi-MCU design. I actually thought a bit about the update problem and I think I have a solution - basically the “master” CPU either updates its own firmware, or, depending on a flag in the firmware update SysEx messages, lowers a pin on the slave “voice” MCU and reset them to make them stay in bootloader mode, then forward them the MIDI packet as is. All the voice chips receive the forwarded update data simultaneously and update their firmware. Voila. This could work well or end up being a flaky nightmore… I don’t know but it looks like a solid plan.
2/ I get my ass kicked a bit and take the time to learn a more modern platform + SMT board design. I think a 100MHz LPC1754 could render 4 voices of polyphony with some smarter DSP than the Shruthi (I got plenty of cool things with Palm Tungsten Ts back in the Chocopoolp days…) + drive a quad DAC and a pair of octal S&H for generating plenty of control signals + those things in tiny 100-pins packages have plenty of GPIOs! For the kit distribution, the options would be a board with the SMT components pre-assembled, or maybe a “You buy the pre-assembled, boring, digital/control board, and you do yourself the funky through-hole analog filters board”.

Option 1/ looks like a slow and lazy evolution of what I am doing - with the risk that I’ll eventually get bored of counting CPU cycles. Option 2/ is challenging, but it’s going to be a massive time and money investment for something I’m still supposed to do as a hobby in my long sleepless nights. I’ll see how well things go with the Shruthi-1, I still have a couple of variations of the analog board to design. Heck, 1 year ago I didn’t even know what was a microcontroller or a power rail!

I have to say that before that post, the idea of doing kits with SMT boards didn’t sound like something I’d be interested in - I think a big part of the beauty of your kits is the feeling of accomplishment from building them yourselves. SMT seemed like a step towards fully pre-manufactured synths, which is less interesting. That said, if you think you can do what you say can be done with SMT and get smarter DSP and polyphony then it could be a really interesting next generation of instruments.

Now I’m sort of in two minds.

Out of interest, what’s the limiting factor with through-hole? Is it the processing power available to through-hole-sized processors (I noticed you went for a more powerful processor with the Shruthi-1 - is that as powerful as through-hole chips get?) Or is it more about physical PCB size, or the number of connection pins for things?

Discussion about the use of SMT parts and more modern MCUs is being continued here:
http://mutable-instruments.net/forum/comments.php?DiscussionID=135

Unfortunately I discovered today that my schematics do not match the delay I had breadboarded… and neither work at the moment. So I had made a lot of headway into board layout, and was almost completed, but must return to the schematics to revise them and figure out what is correct… In any event, my schematics posted earlier should be considered defective… :frowning:

Quote:
Btw- Did you get a wtpa-1? I wish I’d heard about that sooner!

>>
you can still build it. pcb’s and mcu are still available.

probably worth hangin on till wtpa2 drops though…