I just can't get it to work. Someone had this suggestion to make the marker useable by NPCs but I tried it and while it compiles the NPC just moves to the marker and stands there. At least without the script it would play the flute soundlessly. Anyway this is what was suggested
Better late then never, I found a way to make actors play the flute:
1. Place a marker at the spot where the actor should play the flute.
2. Find the actor reference in its cell, open the edit window for its reference, go to the "linked ref" tab. There add a a new reference to the marker with the keyword "BardPlaySpot". Close this window now.
3. Open the actor npc, go to the "AI Packages" tab and add a new custom package. I used the package template "Travel" but others might work too. I also cleared all interrupt flags, thought it's probably not needed. There go to the "Begin/End/Change" tab and add a new script with these contents:
;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname PF_custom_playflute_xxxxxx Extends Package Hidden
;BEGIN FRAGMENT Fragment_0
Function Fragment_0(Actor akActor)
;BEGIN CODE
BardSongsInstrumentalFlute.Start()
;END CODE
EndFunction
;END FRAGMENT
;END FRAGMENT CODE - Do not edit anything between this and the begin comment
Scene Property BardSongsInstrumentalFlute Auto
ReferenceAlias Property Bard AutoThen edit the properties of this script, on the "Bard" property select "BardSongsInstrumental" as quest and "Bard" as alias. On the "BardSongsInstrumentalFlute" property select "BardSongsInstrumentalFluteonly01" as scene. Now you need to add "BardSongsInstrumentalFlute.Start()" to the "On Begin" papyrus fragment. If all went well the script should compile without an error.
Now save the plugin and give it a try, if the npc doesn't play its flute when you load an old savegame you might have to issue "resetAI" on the console.