A music box was an automatic musical instrument that could play short melodies.
Kevin Uxbridge had a small glass-domed music box in his home at the Delta Rana IV colony, which an illusion of Rishon Uxbridge claimed had been in her family for generations. It played a short melody and two tiny dolls would dance when it was activated. Uxbridge projected the melody of the music box into Counselor Deanna Troi's mind so she would be unable to scan him telepathically and find out he was actually a Douwd. (TNG: "The Survivors")
When Janet Brooks's husband Marc died, she had all of the belongings which reminded her of him removed from their quarters, including a small wooden music box. Counselor Troi somehow managed to get hold of the box and returned it to Brooks during a counseling session five months after Marc's death. (TNG: "The Loss")