I used this extensively (in Stravinsky and whatnot). artificialHarmonic = #(define-music-function (stopped touched result duration) (ly:pitch? ly:pitch? ly:pitch? ly:duration?) #{ \afterGrace <$stopped $touched \harmonic>$duration \tweak NoteHead.font-size -6 \tweak Stem.stencil f \tweak Beam.stencil f \tweak Flag.stencil f \parenthesize $result \harmonic #})
used as : \artificialHarmonic ds,, fs as''1. It works for me but is not quite perfect. For one, I would love for it to generate only the midi for the $resulting note and not the whole chord (which is musically totally irrelevant). Hope it helps -- Pierre-Luc Gauthier