Searching \ for '[EE]: Fancy sound output for PIC based project' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/ios.htm?key=sound
Search entire site for: 'Fancy sound output for PIC based project'.

Exact match. Not showing close matches.
PICList Thread
'[EE]: Fancy sound output for PIC based project'
2001\10\14@181220 by Philip Galanter

flavicon
face
Hi all.  I am an artist with some strong software chops (including
some firmware work in a previous life), but weak electronics skills,
and working on a project that will result in 100 small identical
circuit boards.  (enough so that everything I have to do by hand
needs to justify itself, but so few that jobbing things out to
fabricators or custom chip labs may not be cost effective.  (did I
mention this is on a limited budget?  Think starving artist here...))

I am getting up to speed on the world of PIC, and want each of the
above boards to have "fancy sound"...i.e. a small speaker and the
ability to make high quality sounds of my own design.  (I am an
expert synth player/programmer).  Each board only needs to make about
10 short sounds, and using sampled sound I could get by on 10 to 20
seconds of total sound.  But I have to be able to sculpt the sounds
myself...

It seems to me the alternatives are as follows:

A) Use the PIC to synthesize square wave based sounds directly. (+)
Cheap (-) Limited timbres, may use lots of PIC cycles

B) Use the PIC to play back sampled sounds via PCM out a single pin
(+) Cheap (-) Have to find a way to convert sampled sound files to
PCM files, have to have lots of non-volatile sound memory ($$$), a
way to program sound memory, may use lots of PIC cycles (?)

C) Use an external sound chip triggered by the PIC (+) Versatile, low
load on PIC cycles (-) Have to find a way to load my sounds into 100
sound chips, more chips means more $$$

D) Use a second PIC with 8 (12? 16?) pins dedicated to driving a DAC,
and have the first PIC tell it which sound to make when.  (Bad S/N
not so much a problem as long as I get to design the sounds). (+)
Versatile, low load on PIC cycles (-) have to have lots of
non-volatile sound memory ($$$), a way to program sound memory, and 2
PICs ($$$)

So here are my questions:

Does anyone have good examples (circuits, code) for any of these (A-D)?
I'll be happy to buy a book if that is where the info is...

For (B) would my best bet be using a second flash memory chip for the
sounds, and then have the PIC read the memory and send it out the pin
I use for PCM output?  How would I get the sound data into the (100)
memory chip(s)?  (I'd like to avoid buying an expensive PROM burner
or the like just for this).

For (C) any specific sound chip suggestions?  (URLs especially welcome!).
The ones I've seen are mostly record/playback devices...like for an
answering machine or a toy.  It would be very tedious to program 100
of these each with 10 different "messages" via analog recording or
the like.  And I just need playback.

For (D) anyone done this?  DAC chip suggestions?  Circuits?

And finally...

What speaker should I use?  And will I need a transistor acting as
power amp or something?  It needs to be small (one inch diameter or
less...flat-ish).  Best if it can just be mounted right on the board.
Most Piezo sound devices seem to be more like preset buzzers, but I
like the idea of using a Piezo element.  I can find lots in the
catalogs...but I can't tell from that which will sound the best.
Obviously I am not going to get bass response!  Also again, any
circuits I can crib?

I know this is a lot of questions...any partial responses would be
very welcome...and thanks so much for your time!  Phil

--

Philip Galanter         New York University
Associate Director      251 Mercer
Arts Technology Group   New York, NY 10012

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\10\14@184005 by Nicolas Fournel

flavicon
face
Hi Philip,

I'm in the exact same case... I would like to play some sounds (even just one...) of my owns with a Pic.  Software and sound design is not a problem, but the hardware part is tougher... And I really would like it to be small, too...
For (C) you can check:

http://www.quadravox.com/

They are doing a programmer to use your .WAV files with ISD chips. There have beeen a few articles on the ISD chips in Nuts & Volts  Let us know what you find,

Nicolas



>>> Philip Galanter <spam_OUTpg1TakeThisOuTspamACF2.NYU.EDU> 10/14/01 02:59PM >>>
Hi all.  I am an artist with some strong software chops (including
some firmware work in a previous life), but weak electronics skills,
and working on a project that will result in 100 small identical
circuit boards.  (enough so that everything I have to do by hand
needs to justify itself, but so few that jobbing things out to
fabricators or custom chip labs may not be cost effective.  (did I
mention this is on a limited budget?  Think starving artist here...))

I am getting up to speed on the world of PIC, and want each of the
above boards to have "fancy sound"...i.e. a small speaker and the
ability to make high quality sounds of my own design.  (I am an
expert synth player/programmer).  Each board only needs to make about
10 short sounds, and using sampled sound I could get by on 10 to 20
seconds of total sound.  But I have to be able to sculpt the sounds
myself...

It seems to me the alternatives are as follows:

A) Use the PIC to synthesize square wave based sounds directly. (+)
Cheap (-) Limited timbres, may use lots of PIC cycles

B) Use the PIC to play back sampled sounds via PCM out a single pin
(+) Cheap (-) Have to find a way to convert sampled sound files to
PCM files, have to have lots of non-volatile sound memory ($$$), a
way to program sound memory, may use lots of PIC cycles (?)

C) Use an external sound chip triggered by the PIC (+) Versatile, low
load on PIC cycles (-) Have to find a way to load my sounds into 100
sound chips, more chips means more $$$

D) Use a second PIC with 8 (12? 16?) pins dedicated to driving a DAC,
and have the first PIC tell it which sound to make when.  (Bad S/N
not so much a problem as long as I get to design the sounds). (+)
Versatile, low load on PIC cycles (-) have to have lots of
non-volatile sound memory ($$$), a way to program sound memory, and 2
PICs ($$$)

So here are my questions:

Does anyone have good examples (circuits, code) for any of these (A-D)?
I'll be happy to buy a book if that is where the info is...

For (B) would my best bet be using a second flash memory chip for the
sounds, and then have the PIC read the memory and send it out the pin
I use for PCM output?  How would I get the sound data into the (100)
memory chip(s)?  (I'd like to avoid buying an expensive PROM burner
or the like just for this).

For (C) any specific sound chip suggestions?  (URLs especially welcome!).
The ones I've seen are mostly record/playback devices...like for an
answering machine or a toy.  It would be very tedious to program 100
of these each with 10 different "messages" via analog recording or
the like.  And I just need playback.

For (D) anyone done this?  DAC chip suggestions?  Circuits?

And finally...

What speaker should I use?  And will I need a transistor acting as
power amp or something?  It needs to be small (one inch diameter or
less...flat-ish).  Best if it can just be mounted right on the board.
Most Piezo sound devices seem to be more like preset buzzers, but I
like the idea of using a Piezo element.  I can find lots in the
catalogs...but I can't tell from that which will sound the best.
Obviously I am not going to get bass response!  Also again, any
circuits I can crib?

I know this is a lot of questions...any partial responses would be
very welcome...and thanks so much for your time!  Phil

--

Philip Galanter         New York University
Associate Director      251 Mercer
Arts Technology Group   New York, NY 10012

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\10\14@191540 by Allen Mahurin

picon face
The ISD chips are great for recording/playback voices.
However, anything above 4kHz (which you'll exceed if
doing any siginifcant sound effects or music) will be
lost or degraded.  For quality sound and a decent
frequency range, I'd suggest finding another chip.

Good luck,

ATM

--- Nicolas Fournel <.....Nicolas.FournelKILLspamspam@spam@FACTOR5.COM>
wrote:
{Quote hidden}

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\10\14@211032 by Philip Galanter

flavicon
face
Yep, the ISD chips seem to be quite popular for this kind of
thing...they are all over the web and folks here (in the ITP program)
seem to like'em too.

Still they seem a bit...inelegant to me.  Not so good frequency
response.  Having to program them via analog means one by one
(although I guess there are some industrial ($$) programmers out
there).

I'd still like to have the sounds as data in memory and then play
them out a DAC or something.

When I worked briefly at Williams Electronics sampled sounds would
get clocked out as a bitstream using some form of delta modulation
which a codec chip would then reconstruct into the waveform.  Cheaper
than DAC's I guess, at least at the time (mid 80's).

Here is an AES paper about sound electronics for toys which is
related to all this...a nice overview but not so many details...

http://www.techno-mind.com/snd4toys.htm

Thanks for the info so far.

I hope others will feel free to chime in with alternatives to the ISD path.

cheers, Phil


At 4:14 PM -0700 10/14/01, Allen Mahurin wrote:
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\10\14@211904 by Alexandre Domingos F. Souza

flavicon
face
>It seems to me the alternatives are as follows:

       Think about an 18-20 bit shift register (2 more chips) and a EPROM (one more chip) with an R-2R ladder or a ZN426 (oh no! one more chip!), to have about 20 seconds of nice sound ;o)

       Or forget everything and use an ISD1000-something, with 10 to 40 seconds of pure dirty sound ;o)


---8<---Corte aqui---8<----

Alexandre Souza
taitospamspam_OUTterra.com.br
http://planeta.terra.com.br/lazer/pinball/

---8<---Corte aqui---8<----

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\10\15@090352 by Olin Lathrop

face picon face
> Hi all.  I am an artist with some strong software chops (including
> some firmware work in a previous life), but weak electronics skills,
> and working on a project that will result in 100 small identical
> circuit boards.  (enough so that everything I have to do by hand
> needs to justify itself, but so few that jobbing things out to
> fabricators or custom chip labs may not be cost effective.  (did I
> mention this is on a limited budget?  Think starving artist here...))
>
> I am getting up to speed on the world of PIC, and want each of the
> above boards to have "fancy sound"...i.e. a small speaker and the
> ability to make high quality sounds of my own design.  (I am an
> expert synth player/programmer).  Each board only needs to make about
> 10 short sounds, and using sampled sound I could get by on 10 to 20
> seconds of total sound.  But I have to be able to sculpt the sounds
> myself...

I've done sound output from a PIC a few times.  Unless you have very
algorithmic sound, you won't be able to synthesize it on the fly.  It will
also limit the flexibility of these things, so let's forget about that.  At
10 to 20 seconds of "high quality" sound, you will definitely need off chip
memory.  One current project I'm working on needs about a minute total of
voice-quality sound.  We are doing this by connecting an external flash
memory chip to the PIC.  These are available in Mb, and can easily hold the
amount of sound you are talking about.

Use PWM to get the sound out of the PIC.  Run the PWM at the highest
frequency you can to still get 8 bits of resolution, then low pass filter to
about half the sampling frequency, which should be several times lower than
the PWM frequency.  Now you've got a normal analog audio signal that can be
amplified to drive a speaker as usual.

> How would I get the sound data into the (100)
> memory chip(s)?

Bring the PIC TX and RX lines and GND and power to a small connector.  Make
a separate one-off board that converts these to RS-232 so that you can
upload sound into the flash via the PIC from your PC.  The program on the PC
would take a WAV file as input, resample to your requirements, and upload
the information to the PIC.

> What speaker should I use?  And will I need a transistor acting as
> power amp or something?

It will be more than just a transistor.  Some RC filters to convert the PIC
PWM to the audio signal, and an opamp and a few transistors to drive the
speaker.  Speakers are low impedence devices, typically 8 ohms, so you need
a low impedance source to drive them.

> It needs to be small (one inch diameter or
> less...flat-ish).

This is completely at odds with your earlier statement of "high quality"
sound.  You need to quantify what frequency range you ar talking about.  You
can pretty much forget about frequencies below 1KHz for anything as small as
1 inch accross.

> Most Piezo sound devices seem to be more like preset buzzers, but I
> like the idea of using a Piezo element.

Piezos have very peaked frequency response, and aren't usually meant for
reproducing arbitrary sound.  You will need a magnetic device, and will have
to decide whether you want small size or high quality sound.  You aren't
going to get both.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, @spam@olinKILLspamspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\10\15@150815 by Ned Konz

flavicon
face
On Sunday 14 October 2001 02:59 pm, Philip Galanter wrote:

> I am getting up to speed on the world of PIC, and want each of the
> above boards to have "fancy sound"...i.e. a small speaker and the
> ability to make high quality sounds of my own design.  (I am an
> expert synth player/programmer).  Each board only needs to make about
> 10 short sounds, and using sampled sound I could get by on 10 to 20
> seconds of total sound.  But I have to be able to sculpt the sounds
> myself...

You should talk to Aaron Ferrucci <KILLspamaronfKILLspamspamantfarm.org>, who made the Very
Large Array sound sculpture installation at Burning Man '97 and '98.

It was a very impressive installation which started playing sounds at dusk.
There were 256 units in 4 8x8 grids; the sounds were sampled.

He used PICs and a  sound record/playback IC from Information Storage Devices
in each one, driving  two little speakers more or less directly, as I recall
(though he may have used a small transistor to up the power).

http://www.antfarm.org/~aaronf/vla.html
http://www.antfarm.org/~aaronf/vlafaq.html

--
Ned Konz
currently: Stanwood, WA
email:     RemoveMEnedTakeThisOuTspambike-nomad.com
homepage:  http://bike-nomad.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\10\15@185451 by Philip Galanter

flavicon
face
At 8:16 AM -0400 10/15/01, Olin Lathrop wrote:

lots of great stuff...thanks tons!

{Quote hidden}

Understood.  I guess I meant "high quality" relative to sound
elements found in toys, typical PIC robot projects, and the like.  A
speaker perhaps a cut above what I could find at the typical Radio
Shack (or am I being unfair to RS here?).

For this project the sounds will have no bass...they are high and
mid-high pitched sounds.  But I would like the upper harmonics to be
there.
So I guess I am looking for a small speaker that can be mounted on a
circuit board, but wouldn't be too shabby as a tweeter in a low power
speaker.

Phil

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\10\15@190956 by Philip Galanter

flavicon
face
Cool Project!  Will drop him a line ...  thanks! Philip

At 12:08 PM -0700 10/15/01, Ned Konz wrote:
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\10\17@090845 by 742-9014

face picon face
> Understood.  I guess I meant "high quality" relative to sound
> elements found in toys, typical PIC robot projects, and the like.  A
> speaker perhaps a cut above what I could find at the typical Radio
> Shack (or am I being unfair to RS here?).

The low frequency cutoff is going to be pretty much a function of the size
of the speaker, regardless of where you buy it.  Jameco has a bunch of cheap
and small speakers that might do.

> For this project the sounds will have no bass...they are high and
> mid-high pitched sounds.  But I would like the upper harmonics to be
> there.
> So I guess I am looking for a small speaker that can be mounted on a
> circuit board, but wouldn't be too shabby as a tweeter in a low power
> speaker.

This is a waste of time until you quantify "high quality", "no bass", "high
and mid-high pitched sounds".


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, RemoveMEolinspamTakeThisOuTembedinc.com, http://www.embedinc.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservEraseMEspam.....mitvma.mit.edu with SET PICList DIGEST in the body


2001\10\17@124759 by Philip Galanter

flavicon
face
At 8:04 AM -0400 10/17/01, Olin Lathrop, Embed Inc, 978-742-9014 wrote:
>
>>  For this project the sounds will have no bass...they are high and
>>  mid-high pitched sounds.  But I would like the upper harmonics to be
>>  there.
>>  So I guess I am looking for a small speaker that can be mounted on a
>>  circuit board, but wouldn't be too shabby as a tweeter in a low power
>>  speaker.
>
>This is a waste of time until you quantify "high quality", "no bass", "high
>and mid-high pitched sounds".

(context...looking for a good speaker that is as small as possible
for some specific sounds).

FWIW...

It would be great to find a speaker with a "flat" (+/- 1.5 db?)
response from about 500Hz to 10Khz.  Below 500Hz it could fall off
steeply...above 10Khz a gentle slope (6db/octave) would be nice.

It would good to find one like the above but with a "flat" response
from only about 1Khz to 7 Khz.  Especially if below 1Khz the curve
wasn't too sharp.

Since they don't have to be used with an arbitrary signal (I
predetermine the sounds) I won't need to use a LP filter (part of a
crossover) to protect the speaker from bass signals...I think...

But at this point I am thinking I should just buy a bunch of speakers
and listen to them with my intended signal and pick out the best
one...hate to end up with a (n-1) speakers I can't use though...

Phil

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspammitvma.mit.edu with SET PICList DIGEST in the body


2001\10\26@192756 by Larry G. Nelson Sr.

flavicon
face
I need to make a swishing sound to sync to a swinging pendulum. Anyone have
code to generate this type of sound effect?
Thanks
Larry


At 06:50 PM 10/15/01 -0400, you wrote:
{Quote hidden}

Larry G. Nelson Sr.
RemoveMEL.NelsonEraseMEspamEraseMEieee.org
http://www.ultranet.com/~nr

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\10\26@193941 by Jinx

face picon face
> I need to make a swishing sound to sync to a swinging pendulum.
> Anyone have code to generate this type of sound effect?
> Thanks
> Larry

I think a swishing sound may have too much content for a PIC. I'd
imagine you'd want to start with white noise and then run over it
with a band-pass filter (like a wah-wah pedal). It would be far
simpler to let h/w do the work. For example, from the Nat Semi
book -

LMC835 graphic equaliser IC
LMC1992 tone & volume IC
MF4, MF5, MF6, MF8 filter ICs

etc etc

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\10\29@111126 by Olin Lathrop

face picon face
> I think a swishing sound may have too much content for a PIC. I'd
> imagine you'd want to start with white noise and then run over it
> with a band-pass filter (like a wah-wah pedal). It would be far
> simpler to let h/w do the work. For example, from the Nat Semi
> book -

I think this could be done easily in a PIC using the method you described.
There aren't a lot of cycles there.  A band pass filter is just a low pass
and a high pass.  A low pass filter requires a subtract, shift, and add.  A
high pass filter is the original signal minus the low pass.  The high pass
part of the band pass would need to be continuously adjustable, so the shift
becomes a multiply.  That one multiply is the only part of this algorithm
that will take an appreciable number of cycles.

Let's say you update the PWM output at 10KHz rate, which gives you up to
5KHz bandwidth.  With a 20MHz 16-family PIC, that's 500 instructions per
sample.  This would allow software random number generation, but you could
instead just store a list of pre-generated random numbers.  You'd probably
want that anyway to eliminate low frequencies.  All in all, 500 instructions
is a lot for this task.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, RemoveMEolinspam_OUTspamKILLspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\10\29@152825 by Brent Brown

picon face
Maybe you could have two speakers and "swish" some white noise
from one to the other to give the appearence of movement. Just an
idea.

Brent Brown
Electronic Design Solutions
16 English Street
Hamilton, New Zealand
Ph/fax: +64 7 849 0069
Mobile/text: 025 334 069
eMail:  RemoveMEbrent.brownTakeThisOuTspamspamclear.net.nz

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...