This should be legal, but be careful where your music is coming from. If you're using sound samples provided by software you need to ensure it's OK to use those sound samples. There's something in music composition called Sampling. This is taking small bits of other music and re-using it in your own. The legal issues surrounding sampling are a grey area, wikipedia has this to say about it:
Sampling has been an area of contention from a legal perspective.
Early sampling artists simply used portions of other artists'
recordings, without permission; once rap and other music incorporating
samples began to make significant money, the original artists began to
take legal action, claiming copyright infringement. Some sampling
artists fought back, claiming their samples were fair use (a legal
doctrine in the USA that is not universal).
However, if you're creating the music yourself, and it's composed by you, there shouldn't be any issue.