DIYstompboxes.com

DIY Stompboxes => Building your own stompbox => Topic started by: ulysses on May 18, 2013, 06:00:24 PM

Title: White Pink Noise Generator?
Post by: ulysses on May 18, 2013, 06:00:24 PM
hey guys

long time no post. i've been busy in the real world ;) hope you are all well.

im in need of a white/pink noise generator for my moog sub phatty. the noise gen on the sub phatty is a weird sort of wooly brown noise

fortunately you can use the line-in and it will play whatever is coming in the line in when you press a key. awesome.

does anyone have a schem for a noise gen that they recommend? an awesome one that sounds gold. id love it if it had a mixer on it too to mix the noises. but i can add that if necessary ;)

OR if someone had the schem for the white/pink noise gen circuit for the minimoog that would be awesome. i cant find it on the net.

i realise you guys are mainly interested guitar effects but surely some of you you guys sideline in synths too ;)

cheers, ulysses.

Title: Re: White Pink Noise Generator?
Post by: WaveshapeIllusions on May 18, 2013, 06:05:42 PM
Welcome back. Here's a project for a pink noise generator: sound.westhost.com/project11.htm

Removing the filter section would make it into a white noise generator.
Title: Re: White Pink Noise Generator?
Post by: brett on May 19, 2013, 07:15:15 PM
Hi
RG Keen has a very simple noise generator (white?) on his geofex.com site.
I seem to remember that it's based on reverse biasing an Si junction. That's a common idea.
cheers
Title: Re: White Pink Noise Generator?
Post by: artifus on May 19, 2013, 08:06:17 PM
also: http://www.diystompboxes.com/smfforum/index.php?topic=81602.0 (http://www.diystompboxes.com/smfforum/index.php?topic=81602.0)
Title: Re: White Pink Noise Generator?
Post by: R.G. on May 19, 2013, 10:40:53 PM
Reverse broken semiconductor junctions make good white noise. Varies from junction to junction as to the "whiteness" of the noise. Some transistors are reputed to be better than others, and of course the "best" ones are no longer made.

If you want good, reliable, highly-white noise for further shaping into colors, you need long feedback shift registers.

At one time, I'd have done this with CMOS shift registers, but a six or eight pin PIC will do a shift register to do pseudorandom noise with a repeat cycle so long that you can't tell it from real noise by ear.

See Lancasters stuff on noise generators.
Title: Re: White Pink Noise Generator?
Post by: ulysses on May 24, 2013, 07:23:25 AM
thx for the replies ;)

cheers
Title: Re: White Pink Noise Generator?
Post by: R.G. on May 24, 2013, 09:35:31 AM
This thread actually did get me off my duff and I wrote the dozen lines of code. I'm testing it now.

One 8-pin DIP, 78L05 regulator, 0.1uF decoupling cap. Output is pseudorandom noise on one pin, high "whiteness", repeat time about every 9 days. 5V peak to peak signal size.

Resistor/cap networks can make the other noise colors from it.

I'll probably see if small bear wants to sell them.
Title: Re: White Pink Noise Generator?
Post by: artifus on May 24, 2013, 10:32:46 AM
msp430 code ported from arduino: http://blog.suspended-chord.info/2010/08/23/white-noise-generator-for-the-msp430 (http://blog.suspended-chord.info/2010/08/23/white-noise-generator-for-the-msp430)

2231 is a ¢50 chip. $5 development board.
Title: Re: White Pink Noise Generator?
Post by: R.G. on May 24, 2013, 12:00:30 PM
Yep. I took a 430 seminar/class from TI a ways back. That's an entirely viable alternate. The code is much the same, allowing only for quirks of the actual instruction set.

The target chip I picked was the 12F508, largely because I had some in hand and it's a DIP package, not SMD, and I used a PIC because I have the development tools. Pretty much every low-end uC is a candidate for this application, and the choice of a target controller is entirely based on secondary issues.

Here are some prices from Mouser for uCs I think would run this:

10F200                    6-pin SOT-23 SMD   $0.51
12F508                    8-pin SOIC SMD     $0.70
12F508                    8-pin DIP          $0.83
MSP430G2001IPW14          14-pin TSOP        $0.83
MSP430G2210               8-pin SOIC         $0.85


The 10F200 is cheapest from Mouser, but is an SMD part with 0.050" lead spacing. The 12F508 SMD costs another $0.19, also in a 0.050" spacing SMD package. The 12F508 in through-hole is $0.83 in ones. The 14-pin 430 is $0.83, and is a 14 pin 0.025" spacing SMD. The 8-pin 430 is an 8-pin SOIC, 0.050" spacing, for $0.85. All prices from stock, in ones. All prices go down if you order more than one at a time. The 100-unit price goes down: the 12F508 DIP is $0.53 in 100's, the 8-pin 430 is $0.43 in 100's.

Pretty much, pick the package you like and the development tools you like. The costs are trivially different and the code will run on all of them.
Title: Re: White Pink Noise Generator?
Post by: artifus on May 24, 2013, 12:18:01 PM
new to uc's here but quite enjoying the journey. quite taken by msp due to cost and arduino code compatability for ease of learning - early pic experiences put me off somewhat initially and have found the msp native code somewhat more logical (to my mind) in learning and the arduino/energia compatibility has helped in getting things going project wise and led to further learning. dabbling with pics a little but asm still scares me. was not trying to undermine you, just alerting folk to available alternatives which these days appear to be getting cheaper and easier to use by the day.

Title: Re: White Pink Noise Generator?
Post by: R.G. on May 24, 2013, 02:09:52 PM
Quote from: artifus on May 24, 2013, 12:18:01 PM
new to uc's here but quite enjoying the journey. quite taken by msp due to cost and arduino code compatability for ease of learning - early pic experiences put me off somewhat initially and have found the msp native code somewhat more logical (to my mind) in learning and the arduino/energia compatibility has helped in getting things going project wise and led to further learning. dabbling with pics a little but asm still scares me. was not trying to undermine you, just alerting folk to available alternatives which these days appear to be getting cheaper and easier to use by the day.

And you are exactly right! Ease of programming and using the tools (that is, development expense, in all senses of the word) is a Big Deal in the programming business.

For one-off jobs, using whatever's easiest to use is a really, really good thing.
Title: Re: White Pink Noise Generator?
Post by: R.G. on May 24, 2013, 06:18:38 PM
Did some code tinkering.

A quirk of the math is that computing the feedback for a 63-bit long LFSR is really easy. Adding three more bytes of shift register *reduced* the code size in the main loop down to under 20 instructions, and it executes faster, probably about 1uS per instruction. So it generates a new result every 20uS or so.

The loop repeats every (2^63)-1 iterations. You get 50,000 new "random" bits every second. 2^63 is 9.22 times 10^18. Doing the divide, that's 1.8x 10^14 seconds, 5.12 x 10^10 hours, 2.13 *billion* days, 5.8 million years.

I don't think I'm going to do an exhaustive test on this for looping.  :icon_lol:
Title: Re: White Pink Noise Generator?
Post by: artifus on May 24, 2013, 06:33:09 PM
certainly not when a single transistor suitably abused would do!  :P
Title: Re: White Pink Noise Generator?
Post by: puretube on May 24, 2013, 06:40:38 PM
Quote from: artifus on May 24, 2013, 06:33:09 PM
certainly not when a single transistor suitably abused would do!  :P

@ > 10V...
Title: Re: White Pink Noise Generator?
Post by: R.G. on May 25, 2013, 12:00:35 AM
Quote from: artifus on May 24, 2013, 06:33:09 PM
certainly not when a single transistor suitably abused would do!  :P
An abused transistor has some advantages, in that the noise from it is truly random, and never repeats, ever.

The problem with the single transistor with a zenered base-emitter is that it's not a complete solution. There's a few millivolts of noise there. It has to be amplified up by an external amplifier to usable levels. The amplifier is really part of the circuit as the noise is unusable without it.

The noise comes out of a pseudorandom generator as a string of high/low levels at 2 to 5 volts, and can be used after only some passive R-C filtering.

Trade offs! They're everywhere!  :)
Title: Re: White Pink Noise Generator?
Post by: PRR on May 25, 2013, 04:31:47 PM
> 5.8 million years.

Last time I made digi-noise, the chip was over a buck and it repeated with an obvious thump every 5 seconds. And we thought that was wonderful.
Title: Re: White Pink Noise Generator?
Post by: R.G. on May 25, 2013, 07:18:48 PM
Ah, progress. Now we can make noise longer than any living person will need it. What a glorious time we live in!   :icon_lol:
Title: Re: White Pink Noise Generator?
Post by: R.G. on May 26, 2013, 10:19:46 AM
It's strange how pulling on one thread pulls in more of the web (no, not the internet).

I went off looking for info on how to fix a quirk in my code simulation of the noise generator and wound up reading about Fibbonaci and Mersenne primes, Galois fields, statistical tests for randomness and breakability of ciphers based on feedback shift registers. It seems that this field has moved on a bit since I last touched it.  :icon_lol:

Anyway, I found some stuff that I think will improve the noise characteristics of the output stream at high frequencies with little or no code increase, just a bit of more clever coding. It turns out that if you use multiple shorter shift registers and let them muck with each other's output bits interactively, you get more unpredictability, better statistical results on the output, and nearly the same output sequence length. Things like shuffling the outputs of two or more registers like a deck of cards, using one shift register to determine whether one or more registers get clocked, combining the outputs with XORs, multiplexers, adders, multipliers, and so on are the modern thinking on how to get better seeming-randomness in the output of a noise generator. Kewl!

And here I thought "Galois" was a French cigarette.  :icon_lol:

Title: Re: White Pink Noise Generator?
Post by: PRR on May 27, 2013, 12:35:31 AM
> pulling on one thread pulls in more

Going the other way, borne back ceaselessly into the past, I found my old chip.

http://www.electricdruid.net/datasheets/NoiseGen1Datasheet.pdf
"MM5837 ...makes a noise like a broken recording of a steam train."
"It uses a 17-bit LFSR at a rate which is somewhere between 24KHz and 56KHz"

I see he proposes a full processor where we usta use a 17-stage shifter. With some of the modern frills you outline. However the "Pink" on page 4 looks awful red to me. NatSemi published a 4-R 3-C pinker which I can testify is mighty-pink across the audio band. If anybody cares.

"Gauloise". Évariste is some other guy.
Title: Re: White Pink Noise Generator?
Post by: R.G. on May 27, 2013, 09:30:38 AM
Quote from: PRR on May 27, 2013, 12:35:31 AM
http://www.electricdruid.net/datasheets/NoiseGen1Datasheet.pdf
"MM5837 ...makes a noise like a broken recording of a steam train."
"It uses a 17-bit LFSR at a rate which is somewhere between 24KHz and 56KHz"
I had and listened to one of those way back when. It did indeed sound like a repeating hiss-hiss-hiss... going forever.
It's probably good enough to get a minute or two of noise before a repeat, and an hour would be massive overkill. The human penchant for hearing repeats even in pseudonoise wouldn't likely pick that up.

QuoteI see he proposes a full processor where we usta use a 17-stage shifter. With some of the modern frills you outline. However the "Pink" on page 4 looks awful red to me. NatSemi published a 4-R 3-C pinker which I can testify is mighty-pink across the audio band. If anybody cares.
I'll have to go look at that.

The use of a very small processor instead of a 17 stage shift register is one of those economic things. Once you have the shift-shift-shift-shift-XOR/repeat loop done, It's easy to just extend the shift register, which is the difference between a 1/sec repeat and a 1/eon repeat. My first shot was a 47 stage simple loop, which gives a repeat time of (2^47)-1 = 1.41E14 states. At 50000/second, that's 28E6 seconds, 782,000 hours, 32578 days, and 89 years. I was unable to resist sticking in two more shift bytes to get to 63 stages, which upped the repeat time to over 5million years. I'd hate to play a show where that would matter.  :icon_eek:

Same math on a 17 stage gives 2.3-2.6 seconds.

The designers of the National noise chip sweated a chip floorplan and layout for getting those 17 flipflops and control logic into a silicon mask. Lot of work.

Hmmm. I wonder what the smallest repeat needed is. 17 stages is just over the 16 bits we get in two 8-bit registers (using 8-bit baby processors), so doing 17 bits already requires three registers. If we have 24 bits in three registers, the longest repeat sequence we could get would be 2^24-1, but calculating the feedback is half as hard for 23 stages, and we get 2^23-1 steps. This repeats every 2.8 minutes at a 50kHz step rate, and that's probably good enough for rock-n-roll. I'll go look at how fast I can calculate that on a cheap chip.

Quote"Gauloise". Évariste is some other guy.
Er, it's all  Greek to me.  :)  Sorry. I have a little French, but not enough to distinguish those names.   :icon_biggrin:


Title: Re: White Pink Noise Generator?
Post by: R.G. on May 27, 2013, 10:12:08 AM
Looks like a 23 stage gives 2+/- minutes repeat time at 71kHz output speed. Again, probably good enough for rock-n-roll. Maybe good enough for classical. Two minutes is an awfully long time to remember hiss.
Title: Re: White Pink Noise Generator?
Post by: R.G. on May 27, 2013, 06:11:22 PM
10F200 and 0805 SMD parts make a pink output on a board 1" by 0.5". Where to put the pads for wires  and the 78L05 regulator is a big part of the PCB design. They're about half the PCB area.
Title: Re: White Pink Noise Generator?
Post by: PRR on May 28, 2013, 12:17:02 AM
> The designers of the National noise chip sweated a chip floorplan and layout for getting those 17 flipflops and control logic into a silicon mask. Lot of work.

At the time, IIRC, full-adders and parity generators and even the rate multiplier were standard items. I don't recall thinking a 17-stage on a die was an amazing thing. However for the limited and cost-adverse market, it WAS work.

> sound like a repeating hiss-hiss-hiss...

To listen steady, it was strong-flavor.

But as a percussive chuff or tizz on an "organ" or "percussion" voice, a few milliSeconds, beat-rate never in-sync with the chip repeat rate, it probably was not a real flaw. Yes the VU meter bobbled a few dB but a real hiss in music will vary quasi-randomly with drummer's coordination or organ's notes-load.

> 89 years. .... 5million years. I'd hate to play a show where that would matter.

There's a 'Dark Star' mash-up, "Grayfolded", on 2 CDs running 103+ minutes. I recall Phil Corner hosting concerts that ran for days with rotating musicians. Somewhere on the Web I ran into a composition which has been playing continuously for 12 or 13 years, I don't remember if it is meant to play forever or if an end is expected at some time. _My_ attention span is more Buddy Holly to JS Bach.... 2 to 20 minutes.

I think that if the hiss is not the star, but only spice on the music, the MM5837 is nearly there and anything "better" is for the mathematician, not the musician. (Didja see the newly proposed proof of prime gaps (http://www.slate.com/articles/health_and_science/do_the_math/2013/05/yitang_zhang_twin_primes_conjecture_a_huge_discovery_about_prime_numbers.html)? Wanna get tickets and go to the show?)
Title: Re: White Pink Noise Generator?
Post by: ulysses on May 28, 2013, 05:27:08 AM
oh wow- ive never done any audio dsp coding ;)

i found a copy of the schem for the noise generator in the original minimoog. what is interesting is that it has white pink and red(brown) where the minimoog only had white and pink available on the board.

unfortunately its got +10/-10 voltage. ill have to work something out for that but looks like i'll be able to make myself a minimoog noise generator ;)

ill post the schem up to my layouts section

cheers
Title: Re: White Pink Noise Generator?
Post by: ulysses on May 28, 2013, 05:29:02 AM
here it is
http://www.aronnelson.com/gallery/main.php/v/ulysses/misc/Screen+Shot+2013-05-28+at+7_12_45+PM.jpg.html

cheers
Title: Re: White Pink Noise Generator?
Post by: ulysses on May 28, 2013, 05:43:29 AM
hey rg

do you think this moog noise circuit will work ok with 9v+ and 9v- ?

i might just use 2 9v batteries and wire them up together to give 9+ and 9-

what do you think? that way i wont have to muck about with a max chip ;)

cheers
Title: Re: White Pink Noise Generator?
Post by: artifus on May 28, 2013, 07:45:17 AM
Quote from: PRR on May 28, 2013, 12:17:02 AM
Somewhere on the Web I ran into a composition which has been playing continuously for 12 or 13 years...

as slow as possible?

Quote from: http://en.wikipedia.org/wiki/As_Slow_as_Possible#Halberstadt_performanceThe actual performance commenced in the St. Burchardi church on September 5, 2001... The performance is planned to continue until September 5, 2640.
Title: Re: Re: White Pink Noise Generator?
Post by: slacker on May 28, 2013, 08:54:28 AM
There's also Jem Finer's Longplayer started in 2000, supposed to play until 2999 before repeating.
Title: Re: White Pink Noise Generator?
Post by: R.G. on May 28, 2013, 08:55:25 AM
Quote from: ulysses on May 28, 2013, 05:43:29 AM
do you think this moog noise circuit will work ok with 9v+ and 9v- ?
It might work on a single 9V supply, with some juggling of DC levels and part values. It's a fairly simple broken-base-emitter noise generator with transistor amplifier after it. The two transistors and RC networks that follow it are a pinking filter and a .. ? .. redding filter?  then recovery amplifiers to get back the level lost to the filters.
Title: Re: White Pink Noise Generator?
Post by: PRR on May 28, 2013, 09:05:56 PM
> do you think this moog noise circuit will work ok with 9v+ and 9v- ?

The plan you posted is marked +/-10V, is all +/-20% design, it won't know the difference +/-9V.

As R.G. says, *single* 9V operation is *barely* possible, if the 9V is full 9V (not a saggy battery). It takes ~~7V to break-over the transistor, and a bit more for steady current through its supply/load resistor. Might need to select transistor and resistor for reliable single-9V operation.

That's why I liked the MM chip, it ran good-enough from over 12V down near 5V, battery health was never an issue.

But at +/-9V you are golden.

Title: Re: White Pink Noise Generator?
Post by: R.G. on May 28, 2013, 10:07:33 PM
Latest iteration:PIC, runs at 16MHz internally, outputs values at 250kHz, recycles every 1.8M years, feed it from 9V with a resistor and a zener. Runs from 2.6V up to 5.5V, so maybe a power supply could be concocted...  :)

Operating current about 25uA except for whatever you put out to the pinking filters.

In fact, its signal would be a good one to feed the moog filters if suitably attenuated first.
Title: Re: White Pink Noise Generator?
Post by: ulysses on May 29, 2013, 03:43:07 AM
very good ;)

i will make a vero board and wiring diagram when i get the time ;)

cheers