Posted by & filed under Oscillators, Synth DIY, Vintage synths.

Can we make a modern reproduction of the classic top octave generator / top octave synthesiser chips of the 1970s, as used in classic string synths and combo organs? What would be involved? Can we improve on the originals in any way? This page is a summary of what I learned by doing it.

A little background

In the late 1970’s, many synth manufacturers were thinking about producing polyphonic instruments. One musical area where that was already done was in the electronic organs of the time, and so the technology used in organs found its way into synths, and gave birth to the sub-genre known as “string synths”, since that was the best noise they made! Most of these instruments are fully polyphonic – e.g. you can press all the keys down and hear all the notes, although some of them use only a single envelope generator and filter for note shaping (“paraphonic”). So how did these things work?

How do string synths and organs work?

In general, they used the following scheme. A high frequency clock (typically 1 or 2MHz, sometimes 4MHz) drives a top octave generator chip (“TOG”, also known as a “Top octave synthesiser”, “TOS”, or “top octave divider”) which produces all the note frequencies for the top octave as basic square waves. These square waves can then be fed to flip-flop dividers to produce a note an octave lower. The output of that flip-flip can then be fed to another flip-flop to get an octave below than that, and so on. Luckily, we don’t need a ton of individual flip-flop chips, because that arrangement is basically a binary counter, and there are many counter chips available which will produce all the required octaves when fed the highest note frequency.

This all uses quite a few chips (one oscillator of some type, the top octave generator, and twelve dividers) but it produces all the tones you need for an entire organ – around 100 pitches. One hundred pitches from fourteen chips is pretty good, especially in the Seventies!

Can we reproduce this with modern technology?

There are easy bits and hard bits. The dividers are the easy bits, since there are still plenty of divider and counter chips available that would do the job. The difficult bit is the Top Octave Generator. This requires twelve separate dividers that can divide by large numbers (up to ÷478), and it needs to work at least the 2MHz input frequency that the originals managed. There are various ways to attempt this. One obvious solution is to use “custom hardware” in a programmable logic device like a CPLD or a FPGA. Given a large enough device with enough gates, this would work, but it’s not the easiest or most accessible solution. An alternative is to attempt to recreate the dividers in software.

So, can you program a PIC to make a TOG/TOS chip?

You can easily write code to produce a “divide by X” scheme. If we assume our instruction clock rate is the master clock, we’d simply need to output a pulse for each X instructions. We could even hard-code this for maximum speed and efficiency. It’d look something like this:

DividerLoop:
   bsf   OUTPUT_PIN   ; Set the output pin high
   nop   ; Do nothing for many instructions until pulse goes low
   nop
   ; Etc - add the required number of "nop"s in here
   bcf   OUTPUT_PIN   ; Set the output pin low again
   nop   ; Do nothing until pulse goes high again
   nop
   ; Etc - add the required number of "nop"s in here
   goto DividerLoop

This approach works fine for generating a single note, but it doesn’t scale up to multiple notes at all. The required division ratios are not simple multiples of each other (they’re approximations to numbers related by the twelfth root of two – Ouch!) and that means that there’s no simple cycle of outputs we can run through. In fact, the output sequence doesn’t repeat for a very long time. However, there’s another way.

An alternative scheme

How about if we organise the work like this instead?

Here we have no separate top octave chip. Instead, each divider produces a single note frequency and then all the octaves from it. This is much simpler to do, since now our software only has to produce one divider and the subsequent octaves. The Druid “NOTEDIV” code for this is below.

One way to think about this code is that we’re producing naive, non-bandlimited square waves at an output sample rate of 8MHz. This is a divider scheme, not an NCO/DDS with a phase accumulator, so there’s no jitter in the edges. Instead, we accept the limited frequency accuracy of the divider method.

This code uses sample-accurate delay routine. At 8MHz, that’s 125nsecs. Since we have more than 8 outputs, we can’t change them all at once (the output port registers are only 8 bits wide). This means there’s a 2 instruction/250nsec delay between the update for certain outputs. For audio frequencies, this isn’t significant.

The code also uses four input pins on the PIC to select between different division ratios, and then we only need one set of code rather than twelve different firmwares. This gives us a general-purpose “Note divider” chip for building combo organs and string synths.

Are there any improvements we can make over the original chips?

Well, we can run the code faster than the original chips could manage. There are plenty of cheap PICs that will run with a 32MHz clock, giving a 8MHz instruction cycle. This is at least an octave higher than the originals, and two octaves higher than many of the common TOG chips could go.

Some Top Octave chips produced 50% duty cycle waveforms (pure square waves with only odd harmonics) and others produced 33% duty cycles (narrower pulse waves with a marked 2nd harmonic). I was able to add an input to select between two different duty cycle options; 50% and 25%. The 25% pulse wave has the strongest 2nd harmonic of all pulse waves. All of the outputs are affected by the duty cycle choice, unlike what happens if you use dividers, where the divider outputs are bound to be 50% square waves, whatever pulse width you feed in. This is done by ANDing the output with the output an octave higher. Since all the octaves are in a binary counter, this is just ANDing the counter value with a right-shifted copy.

The PIC chips can also be run from an external clock, and they’re not fussy about what frequency it is. In fact, you can run them off an LFO if you want to and…do…really…slow…computing…!! I thought the best use for this facility would be to run the chips from a single master high frequency VCO to which modulation could be applied, and I developed a PCB to allow me to test running a set of twelve NOTEDIV chips from the VCO on a 4046 phase locked loop chip. Unfortunately what I discovered is that there is enormous variation between different brands of 4046 chip, and even between different chips by the same manufacturer. It all worked, but I couldn’t get the range or tuning I wanted without tweaking nearly every resistor value in the circuit for each individual chip. That’s ok for a one-off or for experimenting with, but no use as a project for people who just want something simple to help them build the string synth of their dreams. As a result, my development of this idea got back-burnered at this point, but I do have a few PCBs and NOTEDIV chips, so if you’re interested in taking it further and would like one, contact me.

Tone Generator PCB: produces twelve notes over ten octaves, 120 pitches

 

Detail of the 74HC4046 VCO and the first three NOTEDIV chips and their outputs

Pinout Diagram

 

More details

This is as far as I got with this. I do have a schematic for the PCB which I’ll put up at some point.

Other possibilities

If you don’t want external pitch modulation, it would possible to modify the code to use the internal clock on the PIC. This would mean that you’d have free-phase notes, although octaves would still be phase locked (this is typical for electronic organs anyway, and is a part of the sound). Using an external crystal would give the most stable and accurate results, but in some ways, that’s not the point here, and it might be that the internal RC oscillator would be good enough.

6 Responses to “Adventures in Top Octave Generation”

  1. Gordon Nudd

    Hi,
    with a cheap Altera CPLD board from China you can program 5 or 6 octaves of free phase signals, or using two obviously 10 or 12 octaves. The signals have extremely accurate frequencies as the starting frequency/clock is 48MHz, much better than 1 Cent. It’s also possible to make all signals have a 1:1 mark/space ratio (square wave).
    Cheers,

    Reply
    • Tom Wiltshire

      Very interesting, Gordon. I’ve never played with CPLDs. That’s nice work to get all that on one chip!
      How do you control the gating of the tones by the keyboard? I’ve been thinking about it since, and it seems to me like this part is in some ways a harder problem than the top octave generation – and similarly, the chips which used to provide a solution are no longer available.
      Thanks,
      Tom

      Reply
  2. Gordon Nudd

    Tom,
    Exactly! The TOS/TOG is the easy part. Then comes the switching and the 9×61 (or 9×85) = 549 resistors to the nine foot registers 16′ to 1′. I have used MAX7426/7 switched capacity filters which turn a complete octave of square waves into perfect sine waves. But of course all the signals of this octave are then on one wire – so the filters have to be after the 9 registers – ie 45 filters – which wouldn’t be soooo bad. My old brain is however having trouble figuring all this out. Regards gating of the keyboard – I can easily send the keyboard signals (or through a converter board from Midi) to the CPLD EPM1270T144 to switch the outputs – but then we don’t have any attack/sustain (CPLD with analogue functions would be interesting!), so we need switching circuits after the CPLD TOG. I don’t know if a CPU could do all this? Guess it’s all ‘cos I’m stuck in the old ways – as I recently wrote in a forum -‘Now that we don’t need ’em any more, top octave sythesizers have become very easy to make’.

    Reply
  3. David Borresen

    Very interesting. Ive been looking for a good solution for this as Ive got the ensemble and filter boards from an organ and would like the 8 octaves of strings to match. So leaving message to follow mostly, not much I can add other than Id be a willing tester.

    Reply
  4. Gerry Murray

    I wonder if the divider chips could have a MIDI stack and you could have them multidrop listening to the MIDI stream and gate the outputs appropriately. Sustain would be the obvious problem, of course.
    I imagine it would be a challenge handling the MIDI interrupts while updating the divider outputs.
    However, I’ve seen some of your code and if anyone could do it, you could. 🙂

    Reply
    • Tom Wiltshire

      Interesting idea. You’re quite right that the challenge is in keeping the divider outputs updated whilst also doing the MIDI in a timely manner. The way I’ve done the dividers currently, I don’t think it would work, since I’ve had to use instruction-cycle-accurate delays to get the correct pitches and make it work. But the code *does* spend quite a while hanging about in those delay loops, so I suppose it could be processing MIDI then instead. Maybe.
      I do keep thinking about this, because being able to generate the right pitches is only half the battle. The other half is gating them. I’ve been wondering about using R-2R ladder DACs to be able to output multiple mixed tones (an 8 foot pitch output, for example) since even a four bit output would be cable of handling 16 square wave tones. That’s a pretty big saving of pins.
      Dunno – it’s just a thought I’m still kicking around. I don’t know yet how practical it is in software.

      Tom

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *