How to create music notation sheets?

In an application that creates for example piano music, how to create music notation sheets?