People always have created music by many different ways but this is one consisting on coding your melodies. jMusic is a Java library to compose and create new music using musical concepts and Java notation.
You can create notes, phrases and scores, this can be applied to different instruments and then write the result into a MIDI, audio, XML or jm (own jMusic extension) file or playback with MIDI interface, and all in an object oriented language.
Also, for people not familiar with code, there is a library called jm-Etude, based on jMusic and created by Daniel Dihardja, that is more music-friendly and organizes better the notes, scores and phrases in a Java class called Etude.
A good and different way to create music with another point of view, computer programing.