Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

making music using PIC :D

Status
Not open for further replies.
i just got an idea to make a music
using PIC :D , to make it work i find
a shine wave circuit which it use a series of resistor
**broken link removed**
every time a resistor hit other resistor it will make a
different sound
but i didnt not really understand how to programming
the PIC , im still developing the program but i have some
question .
how to moving the high output
from pin to pin
without delay but every time the pin is high it
will play within 0.5 second
, i following some blinking led script and changing some code
but i still dont understand about this
because to blinking led its only use one pin
but the shine wave uses many pin
,
if anyone could help me on this project
it would be helpful :)
 
There is a free BASIC out there that does just that, called Studio. You use it with an inexpensive ($8) PIC called the Nano. This can be seen at
Basic ATOM Nano 18
The USB programmer for this is another $15. That's just $23 for both.
The command to make music with eight "voices" is "SOUND8", and looks like
Code:
Example
dur1 con 2
dur2 con 1
nA con 440
nB con 494
nC con 523
nD con 587
nE con 659
nF con 698
nG con 784
nA2 con 880
sound8 outl,[dur1\nc\ne\ng,dur2\nf\na\nc\a2]
This program first defines nA – nA2 as the musical notes (equal tempered scale) A, B, C… A2 respectively. Then it plays the chord C-E-G for 2 seconds (on pins P0 to P2), followed by the chord F-A-C-A2 for one second (on pins P0 to P3). The remaining pins on the port remain silent. Of course, flats and sharps can also be defined; a quick internet search will give you the frequencies you need.
Pretty simple, huh?
A quick schematic for the summing circuit, and there you have it!
kenjj
 

Attachments

  • Sound8 Schematic.PNG
    Sound8 Schematic.PNG
    6.8 KB · Views: 468
You can use picbasic pro and make sound easy It's free for 50 lines of code you can do a lot in 50 lines
here a sample from them
Code:
        Include "bs1defs.bas"           ' Include BS1 variables

SND     con     0                       ' Define speaker pin

loop:   Random W0                       ' Randomize W0
        B2 = (B0 & 31) + 64             ' Generate notes [64..95]
        If B2 >= 68 Then beep           ' Make [64..68] silence
	B2 = 0
beep:   Sound SND,[B2,4]                ' Generate sound
        Goto loop                       ' Forever
And you don't need a ton of resistor just a cap and a small speaker you can hear it with that If you need louder any cheap
computer speaker amp will do. You can find a cheapo that uses just 2 battery's
 
You can use picbasic pro and make sound easy It's free for 50 lines of code you can do a lot in 50 lines
here a sample from them
Code:
        Include "bs1defs.bas"           ' Include BS1 variables

SND     con     0                       ' Define speaker pin

loop:   Random W0                       ' Randomize W0
        B2 = (B0 & 31) + 64             ' Generate notes [64..95]
        If B2 >= 68 Then beep           ' Make [64..68] silence
	B2 = 0
beep:   Sound SND,[B2,4]                ' Generate sound
        Goto loop                       ' Forever
And you don't need a ton of resistor just a cap and a small speaker you can hear it with that If you need louder any cheap
computer speaker amp will do. You can find a cheapo that uses just 2 battery's
hi thanks for the for the post
i will try to downloading PicBasic
my internet is to slow for now :)
 
Status
Not open for further replies.

Latest threads

Back
Top