Tap Tempo LFO with PIC 16F684

Started by ElectricDruid, May 13, 2009, 05:22:13 AM

Previous topic - Next topic

David

Quote from: JKowalski on June 29, 2009, 12:45:16 PM
This topic should be moved into the building your own stompbox forum, seeing as how it is meant for people who are not familiar with PICs. He is asking the community that has no experience with them what they would like to see in a preprogrammed chip that he could sell off to them.

In short, the target audience for the project & topic does not even venture into this forum.  :icon_rolleyes:

Yes, they do.

.Mike

Quote from: jacobyjd on July 02, 2009, 09:10:19 AM
Just to chime in with others--if this ended up looking like a 1-stop shop, multi-shape LFO in a single-chip format w/ minimal external parts and tap tempo, I would absolutely be in for one. In fact, I would consider converting my pedalboard setup to use a remote LFO plugin, and I would keep the LFO in its own box with a tap switch. I would use the LFO to sync up multiple modulation pedals from a central point.

You know, I was thinking about this, and I think it could be very cool. I'm building a multi-effects project, and having one LFO that controls multiple modulation effects would be great.

Someone earlier mentioned multiple LFO outputs and tempo divisions. I wonder if it would be feasible or useful to sort of combine the two. For example you could have one LFO going out to a tremolo at 100% speed, and another LFO going out to a phaser at 50% speed, and another going to a delay at 10% speed. The LFOs would be in sync with each other, just at different rates.

I suppose, though, it would be better to have a way to sync multiple LFO chips in terms of speed only, so you could use a different waveform or depth for each effect.

Could the tap-tempo VCLFOs simply be run in parallel, so that a single tap button changes the speed of multiple LFOs at the same time?

One of the LFO's inputs could be a tempo division CV, and all the other features (depth, waveform, wave distort) would be independent of the other LFO chips, and have their own potentiometers for adjustment. Of course, if you always wanted one of the characteristics to be synced with all LFOs-- waveform, for example-- you could just run the waveform CV to each LFO chip you want synced.

I bet that some pretty cool layers of effects could be built on that.

:)

Mike
If you're not doing it for yourself, it's not DIY. ;)

My effects site: Just one more build... | My website: America's Debate.

JKowalski

Quote from: David on July 02, 2009, 10:44:13 AM
Quote from: JKowalski on June 29, 2009, 12:45:16 PM
This topic should be moved into the building your own stompbox forum, seeing as how it is meant for people who are not familiar with PICs. He is asking the community that has no experience with them what they would like to see in a preprogrammed chip that he could sell off to them.

In short, the target audience for the project & topic does not even venture into this forum.  :icon_rolleyes:

Yes, they do.

Well, there are exceptions. I meant the general population.

flo

#23
Just found this thread because I was looking for a "tap tempo" square wave LFO with an option to set the duty cycle (wave distortion) in discrete steps that make "musical sense" like 50%, 33%, 25%.
This thread sort of covers it.

So it is basically the "Voltage Controlled LFO (VCLFO 9D)":
http://www.electricdruid.com/index.php?page=projects.lfo9
with added tab tempo control instead of the voltage control?

It would be nice to do it with an even simpler 8 pins PIC like: PIC12F629 or PIC12F675.
We probably only need up to 4 inputs (tap tempo, tempo division, duty cycle or wave distortion, wave-form selection) and the PWM-LFO output.

brian.d.haber@gmail.com

Quote from: jacobyjd on July 02, 2009, 09:10:19 AM
I would use the LFO to sync up multiple modulation pedals from a central point.

I, too, have thought about that before (great idea!). How would you make it work with pedals that don't have tap tempo inputs?

Also, does anyone know if it is possible to make a chip that averages the time in between 4 taps (instead of just 2) to get a more accurate setting, a la the Boss DD5? This would help most with pedals that you want to sync to the BPM of a song that are continuously running (e.g. tremolo, phaser), and lag (or speed) further and further behind the beat as the song progresses. Its not so much of an issue with delay pedals, because the pedal goes off of the notes you play.

flo

Using 4 taps instead of 2 is just a matter of programming with a PIC.  ;)

brian.d.haber@gmail.com

Quote from: flo on September 05, 2009, 07:10:27 AM
Using 4 taps instead of 2 is just a matter of programming with a PIC.  ;)

Thanks for the response. So, how exactly do you buy a generic PIC from Mouser and program it to perform a certain algorithm, such as the averaging 4 tap tempo inputs to set the tempo on a tremolo? Is there a common programming language to interface with the PICs (e.g. assembly language), and if so, how do you interface with it?

flo

#27
There is a lot of information about programming PICs on the internet also for beginners. I suggest you search it.  ;)

Beginners checklist for PIC  Microcontrollers
http://www.piclist.com/techref/piclist/begin.htm

PIC Programming - Getting Started
http://www.mhennessy.f9.co.uk/pic/index.htm

But basically:

- Buy a PIC chip.
- Buy a PIC programmer. I got a clone of the MicroChip PicKit2 from ebay.
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en023805
- Install the MicroChip MPLAB IDE.
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&redirects=mplab
- Learn to program it using very simple examples and a language called "C" (or else Assembler but its more difficult).
http://www.nextdawn.nl/c-reference/index.php
http://www.nextdawn.nl/sub/c_language/index.php
- Write a program in MicroChip MPLAB IDE, preferably using an example project to get you going.
- Compile the program with the MicroChip MPLAB IDE into a binary file.
- Put the binary file into the PIC chip using the MicroChip MPLAB IDE.
- Put the PIC chip into the hardware you build.
- Test the functionality of the program running in the PIC.
- Fix bugs in the program in MicroChip MPLAB IDE.
- etc.

ElectricDruid

Just a note to say that this isn't dead. After some nudging from elsewhere, I've gone back to this project and am getting close to having it finished off. Hopefully code and a datasheet will appear shortly on my website (http://www.electricdruid.com).

Thanks,
Tom

Roy

That's very good news about tap-tempo development.

I found this thread after I mentioned elsewhere  http://www.diystompboxes.com/smfforum/index.php?topic=79078.msg666768 (Gristleizer PCB's) that a soft LFO might be worth pursuing, and then I found that it had already been done.

Does the tap-tempo input completely replace the frequency control? If it does, then you can't use the pot to nudge the frequency up or down, you have to re-tap it. And if it doesn't and there's still a frequency pot too, then there is the usual problem of editing an existing value when the pot's physical position doesn't match the setting. Either you do a Prophet-5 style edit from where you happen to be, or you use a rotary encoder and accept the finite steps which are larger than the smallest step on a pot.

I was thinking about the algorithm. Taps 'expire' after 65 seconds, which is an absolute age in messing around with things terms. Consider the situation where it is 64 seconds since the last tap. You tap twice. The first tap is paired with the ancient tap, setting the frequency to very-slow-indeed. The second tap is now taken as a new 'first' tap, so noted but not acted on. The net result is that the frequency is still very-slow-indeed. Now consider the situation where it is 66 seconds since the last (unpaired) tap. The first tap is noted, the second concludes the timing interval and the LFO is set to the tempo defined by those two new taps. That is very different behaviour, depending on stuff that happened ages ago.

Would it be better to not differentiate between 'first' and 'second' taps, and each time there is a tap, try to pair it with a preceeding tap and set frequency appropriately. If there is no preceeding tap within the last 65 seconds, note the new tap but do nothing to the frequency yet.

If you're really clean about never leaving an unpaired tap it would never be a problem. I know I'm not like that. I might tap it three times, five times, whatever, until it sounded right.

I can't pretend to speak from first hand experience, though. This is just conjecture. How does it pan out in practice?


Roy Gwinn

ElectricDruid

You've got it pretty much spot on, Roy. I had exactly the problem you describe, and a related issue which was that 1mS resolution wasn't really enough for the timing. So I've used the 19.5KHz sample interrupt to count instead. This means the counter counts 19500 per second instead of 1000. This improves the resolution and reduces the maximum 16-bit time to a bit over three seconds. This is slow enough for fairly slow tempos (20BPM or less) but isn't long to wait for a unpaired tap to 'expire'. It seems to work pretty well.

The tap tempo does completely replace the tempo cv input, yes, and that means that you can't use the knob to nudge a tapped tempo up or down a bit. If you twist the knob, the chip changes to the new tempo you just set with the knob. The most recent change wins.
It's simple to use. If you want a particularly frequency, set it with the knob; if you want a particular tempo, tap it with the button.

Finally, you're dead right about needing first and second taps too. That's exactly how I thought to do it too.
Great minds think alike, and fools never differ.
T.

Skruffyhound

Like I said in the other thread. I'm interested, if you are at a point where you want to start taking orders, I'm in for a few. How many depends on the final price. Thanks for doing this.

ElectricDruid

I think I've finished! I've put details of my Tap Tempo LFO up online at:

http://www.electricdruid.com/index.php?page=projects.taplfo

There are example circuit diagrams, a datasheet, code, etc. Any questions, please ask.

I'll be trying to sort chips out soon, and if I can persuade Steve Daniels that this is a good idea, you might be able to buy programmed chips from Small Bear.

Thanks,
Tom

RonaldB

Looks good Tom, ;)

Thanks for making this avalible for everyone.

Ronald

JKowalski

I've been waiting for this for a long time. Thank you so much for finishing it up! This program, IMO, has the perfect array of features, all useful, in a good sized chip. You have done a wonderful job, and are very generous to offer all of this hard work freely to the community! I'm gonna test it out as soon as I can.

Many many many thanks for your efforts and generosity!

Processaurus

#35
Very cool, thanks very much for putting this together, Tom.  Question, when, rythmically, does the new tempo come in once you've tapped?


Idea, to make inverted LFO's (for stereo effects and the like) one could probably just stick an inverter on the PWM output (with the inverter powered from the 5v), and then LP filter that just like the non inverted signal.  As you turn the depth down with the digital control, does the LFO remain biased at 2.5v?  If so, the digital depth knob would work fine for the inverted copy...


I got some PIC's to try your original VCLFO, but hadn't had a chance to try it yet, this is timely!  Awesome!

EDIT: reading answered my questions about hanging taps and interaction with the Tempo CV knob.

Processaurus

One last question, do you recall the cutoff frequency of the Bessel LPF?  I was thinking about trying the single opamp 3 pole filter that Boss uses (can't recall the actual name of the circuit).

potul

Wow, that's great. Very well documented as well.

Thanks for this, now I have to figure out where I want to use it... :)

Potul

ElectricDruid

The bessel filter has a cutoff around 1KHz. It's a tradeoff between sharp edges on the ramp and square waves and better filtering. I chose 1KHz originally because it meant I could have a 1mS attack time for my PIC envelope generator. Since then, I've just reused it.

You could go lower for an LFO, I'd have thought. By all means experiment with different filters. The very first filter I used came from a Maplin ADA echo project from about 1984!

T.

flo

How hard would it be to use a small PIC instead (like a 8 pin PIC12F629 or PIC12F675) with just the basic in/out options (tap tempo in, PWM out and two other parameters like "waveform" and "level")?
Just state to use the other PIC device in the code, shuffle the "parameters" to the right hardware pins and re-compile?  ;D