As for me, when you come across such features as the piano playing, stopping, and playing it can signify that the author of a movie/book wanted to create special mood for the reader, I would say either to frighten a reader or to add a suspense because usually after such twists something unexpected should happen.
Hope youwill find this answer helpful.