dividing an asymmetric duty cycle pulse

Started by parmalee, December 06, 2016, 08:57:49 AM

Previous topic - Next topic

parmalee

Simple question:

If you divide a pulse wave with, say, a 33% duty cycle, will the divided pulse retain that 33% duty cycle, or will it have a ~50% duty cycle?

I am assuming the former, as a number of combo organs and divider-based organs , i.e. Farfisa Combos--for which the top octave oscillators are roughly 30-35% duty cycle, seem to have asymmetric pulses as their top octaves.

Unless the dividers themselves impart the asymmetry.  If this is the case, I recognize that discrete dividers can accomplish such fairly easily--but what about single chip CMOS dividers?  Any simple, low part count way to achieve an asymmetric pulse from a 4013, for instance?

R.G.

This is another of those questions that seem like they ought to have a simple answer, but don't.

Every simple digital flip-flop divider produces a duty cycle of exactly 50%. This is because the input signal which serves as a clock for the flip-flop triggers it to flip on one instance of the input wave each cycle, and even asymmetrical waves have constant periods.

So no, the dividers in a divider-based organ do not impart asymmetry. That's the simple part of the answer.

There are ways to do this, but they are complicated. If you are only doing one or a few of these, and do not want a wide signal frequency range, you can fire a one-shot with the output of the flip-flop and generate an asymmetrical wave. But the on-time of the output is constant, not the duty cycle, and so the duty cycle changes as the input frequency changes. If you're doing a fixed frequency input, a simple R-C network may do what you need.

If you are doing a long divider chain, you can generate the waveform you like by doing logic and/or addition on the chain of divider outputs. This is what divider organs do. But that's not low parts count.

The low parts count way to do it is to use a six-pin or eight-pin uC and generate the output wave with whatever duty cycle you like by internal programming once per input clock. But that's not simple.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

parmalee

#2
Thanks R.G.

I had thought that was the case, and I'm not entirely clear as to why I had momentarily forgotten how flip-flops work.  I'll chalk it up to some kind of brain freeze--I'm epileptic, so that's not an unreasonable "excuse"  ;D 

It appears that a simple RC filter is, in fact, all that is used--at least, in the case of the Farfisa Compacts.  The inputs are fixed frequency--from each of the 12 oscillators--so it works quite nicely.

I'm endeavoring to build a sort-of Vox Continental clone, albeit with 5/6 size keys and replacing the discrete blocks with CMOS chips, op amps, etc. wherever practicable.  The biggest obstacle so far is figuring out some sort of fairly unobtrusive 4-pole single-throw switching mechanism for each of the keys--any ideas?  At least 4-pole is needed for the 16', 8', 4', and mixed-odd harmonics triggers.

And yeah, I know, Yamaha has already done this with their Reface series--the YC is the combo organ one.  But it's just not the same.

Anyways, here's the relevant portion from the MiniCompact schematic:


anotherjim

With the 4013, from one stage, you could gate the output with the input to obtain 25% duty, otherwise it is exact 50%. A simple 2 Diode and resistor AND gate would probably be more compact than using a gate chip.

I think the Compact organ dividers are monostable timers - they basically miss every second input pulse while the RC time is running and the duty will only be 50% by accident.

Later organs started to move away from direct keying where each footage had a contact busbar with each tone feeding a separate key contact - to diode keying; where diode gates are used to switch a tone on or off. So the tones don't directly feed the key switch. In principle, that meant that several footages could be controlled from a single key switch and made it fairly easy to add features like auto chord.
The diode switching, could be a diode AND gates.
Those organs had hundreds of diodes in them!



parmalee

Quote from: anotherjim on December 06, 2016, 12:22:52 PM
Later organs started to move away from direct keying where each footage had a contact busbar with each tone feeding a separate key contact - to diode keying; where diode gates are used to switch a tone on or off. So the tones don't directly feed the key switch. In principle, that meant that several footages could be controlled from a single key switch and made it fairly easy to add features like auto chord.
The diode switching, could be a diode AND gates.
Those organs had hundreds of diodes in them!

This is interesting--and definitely worth pursuing!  IIRC all of the Farfisas--the Compacts, the FASTs, and the VIPs--used the multi-pole approach, but I do recall some other makes (mid-70's onwards) employing something like this.  Also some of the string synths.  Unless I'm missing something here, why was this approach not adopted earlier?  Surely the part count would not have been a factor; moreover, multi-pole switching is both mechanically cumbersome--and depending upon how one does this, often prone to failure and making for truly nerve-wracking repairs--and requires an insane number of wires.

parmalee

Quote from: anotherjim on December 06, 2016, 12:22:52 PM
Those organs had hundreds of diodes in them!

I came of age in the 1980's:  the era of digital waveforms, keyboard matrices, and the mass extermination of knobs and sliders.  Yet my musical tastes (as far as "popular" music goes) ran from freak-prog--VDGG, Henry Cow, Magma, This Heat, et al--to post-punk.  I never really "got" DX7s, early samplers, and the like, vastly preferring things with lots of sliders and knobs, and a (to my mind) far more intuitive approach to subtractive (analog synths and all the other organs) and additive (tonewheel organs with drawbars) synthesis.

I still don't quite "get" those things.  I like "blocks" and boards that actually look like algorithms, even if that means added weight, spotty reliability, and rat's nests of wires.

That said, I honestly do not understand how it is humanly possible to physically build one of the larger Hammond tonewheel organs, with 9 poles per switch x 61 x 2 plus a 25 or 33 key pedalboard (using reed switches, yes?) PLUS sundry effects like the chorus/vibrato scanner, etc.  I can't recall how long all the wires in a B3/C3 laid out end to end would extend, but it was more than a couple of miles!

So, hundreds of diodes.  Meh.

anotherjim

I have a Farfisa home organ with both systems, they basically added features on top of the direct keyed organ.

The main diode method I've seen only needed 1 per footage, the key switch determines if the diode is forward or reverse biased. In forward bias, the tone goes through the diode. This needs more in the way of resistors than a logic diode gate (hundred of resistors too).

I was horrified by the lack of control on digital keyboards from the '80's, even on those that were analog under it all. Also I hated the sound of DX7's which have ruined an entire decade of music for me.

parmalee

Quote from: anotherjim on December 06, 2016, 03:30:44 PM
I have a Farfisa home organ with both systems, they basically added features on top of the direct keyed organ.
It seems that a lot of the Italian manufacturers--and Farfisa especially-- from that period were inclined towards throwing in added features at the last minute, without bothering to redesign so as to incorporate such in a sensible and logical fashion.  Some of them actually look as though they were modded by the user, but schematics and service manuals reveal otherwise.  Of course, my own organs have plenty of mods as well--but they're MODS, not a part of a finished and marketed product!

Also, a number of the Farfisa home models were simply FASTs and VIPs with some classy faux wood panels slapped on the exterior.  I'm guessing someone  thought that looked better.  Strange.  Regardless, these can often be picked up fairly cheaply and turned into a folding combo with some little effort.  And considering the prices these things go for nowadays, that is very much a good thing--about 15 years ago I picked up a Farfisa Mini Compact Deluxe (yes, Deluxe--only a very small number were made for the Minis) for 80 bucks at a Salvation Army.  With perhaps a dozen hours of work and negligible parts costs (mostly re-capping), I restored it to near perfect sound.  Now even the Mini Compacts are selling for like 4 or 5 hundred, and half of them don't even work!

My personal favorites were the Transivox and Transicord electronic accordions:  basically, a Compact with some funky bellows.

QuoteThe main diode method I've seen only needed 1 per footage, the key switch determines if the diode is forward or reverse biased. In forward bias, the tone goes through the diode. This needs more in the way of resistors than a logic diode gate (hundred of resistors too).

Still, in terms of cost and footprint, a considerable improvement over the multi-pole switching.  Have you ever had to replace those little plastic-and-wire contraptions that connect to the busses?  It's a nerve wracking task.

QuoteI was horrified by the lack of control on digital keyboards from the '80's, even on those that were analog under it all. Also I hated the sound of DX7's which have ruined an entire decade of music for me.

Funny how in theory it seemed really promising.  The Vox Continental does a far better job at emulating the additive sine wave approach of the Hammond tonewheel organs, even if in the end it sounds nothing like a Hammond.  It's sound certainly is unique though, no other combo organ sounds anything at all like a Continental.  Odd that Ray Manzarek replaced his with a Gibson.

Not only do the DX7s, and their ilk, ruin music for that period, they also ruin what otherwise might have been fairly decent films.  Imagine were John Carpenter to have used a DX7 to score The Thing or The Fog?  Or had Goblin used DX7s in their work for Argento, Fulci, et al?

PRR

>> move away from direct keying where each footage had a contact busbar with each tone feeding a separate key contact - to diode keying;
> why was this approach not adopted earlier?


Dim guess-- they had already invested in the tooling to make little wire switches in quantity. Maybe even had a few thousand already run off in inventory. Why do a re-think and re-wire if it was easy to keep on doing the same thing?

It is also possible a wire was cheaper than a diode.

Whereas other factories might not have the tooling, or demand in excess of key production, and moved to simpler key-mechanicals with more diode logic.
  • SUPPORTER

R.G.

Quote from: parmalee on December 06, 2016, 12:04:02 PM
I'm endeavoring to build a sort-of Vox Continental clone, albeit with 5/6 size keys and replacing the discrete blocks with CMOS chips, op amps, etc. wherever practicable. 
You would probably enjoy "Electronic Musical Instruments" by Richard Dorff. It's a book on electronic organs, and has a "deep dive" on how many of them work from both the system and circuit perspective.

If you're doing an organ, then monostables and diode-resistor-capacitor one shots will give you your desired duty cycle, approximately.

If you are into saving yourself some circuitry, a single CD4024 gives you seven stages of binary flipflops in one package. A top octave generator and 12 CD4024s generate all the musical notes. Or slice it another way: a single PIC can be crystal controlled to be amazingly close to standard tuning for a single note in the top octave. One PIC plus one 4024 gives you eight octaves of dividers, all the octaves for one note. Twelve identical circuits gives the entire note generation for an entire organ, with only two chips per note.

As for a 4PST, you can use either a CD4066 for that, or you could use JFETs as switches. The CMOS is probably cheaper.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

anotherjim

Wow, I never heard of that Mr Dorff, but a little searching led on to this page...
https://120years.net/the-thyratone-richard-henry-goldfogle-dorf-usa-1945/
I may be lost in there for a while ;)

ElectricDruid

Quote from: R.G. on December 06, 2016, 10:56:47 PM
Or slice it another way: a single PIC can be crystal controlled to be amazingly close to standard tuning for a single note in the top octave. One PIC plus one 4024 gives you eight octaves of dividers, all the octaves for one note. Twelve identical circuits gives the entire note generation for an entire organ, with only two chips per note.

You don't even need the 4024. I did a PIC-based divider, using an NCO to get the master clock, and then incrementing a counter every time the clock pulses. If you use one of the port output registers for the counter, you've instantly got 8 output octaves, but you can do more if you want. I added four input pins to allow you to select which note the generator would produce. For bonus points, I also added an input to select between 50% and 25% duty cycle (which gives a notable second haromnic). This got note generation for an entire organ down to 12 chips.

I spent a long while experimenting with running twelve chips off a 4046 VCO, so I could have genuine analog vibrato and pitch modulation, but I couldn't get reliable frequencies out of the VCO - every damn 4046 chip is *way* different, to the point of resistor values being a bit of a waste of time (happy to hear about better experiences if anyone's used it as a high frequency VCO). But the possibility of using an external clock with the PIC offers all sorts of options, including running it into LFO territory.

Tom


bluebunny

Quote from: ElectricDruid on December 08, 2016, 12:46:54 PM
happy to hear about better experiences if anyone's used it as a high frequency VCO

Thomas Henry uses the CD4046 in his X-4046 VCO, but he does note that certain makes of the chip will work (e.g. Motorola), whereas others simply won't (e.g. TI).  Not all 4046s are made equal, it seems.
  • SUPPORTER
Ohm's Law - much like Coles Law, but with less cabbage...

anotherjim

No, I don't think a 4046 VCO in particular would be considered good enough. As a PLL, it only has to pitch up or down as it's told with no idea of hz/volt, as long as it's in range, it does its job.

Yes, Thomas Henry's X4046 synth VCO which abandons the VCO CV input and takes control via the timing resistor. Even then, folks have trouble and have to find different sourced 4046's to get one with the right spec. That's mainly a problem of key scaling. For a master oscillator, stability is more important, so it might be a useful approach to that if nowhere near as simple as you might wish.
I have noticed the VCO is a little better if you pick the timing RC values so that CV is close to half supply at normal pitch.
Also, over 1Mhz, the CD4046 isn't so good. Spec doesn't want resistors <10k and the timing cap has to be tiny. Might be better using 74HC4046, although I read somewhere that the CV linearity is far worse than the 4000 series ones.

Inspired by the Hammond motor off, "tone wheel pitch-bomb" effect, I put a 4046 pitch follower in between the master oscillator and TOG in my Farfisa. Master osc is very close to 1Mhz at concert pitch. I added switching so I could either cut the master osc input to the 4046 or switch to a divided (4013) octave down. Using comparator 2 in the 4046, the VCO drifts down to zero at the loop filter RC rate when input is lost. At octave down, it swoops down only an octave - this inspired by the synthe-slalom effect Farfisa fitted to some combo organs, even some with 12 separate top oscillators!
Had to make a knee lever switch for this (simple, ply paddle on hinge hits a microswitch and piece of plastic magnet to hold it up out of use). Obviously, the pitch bomb is most effective with a ridiculous number of notes held, and if discordant, so much the better! So hands-free operation needed.
I mention that  because the 4046 is wonderfully stable at following the master osc - even the vibrato that is applied to the master osc is replicated by the 4046. Having a coherent square wave input to follow makes a big difference to the 4046, unlike attempts to track guitar signal.

So if you have 4046 master oscillator, have it tracking a stable reference (err.. master-master oscillator). You can inject vibrato at the 4046, but pitch bend will have to be done in the reference. The 4046 VCO could bend, but would just keep bouncing back in synch.

I sometimes think we worry too much about pitch stability when it comes to keyboards. For domestic/studio use, when the temperature can be fairly consistent, and when really good voltage regulation is laughably easy to get, many oscillator types are good enough -  I wish my guitars were as stable. I'd be far more interested in the oscillator having easy pitch control & tuning.
My Farfisa uses a pair of TTL monostables in a round-robin. The old TTL databooks show this application, but suggest this is not a preferred way to make an astable due to poor stabilty. Farfisa did use metal film resistors and polystyrene timing caps to help. I actually find it very stable in practice.

There might be another good reason you might keep 12 separate oscillators. Those organs have "free phase" between pitches which is an audible difference to the tone wheel  and TOG systems. Only the octaves are synchronous.

Maybe too, should add a caveat about diode switching. Having squarewaves and the diode having a little bit of capacitance means there is some leakage. That could amount to significant leakage noise when all added up.  Using keyswitches sidesteps this as they isolate very well, although you get it then from the wiring loom. May be a need for some pF range ceramic bypass caps out of the diode gates to kill any hf leakage.

How did I write all that! hope it isn't just boring waffle...

ElectricDruid

Not waffle at all, Jim. Very interesting, thanks.

I realised that "not all 4046s are created equal" (never were truer words spoken!) and I bought about four different kinds to experiment with - TI, Motorola, National Semi and I don't remember what. Also I was trying to produce +/-1 octave of pitch bend around 4MHz, so ranges from 2MHz up to 8MHz. Sounds llke that might be a bit of an ask. The original "standard" 4046 won't go that high, but many of the modern ones list 10MHz or 12MHz as their highest frequency. And it's true, they'll produce frequencies that high. You just won't know *which* frequency is all, at least if my experiments were anything to go by. Results were *hopelessly* inconsistent between different brands of chip, and there was considerable inter-chip variation too.
Thomas Henry's 4046 VCO was the design I started with, although I simplified a bit since I only wanted a master VCO with V/Oct modulation (so no linear FM, for example, and no temp compensation). It seemed to be possible to tune the circuit to get a given chip to do what I wanted, but changing the chip meant changing many of the resistor values surrounding it. It wasn't anything I could feasibly see being a decent DIY project since it was so unreliable and *really* needed an oscilloscope or a decent frequency counter to stand even a chance of making it work, so I abandoned it.

Pity - I quite fancied a DIY string synth or combo organ: Run up a load of PIC counters, maybe do some tone filters, key switching, bung a lush chorus on the output, or a JH hammond vibrato or something and bingo! You're back in the 70s!

Tom

amptramp

Fairchild produced the µA2240PC which is a 555-type oscillator with an open-collector 8-stage divider.  I used twelve of these to replace the oscillator / divider section of a Minshall Model E organ from the early 1950's.  It worked if you used the Korean parts but not if you used the Indonesian parts.  Device data sheet:

http://www.datasheetarchive.com/dlmain/4b7e6fb93fc264a330783406edae51710fc932/M/UA2240

anotherjim

I never heard of that one Ron, pity it's obsolete it looks useful.

Tom, About the 4046 follower for the organ, when it was on breadboard it jittered very badly. I had faith it had to be better once soldered up, and it was.


R.G.

Quote from: ElectricDruid on December 08, 2016, 12:46:54 PM
You don't even need the 4024. I did a PIC-based divider, using an NCO to get the master clock, and then incrementing a counter every time the clock pulses. If you use one of the port output registers for the counter, you've instantly got 8 output octaves, but you can do more if you want. I added four input pins to allow you to select which note the generator would produce. For bonus points, I also added an input to select between 50% and 25% duty cycle (which gives a notable second haromnic). This got note generation for an entire organ down to 12 chips.
Yeah, that works. I've posted that approach here before. I just didn't want to scare off a non-programmer even more. I didn't try the NCO thing because when I first got into PIC organ generators, PICs didn't have NCOs in them.  :icon_sad: 

One experiment that was only modestly successful was to have a single PIC generate the bagpipe scale. That's a lot trickier, as doing all the notes in one PIC needs something like a counter for each note, and there are the inevitably collisions where more than one interval needs updated at a time, so the timing is a few clock counts off on an edge sometimes as the irrational intervals cycle. But then some people would say that this can only improve a bagpipe's scale.  :icon_lol:
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

ElectricDruid

Quote from: R.G. on December 10, 2016, 10:13:51 AM
Quote from: ElectricDruid on December 08, 2016, 12:46:54 PM
You don't even need the 4024. I did a PIC-based divider, using an NCO to get the master clock, and then incrementing a counter every time the clock pulses. If you use one of the port output registers for the counter, you've instantly got 8 output octaves, but you can do more if you want. I added four input pins to allow you to select which note the generator would produce. For bonus points, I also added an input to select between 50% and 25% duty cycle (which gives a notable second haromnic). This got note generation for an entire organ down to 12 chips.
Yeah, that works. I've posted that approach here before. I just didn't want to scare off a non-programmer even more. I didn't try the NCO thing because when I first got into PIC organ generators, PICs didn't have NCOs in them.  :icon_sad:
I checked the code, and actually it wasn't an NCO, but yeah - it's still the case faster modern PICs helps. Instead I had a fast loop incrementing the output counters, and a variable delay of X cycles in the loop. So it's a question of getting the loop the right number of instruction cycles long, and the shorter those cycles, the more accuracy you get.

I had a look around and found your earlier thread about it:

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

As is often the case, someone's been there before me. You even mention the idea of using input pins to select the tuning so that if you plug the "C" chip into the "Db" socket, it miraculously turns into a "Db" chip, since they're all the same code.

Quote
One experiment that was only modestly successful was to have a single PIC generate the bagpipe scale. That's a lot trickier, as doing all the notes in one PIC needs something like a counter for each note, and there are the inevitably collisions where more than one interval needs updated at a time, so the timing is a few clock counts off on an edge sometimes as the irrational intervals cycle. But then some people would say that this can only improve a bagpipe's scale.  :icon_lol:
Now *there's* an idea that I'm unlikely to replicate!!

Tom

R.G.

I'd have expected someone with "druid" to appreciate the pipes.   :icon_lol: 

A lot of my work started from "old crow"'s top octave generator. May still be on the net. He could only approximate the "top octave" about three octaves down from the top, because of the speed of the PICs he was working with. Faster is definitely better, as one or two instruction cycles is the finest possible difference to make between two intervals timing out. His approach never made it to there.

Going to one note per PIC makes the thing more accurate, as there is only one interval to be approximated by the instruction clock, however that's done, whether by isochronous code or some variant of timer or NCO.

I took a lot of solace in the fact that only people with real, true perfect pitch can hear pitch errors of less than a cent or so. That makes it easier to get under the error budget per note. And those poor perfect pitch people are so traumatized by the tuning errors in everything else that they probably won't notice a PIC's error.

Except for the bagpipes.    :icon_biggrin:
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.