Once you have read and understood Hack Music Theory Part 1, you should get this PDF. If the aforementioned book is the best ten dollars a beginning musician can spend, this PDF is easily the next best ten dollars. It basically answered exactly the questions I had about how to compose music.
It was thanks to this book that I managed to compose my first tune in LMMS[a]. I spent ten months on false starts and confusion, and after reading this document it took me a couple of days to produce something that I could actually listen to without wishing I'd go deaf (a low bar, but we all start noob).
The PDF is very short and consists of fourteen topics in six categories, each topic being just one or two pages of ultra-condensed music theory. It starts by discussing the overall framework - how we associate emotions with certain musical structures and elements, then proceeds to explain how we can create a tune in the chosen set of structures. For example, we choose a scale (Dorian) based on the emotions we want to convey ("sad but hopeful"); then we can create the chords for that scale, and create a chord progression with the minor (sad), major (happy) and diminished (chaotic) chords. From the chord progression we can figure out some good options for a bass line, and so on.
It may sound like Ray takes all the creativity out of music, but that's far from it. The theory gives you a good starting position and a good set of musical components - but just like an art store can give you a nice set of paints, it is up to you to customize those components and assemble them into a creative work.
Once you've read and tried the methods and concepts in this PDF, I can recommend going to the Hack Music Theory YouTube channel[b] and watch some instruction videos about any topics you realize that you need to understand.