From Bulbapedia, the community-driven Pokémon encyclopedia.
A Melody Berry (Japanese: メロディベリー Melody Berry) is a type of Berry that has only appeared in the anime, in the Pikachu short Meloetta's Moonlight Serenade. They are grown on a type of tree called known as a Melody Tree (Japanese: メロディツリー Melody Tree).
The Berries have the ability to produce music and glow when Meloetta sings near them.
In the anime
In Meloetta's Moonlight Serenade, Meloetta sets up a stage to perform a concert for several of its Pokémon friends. After performing a small dance, it creates a Melody Tree, which soon produces five Melody Berries. After they fully grow, the Berries fall of the tree while the Melody Tree grows to an incredible height and glows brightly.
Meowth, having fallen in love with Meloetta, accidentally causes Crustle to cause a Sandstorm. The tornado of sand carries the Melody Berries away and sends them flying into different directions. Feeling bad for Meloetta, Pikachu, Snivy, Oshawott, Emolga, and Pansage go to look for the missing Berries. Meowth, only wanting to impress Meloetta, takes Wobbuffet with him to get the Berries before Pikachu and the others do.
The first Berry, a pink one, was caught by Meloetta after it and others were sent flying away. The second, a purple one, was found in the branches of a tall tree. With the help of a wild Totodile and Bulbasaur, Pikachu managed to find and retrieve it. The third, a blue Berry, was found by a wild Togepi, who decided to play with it until it accidentally dropped it off a hole-covered cliff. After chasing the Berry down the cliff, Snivy and Emolga managed to retrieve it with the help of a wild Chikorita and Torchic.
The fourth Berry, a yellow one, was found by a wild Corphish, who took it to the bottom of a lake. Oshawott, with the help of a wild Piplup and Squirtle, dove to the lake and battled the Corphish, who simply assumed they were playing. After Oshawott and Squirtle were defeated, Piplup defeated Corphish, knocking the Berry out of its pincers. The Berry lands near Meowth and Wobbuffet, who pick it up only to be blasted away by a wild Psyduck.
The final Berry, a red one, was found in the cloud of a wild Drifblim by Meowth. In an attempt to retrieve it, all of the Pokémon end up latched onto Drifblim as it is blown away by a draft of wind. Pikachu manages to get the last Berry, only for it the other Pokémon to fall off of Drifblim. Meloetta, with its Psychic powers, rescues its friends, who then return the missing Berries to it. With all of the Berries back in its possession, Meloetta continues the concert that it had held earlier.