View previous topic :: View next topic |
Author |
Message |
benni
Joined: 28 Jun 2012 Posts: 28
|
Sounds and Melodys 16F887 |
Posted: Wed Sep 19, 2012 10:32 am |
|
|
Hello,
I want ask if someone knows the chords for the Tetris melody in the example of: EX_TONES.c
OR
is there is a way to write a .wav file in the PIC?
Thanks for the Help
Regards Benni |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Wed Sep 19, 2012 12:19 pm |
|
|
How well versed are you in PCM format wave file playback?
Do you expect the 887 to have the required HARDWARE?
What is the purpose of this question? |
|
|
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
|
Re: Sounds and Melodys 16F887 |
Posted: Wed Sep 19, 2012 3:54 pm |
|
|
benni wrote: | Hello,
I want ask if someone knows the chords for the Tetris melody in the example of: EX_TONES.c
OR
is there is a way to write a .wav file in the PIC?
Thanks for the Help
Regards Benni |
LOL.
ex_tones.c / tones.c takes frequency. Therefore -
Get sheet music here:
http://www.gamemusicthemes.com/pdf/GameBoy/Tetris_-_Theme_A.pdf
Convert note to frequency here:
http://www.phy.mtu.edu/~suits/notefreqs.html
Please post youtube of this working when done. _________________ I came, I saw, I compiled. |
|
|
benni
Joined: 28 Jun 2012 Posts: 28
|
|
Posted: Thu Sep 20, 2012 10:19 am |
|
|
Hey,
Does someone knows to read notes and could translate this to me please?
Regards Benni |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Thu Sep 20, 2012 12:09 pm |
|
|
google
READ MUSIC notation
and also
MUSIC NOTE FREQUENCY
this is web research 101 |
|
|
benni
Joined: 28 Jun 2012 Posts: 28
|
|
Posted: Thu Sep 20, 2012 12:46 pm |
|
|
I already googled -.-
I just don't find the notes that are in the pdf file of the Tetris theme... |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Thu Sep 20, 2012 12:49 pm |
|
|
i think you must agree that :
Quote: |
notes that are in the pdf file of the Tetris theme... |
is not a CCS problem |
|
|
rald
Joined: 04 Sep 2013 Posts: 25
|
|
Posted: Sat Mar 14, 2015 6:11 pm |
|
|
hello
I have been trying to create a very simple laser sound saved into the internal eeprom of a pic 12F683, I have read the documents about tones but I have not idea about how to create those sounds.
does anyone know how can I convert a wav file or create this kind of sounds for microcontroller?
thanks |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Sun Mar 15, 2015 2:25 am |
|
|
For basic tunes, the 'simple' way is to start with a piece of music.
Look for things written to be played on monotonic instruments (like a xylophone etc.).
Take this, and work out the names of each note. Then put these into ex_tones.
.wav files are direct bitstreams. You don't have the storage size, or the hardware to handle these on a PIC, without a lot of work. Potentially it would be possible on one of the larger PIC's (PIC24 for example), to read such a file from an SD card (it'd get hard to handle all the possible variants, since .wav can contain streams that loop, streams at different sample rates, or even streams that are compressed), but the standard LPCM stream would be relatively 'doable', and this could then be output using a DAC at the constant rate (normally 44.1KHz). However this is a fairly 'large' project.
One system that is much easier to code in the PIC, is 'midi'. This is a serial interface at a relatively low data rate, which in it's simplest form has messages like 'note on', and the tone/emphasis data for the note. It is possible to generate a controller to receive this data relatively easily with a PIC. There are programs on the web, that will convert .wav files to midi streams (understand you lose 90% of the data in the wav file, and end up with a sequence of midi commands to play the basic tune). The output these produce can then be played by a PIC. Some years ago, I wrote a crude 'organ' using a PIC this way, and hardware has got much more capable since this time. |
|
|
drh
Joined: 12 Jul 2004 Posts: 192 Location: Hemet, California USA
|
|
|
rald
Joined: 04 Sep 2013 Posts: 25
|
|
Posted: Sun Mar 15, 2015 12:18 pm |
|
|
Hi guys,
thanks for respond,
about the romanblack program, I used it but I can not undestand how to use the files. do you have any example that I can use to get an idea?
I am going to research about MIDI and see if I can find some solution.
regreats |
|
|
necati
Joined: 12 Sep 2003 Posts: 37 Location: istanbul
|
|
|
balboa
Joined: 24 Mar 2015 Posts: 8 Location: Syria
|
how to use it |
Posted: Fri Mar 27, 2015 1:16 pm |
|
|
would you please tell us how to use the exported file |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Fri Mar 27, 2015 1:48 pm |
|
|
pretty simple
export the sound file as either a PIC .asm file or a MikroC .c file
It's up to you to convert the data into CCS C compatible format. real easy if you know how to use edit features in windows...
Save as filename.pcs ( Pic C Sound file extention) or whatever you want.
Depending on how big your PIC is and the soundfile, you have a couple options.
1) if saved on a flashdrive, simply cut code to read the data and send to an I/O pin with R-C filter as shown in the documentation
2) if small enough to be contained in the PIC codespace,save as const data.
either way will work. I did it for the 16F877 about 10 years ago as it was a bit easier than using a PC ISA sound card...
cheers
Jay |
|
|
balboa
Joined: 24 Mar 2015 Posts: 8 Location: Syria
|
thank you for help |
Posted: Sat Mar 28, 2015 12:41 pm |
|
|
temtronic wrote: | pretty simple
export the sound file as either a PIC .asm file or a MikroC .c file
It's up to you to convert the data into CCS C compatible format. real easy if you know how to use edit features in windows...
Save as filename.pcs ( Pic C Sound file extention) or whatever you want.
Depending on how big your PIC is and the soundfile, you have a couple options.
1) if saved on a flashdrive, simply cut code to read the data and send to an I/O pin with R-C filter as shown in the documentation
2) if small enough to be contained in the PIC codespace,save as const data.
either way will work. I did it for the 16F877 about 10 years ago as it was a bit easier than using a PC ISA sound card...
cheers
Jay |
|
|
|
|