There are a lot of movies, where characters play musical instruments professionally. I'd like to know about Whiplash and La La Land. Did actors there really learn to play musical instruments, or are there some special filming techniques?
For the two films that you mentioned, it appears that the actors really did play the instruments. In general, I think this is going to vary by film.
For Whiplash, I found a few publications that indicate that Miles Teller really did play the drums:
So, long answer short, that is, indeed, Teller playing the drums -- but with help from some great editing and no small amount of hard work.
For La La Land:
"In fact, there's not a single close-up shot of [the character] Sebastian's hands in the entire movie that's a piano double," director Damien Chazelle said at a press event for the movie. "It's all Ryan." Even John Legend, who has a smaller part in the film, was impressed: "I was jealous, man," he said. "Watching him play, I was like, 'Wow, this guy is really good and he just learned this in the last few months.' It's pretty amazing."
Please note that if you read the nola.com article that I linked above, you can find at least one film where the actor (Dooley Wilson in Casablanca) was not actually playing the instrument in the movie (despite being an actual musician). -
Ralph Macchio had no clue what he was doing in Crossroads (1986), as evidenced by his hand movements.
I think it varies widely. There are actors who can play instruments, and there are actors who can't. Some may take lessons just to get a feeling for the instrument they're supposed to be playing, and some may not. Some actors are method actors and immerse themselves in their character, and some are not.
There are ways to fake it, using angles that don't show their hands or don't show their hands touching the instrument. The scene in Deliverence (1972) with the weird kid playing Dueling Banjos, they had a musician sitting behind the kid and doing the actual playing, while the kid just kept his hands at his sides. There's all sorts of ways to fake it if necessary.