PTAP: PT2399 tap tempo control

Started by decc, April 15, 2009, 11:59:22 AM

Previous topic - Next topic

decc

Here is the first (of apparently many) working solution for tap tempo control of a PT2399 based delay.

The basic schematic is thus:



R1 is the existing delay pot (usually 25k or 50k) which now goes in to an AVR microcontroller. Terminal T2 is a momentary footswitch for the tappin'. The MCU handles all the timing and sets the digital pot (50k) which is now wired to the VCO pin of the PT2399 via T3.

The pot has 256 taps to choose from. Depending on the area of the delay curve you're in it ranges from about 3-5ms per setting. (On a typical 300-degree travel pot this is a little over 1 degree per tap.) It is by no means a super-accurate timing device, but given that the average delay only has about 3-5 repeats it is certainly accurate enough for rock'n'roll.


  • On power-up it is in manual pass through mode.
  • First tap activates tempo mode.
  • In tap mode the delay pot selects the beat (eighth/dotted eighth/sixteenth/etc.).
  • Taps are timed and scaled to the beat.
  • Digital pot is set accordingly.
  • Can be booted in to a rough calibration mode by holding down the tap switch on power-up.
  • Less than 5mA

Demonstration (of the chip and my lack of rhythm): http://www.youtube.com/watch?v=oE0piMXWmZQ


Now my question to all who are interested: how would you like this project to be available? My thoughts are:

A. Pre-programmed MCU and digital pot.

B. Kit with PCB

C. Fully assembled

For "A" I figured may as well include the pot at the same time as the MCU as it's something a DIYer typically won't have. For "B" the layout is pretty simple but if there's enough interest in a PCB for adding to existing delays I wouldn't mind ordering a small run.  I doubt this crowd would have much use for "C". :)


earthtonesaudio

Cool! Thanks for sharing.  Seems like 256 steps is "accurate enough" for delay.

RonaldB

Looks good, i was busy making the same thing with an arduino board and a double digital pot.
My thoughts where that if you use 2 digital pots you get 2x256bit and you can make them act as 25K pots.
So thogehter thats 50K.

I had the same features on my arduino tap tempo version. Subdivisions (1/4,1/8*,1/8,1/16 etc.) and i wanted to make an audio tap on it.

But maybe it's an idea to use a double digital pot.

And as far as the project, sell the avr's pre burned with the digital pots. :icon_biggrin:

Good job

slacker

Looks like a great solution. I'd definitely be interested in getting one, I'd prefer option A but whatever you decide is good with me, cost permitting.


decc

Quote from: RonaldB on April 15, 2009, 01:35:33 PM
Looks good, i was busy making the same thing with an arduino board and a double digital pot.
My thoughts where that if you use 2 digital pots you get 2x256bit and you can make them act as 25K pots.
So thogehter thats 50K.

I'm not sure I have the arrangement right, but my thoughts:

  • 2 8-bit 25k in series = 1 X-bit 50k. I don't see any 25k's on Mouser. (There's a 24k but it's a quad.)
  • 2 8-bit 50k in parallel = 1 X-bit 25k. While the PT2399 starts getting lo-fi after the 25k/300ms point I prefer having the extra range just in case.

I say X bits since there is redundancy in there so it wouldn't be a full 16-bit range. (But still more than 8.)

Would the audio tap sync to a metronome signal? That's a pretty good idea!


RonaldB

Well i made a couple of PT2399 delays now and i had good results with 50K delay time pots.

My general idea was to do a double pt2399 configuration with 50k digital pots on them. This would be better for the sound of the delay
But with 1 pt2399 i would use a double 50K digital pot (get them at futurlec.com(microchip)) and do a 22K or 27K resistor across the outher legs.
Then couple them in series.

I have made the Arduino listen to Midi Clock notes. Witch is also a plus. That way you can sync the delay to your sequencer, drum machine or recording software 8).

My point with the audio tap is the same as the Nova delay. So pressing the tap button and stike the rythem with the guitar.
I have to get back on the software + hardware for this. I'm busy now making my custom build Midi controller witch will have Midi Sync tap tempo 8).

best regards
Ronald

cpm

how is the calibration done
i mean, is it hardcoded in the uC, using linear formula, conversion table, whatever?
is there enough consistency from pt2399 chip to chip?

nelson

I'm assuming that this could replace any time based control, assuming you know the relationship between resistance and time? It'd be a simple matter of changing the look up table values?

Knowing how digital pots work, it would be a simple matter of changing the output clocking frequencies look up table relating to the measured frequency of taps.

I'm thinking replacing rate pots in LFO's and the delay pots in analog delays.

In the examples I'm thinking of the relationships are linear, so it should be pretty straightforward.

I'm busy digesting AVR + PIC programming books, although there seems to be a base knowledge assumption that I'm missing. I'm having a hard time conceptualising how it all fits together. I'm sure I'll get there.

I know this is probably cheeky, but it is a DIY forum.

Any chance of the code?



My project site
Winner of Mar 2009 FX-X

Nitefly182

So ultimately you will just wire this circuit in place of the delay time pot in the circuit?

I would prefer PCB/Kit.

decc

Quote from: cpm on April 16, 2009, 07:59:44 AM
how is the calibration done
i mean, is it hardcoded in the uC, using linear formula, conversion table, whatever?
is there enough consistency from pt2399 chip to chip?

There is a lookup table that is used to convert time to delay settings. The math isn't that complicated, but there's no reason to force a poor little micro-controller to do floating point on the fly when you only have 256 answers to choose from. (The timing of the taps themselves is more accurate than this which helps to lock on to the closest possible setting. It also means the chip can be re-used to drive a true clock line for analog delays. I'm not promoting it as such quite yet though since I haven't verified it, but it is an obvious extension to its current abilities.)

The calibration consists of three parts:


  • First is the internal RC oscillator of the MCU. It comes from the factory at +-10% but there's an app. note from Atmel on how to calibrate it to be +-1%.

  • Second is adjusting the look-up table for the digital pot. While the samples I've tested have been right-on for the specified 50k the datasheets do allow for a wider variation as is the case with your standard pot.

  • Third is adjusting for variations in the host circuit, such as the PT2399 itself or the (typically) 1k resistor in series. While this could be done more accurately at programming time it makes more sense to have it a user-controlled function since the device is intended to be added to an existing pedal. Hence the "calibration mode".


Quote from: nelson on April 16, 2009, 11:18:21 AM
I'm assuming that this could replace any time based control, assuming you know the relationship between resistance and time? It'd be a simple matter of changing the look up table values?

Yes and no. The idea is correct, however the values available for digital pots are limited, especially in the higher values since as I understand it integrated resistors cost a lot of die space. We're lucky that 50k works with the PT2399. As was mentioned earlier there isn't even an easy way to get 25k. I looked in to finding a 1M dpot since that's what is already in analog delays but there aren't any. Hence driving the clock line directly in those situations.

Quote
Any chance of the code?

Not very likely. I view the MCU+code as a single finished product the way one would a design using an FPGA/PLD/etc. I am however perfectly happy to discuss the theory of what's happening inside the chip. I think that's an acceptable middle ground. :)

Quote from: Nitefly182 on April 16, 2009, 02:09:04 PM
So ultimately you will just wire this circuit in place of the delay time pot in the circuit?

I would prefer PCB/Kit.

Correct. I put more detailed instructions up here. And since there isn't an issue of "minimum quantity" for just the chips the way there is for PCBs I put up a little PayPal store if anyone is interested. Your vote for the full kit has been counted though.

Auke Haarsma

I am interested in ordering a couple. But, I like running the pt2399 with delay-time pots of 100k and up. Could your taptempo handle a 100k time-pot and also tap into the 100k time-range?

(oh, please add a shipping option to the Netherlands ;) )

decc

Quote from: Auke Haarsma on April 16, 2009, 04:37:57 PM
I am interested in ordering a couple. But, I like running the pt2399 with delay-time pots of 100k and up. Could your taptempo handle a 100k time-pot and also tap into the 100k time-range?

(oh, please add a shipping option to the Netherlands ;) )

The value of the control input pot doesn't matter as long as it's a linear taper (it's just a voltage divider now.) And you're in luck: there's a 100k version of the digital pot so that should be no problem. I'm surprised that it works though. At 50k the repeats are pretty lo-fi already! I wonder what do they sound like at that point?

I'll try to figure out the international shipping option too. (That site is normally used to sell/host proprietary software so I'm new to the whole shipping thing.)


slacker

#12
A couple of questions if you don't mind :)
Once it's in tap mode can you get it back out again? Would you have to "reboot it" to get the delay pot to work again?
Does the delay time pot still work smoothly or can you hear the steps as you turn it?

The Tone God

Quote from: decc on April 16, 2009, 04:52:05 PM
And you're in luck: there's a 100k version of the digital pot so that should be no problem. I'm surprised that it works though. At 50k the repeats are pretty lo-fi already! I wonder what do they sound like at that point?

You cannot just drop in a 100K digital pot for the 50K and expect the taps times to match the pot settings.

Andrew

MoltenVoltage

Quote from: The Tone God on April 16, 2009, 05:33:46 PM
Quote from: decc on April 16, 2009, 04:52:05 PM
And you're in luck: there's a 100k version of the digital pot so that should be no problem. I'm surprised that it works though. At 50k the repeats are pretty lo-fi already! I wonder what do they sound like at that point?

You cannot just drop in a 100K digital pot for the 50K and expect the taps times to match the pot settings.

Andrew

Agreed.

Also, I don't mean to be a wet blanket, but it seems a bit premature to be selling it when you have yet to actually test it with an accurate clock:

"My testing has been limited to a cheap metronome, my own sense of timing, and a half-dozen PT2399 chips. (So while there is a sinking feeling that I missed something here and will let everyone down, as far as my experience goes it actually works!)"

As I'm sure you know, binary math and microcontroller outputs don't always mesh with real-world applications.

MoltenVoltage.com for PedalSync audio control chips - make programmable and MIDI-controlled analog pedals!

decc

Quote from: The Tone God on April 16, 2009, 05:33:46 PM
Quote from: decc on April 16, 2009, 04:52:05 PM
And you're in luck: there's a 100k version of the digital pot so that should be no problem. I'm surprised that it works though. At 50k the repeats are pretty lo-fi already! I wonder what do they sound like at that point?

You cannot just drop in a 100K digital pot for the 50K and expect the taps times to match the pot settings.

Andrew

Sorry if I implied that. The tables would have to be recalculated and verified. But there's no reason to think it won't work any worse than a regular 100k pot.

Quote from: MoltenVoltage on April 16, 2009, 05:54:19 PM
Quote from: The Tone God on April 16, 2009, 05:33:46 PM

Also, I don't mean to be a wet blanket, but it seems a bit premature to be selling it when you have yet to actually test it with an accurate clock:

"My testing has been limited to a cheap metronome, my own sense of timing, and a half-dozen PT2399 chips. (So while there is a sinking feeling that I missed something here and will let everyone down, as far as my experience goes it actually works!)"

As I'm sure you know, binary math and microcontroller outputs don't always mesh with real-world applications.

Indeed, but for this application the refrain is "close enough for rock'n'roll." Since then I have checked the timing on a scope and it passes within 4%, depending on the PT2399 chip in use. Hence the calibration mode.



decc

Quote from: slacker on April 16, 2009, 05:03:24 PM
A couple of questions if you don't mind :)
Once it's in tap mode can you get it back out again? Would you have to "reboot it" to get the delay pot to work again?
Does the delay time pot still work smoothly or can you hear the steps as you turn it?

Hold down the footswitch for 2 seconds to get it back to manual mode. I'll add that note to the description.

As for how smooth the turn of the pot is: let's look at a typical 3/4" knob with 300 degrees of travel. That's 1.2 degrees per tap, or moving the pointer on the knob about .007 inches. There's also some code to make sure it doesn't land right on the edge and wobble back and forth to give you an impromptu vibrato. :)

Auke Haarsma

Thanks for the answers decc.

-Would this work with the recent modulation-delays (EchoBase, Magnus Modulus), -> LFO's on the delay-time?

decc

Quote from: Auke Haarsma on April 17, 2009, 02:37:34 AM
Thanks for the answers decc.

-Would this work with the recent modulation-delays (EchoBase, Magnus Modulus), -> LFO's on the delay-time?


Electrically it should be fine since to the rest of the circuit the digital pot still looks like a regular old variable resistor. Having the desired affect might be another story.

With the Magnus I'd say it's very likely as it has the standard 50k pot + 1k resistor arrangement, with the modulation via a capacitvely coupled voltage.

With the Echo Base I hesitate a bit as the modulation is done with a transistor + 39k resistor that are always in the circuit. The assumption I'm making is that those two don't change the delay curve aside from the intended modulation, but we all know where assumptions get us.


slacker

#19
On the Echo Base when the modulation level is set to minimum the PNP transistor + 39k combo looks like a very small fixed resistor, I don't know the value but its probably less than 100 Ohms. Providing the PTAP doesn't need the 1k series resistor for timing accuracy or current limiting purposes it will work fine like this. If it needs the 1k for any reason you would need to add this, this would then raise the minimum delay time so the chorus type sounds with the delay time pot on or very near minimum will probably be affected. 
Even if you don't need the 1k resistor, according to the datasheet for the MCP41050 (page 14) the minimum resistance when used as a variable resistor is around 125 Ohms, so the chorus type sounds might be affected anyway.

Once you start to add some modulation the PNP transistor + 39k combo looks like a variable resistor in series with the delay time pot. One of the flaws in the Echo Base is that the modulation also adds a series resistance to the delay time pot, this resistance increases  with the amount of modulation. Basically if you set the delay time you want and then add some modulation the delay time you set gets slightly longer rather the modulation being centred around the delay time you set originally. 
I would guess that for small amounts of modulation, given the variations you're going to get anyway with everything else in the circuit this won't matter, and the results will still be close enough for rock n' roll :)
If you want to use the PTAP with more extreme amounts of modulation you're unlikely to be worrying about accuracy. 

I'm going to buy a PTAP and see if it works with the Echo Base because I guess it's something a lot of people will be interested in adding to theirs.

Quote from: decc on April 16, 2009, 08:08:36 PM
Hold down the footswitch for 2 seconds to get it back to manual mode. I'll add that note to the description.

Thanks.

Quote
As for how smooth the turn of the pot is: let's look at a typical 3/4" knob with 300 degrees of travel. That's 1.2 degrees per tap, or moving the pointer on the knob about .007 inches.

Does it sound smooth though, because on some digital delays you can hear that the delay time is changing in distinct steps. What I'm talking about here is grabbing the pot and sweeping it back and forth as an effect not just setting the delay time with it, I should have made that clearer when I first asked the question.

Just thinking aloud here, I wonder if you could replace the voltage divider feeding the MCU with a CV in and modulate the delay time using the digital pot. That would be fantastic  ;D