I have asked this question many times, with no success:
All of us have heard speech coming from a speaker (radio, music, text-to-speech, whatever). We are able, even if the speaker is talking at a constant frequency and amplitude, to distinguish the sounds. This is attributed to timbre. So my unanswered question(s) are:
With only two wires going to out speaker, signal and ground. We can generate frequency (sq. wave) and amplitude ( with a pot or resistor). This can be accomplished using tone(). But tone() inly outputs a droning, electronic sound. It offeres no way to control the timbre. SO how is it that my computer speaker can make speech with the same wires mentioned above? Basically, can I adjust the timbre of a tone() on my Arduino? And/Or how do other speakers do it?
Natural sounding speech, music or sounds are more complex than just putting one simple wave on the speaker. There are things like harmonics and other things that play a big role. That's why the electronic toys from the 80ies sound like electronic toys and today's electronic toys are quite good at emulating natural sounds. Although, many of the natural stuff is still sampled or used from a library.
For the Arduino, naturally sounding stuff is out of it's scope, you will need a dedicated sound processor for that, which will have far more processing power than your Arduino.
Korman
But then how does the SpeakJet work:
I'm sure if that small chip can do it, my arduino can.
But then how does the SpeakJet work:
from the web site it tells you:-
The SpeakJet is a completely self-contained, single-chip voice and complex sound synthesizer. It uses a mathematical sound algorithm to control an internal five channel sound synthesizer to generate on-the-fly, unlimited vocabulary speech synthesis and complex sounds.
I'm sure if that small chip can do it, my arduino can.
So because you car is bigger than your microwave, your car can cook the dinner just as well as your microwave? :-/
I have asked this question many times, with no success:
I don't believe you. I suspect that you just don't understand the answer. You initial question has so many false assumptions in it that it might be difficult for you.
I'm sure if that small chip can do it, my arduino can.
I won't stop you from checking out the datasheet of the TTS256 to replace your beliefs with facts.
Korman
OK Richard I hold up my hand you got me. ;D
it took 350 miles to bake a medium potato.
Of course in the UK there are very few places that are 350 miles away.
But what is timbre, exactly? If I output an A/440hz with tone(), I get -- correct me if I'm wrong -- no timbre. So would adding some harmonies/octaves of A/440 increase the timbre? What is it?!?!
So because you car is bigger than your microwave, your car can cook the dinner just as well as your microwave?
The car is made to drive. The microwave extracts water. <<-- different ideas
The atmel328 and the speakjet are both ICs with lots of transistors and other minuscule components. <-- similar
And I have seen mildly good renditions of speech output.
http://code.google.com/p/tinkerit/wiki/Cantarino
This as no external components, if I'm not mistaken, only the arduino and a headphone jack.
Timbre has been called a "wastebasket" attribute (Dixon Ward, 1965) 55) or category (Tobias 1970, 409), or "the psychoacoustician's multidimensional wastebasket category for everything that cannot be qualified as pitch or loudness" (McAdams and Bregman, 1979).
You might be able to fake it with an arduino, the analog outputs, some very good filtering and mixing but it probably won't be quite what that other chip is. Or you can depend on other external devices.
http://www.youtube.com/watch?v=liRF4alsvaI skip to 3:09
http://www.youtube.com/watch?v=3xCY2K9kQz4 Awwww
http://www.youtube.com/watch?v=zWhV4ZFsb6A music machine
But all those videos just used the tone() function. What is the timbre? What do you mean by filtering? And using analog out would just change the amplitude!
I have seen this sort of thing several times.
Try here: http://www.myplace.nu/avr/minidds/index.htm
Also look at a recent thread in the exhibition forum:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1290317424
I googled "AVR wave generation" and found a lot of stuff.
The no-extra-ICs approach appears to be to build a 4 or 6 bit DAC with a resistor ladder (google again).
What is the timbre?
Any tone consists of a fundamental frequency and any number of harmonically related frequency. Timbre is what we perceive by the change in mix of the strength of those harmonics over the time of the note.
Sound is simply the rapid variation of air pressure in time. A microphone converts that to a very similar variation in voltage. A loud speaker converts a variation in voltage into air pressure (sound).
Pitch is a perception of frequency.
So if I got a speaker to output the various harmonics of C/256hz with varying amplitudes, I would have something like timbre?
I understand pitch and sound, just not timbre. It can't be that difficult to emulate the tone of a piano on the arduino, is it? (Software-side, difficult. But possible?)
I would have something like timbre?
Yes timbre is a quality that helps you distinguish one sound source from another, there are an almost infinite number of them.
It can't be that difficult to emulate the tone of a piano on the arduino, is it?
Yes a piano is a very difficult instrument to emulate well. The timber is slightly different on each and every note. In order to get a good quality note you need a 16 bit sample (at least) and you need to refresh that sample at 44 thousand times a second. This takes a lot of memory and processing power, something in short supply on an arduino.
You can make an approximation of a piano by having only 8 bit samples and outputting them at say 8 thousand times a second but the memory space for the wave table is very small as well so it ends up not sounding so good.
I don't care about particular instruments. But something along the lines of this:
http://www.seventhstring.com/tuningfork/tuningfork.html
Drag the timbre slider.
It looks like from that that a sawtooth creates one tone, a sine wave creates another. Could anyone give me any ideas for an arduino sketch (not the whole thing, just ideas) about how to modulate such waves. Is there a way to output sawtooths, triangle, and sine waves on analog outs? The tone() function only modulates a square wave on the digital pins...
When we went on long road trips, we would wrap our food in aluminum foil and place it on the exhaust manifold. You got to "characterize" your engine to figure that it took 350 miles to bake a medium potato.
Memories, I used to cook sausages and burgers on my way to Plymouth from the north west in the same way. I used to reckon half way (170 miles) before they were done. They were better if you stopped around 120 miles and turned them over before doing the next 50.......
about how to modulate such waves
A change in wave shape produces tones of different timbre because any given mix of harmonics produces a different waveform shape. This is a fixed timbre and doesn't sound "natural". In theory you just output waveforms of the shape you want. For example a triangle wave is produced by outputting voltages that change by one bit at a time. You add a bit until the voltage reaches a maximum and then you subtract a bit each time and so on.
However the arduino only has a PWM as an an analogue output. The problem with that is the analogue value can't be changed very rapidly, you can't change it faster than one cycle of the PWM. Therefore you can't change it quickly enough to generate the tone you want. You have to use some form of external D/A converter.
To see what a PWM signal looks like see:-
http://www.thebox.myzen.co.uk/Tutorial/PWM.html
For more information this is a very good read:-
http://crca.ucsd.edu/~msp/techniques/v0.11/book.pdf