The novels _The Lord of the Rings_ and _The Hobbit_ by J.R.R Tolkien both contain a number of songs, mostly sung by Hobbits, with fully fleshed out lyrics.  A few of these songs even made it into the Peter Jackson movie trilogies, *The Lord of the Rings* and *The Hobbit*.

However, as far as I can tell, the actual notes and music to each song never appeared in any of the original books. 

Did the production crew for *The Lord of the Rings* and *The Hobbit* trilogies make up their own music for these songs?  Or was there some reference in a book, letter or transcript to how the songs should be sung?

I'm looking for an answer *specific* to the movies.  [This answer](http://scifi.stackexchange.com/a/21388/20533) to a similar question shows that there *was* someone writing scores for the songs other than Tolkein, but not whether or not they were used in the movies.