I cannot write a structured piece of music. I can write a few good parts here and there, but it inevitably ends up as a jumbled mess of parts that don't really make sense together. Now, if I'm going to ask about structure, I can't just ask, "Hey, guys, how do I write structured pieces?" So I'm going to break my question down into a number of more pointed ones.
First of all, there's the question of logic. How can I tell if one section of a piece follows "logically" from another? Is this just something I have to do by feel, or is there more to it than that? Intuitively, I think it's a matter of similarities. But even when I make sure that each part of my piece is similar to the last part in some way, it still doesn't sound structured! So what am I doing wrong?
Is it better to try to learn large-scale "overall" structure first, or focus on structuring each part adequately, and then on joining them up?
Are transitions fundamentally important to structure? What makes a good transition? Should a transition be different from its adjoining parts, or similar to each one in some way, or what?
What are some good books on musical structure that can help me actually string together a coherent piece?
Finally: how did you learn about structure? I know it takes "hard work," but that doesn't tell me anything. What kind of work does it take? Do you consciously try to improve your structure, or are there other elements of composition that one should work on first?
Edit: On second thought, this might go better in the Advice and Technique subforum. Can a moderator move this?