Most upvoted comment
Top rated Music books on Reddit rank no. 44
How to PROPERLY use accidentals in your writing?(r/musictheory)
nnngh I see what you’re asking, but it’s really just plain old theory about keys and then we can get a bit more complex.
I write atonal music which uses all 12 tones freely, but I still use the rules of the road to guide my decisions. You shouldn’t ever throw pitches in willy nilly.
Buy these books. They’re produced by the Associated Board of the Royal Schools of Music here in the UK. They are AMAZING and are a complete guide to everything you need to know. Heck, I’m doing music at degree level and I sometimes still find them useful.