PDA

View Full Version : melody



jojokatada
- 20th February 2005, 17:38
hi i would like to use pic16f84a to generate some tones

in the sound command of the pBP manual from 1 to 127 are tones ragne from 78hz to 10,000hz
while the piano has 88 tones from 27hz to 4,186hz

anybody have experience in using the sound command to generate some tones.

or i want to know in 128 tones from the sound command which range is the correspondingthe the 88 tones of the piano.

appreciate for suggestion,help

mister_e
- 20th February 2005, 23:04
to generate multiple specific tone frequency, i'll really prefer to use the 16 bit internal timer.

Since you know your frequency range... it's a bit easy to calculate the according period you'll need. Use this period to get the according timer interrupt and VOILA.

OR have a variable external Oscilator and vary the frequency using a digital potentiometer like those microchip MCP42010 or else...

I figure SOUND statement is mostely use to drive piezo transducer.

jojokatada
- 21st February 2005, 01:11
apreciate for the suggestion

can i use the sound command to drive a speaker small 8ohm
do i need any other component?

mister_e
- 21st February 2005, 03:21
a few uF capacitor in serie with your speaker can do the job... see PBP manual

DWV
- 21st February 2005, 06:36
The sound command outputs specific tones, none of which coinside with the notes on the piano, or with midi note numbers. If you want to output specific tones, use the FREQOUT command. Here is a link that will give you the note name, frequency and midi number for all the notes on an 88 note piano.

http://www.phys.unsw.edu.au/~jw/notes.html

Dave

jojokatada
- 21st February 2005, 07:37
thank DWV for the link