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 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")
In 2378, Tom Paris compared a small toy he found on Otrin's homeworld to a music box. Joseph Carey identified it as a piece by Vivaldi, and Paris decided to keep it as a souvenir. (VOY: "Friendship One")