A friend of mine found some pseudo-random circuits in some books. I sat down and finally figured out Eagle CAD a bit and drew them up in a more Lunetta-friendly way (I hope... admittedly, these circuits are a bit complicated with their connections).

The first one uses a 4006 shift register and a 4077 XNOR . I've already posted about it [here: http://www.electro-music.com/forum/post-323156.html ], since it is a bit problematic and was hoping for a solution. Sometimes it can freeze if the clock speed is "too high" (sorry, I didn't measure the frequency). Usually, I have a switch that's normally "closed" and if the circuit freezes, I use the switch to cut the connection (between 4006 pin 1 and 4077 pin 10 works for me) for a second or two, then it unfreezes.

If anyone else has some circuits of this ilk, feel free to post them in this thread so we can have a collection.

If there are any questions about one, please refer to the chip pair or something so we know which you're talking about.

4006-4077-pseudo-random-4bit-generator-schematic-v2.png

Description:

4006-4077 pseudorandom 4-bit generator schematic (updated 2012.02.17)

Filesize:

20.91 KB

Viewed:

186 Time(s)

This image has been reduced to fit the page. Click on it to enlarge.

Last edited by RingMad on Fri Feb 17, 2012 3:51 pm; edited 1 time in total

Here is another pseudo-random 4-bit generator circuit based on a 40174 hex D Flip Flop (only 4 are used, though), and a 4070 XOR.

This one is "more expensive" than the 4006-4077 circuit, since it requires 2 or 3 clocks instead of just one. I notice that if you use the bits in order, it seems to produce patterns that sortof count (up or down, I don't remember), but not quite. However, this can sound nice. Also, the outputs of the XOR could also be used as bits, thus making this an 8-bit generator.

Attention to any who might have tried to build the 4006-4077 circuit before 2012.02.17... it turns out that one needs a pulldown resistor on at least one of the output bit lines, otherwise the circuit freezes. I've updated the schematic above to reflect that. Sorry.

It turns out the 100k pulldown I mentioned in my previous post didn't really help on the 4006-4077 circuit. But analog_backlash has finally solved the freezing problem (it seemed to reach a steady state when run with clock speeds exceeding approximately 385 Hz). His solution was to replace the 4077 XNOR with a 4070 XOR (same pinout, just swap the chip), and swap the wires going to pins 5 & 6 of the 4006. Thanks, Gary!

I have redrawn the schematic to reflect these changes... see attached.

Alas, it appears that the 4006 shift register has been discontinued, but you may be able to find places that still have some left in stock.

Just noticed that you've updated these threads - thanks for the name check!

The only thing that I've noticed is that due to it being pseudo-random, if you clock it slowly it can seem a bit predictable at first (or am I just imagining this?). What I do is to turn up the clock speed at first and then slow it back down again after a few seconds. I don't know what the bit length of the pseudo-random cycle is, but if I do the above, it sure sounds random to me.

Yeah, truth be told, I somehow have the impression that your amended version is a bit less random than the original. It almost seemed like it would always come up with the same pattern, somehow. It is rather hard to tell, though, not having some kind of data acquisition & statistical analysis. My method is to have the bits go into an R/2R DAC which feeds a VCO and listen and watch the LEDs.

I thought it might be handy to have some way of resetting or changing the pattern, short of turning the whole thing off. I still didn't come up with something entirely satisfactory.

I suspect that the cycle sequence has a bit length shorter than that of the original circuit. As I said before, then reversal of the two connections between 4006 pins 5 & 6 and 4070 (originally 4077) pins 3 & 4 was the only change that I tried and it "worked". It may be that a different set up would give the same cycle length of the original, but like yourself, I managed to fry a 4006 during prototyping and I don't want to lose any more!

I have a Velleman USB I/O board which I have been thinking about writing a Visual Basic program for, to turn it into a simple (low frequency) data analyser, which would be very useful. If I ever get round to doing that, I might work out the answer (but don't hold your breath...).

I've been experimenting with this too. The problem I'm having is patterns do repeat. I'm not sure it really matters for Lunetta purposes. Once the random signal is patched in through other gates, it may not be so obvious that its repeating. I've been basing my circuit off this one here:

Thanks for that link -minus-. I've obviously been there before, as I'd kept a copy of some of the circuits there. The advantage of this design is that the 4015 is still freely available, so you don't have to pay inflated prices from "hard-to-find" component suppliers. I will have a go at this circuit and see what happens.

The ultimate problem, is that if you use purely logic-based circuits to produce randomness, you are always producing a finite sequence of 1s and 0s, so they will eventually repeat. The trick is how long a sequence you can manage to produce. If you want a more truly random sequence, I believe that you need a circuit which utilises an analogue white noise source (e.g. from a reverse-biased NPN base-emitter junction, noisy zener diode etc.). An example of this is at the link below:

Thanks for that James - I haven't seen that circuit before. I forgot to mention the "penultimate problem" earlier. That is the sequence will always start in the same way, all other things being equal. It may be possible to change where the sequence starts by adding a button (or buttons) which force an input (or inputs) to high or low logic (like your original reset button idea). I have not tried this yet - it's just an idea at the moment, but it seems to make sense.

Yes it does always start in the same way. The white noise idea is probably a better option... or using a geiger counter. I'm not convinced 'random' actually exists outside of a theoretical idea.

There are a couple of mistakes in that link I posted earlier. The power jumpers to the 4070 board are in the wrong holes. Also, they mention a 4040 in the text but I assume it's the 4070 they are referring to.

EDIT: I just looked at Les' PRNG. That is essentially what I have on breadboard, although Les is using a more ICs to make his 24 bit. I dropped the 10uF capacitor from the path back to the 4015 in that doctronics circuit too- it just wasn't working. I notice Les doesn't have it either... and if it's good enough for Inventor- it's good enough for me!

I've seen those Geiger-Muller tube random number generators. It strikes me as a rather expensive option! I actually have a Geiger counter which I built several years back (I'm not sure why) but I think that I'll leave it intact.

It is very hard for the human brain to correctly "see" randomness, so it can cloud your judgement. I think that it's a bit like trying to envisage infinity - it makes you go a bit crazy...

I was thinking about SEEING randomness as I was watching this stream of LEDs for several hours. I did not have this hooked to any sound generating device; I was merely observing LED patterns by sight. Had this been connected to observe the patterns aurally I would have noticed it quicker I think. I was pondering whether humans discern aural patterns of this nature easier than visual ones.

I'm not too concerned about being unable to attain the holy grail of randomness. It just seemed like a nice extra feature to tag onto a 4015 shift register module. After I patch a load of other shit into the signal or vice versa, I doubt it will sound 'regular'. I wonder why we find a lack of pattern so interesting?

to me it often is like the interesting stuff happens on the border somewhere between order and chaos, total lack of order being as boring as total order.

So with the random sequence thingies .. it depends a bit on usage .. when it is to be a noise source for emulating high hat sounds or something you'd not want too much tone (i.e no short patterns), but when it does have tone you'd have some interesting other sounds ..._________________Jan

Ha, I was going to write some stuff last night but was too tired, and now you guys are talking about this aspect...

I think total perfect randomness would not be very "musical". I guess it depends on how it is used. I tend to use it in situations where there is a pretty obvious relation between the bits and the sounds. My clock rates are relatively slow, often producing a few bits per second.
What I like about these pseudo-random circuits is that they produce patterns that repeat, but which produce variations that to me, keep it interesting. I guess some people can listen to a 4/4 beat forever, but I find it interesting when there's a glitch or some sort of change every once in a while.
For me, the question is how much repetition and how much glitch.

Sounds like an interesting idea James. I think that you and Jan are right that having a certain degree of randomness can be interesting, but total randomness less so. I also think that the -minus- observation that maybe we can more correctly spot aural pattern repetition than we can analyse visual repetition (of LEDs flashing) is probably true.

As for the apophenia, I have a textured ceiling in my living room (it was like that when I moved in) and I can see a profile view of the head of "popular British entertainer" Bruce Forsyth and the word "FIZZY" in it (but not Jesus). I'll leave it to your imagination what this says about the state of mind...

A very interesting article, I will definitely add Apophenia to the list of concepts that help me understand the world (which is quite chaotic, as you all may have noticed).

I did not really follow the in-depth details of the Higgs particle, so I do not know if sonification of data really contributed to finding it, I bookmarked the CERN-page about it some months ago:
http://lhcsound.hep.ucl.ac.uk/page_library/SoundsLibrary.html
Beautiful sounds, aren't they? The idea behind it is, that the amount of data generated by the LHC is so massive that a visualisation does not really make sense, as it has to be so coarse that the important details are not visible anymore. Thus, patterns and irregularities are difficult to find in traditional graphs. But the ear is much more efficient here, so sonification is another option.

Pseudo Random sequences usually have a maximum length determined by the number of shift elements..2^n-1, for 4 bits, is 16-1, or 15 steps. But where the XOR and feedback is placed could shorten that. To get more random, one could build two of these, running on different clocks, and XOR them together. The nice thing about pseudo random sequences, is that they are repetitive, so they can be useful for music. Adding a way to preset the shift registers, and reset back to that value after a set number of steps, or a certain value is hit on, means you get a step sequencer capable of many different sequences, but controllable and reload able from just a few controls. There's also typically 1 value that "locks" the shift registers into 1 value that doesn't change with clock pulses either. That's the -1 in 2^n-1.

Very nice for modulating with other signals, even through a pll or ring mod derivative. And sometimes better than an LFO for introducing slight oddity to something that's otherwise a bit too mundane (like a plain sine wave).

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum

Please support our site. If you click through and buy from our affiliate partners, we earn a small commission.