PDA

View Full Version : Compress Music being played by the Sound command



IAmTheAnswer
- 11th June 2010, 12:44
Songs for the sound command take up much space compared to the memory available in 16f628a microcontrollers. Is there a way to compress them?

Acetronics2
- 11th June 2010, 13:54
Songs for the sound command take up much space compared to the memory available in 16f628a microcontrollers. Is there a way to compress them?

Hi,

I do not see how to "compress" some more the Data for the SOUND Command ...

I had an eye to the .asm generated by your program ( RRWine), [ Humour ON ] and it looks that command is not exactly optimized for long plays ... [Humour OFF]

you Also could use the 16F648 ... which is a '628 with twice the Program memory space ...

Using a music dedicated chip ( say ISD 4xxx ) appears to be a much better solution ...

Also see here ... :
http: //www.aplusinc.com.tw

Alain

Art
- 12th June 2010, 02:26
What does you code look like?

I never tried to make music with a pic, but my first thought is to use a lookup table full
of frequencies and time lengths, and pass those to a single SOUND command routine.

Now if you wanted to go further, time length values could probably be divided down to fit
into 4 bits, and then expanded by the SOUND routine, so you could fit more than a singe value
into each byte in the time length lookup table.

It's all really difficult without seeing how you are playing music.
Art.

Jumper
- 12th June 2010, 03:59
http://www.picbasic.co.uk/forum/content.php?r=213

or use a SD-card and play wav-files from it then you have plenty of space