Author Topic: Tap timing, hideously complex?  (Read 7865 times)

0 Members and 1 Guest are viewing this topic.

mrmrcoleman

Tap timing, hideously complex?
« on: December 03, 2005, 08:44:18 AM »
High on the success of my first pedal, I have come up with a few ideas for some cool pedals, some of which involve tapped timing. I have seen this sort of thing on one of the high end boss multi FX type pedals. How difficult is it to build some sort of timer circuit whereby the time interval can be set by a tapped button?

I assume it is incredibly difficult but I just thought I would ask!

Thanks,

Mark

R.G.

Re: Tap timing, hideously complex?
« Reply #1 on: December 03, 2005, 08:53:58 AM »
It is incredibly difficult to do in analog, trivial to do with a microcontroller.
R.G.

Quick IQ Test: If anyone in a governmental position suspected that YOU had top-secret information on YOUR computer, how many minutes would you remain outside a jail cell?

mrmrcoleman

Re: Tap timing, hideously complex?
« Reply #2 on: December 03, 2005, 08:55:02 AM »
Could you explain further by any chance? Sorry for being such a noob, but I kind of need spoon feeding with this stuff at the moment :icon_frown:

R.G.

Re: Tap timing, hideously complex?
« Reply #3 on: December 03, 2005, 09:17:07 AM »
In tap timing, you are in effect telling the pedal "This is the cycle time of your LFO. Measure this and REMEMBER it, doing that cycle time until I tell you to quit."

It's not hard to tell an analog circuit a special time. It is quite difficult to make it remember and do that forever. It is really, really difficult to make it remember it from only one or two examples.

If you had a long number of examples, a phase-lock-and-hold would work fine, but one example just looks like noise to the phase lock. You might do something involving starting a ramp with a first tap, then stopping it with the second ramp, and carefully, carefully making that voltage be the input to a voltage controlled oscillator, then worrying a lot about making the frequency of the oscillator be exactly the timing of the taps. Then there's the whole issue of making the output waveform be what you want.

A microcontroller (or other digital means) on the other hand is naturally suited to taking one sample of a number and remembering that forever. It is also ideally suited to making arbitrary waveforms by table lookup.
R.G.

Quick IQ Test: If anyone in a governmental position suspected that YOU had top-secret information on YOUR computer, how many minutes would you remain outside a jail cell?

mrmrcoleman

Re: Tap timing, hideously complex?
« Reply #4 on: December 03, 2005, 10:02:17 AM »
Ok, I'm with you now. Think I might put that off for a little while!

Mark

robbiemcm

Re: Tap timing, hideously complex?
« Reply #5 on: December 03, 2005, 12:49:30 PM »
Does anyone build diy pedals with microcontrollers or is that just something which we don't/can't do?

The Tone God

Re: Tap timing, hideously complex?
« Reply #6 on: December 03, 2005, 01:35:48 PM »
The function is our friend:

search criteria: tap tempo

http://www.diystompboxes.com/smfforum/index.php?topic=39062.0

http://www.diystompboxes.com/smfforum/index.php?topic=35774.0

http://www.diystompboxes.com/smfforum/index.php?topic=21453.0

http://www.diystompboxes.com/smfforum/index.php?topic=21642.0

http://www.diystompboxes.com/smfforum/index.php?topic=8178.0

http://www.diystompboxes.com/smfforum/index.php?topic=22301.0

http://www.diystompboxes.com/smfforum/index.php?topic=21454.0

http://www.diystompboxes.com/smfforum/index.php?topic=2669.0

http://www.diystompboxes.com/smfforum/index.php?topic=345.0

http://www.diystompboxes.com/smfforum/index.php?topic=30245.0

http://www.diystompboxes.com/smfforum/index.php?topic=27812.0

http://www.diystompboxes.com/smfforum/index.php?topic=25811.0

And thats from just the first page of results.

Does anyone build diy pedals with microcontrollers...

Yes I do.

...or is that just something which we don't/can't do?

It depends on who you consider "we". If by "we" you mean the average DIYer then look at the threads that keep popping up. Most of them are based around basic fundimentals of electronics. Alot of people here are learning just enough electonics to build pedals as oppssed to learning electronics and decided to build a few pedals along the way. To throwing uC at them is like throw algebra at 1st graders.

Are there DIYers who can do it ? Yes. Is it something that the majority of DIYers can do ? Looking at the forum's threads I would have to say no.

Andrew
« Last Edit: December 03, 2005, 01:51:03 PM by The Tone God »

Vsat

Re: Tap timing, hideously complex?
« Reply #7 on: December 03, 2005, 02:28:51 PM »
The analog tap tempo circuit becomes a lot simpler if you deal with PERIOD rather than FREQUENCY.
Can be implemented with four 35 cent chips, running directly on 9V, current drain = 1.1 mA, (larger current drain  if an LED is added).  The microcontroller approach is still the simplest, but even there you'll probably still be using 3 chips : a 5 volt regulator, the uC and an op amp chip. Another possible approach is to use a Xicor/Microchip/Dallas DIGIPOT chip. That method will also require a 5V regulator and  op amp. For a commercial product, uC definitely the way to go, especially if the user-interface is anything but bare-bones.

Currently using the garden-variety approach in a tap-tempo phaser. It is novel and intuitive to use, but difficult  to set when "target" period is shorter than about 0.5 seconds. Perhaps use a x10 switch for the very fast tempos .
Cheers, Mike

Transmogrifox

Re: Tap timing, hideously complex?
« Reply #8 on: December 03, 2005, 07:08:42 PM »
Quote
Alot of people here are learning just enough electonics to build pedals as oppssed to learning electronics and decided to build a few pedals along the way. To throwing uC at them is like throw algebra at 1st graders.

For the amount of time people invest in learning basic electronics, they could easily get into programming uC's.  Once you get a grasp on the architecture and learn what some basic assembly commands do (which are clearly laid out in the datasheets for the uC's), then the average hobbyist could learn to do microcontroller programming.

If you simply start by getting an example code set to make the output count in binary then reverse and count back down, and get to where you are able just to get the code to assemble and load onto the chip to run, then you can start playing with it, learning as you go.

Unfortunately, you do need to have some mathematical proficiency to wrap your mind around hex and binary.  I do know a hobbyist that has picked up microcontroller programming.  He has programmed an LCD to display a "xx loves yy" scrolling across (xx and yy are his name and his wife's name, respectively).  I'll bet his wife thought it was very romantic  :icon_confused:
trans∑mog∑ri∑fy
tr.v. trans∑mog∑ri∑fied, trans∑mog∑ri∑fy∑ing, trans∑mog∑ri∑fies To change into a different shape or form, especially one that is fantastic or bizarre.

Paul Perry (Frostwave)

Re: Tap timing, hideously complex?
« Reply #9 on: December 03, 2005, 07:41:26 PM »
Transmogrifox is right, in the sense that people have different skills & experience. I come from an analog background & I'm not into micros at all..... but, I see on embedded (micro) boards, plenty of people who can do all manner of programming, including DSP, but who can't solder to save themselves, much less put a single transistor amp together!! Maybe try to get involved with a robitics group (if you are at a college), that's about the last of the DIY scene left today, and they are using exactly the skills you need for a tap tempo anything.

robbiemcm

Re: Tap timing, hideously complex?
« Reply #10 on: December 05, 2005, 06:37:03 AM »
Thanks for the answers, I'm still in high school so no robotics group or anything like that. However now having heard about it I will probably just learn it myself. My strengths are Maths and Physics and my cousin has taught me programming in a few languages and I've done a bit here and there with weird programs, lol. I just need to buy the materials thaat you use you do this sort of stuff, and do a bit of reading I suppose. I'll use google and try and find these other communities you speak of.

The Tone God

Re: Tap timing, hideously complex?
« Reply #11 on: December 05, 2005, 06:57:18 PM »
It is true that skill sets do affect how one maybe able to learn a new technology and one maybe better at one technology then the other but in this case you have to be good at both to be successful. I used the level of disscussion possed by the common poster at this forum as a rough scale of the "average DIYer" skill set which is somewhat of a reasonable meteric to use at this point. If people are having a hard time understanding how to bias a simple single transistor section or how to use ohm's law for simple calculations then expecting them to learn how to do basic uC tasks like managing stacks or do bit shifting is a bit of a stretch I belive.

Awhile back I put forth the offer to do a set of articles teaching basic uC programming. For a number of reasons I decided not to. One of the reasons brought forth in that discussion concluded that those who wanted to learn could on their own accord. That seemed reasonable to me.

Back to topic. The actually capturing and calculating of the user's tapping cycle is not even the toughest part. Its the output of the result more specificly how the result is interfaced and relates to the controlled circuit is the tough part. The many different circuits that could benefit from a tap tempo vary heavily in design. A BBD based delay has a different clock need then say a PT-80. Phasers, Phase 90 or Small Stone ? Tremolo, CA or EA or Pulsar ? The vast different types of clock circuits used in DIY effects make a "generic" tap tempo circuit practically impossible to create.

Just a few thoughts.

Andrew

Vsat

Re: Tap timing, hideously complex?
« Reply #12 on: December 05, 2005, 07:53:21 PM »
Same problem interfacing any general-purpose triangle (or other waveshape) LFO to an arbitrary fx unit.
The LFO output could be interfaced to the fx unit in the form of a variable resistance, a variable current, or a variable voltage. These may vary in an exponential or linear manner, or some other fashion. They may be unipolar or bipolar. Offsets may be added if the fx unit does not expect a ground-referenced signal. If the fx unit is designed to accept a control voltage in the first place the interface could be relatively simple.  Shame if the tap-tempo circuit and interface takes even more parts than the original circuit though!
Mike

Transmogrifox

Re: Tap timing, hideously complex?
« Reply #13 on: December 05, 2005, 10:39:18 PM »
Same problem interfacing any general-purpose triangle (or other waveshape) LFO to an arbitrary fx unit.
The LFO output could be interfaced to the fx unit in the form of a variable resistance, a variable current, or a variable voltage. These may vary in an exponential or linear manner, or some other fashion. They may be unipolar or bipolar. Offsets may be added if the fx unit does not expect a ground-referenced signal. If the fx unit is designed to accept a control voltage in the first place the interface could be relatively simple.  Shame if the tap-tempo circuit and interface takes even more parts than the original circuit though!
Mike

That would be too bad...however for an LFO, all the required waveshapes and offsets can be programmed into the uC.  There are various ways of doing the A/D conversion, whether it be taking an 8-bit output from 8 I/O pins and adding the voltages, or PWM or just using a uC with a D/A converter in it.  The rest is just having the know-how to use the correct "ground" reference and power supplies to interface.

Most analog FX use a 9V batt,  so the modulation voltage ranges between 0 & 9 volts.  Put a simple amplifier on the output of your uC so you can get a near 0-9V range, then set the "center point" and depth by the program in your uC.  If you took inputs, then there would be a couple more controllable parameters you would have to play with.
trans∑mog∑ri∑fy
tr.v. trans∑mog∑ri∑fied, trans∑mog∑ri∑fy∑ing, trans∑mog∑ri∑fies To change into a different shape or form, especially one that is fantastic or bizarre.

Vsat

Re: Tap timing, hideously complex?
« Reply #14 on: December 05, 2005, 11:04:14 PM »
Yup, for OTA-based fx the uC could supply the Iabc directly through a weighted resistor network, with some filtering, provided there is sufficient resolution to handle the lowest couple of octaves without noticeable stepping. If this is an issue, then supply a linear control voltage to an expo current source. For LDR units, the uC could directly PWM the LEDs, and let the LDRs do the smoothing. Simple way to add triggered-envelope functions as well.
Mike

Paul Perry (Frostwave)

Re: Tap timing, hideously complex?
« Reply #15 on: December 06, 2005, 07:44:05 AM »
An interesting thing about PWM outputs, is that if you can easily multiply things by them (well, it has to be at an ultrasonic rate if you are doing audio, but even so..). In the early analog computer days, one way to multiply was to have X control the PWM, and Y control the amplitude of the pulses. Smooth it out and there you have XxY!

Transmogrifox

Re: Tap timing, hideously complex?
« Reply #16 on: December 07, 2005, 10:32:44 PM »
An interesting thing about PWM outputs, is that if you can easily multiply things by them (well, it has to be at an ultrasonic rate if you are doing audio, but even so..). In the early analog computer days, one way to multiply was to have X control the PWM, and Y control the amplitude of the pulses. Smooth it out and there you have XxY!

This was one of my ideas for a ring modulator, however X has a gain of 1, and Y has a gain of 1 if you don't have a PWM output 'x' that does not range from -1 to 1 due to control voltage.  I ended up using a little more complicated scheme with CD4066 switches to accomplish this.  It works quite well, I posted soundclips in one of the threads here...though I think putfile has dumped them.  Maybe I should do a search for that thread and find out if they're still there.
trans∑mog∑ri∑fy
tr.v. trans∑mog∑ri∑fied, trans∑mog∑ri∑fy∑ing, trans∑mog∑ri∑fies To change into a different shape or form, especially one that is fantastic or bizarre.

GFR

Re: Tap timing, hideously complex?
« Reply #17 on: December 08, 2005, 07:22:56 AM »
Transmogrifox,

If you use an opamp "polarity reverser" like

http://www.geofex.com/Article_Folders/polarity_reverser/polarity_reverser.htm

(I think there's a similar circuit in one of the Craig Anderton's books)

You can control the switch with a PWM for a range of -1 .. +1.

Paul Perry (Frostwave)

Re: Tap timing, hideously complex?
« Reply #18 on: December 08, 2005, 08:38:28 AM »
This was one of my ideas for a ring modulator, however X has a gain of 1, and Y has a gain of 1 if you don't have a PWM output 'x' that does not range from -1 to 1 due to control voltage. 

This was a problem wiht the old analog computer setups If you are searching indexes, you are looking at a "one quadrant" multiplier if it only does positive X and Y, or a "full quadrant" if it does + and - both ways.
To get around this, imagine you have a +-5v range.. then add 5v to both X and Y, then multiply the results:
(X + 5)x(Y + 5) = (XY +5X + 5Y + 25).

Just subtract out the X, Y, ad constant terms & there you are :icon_wink:
In the application notes for the LM13700 OTA, yu can see the LM13700 being used as a two quadrant multiplier,
the subtacted term is not obvious in the circuit, but it is there... and note that if you change the supply rails, it doesn't cancel any more. I bet that's caused a few tears.

R.G.

Re: Tap timing, hideously complex?
« Reply #19 on: December 08, 2005, 09:30:40 AM »
I think you're all missing a key point. You don't necessarily want a uC to have built in all the possible ways to run an LFO. Even some of the bigger storage unit devices might not have enough internal storage to let you put all possible ways into it and just pick which one. What you want is modular software. You'd like to pick which routine gives you the output waveform, offset, etc you want for a given effect, all pre-tested, and then only hook into the object linking run the parts you need. It's like hooking up effects in a chain - you bypass the ones you don't need for this song.

A particularly effective setup is one I have on my workbench now. It's a PIC 16F818 driving a Microchips dual 50K digipot. This thing can give you control voltages directly, or it could run either single-pot or dual-pot setups as long as you run the LFO on 5V or less, and voltage outputs directly, even with offsets. More importantly for some setups, it can put out an LFO voltage that goes all the way to ground.

You want to synthesize the LFO waveform directly for simple programming. If you merely control an analog LFO, then you have to close a digital feedback loop on the LFO and not only read the tap timing switch, you have to read the timing of the LFO you're controlling and adjust it to the correct timing in a control loop. The control loop approach, which not particularly challenging in a programming sense (things like broom balancers are staples of sophomore Controlls courses) is difficult to shoehorn into the memory and real time constraints of a uP. That will get better as uCs get faster and have more storage.

You could do this with an 8 pin 12F508 (probably) or 12F629 and a 14 pin digipot. I *think* you could also do it with a 16 pin CMOS shift register instead of the digipot, for about the same price.

Quote
Shame if the tap-tempo circuit and interface takes even more parts than the original circuit though!
Perhaps in one sense. However, in another sense, the original circuit is often much less than the other stuff to make it work the way we want it to. And the original circuit doesn't do tap tempo., which is presumably a worthwhile effect on its own. Or, from the software engineer's perspective, the user interface is usually more expensive and demanding than the base calculations.
R.G.

Quick IQ Test: If anyone in a governmental position suspected that YOU had top-secret information on YOUR computer, how many minutes would you remain outside a jail cell?