Top Octave Generator chips and dividers

Started by R.G., September 07, 2011, 12:34:08 AM

Previous topic - Next topic

amptramp

Quite some time ago, I acquired a Minshall Model E organ which had 36  x  12AU7's as top octave oscillators and dividers.  This was very critical for adjustment and component drift, so I replaced the tone generator chassis with a single board using 12 Fairchild µA2240PC oscillator-divider chips.  The oscillator is like a 555 connected internally as an astable and the dividers were open collector.  A lot of ribbon cable was consumed, but it worked.

brett

Hi
my 2c worth..
I'm guessing that it wouldn't matter if you used A (3.5kHz) through A (7 kHz) for the top octave.
People only imagine they can hear much over 10kHz. The TV whistles at 14kHz - can any of us hear that?
For me the TV whistle disappeared 22 November 1975. Deep Purple took it away.  ;D
cheers
Brett Robinson
Let a hundred flowers bloom, let a hundred schools of thought contend. (Mao Zedong)

Taylor

Quote from: brett on September 11, 2011, 11:46:11 PMThe TV whistles at 14kHz - can any of us hear that?

Yes, I can always tell when a CRT TV is on in the area just by hearing it. Then again, my ears didn't exist until well after 1975.  :D

...and I don't consider myself a golden ear type. My friend who plays guitar is always gawking at different clean guitar tones in music, but to me they're all nearly indistinguishable. (Ready the torches!)

Jaicen_solo

I'm with you Taylor, I hear CRT's in the back of my head for some reason. Perhaps it's a resonance issue. Either way, I have only one good ear, the other is a casualty of a car accident when I was 4yrs old. My right ear only hears very high frequencies for some reason, again most likely a skull resonance issue, because I'm missing some inner ear bones.

Anyway, back on topic, I have a mutlitude of uses for a top-octave generator, but primarily i'd use it to make a workalike of a Roland RS string synth (PARAPHONIC!).
I think that generating each note using a single pic, then dividing down each octave is the way to go for sure.

rustypinto

#24
I know SMT is generally frowned upon, but CPLDs are probably a competitive option here (generally QFP packaging). RG, I don't know your intentions with this project in general, but the CPLD side is certainly better suited for making lots of these, and thats where it would lose against general DIY. But I will still give my reasons:

Pros:
1. Space saving. Eg. Altera EPM3064 = 44QFP (maybe x2, depending on the counter constraints) vs the ~12 DIP14-16, ouch
2. You're already pre-programming the microcontroller, so you're probably going to be OK with having to pre-program an EEPROM which includes the CPLD program/ glue logic.
3. The glue logic is straight forward to code (counters are usually the text book examples), and the development tools are usually free (Altera web edition, etc).
4. Cost: hopefully will stay under the 'pros' section. EPM3064 (slowest speed grade, lowest temperature) = $2.10 x1. Lets call power and EEPROM memory $2, then a single CPLD implementation = $4.10, and a double (this is the one to beat, totally based on the logic requirements) = $6.10 (also assuming a single EEPROM can handle loading two CPLDs).

And of course, cons:
1. Power: limited to 3.3V in most cases. But you can probably scoot by with an LDO since the PIC will require 5V (max) anyway.
2. SMT assembly, oh well.
3. Some CPLDs are only available directly from the manufacturer (Eg. EPM3064 in my example).
4. Complexity: an extra code environment

And it seems like some other contenders are thinking along the same lines:
http://m.matrixsynth.com/2009/01/top-octave-generator-11.html

Please also note that i have no affiliation with Altera, but i use them all the time. Xilinx also has a great offering of PLDs.
  • SUPPORTER

R.G.

I messed with that approach for a while. I decided it was a PITA, given where I am with the PLD technologies.

It would be Really Good if someone did the internal dividers to get a top octave, then also the chains of binary dividers to get all the notes out in a QFP so that other glue chips and such were not needed, and so the internals were substantially or fully static so one could play vibrato/slide games with the master system clock. Even better yet if one could use internal PLLs to give some looseness from the main clock and perhaps modulate the relative frequencies of the note-strings a bit for adding some complexity to the scale. I thumbnailed a design a few years back but I'm so inept with PLDs that I have no idea if it was feasible or junk.

What I wanted was an MK50240 and some dividers. I wound up at single-note-and-divider PICs because of cheapness and simple programming. Actually, this is kind of an advantage, because PICs are fully static, and you can monkey with their clock inputs within reason.
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.

amptramp

Before everyone goes off to design his own generators and dividers, consider that most musical instruments do not have precise harmonic relations between the components of the frequency spectrum they put out.  If you play an acoustic guitar with a 300 Hz fundamental, the next component up (they are sometimes called partials to distinguish them from integer multiples of frequency, which are harmonics) is 595.4 Hz then 897 Hz then 1198.1 Hz then 1500.0 Hz.  In other words, the partials are at  1.985, 2.99, 3.994, 5.000 times the fundamental.  The deviation from exact multiples is part of the timbre of the instrument.  If you use exact harmonics from a divider, the output will sound like a Lowrey organ - not a particulary great sound.  You can see this sort of thing on a scope where waveform components seem to be running past each other in a real instrument whereas with integer division, everything is in lockstep.

For those of you with a library of obscure electronics applications books, check out the "Systems Design Handbook" by Monolithic Memories incorporated.  They show a "High-Quality Musical Sound Generator" as one of their articles which is an arithmetic processor to generate musical instrument voicing.  They explain in detail why the partials must remain inharmonic.

R.G.

Yep, the inharmonicity of partials is part of the instrument timbre. For a good example, listen to some mbira music. The thick reeds start with fairly far-off harmonics, which quickly decay, leaving a smoother sounding fundamental. Most lamellophones do the same thing.

However, organs have done fairly well with top-note or top-octave and locked dividers for harmonics. And synthesizers have done OK with waveform generation as a basis. A triangle, sawtooth, or square wave just can't have partials that are off from the mathematically-expected frequencies. Mother Nature said so. And exact harmonics won't sound like a Lowrey organ, it'll sound like all electronic organs. I've just been re-reading "Electronic Musical Instruments" by Richard Dorf, so I have some fresh review of Lowrey versus Baldwin, Thomas, Schober, Allen, Rogers, et. al. Lowrey's distinct sound is more a matter of its tone shaping than the divider nature of the thing.

A fair amount of the Hammond sound was its additive synthesis approach to harmonics.
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.

rustypinto

Looks like i mis-spoke about the EPM3064 using an external EEPROM. This device comes from the MAX3000 family which ARE EEPROM based, and you can only load them through a JTAG programmer (much like the PICs). You can socket them, but it makes more sense to put down a header and do in-circuit programming. So if you're willing to invest in the programmer, this particular device family is very cost effective: my estimate from before would drop to $3 - $5.

Now, there are devices that can utilize an external EEPROM to load their configurations, and this is useful because you can socket the EEPROM and use your existing PICKIT to burn it. Unfortunately, the CPLD devices that support this are more expensive (Altera ones start at $6).

Can you specify the dividers and I/O? Knowing that, along with the loading method is enough to know if a CPLD is worth it or not. If so then i'd be happy to code the dividers (thats the easy part).
  • SUPPORTER

R.G.

Interesting. For me, my vast lack of knowledge about current PLDs makes the coding the hard part for me.

I'll have to think about the most convenient way to do programming and the physical setup of how to get the signals into and out of the chip.

Here's the overview:
- a master clock input; actually, twelve clock inputs that can be ganged to one clock or separated would be really good as an enhancement
- divider chains; the MK50240 "9-bit magic series" is the place to start; that's divide by 239, 253, 268, 284, 301, 319, 338, 358, 379, 402, 426, 451, 478
- each divider chain brought out to an output pin
- for each divider output, a string of seven binary dividers doing a simple binary countdown, with each divider output brought out to a pin
- That makes for 12*8 output pins, 96 total; one (better, 12) clock input pins, then power(s) and ground(s); then programming pins as needed. Looks like 144pin QFP would do the whole thing.
- Next choice down: limit pins by backing down on the divider chains' length. The master divider chains give you one top octave. One divider on each one of them gives you 12 notes of the next octave down. Another divider gives you a third octave down, and so on.

Is there a simple way (and I'll go look it up as well) to implement the JTAG programming in a PIC that can itself accept a serial input via USB, 232, I2C, etc. and have a default programming stored for autonomous bring up and then also external programming of the mule?
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.

rustypinto

Heh, in all of this, i was aiming on stuffing all of your "simple binary countdown" in the PLD. The odd-ball dividers definitely won't fit in a single, but maybe 2x the PLD i'm talking about.

Were you originally aiming to satisfy the divider chains with all CD4024/ CD4040? Or am i completely missing something?

There is a simple way to load the PLD with a PIC, but not with the one you selected (gotta have the resources). Altera has something called a JAM player, which is general purpose embedded driver meant for controllers loading peripherals. The JBI (JAM byte interpreter) has a ~14kb flash foot print, and takes about 4kb RAM to work.

https://www.altera.com/download/programming/jam/jam-index.jsp

This is usually why the header to external USB/232/etc - JATG converters are used the most.
  • SUPPORTER

R.G.

Quote from: rustypinto on September 14, 2011, 10:17:16 AM
Heh, in all of this, i was aiming on stuffing all of your "simple binary countdown" in the PLD. The odd-ball dividers definitely won't fit in a single, but maybe 2x the PLD i'm talking about.
Given the ease of getting binary dividers, I'd vastly prefer to have all the oddball dividers into a single if that's possible. This is in fact the thing that made me abandon the PLD thing - I could not get all of the top octave into a single PLD. It seemed to be a poorer choice to me to go to a high-pin-count SMD package if I still couldn't get all the funny stuff into one fancy package.

Is there a PLD package you're familiar with which can get all the top octave dividers into one package?

This is the crux of the issue for going to single-note PICs: pins!  If I have to have a dozen divider chips at 14-16 pins each, I may as well make those PICs, each doing the oddball divider for one note and all the binary/octave divides, and eliminate the top octave chip all together. If I can get the top octave plus all the dividers into one PLD, a single chip solution is attractive enough to go to a QFP.

QuoteWere you originally aiming to satisfy the divider chains with all CD4024/ CD4040? Or am i completely missing something?
No, I wasn't. I only mentioned the partitioning into other external dividers so that if needed, the logic in the PLD could all get into one package by pushing dividers out of the QFP onto external stuff, in the aim of getting all the complex stuff into one QFP.

That was my reasoning - however odd it may seem. It was logic design directed by ease of assembly.  :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.

R.G.

I did some more thinking. Looks like the 16F54 will handily do a single note divider from 8 or 16MHz to a top octave note, and also put out eight octaves of that note. The 16F54 is $0.66 each in ones from Mouser at today's prices. Since you need 12 of them you get the price break of $0.55 each for quantities over 10, so the whole dozen notes and eight octaves is $6.60. A CD4040 or CD4024 is $0.48 in ones, and the price break is at 25, so 12 of them cost you $5.76, and you still have to generate the top octave.

The 16F54 also has enough pins left to sense what note it's supposed to be from where it is in the PCB and what pins are connected, so the same program will be any of the twelve notes.

The oscillator is a PITA. You need a dozen 16MHz clocks, and it's very tempting to try to make one of the 16F54s do it and feed the others. That is not a good idea. You can either buy a dozen 16MHz crystals at $0.30 each ($3.60) or one 16MHz and one other chip to do the oscillation, or an oscillator module. The oscillator module is $1.60, and probably more reliable at the job than rolling your own.

Looks like the whole mess is 12 PICS, a clock oscillator module, and about 96 wires  :icon_eek: off that board to be the actual notes.
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.

Jaicen_solo

Hmm, that's not the satisfyingly simple solution I was hoping for R.G!

R.G.

Quote from: Jaicen_solo on September 18, 2011, 08:52:07 AM
Hmm, that's not the satisfyingly simple solution I was hoping for R.G!

Me neither - but it is a solution that can be had. A complicated, expensive bird in the hand is worth about 50 rare, delicate, perfect birds on the other side of the planet, or on another planet altogether.  :icon_lol:

One other thing about PICs - they are fully static, so you can play the same games with messing with clock frequency that you could with the MK50240. If you fed the 50240 1MHz, you got one octave lower than the top one; 500kHz, two octaves lower, and so on. You could get the specific octave you wanted by lowering the clock.

Likewise, the PIC solution does the same thing. If you feed it a variable clock frequency, its outputs obligingly go lower.  If you want a specific octave, you still have to use all 12 chips to get a full octave, but you only need 12 wires going off the board.
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.

igor12

Hey guys,
I successfully ported over the PIC16c54 code to a PIC18F18k23 which can run at 64Mhz!  Which gives you a top octave of 1041.68 Hz using the standard code.  It sounds in tune to me (well maybe a little off, it is hard to tell). I have been trying to tweak the code to get a top octave of 2093Hz by playing with the pre-scaler and counter numbers.  But I can't seem to dial it in.  I am about ready to throw in the towel on using the PIC.  Another idea is to use 2 hex Scmitt triggers.  Each oscillator uses 1cap and 1 resistor,  but replace the resistor with a digital pot controlled by a PIC.  Allthough the combined cost of the digital pots might make it a better idea to just buy a real TOS for $40.

R.G.

Quote from: igor12 on November 11, 2012, 12:34:25 PM
I am about ready to throw in the towel on using the PIC. 
As I said, using several small PICs for one or two notes per PIC is probably simpler and more practical than using the PIC for all of them.

This is a kind of parallel to how CPU development is going these days. Getting ever-higher clock speeds for uniprocessors stalled out at about 3-4GHz. So we're getting higher computational performance by using several CPUs in tandem, each doing part of the job.
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.

amptramp

You could build a replica of the Hammond tone wheel generator using a phase-locked loop (PLL) and a divider network that does 185/196.  This gives you a close approximation to the twelfth root of two frequency ratio between adjacent notes.  You may be able to do a divider network in a PLD, so you would have eleven of them (a generator for key of A at 7040 Hz and everything else derived from that).  The A generator would probably be a phase-locked loop running from a master 1 MHz crystal.  You would have simple dividers each running 4046 PLL's for a top octave.  A pair of 8-bit divider chains is a relatively simple task for a small PLD.

WaveshapeIllusions

I was thinking about this, and what about doubling instead of dividing? Would that be simpler than using a divider chip? Looking at a triangle wave, if you full-wave rectify it, it will double the frequency without distorting it much. Setting an oscillator for a lower frequency and doubling it for each next octave seems like it might be simpler.

PRR

> doubling it for each next octave

One way or another, the octaves are easy.

The Top Octave Chip did the hard part: the 12 semi-tones, each twelfth-root-of-two apart(*).

Twelfth-root-of-two is a very hard number to compute 11 times in 500 microseconds (1/2000th of a second, period of a high note).

Hmmmm... I suppose that computing 2^(1/12) at 32Hz, then doubling-up, does lessen the computational frenzy. But making triangles and rectfying them is a lot trickier to do 76 times than just using 12 hex-flop counter chips.

(*) Or close-enough that the errors were mostly unnoticed.
  • SUPPORTER