updated function to work with Lilypond 2.18