Build a Random Music and Light Generator and Glimpse Evidence of GOD

 by mikey77
random-music-generator.jpg
Generating truly random numbers appears to be impossible. It is, however, fairly easy to use a microcontroller to generate pseudo random numbers and then use them to display sounds and different colored lights. While the music that is generated is not exactly Beethoven, it is more interesting than you might expect. I would venture to say it is more pleasant to listen to than much of what they play on the radio these days. A music generator slightly better than this, may someday replace rock stars (I am hoping).

The fact that we cannot generate true random numbers has interesting implications which are considered in step 4.

pic 1 shows the music and light generator. It is 1.3"x2.3"x.8". It plays music over a two octave range through a built in 1" speaker. A surface mount RGB LED displays a range of colors below the speaker. It runs on a 1.5 volt AAA battery.
 
Remove these adsRemove these ads by Signing Up

Step 1: Music Generator Components

random-circuit-top.jpg
random-circuit-bot.jpg

Pic 2 shows the random music generator top of circuit board.
Pic 3 shows the bottom of circuit board

You can see the liberal use of Liquid Tape to reduce the chance of shorting between the components.

MATERIALS

1.5 volt to 5 volt voltage converter:
http://www.bodhilabs.com/vpack5aaa1.html

08m Picaxe Microcontroller: http://www.hvwtech.com/

1 inch, 32 ohm speaker, LM-386 amplifier, switch, resistors, capacitors, .1" header sockets, RGB LED: http://www.mouser.com

On-off Switch, Plastic Case-1.3"x2.3"x.8" : http://www.jameco.com/

1-40 of 47Next »
botronics says: Nov 8, 2011. 8:48 PM
Does anyone have a video of it in action so e can hear hat it sounds like?
legionlabs says: Feb 20, 2010. 9:23 AM
If there is a higher consciousness which designed the universe, I would like to give it a good stern talking to about proper engineering practices (not to mention documentation).

Humor aside, I built an actual random number generator a while back. It uses a shielded particle detector to sample the impact of helium atoms originating from a radioactive source. The full engineering specifications are available at your request. If you want to try and prove your hypothesis that there is no randomness, I have just over 100 megabits of data you can have if you want.

I'd be happy to give it to you and let you see what you can find. That's science, right?

I'll be honest: I've already run extensive statistical tests on it and it passed every one I can throw at it. It's random so far as I can tell, as predicted by current knowledge of quantum physics.

Also: Praise Eris.
fastlines49s in reply to legionlabsSep 27, 2011. 9:47 PM
Woot for the absolute randomness of quantum physics!
marc_is_curious says: Jul 17, 2011. 2:31 PM
Am totally new to Picaxe
a Mac (hence MacAXEpad ) User
and
just tried to look at the code
receiving the message "error: loop without Do" message -
this happens with a lot of other PIcaxe script
which i downloaded too,
hence it must be me
who "does smthng wrong" -
may you please provide a hint
on this (for an absolute newbee)?

i look forward to your reply!
mikey77 (author) in reply to marc_is_curiousJul 17, 2011. 8:39 PM
Most likely the problem is loop: and goto loop.

If you change loop: to loop1:

and change all instances of goto loop to goto loop1 that should solve the problem.

This program worked fine with the older picaxe programming software until the word "loop" became part of the command set in the newer programming software. So loop can no longer be used as a label unless you add additional numbers or letters to it.
marc_is_curious in reply to mikey77Jul 18, 2011. 12:33 PM
good hint - thanks -
but now the code gets stuck at ....

lookup b8,($20,$2 ....

.... telling me about syntax errors.

am a bit worried that eventhough i work myself through
whole script it's functionality might suffer from my corrections.

however and whatever remains:
such a shame they changed the syntax -
i like your project !
i need to teach myself/learn about the alterations
of the current script - and "translate" it.

thanks for you rreply
& have a great day!
AKninja04 says: Dec 9, 2009. 6:53 PM
Hi, I'm trying to use the LM 386 for a different project. This is surely a noobish question but I wanted to know: do all the grounds in this project run back to the negative end of the battery?
ski4jesus in reply to AKninja04Apr 4, 2011. 3:19 PM
absolutely. if not, no power would run at all. rule of electrons is they have to have a backwards route, or nothing will work.
codongolev says: Apr 8, 2010. 1:44 PM
there's so much more evidence for God than nature. I mean, it depends on which God you're talking about, but I've found that the God of christianity has the most evidence for existence.

but really, do you think this was the best place for this? I mean, this is instructables. and this was kind of jammed onto the end of an instructable. I'm not saying you're wrong, I'm saying that you probably could find other, more effective ways of sharing your faith.
mikey77 (author) in reply to codongolevApr 8, 2010. 7:52 PM
I see evidence of God in the magnificent conscious designs that are all around us in Nature and the Universe.

If you have evidence that is independent of Nature and the Universe please share it with us.

By the way, the most effective way of sharing is to go where there is a need.
codongolev in reply to mikey77Apr 9, 2010. 7:31 PM
um.... the evidence I'm talking about would be too long to explain in this little box. but I'm currently reading "the case for christ" which explains the historical accuracy of the bible (actually documents an atheist's journey to discredit christianity, and ends with him converting- true story), and I've read "mere christianity" (which has a large chunk of it explaining how morality proves God exists), and I'd like to read "evidence that demands a verdict" and "more evidence that demands a verdict" (obviously both by the same author), which, because I haven't read, I can't really account for the topic. (by the way, all three of these authors were atheists who decided to search for the truth and became christians. I find this to be overwhelmingly convincing for the evidence of Christ and God.)

but yeah. that's what I mean by there's more evidence.
nikolardo in reply to codongolevJul 21, 2010. 1:22 PM
My current view is that there is something more to the universe than we can discover and test scientifically - all the real things science cannot explain - but I won't put faith in any religion. Religions are the oldest form of organized crime, Christianity being no better. However, every single religion I've ever heard of has the same base: be nice to other beings. Every religion is based on that principle, only the dogmas are different. Interestingly, almost all/all religions have a mystical sect, and they vary very little in their dogmas, even. So while I agree that there is something to spirituality, I strongly doubt the existence of a single conscious entity, "God". Also, at the instructable: things that survive millions of years of evolution have to look designed, and are designed, not by a conscious entity with forethought, but by the continual process of evolution. Also, it has been suggested that the human tendency to view things as "designed" is evolutionarily beneficial, as it comes to the same thing in terms of survival, etc, but is simpler than comprehending evolution. It does make trouble philosophically, though.
Robot Lover in reply to nikolardoNov 24, 2010. 8:14 PM
Christianity is not based on doing good things to others to go to heaven. Although God does want us to love one another and do good things. it is not how to inherit eternal life. The way to get into heaven is to accept that Jesus died on the cross and believe what god says in the Bible. Believing in God is not about religion, it's about worshiping God.
nikolardo in reply to Robot LoverNov 27, 2010. 9:03 AM
Maybe - your post was a little confusing, and I didn't follow it entirely - so maybe Christianity is not based on doing good things to others to go to heaven. However, Jesus's main teachings went along the lines of "all you need is love," and are contradictory to much of the Old Testament. Also, I don't believe that any God could support faith without evidence based on a book written by men, who are fallible. The last thing you said, though, about belief in God not having to be tied into religion, I support that. Maybe not in the blind worship plane of things, but certainly in that one can experience God (or a deeper understanding of the universe, or what-have-you) without dogmatic religion.
Robot Lover in reply to nikolardoNov 27, 2010. 6:22 PM
I am glad you think the same about religion as I do. I do not view you as a bad guy because you have different beliefs, just wanted to get that straight so we don't brake out fighting. I am sure you are a great guy. I hope that you do not get angry for me saying this, but that is your opinion and I am sure many others share the same opinion as yours. My belief is my opinion which I have based my life around. i do not believe it as an opinion though, because I thoroughly believe it. I am sure you feel the same way.
nikolardo in reply to Robot LoverNov 27, 2010. 7:57 PM
Not really, actually. My notion of the "everything else" in the universe has changed a lot over the years, and I suspect it will continue to do so. It's like my view of anything else - when I gain more information and experience, I have to change what I believe to fit what I know. What I believe is based on what I experience, and because I'm always experiencing more, my beliefs change accordingly. Really, all I have now are a set of suspicions, because I don't believe that I have it right.
macmaniac says: Jun 27, 2010. 1:24 PM
A rock does not become a plant. Evolution is not random or blind.
and7barton says: May 27, 2009. 12:30 AM
I made a simple random number generator which I believe, did make truly random number sequences - I pointed a lens at the sky, with an Light dependant Resistor mounted underneath it, connected to an A-D converter, resulting in a number between 0 and 255, which was dependant upon the light level affecting the LDR. Clouds, which are random in size and thickness, affected the primary light levels so there was truly a random output. I then wrote some simple software to compress the 0 - 255 range into a small range of 0 - 9.
legionlabs in reply to and7bartonFeb 20, 2010. 9:00 AM
The problem of course is proving that clouds are random size and thickness. I'm sure many meteorologists would claim otherwise.

The best thing to do is test the ouput! NIST produces a decent randomness test suite (if such a thing can exist), though you'll need ~100 megabits of data.

http://csrc.nist.gov/groups/ST/toolkit/rng/index.html

Sandisk1duo says: Jul 10, 2008. 10:27 PM
Love th last step :' )
JohnJY in reply to Sandisk1duoNov 25, 2009. 7:28 PM
I second that motion!
bigdeee says: Jul 31, 2009. 12:16 PM
Odin is truly a wonderous god. Thanks for providing evidence!
Aar000n3y says: Jul 10, 2008. 6:42 PM
(removed by author or community request)
Aar000n3y in reply to Aar000n3yJul 10, 2008. 7:09 PM
Also, if there's a way to randomize the note's length with a limit on how long it can go for, that could make it sound more musical
Timmydamonkey in reply to Aar000n3yJun 9, 2009. 7:11 AM
ur post got removed. wat did you sat?
was it bad. Oh no it was bad wasn'y it.?!!!

noob.
and7barton in reply to Aar000n3yMay 27, 2009. 12:34 AM
That's easy, with a simple set of software rules. You need to write a rule for each possible value your random input delivers. I only know it in BASIC, in which it will be a FOR-NEXT loop. Turn the sound on, loop so many times, then turn the sound off. Don't ask my how to do it for a PC.
sr1sws in reply to Aar000n3yJul 10, 2008. 6:49 PM
Those that have ears to hear, will. Steve
Aar000n3y in reply to sr1swsJul 10, 2008. 6:57 PM
(removed by author or community request)
pitty in reply to Aar000n3yJul 10, 2008. 9:05 PM
It's his Instructable and he did label it appropriately. If you are offended by people talking about there beliefs may be you should not have gone past the title. Great instructable and good on you for talking about your beliefs.
LinuxH4x0r in reply to Aar000n3yJul 10, 2008. 8:35 PM
If you don't like it don't read it. He can say what he wants. BTW, nice ible. If nothing else, that 1.5 to 5v chip looks promising
budsiskos says: Apr 19, 2009. 7:52 PM
kind of reminds me of that galatic god from futurama
AzurusNova says: Feb 14, 2009. 1:53 AM
Iv come across this a few times and always liked it. I was curious if there is a way to put in a potentiometer into this design to increase or decrease the speed and volume. If I can get the parts for this and put together one of my own, I'm sure Ill have it up online somewhere. :P Also a light resistor could add some fun to this as well >:)
mikey77 (author) in reply to AzurusNovaFeb 16, 2009. 6:18 PM
You can easily put a potentiometer into one of the inputs of the Picaxe and then read the voltage to change the random variable. Obviously, this would require reprogramming the Picaxe microcontroller. All kinds of real world inputs such as light or sound or temperature or touch can be used to vary the speed, volume and frequency.
sreekarthi says: Feb 10, 2009. 4:33 PM
Looks great!! Could you please give the RGB LED specification?
mikey77 (author) in reply to sreekarthiFeb 16, 2009. 6:12 PM
You can use any RGB LED. Even a 5mm regular size LED will work fine. I used a surface mount led just to see what kind of light it would output. If you use a regular LED you can sand down the lens to cut the length in half and paint the sides with white or silver paint. This will improve the mix of the three colors.
IW5 Industries says: Dec 30, 2008. 5:35 AM
one word: supercalaawsomessifaction!!!!!!!!
IW5 Industries in reply to IW5 IndustriesDec 30, 2008. 5:36 AM
if thats not a word then ill just use: awsome.
dmitry says: Sep 16, 2008. 12:01 AM
I don't really get what the crap about creationism is about, but that's an alright statement about creating true randomness. Which is, as far as I know, impossible.
saites2001 says: Jul 10, 2008. 9:07 PM
You can generate truly random numbers.
Goodhart in reply to saites2001Jul 11, 2008. 5:01 AM
That is more "deriving" random numbers then "creating" them though, isn't it?
1-40 of 47Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!