This English expression is commonly used. Despite the fact that it started as a literal expression it has evolved over time and is now much more frequently used in a metaphorical sense.
This expression is used in order to denote the act of doing something spontaneously. It suggests the act of deciding what to do in an impromptu manner rather than having everything pre-planned.
The expression was first used in a less metaphorical context in the music world. At this time it was used to denote the playing of music without using printed notation. This use dates back to 1839 in an edition of The Edinburgh Review which reads “Miss Austen is like one who plays by ear, while Miss Martineau understands the science.”
The use of the expression in a context not related to music can be traced to the United States in the early 20th century. The first recorded use dates to the year 1934 in The Coshocton Tribune which reads “before going further in this direction, perhaps I can believe that awful suspense by stating that I am reliably informed today that the Brooklyn Dodgers, otherwise the daffiness boys, otherwise the young men who play by ear, are for sale.”
An example of this expression in use can be found in a quote by the author Joan Didion. She is quoted to have said “grammar is a piano I play by ear.”