Brave is coming out this weekend, so we can all spend our weekend with melifluous Scottish accents ringing in our ears. But where exactly do accents come from in the first place? How do we get them? What's the mechanism by which they evolve?

Here's our complete guide to the science of accented speech.

It's amazing how quickly and completely we can spot someone doesn't speak the same way we do. Accents have been used to distinguish one type of person from another since Biblical times. In the Bible, a victorious tribe used the fact that their enemies could not correctly pronounce the word "shibboleth" to identify and kill them. The consequences for mushmouthery have gotten less lethal since then, but accents still mark people out. Different groups of people talk, grunt, exclaim, and even laugh in different ways.

And it's not just people. Goats say bahhhh with different accents, depending on where they live. Gibbons sing different songs, depending on which groups they're raised in. There are even researchers who specialize in pigeon accents. Language pronunciation simply drifts apart, when groups are isolated from each other, even for just a few years, or by just a few miles. But when does it begin?

Babies are born with the ability to form any kind of sound. Put a kid in the right environment, with two different spoken languages, and they'll be able to flawlessly speak them both, no matter how different and contradictory they are. An ornithologist even noted that, because she played bird calls in the car, her child was able to imitate different birds, and identify them by sound. At some point, though, we lose the ability to make certain sounds. And before that happens, we lose the ability to hear them.

Scientists at the University of Washington recently performed experiments on babies from six months to a year old, trying to figure out what these babies can hear. These particular experiments were done on babies from English-speaking and Japanese-speaking households. The scientists were testing how babies heard the English "l" and "r" sounds. While the two sound different to English-speakers, Japanese speakers, even ones who speak English perfectly, have a harder time distinguishing the sounds. (English speakers, meanwhile, are known for their trouble with the Spanish "p," "b," and "v" sounds, and the Chinese "shee" and "chee" sounds. Every language edits out certain distinctions in noises.)

The experiment is simple. A baby sits on its mother's lap. A speaker to its side plays the sound of someone saying "la la la la la la," until, at some random point, the "la" is replaced by a "ra." At that point, a bear near the speaker beats on a drum and a light flashes. The baby only knows to look for the amusing little show if it can hear the difference between the sounds. At six months, babies in either household were equally likely to look at the speaker. At a year, eighty percent of kids in English speaking houses turned, but only fifty-nine percent of kids from Japanese speaking houses turned. That's not much better than random chance. By one year old, the Japanese kids had lost the ability to distinguish the sounds.

But that doesn't mean they're necessarily lost forever. The ear can be trained, often as naturally as when babies do it. Many people find that, when they move to new areas, they lose their accents. This happens especially if they are fluent in the language to begin with. I know a short trip to England when I was a kid had me talking like Madonna within two weeks. Most of the kids at my college put their accents on and took them off unconsciously, depending on whether they were talking to someone back home or at school.

And there's a reason for this. Studies have shown that imitating an accent makes it easier to hear what the person is saying to you. Establishing a common ground between two people, even if one person is "putting an accent on" helps people from mixing up similar-sounding words and identify words that might otherwise be pronounced unrecognizably. If one person has gotten a feel for the differences in pronunciation, it takes less processing power in their brain to understand what's being said to them, and the verbal exchange is more fluid.

Can an accent be changed completely? It's tough, even for native speakers. We all know people who think they can do accents — generally when they get on screen. I can't judge the performance of Americans who try to put on other accents (although any overseas io9 reader is welcome to talk about which Americans can pass in the comments), but I've heard a few jaw-droppingly great American accents in my day. Idris Elba can do not only generic American but regional accents. Hugh Laurie is perfect, as far as I can tell. Minnie Driver and Robert Pattinson had me fooled. Then there's Eddie Izzard, who is a talented and intelligent man, but who would have been slaughtered by any American asking him to say "shibboleth," despite starring in a TV series in which he was supposed to be American. How does one acquire a new accent?

Imitation only goes so far, apparently. When people imitate, they rely on the memory of how someone speaks. An accent is more about holding the mouth and tongue in a certain position and letting the accent go from there. Apparently, as an American, I flap my mouth wider, get more nasal, and let my tongue slip away from the ridge of my teeth in a way that any self-respecting English person wouldn't. Beyond that, it's just about time, attention, and practice with someone who will tell you when you sound ridiculous. You can train your brain to hear the right sounds, and train your mouth to make them.

But then again, go and listen to the Brave trailer. Why would anyone try to sound American when they can sound Scottish? Anyone got tips on that?