is the grammar of the following sentence correct?

To meet the requirement of appropriate piece, the piece needs to have at least five different music notes and no obvious repeating melody.

No, the grammar of the sentence is not correct. The sentence should be revised as:

"To meet the requirement of an appropriate piece, it needs to have at least five different music notes and no obvious repeating melody."