The sunlight shining thru my bedroom window triggered a 100

The sunlight shining thru my bedroom window triggered a 100 year old music box to play its tune with the lid closed.  No one touching it.  I would block the sunlight beam and it would stop and then I would move out of the way and the song would start over from the beginning and continue to play as long as the sun shone on it.  How is that possible.?.  I researched and cant find anything that suggests what is plausible in this situation.  Help?