Maria Popova, through her Brain Pickings blog, shared the following advice Hemingway gave to the young aspiring writer Arnold Samuelson. If we change the word "writer" for "composer", and add "listen" to the word "read", we'll get a very good lesson for those making music.
I think it healthy to maintain interest in the music that's presently being made, but with a certain distance in terms of learning from it or, as Hemingway put it, stealing from it. Instead, one does better to learn from the recent (and perhaps not so recent) masters. That way, through some distance, we can better tell the good stuff from bullshit. Also, we don't get sucked into stupid games of jealusy and grudges.
Never compete with living writers. You don’t know whether they’re good or not. Compete with the dead ones you know are good. Then when you can pass them up you know you’re going good. You should have read all the good stuff so that you know what has been done, because if you have a story like one somebody else has written, yours isn’t any good unless you can write a better one. In any art you’re allowed to steal anything if you can make it better, but the tendency should always be upward instead of down. And don’t ever imitate anybody. All style is, is the awkwardness of a writer in stating a fact. If you have a way of your own, you are fortunate, but if you try to write like somebody else, you’ll have the awkwardness of the other writer as well as your own.—Ernest Hemingway.