A mantra is a sacred text. It carries a particular vibration. it carries a certain message or a deeper meaning. it is highly delicate matter. A lot of inner journey must have happened before someone created these texts. It is not just a combination of words. It is a call to the higher energy, divine energy.
Whenever a mantra was created, it was created for a certain purpose. its sacredness lies in its purpose. So when a musician composes a mantra, he/she should be immensely grateful to the sacred text. In fact it is a privilege of him/her to be allowed to work with these sacred texts. A mantra does not need a musician, a musician needs the mantra. A mantra is complete without music or musician. Keeping this in mind, a musician should understand the meaning, the depth, the delicacy and the purity of a mantra and accordingly create a melody for it.
Also, a mantra is an Eastern ancient text so the music ideally should carry the Eastern flavour. It is not a cut & paste job, just to create a melody and then simply paste a mantra o top of it, sometimes even squeeze the mantra into a melody forcibly. No, it does not work like that, just like singing flamenco songs in Indian style wouldn't make justice. Creativity is when something becomes beautiful, so one has to absorb some flavours of this ancient tradition even before starting to compose a mantra. It has to become part of one’s inner system. A rock an roll melody pasted on a mantra simply does not work, it just does not go together, the essence doesn't go.
A mantra is an invocation so when starting to make a melody for a mantra, the musicians should invoke the energy of the mantra, its meaning and the depth of wisdom or the message that it carries. Then through his melody, he should be able to carry, maintain, sustain and convey that same depth. There has to be a strong connection between the sacred text and the melody's mood carrying its genuine flavour.
It is a responsible job for a musician presenting music in the public domain to sustain that piousness of the sacred text in his composition. No matter how different elements he uses in his music, that sacredness should remain untouched and in fact should be enhanced through the music, so that it can go deeper and do its work, so that it can serve the purpose for which Mantras are there.