Play by ear
Initially, this referred to the playing of music without reference to printed notation. More recently it is also used figuratively to mean 'handle a situation in an impromptu manner', that is, without reference to pre-determined rules or guidelines.
The use of the word 'ear' to denote musical talent dates back to the 16th century. William Caxton's assistant, Jan van Wynkyn (a.k.a. Wynkyn de Worde) printed this book by William Bonde - The Pilgrimage of Perfection, 1526:
"In the psalmody... haue a good eare." [The psalmody was a place where psalms were sung - what is now called the choir.]
The phrase 'play by ear' is much later. The first record of it is in an 1839 edition of The Edinburgh Review:
"Miss Austen is like one who plays by ear, while Miss Martineau understands the science."
The figurative sense came into being in the mid 20th century in the USA. the early references in that context all relate to sports, notably baseball; for example, this story about the proposed sale of the Brooklyn Dodgers, from The Coshocton Tribune, February 1934:
"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."
See other phrases that were coined in the USA.