As a pianist with over 30 years experience, I gained some compositional skills "on the job" so to speak. My Opus 1 (seven piano pieces) contains a fugue, a tiny brush with serialism, and a more romantically styled work, etc. Its diverse technical and musical difficulties manifest within a range from pre-grade 1 to grade 6 levels. These pieces are also useful for sight-reading, and/or providing some possible seeds that budding composers, might base their personal creative ingenuity around?
When it is possible, as it is almost wholly organic, I like to improvise. With my lack of a formal theoretical tutorage, I have much fewer mental rigidities and restricting rules and/or memories. I do memorise sounds, and the basic digital articulations of scales and arpeggios, etc., so with the absence of a score, my intuition is very much in charge.
The closest parallel to how this improvisatory process is facilitated is that of a well-trained, computational, back-propagation neural network (of course the reverse relationship is more precise.) So by training such a human "network" with copious numbers of compositions from all the main musical periods, beginning chronologically with the Baroque (therefore, Baroque, Classical, Romantic, Impressionist, 20th Century, and today's contemporary works that include minimalist trends) a fresh, personal artistic statement might emerge, if it wants to!
The workings of such networks are not precisely known. That's the point of them. They are given complex jobs that are hard to formulate, however, such unconscious playing has its roots in the absolute beginning of learning the piano (or your other instrument), and along with the very beginning of each individual, free improvisation, conscious first steps are required! What is life if not to take steps, especially first ones!?
Two of my improvisation videos, and a link to enable the purchase of my Opus 1 sheet music, are on my Content page.