Clocked 8-Bit Random Pattern Generator For A CMOS Synth

A random noise generator is pretty handy when working with music, and building one using a micro-controller can be pretty trivial. So it’s nice when someone comes along and builds it from a few analog and digital parts. [acidbourbon] built his Clocked 8-BIT Random Pattern Generator for  CMOS Synth  inspired and motivated by the recent article Logic Noise: Sweet, Sweet Oscillator Sounds by [Elliot Williams]. It’s 8-bit output can be used as a random sequencer for DIY CMOS synths.
This pattern generator is suited to to be used in combination with a 4051 8-channel analog multiplexer. But it sounds quite interesting on it’s own (best enjoyed in stereo, check out the video after the break). After building some CMOS synth circuits, [acidbourbon] moved on to make some sequencers and multiplexers which then let him to devise this random pattern generator which could be gated using a clock signal.

The basic principle is straight forward – generate noise, amplify it, apply a clock to get the gated noise output. His design choices for the various sections are well explained, based on constraints that he had to work with. Everything needs to work at 5V, but his noise generator circuit requires 12V to work. He choose to use a charge pump to generate -5V, resulting in a 10V supply, which was barely enough, but worked. A boost regulator might probably have served better to generate 12V, but maybe he already had the ICL7660 charge pump IC lying around in his parts bin. The rest of the circuit uses standard CMOS/TTL devices, and [acidbourbon] provides all of the design files for what looks like a neat, single sided PCB that can easily be made using the toner-transfer method.

Video below.

33 thoughts on “Clocked 8-Bit Random Pattern Generator For A CMOS Synth

    1. On its own ? Probably not.

      In combination with a cryptographically secure pseudo random generator ? Sure. For instance, you could feed this into a raspberry Pi, and add a driver to insert this into the random pool, and then read the random numbers back from /dev/urandom.

    1. Also: “A random noise generator is … and building one using a micro-controller can be pretty trivial”.

      Just like LFSR, totally predictable and not random.

      ie – Generating a random number by just using code (and no entropy source) in a micro-controller is not even possible let alone trivial.

      1. For the purpose of generating sound, using software works just fine. For random numbers for games and simulation, a pseudo random generator also works fine, as long as it’s a good quality. Even for crypto purposes you can use a pseudo random generator, as long as it’s cryptographically secure, and you can initialize it with enough random input.

        1. That’s my point lol. A micro-controller can only generate pseudo-random. It is not possible for a micro-controller to generate true random (unpredictable) numbers. If it can be coded then by definition it can be predicted and hence is NOT random.

          1. The notion “predictable” depends on how much you know. It’s easy for me to generate pseudo random numbers that you can’t predict. Shuffling a deck of cards is also pseudo random, but it’s good enough for casinos.

          2. By definition, random numbers are not predictable under and circumstances or with any amount of resources.

            I you create a coded pseudo-random number generator and give me the code and seed then I can predict every number in the sequence. It therefore is not truly random.

            The point I was trying to make is that is simply not possible to create (truly) random numbers using a micro-controller.

          3. That’s one definition, yes, and I agree that if you use that definition, then a software algorithm is not truly random.

            What I’m saying is that it’s not a very useful definition in real life circumstances, where perfect knowledge and unlimited resources are rare.

          4. This device uses avalanche diode breakdown for true random generation. Look at the diagram of the build and compare that to other random sources using avalanche breakdown.
            IE – compare the “white noise section” from https://acidbourbon.files.wordpress.com/2015/02/project.png
            to the hardware RNG http://web.jfet.org/hw-rng.html

            If in fact the diode in the transistor is undergoing avalanche breakdown then its a quantum effect and by definition its a truly random event.

            So if your saying the fact that the RNG is external to the micro then yes I could agree with this case as the micro is not “random” however I draw your attention to

            http://www.ti.com/lit/an/slaa338/slaa338.pdf IE the TI Launch Pad, this uses just the mico for hardware RNG.

            So the above statement that you can’t code true random is false. The fact that every piece of hardware has minor differences between each part yields a truly random functions for the exact same software with the exact same initial states. Thus a truly random generator.

            I know this for a fact because I have built several of the them. In addition to not using a CCD because the bias on the device even after cranking the gain up still failed validation, however removing the IR cut filter in front of the CCD and placing an alpha radiation source directly in front of the CCD yielded truly random generation based on quantum effects and passed validation.

            And all of this avoids the actual micros with hardware RNG on-board. So yes micro-controllers can and do have truly random functions available to them and not just pseudo random. Not all micros, not all that efficient but it works.

          5. @Koplin

            Quote: “So the above statement that you can’t code true random is false”

            My original statement was: “Generating a random number by just using code (and no entropy source) in a micro-controller is not even possible let alone trivial”

            In your example you are using the timing differences on a MCU (due to temperature) as an entropy source and is exclude in my original statement.

            The same apples with other ‘tricks’ like reading an open circuit analog input or a LSB of a temp sensor. These examples are using an entropy source that is other than from specifically ‘code’.

            These examples actually re-affirm my statement. Put simply – why would you use these ‘tricks’ if you could just write code for the entropy. The answer is simple – you ‘have’ to use these tricks because it ‘impossible’ do write code to do this.

            If it were possible then you could give me the formula for ‘random’.

    2. No it’s not – it’s a transistor noise generator followed by an amplifier and a shift register, as is shown in the circuit diagram in the article.

      An LFSR would eliminate the need for a 12 volt power source, though.

  1. FWIW, here is the algorithm to generate the noise square wave pattern of the AY-3 sound chip:
    // note: rng is set originally to 0x003333 during initialization;
    int newBit17 = (rng & 0x04) > 0 == (rng & 0x01) > 0 ? bit17 : 0;
    rng = newBit17 + (rng >> 1);
    You would then AND that with 1 for the bit value used in sound generation for that cycle..

  2. Also if you have ungrounded ADC pins you could sample those in odd ways to get a more random source of entropy, but for whitenoise I don’t think it is really all that necessary.

    1. Ungrounded pins are not very random. Power-line noise dominates, and it tosses a predictable 50/60Hz pattern into the mix.

      But like you say, it all depends on the purpose. If you need only a few bits of entropy, you’re probably fine. If you need megabytes, the correlations will catch up with you.

  3. Charge pumps are simple compared to boost converters. A boost converter will require at least 3 external components, one of which is an inductor. That can introduce all kinds of problems and design complexity. In a low current design that only needs double the supply or less, a boost converter just does not sake mense.

Leave a Reply to Brendan RobertCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.