This story is a sort of Keltic Gilgamesh. It was actually the custom of the Picts to expose their dead, before burying the bones in a common burial house. They may not have had pan pipes, but a magical instrument, which makes people dance, is not an uncommon theme.