QUOTE(AndyL @ Oct 10 2009, 02:14 AM)

You can play it in any key you like, no reason why you can't do it in E major. When you say "starting on the tonic" do you mean the melody starts on the tonic note, or the first chord is the tonic chord? It would be usual to start with a tonic chord, but the first note of the melody is the dominant, not the tonic (so in E major the first note would be B). If you're playing the melody starting on E, you're playing it in A major.
This is interesting, and it's not something I'd realised, I'm afraid. I've got G5 theory but harmonised composition doesn't come into G5, and the only compositions of my own that I've done have been single line melody for me to play on my clarinet. And being beginner on piano, I'd just picked out the melody line starting on E, and thought the key would be E major
So I see what you're saying, thanks, and yes, I'd wanted the melody to start on E so the key should be A Major. That makes much more sense as when I had the key as E Major, I'd had to naturalise the D
So my first chord should be the tonic chord of A Major

And then I would go to the dominant chord, then back to the tonic chord, then sub-dominant chord, and maybe play around with some first or second inversions? Is that right? (and if so, I think I understand what to do)