The following excerpt is about writing words, but it applies to composing music. WW
Scholars Talk Writing: Jay Parini
An Interview by Rachel Toor in the The Chronicle of Higher Education
May 23, 2016
Toor: Advice for academics about writing?

Parini: Everyone is different, so no single approach will fit all. But I know a few things.

One: Don’t stop. You have to write a lot to get better at writing. If you find that your inner critic is making it hard to write, if you’re a perfectionist, lower your standards. Write badly if you must. You can always revise, making the sentences better, the paragraphs more coherent, the whole tighter and stronger.

Write every day. If you must, get up early—I tend to get up very early and start early. An hour each day is enough. John Updike once told me that he wrote at least two pages a day. He pointed out that this gave him a minimum of 600-plus pages a year. That’s a lot of writing to work with, revise, edit.

The real work of writing, the fun work, is rewriting. So don’t be fussy. Write, revise, and write some more. And don’t hesitate to use those weird little gaps in the day. I often have huge luck with a spare 20 minutes.

And don’t fuss. Don’t think you have to be at your desk in a quiet place. That’s nice if you can get it. But I’ve learned the hard way—raising three kids with my wife, being very busy as a teacher—that you can’t let chaos ruin a good hour of writing. I can usually find a good hour, somewhere, in my day. Often between 6 to 7 in the morning—before the noise begins.

It’s my probably superstitious belief that if you stick to your writing, it will stick to you.