WordNet records no synonym and no antonym for ditty. It is the only member of its synset, which is common for technical, taxonomic and single-sense vocabulary — there is no other English word that means the same thing. The broader and narrower terms below are the useful relations in that case.
Counts are distinct word forms across every sense. A synonym that appears under three senses is counted once here and shown three times below, under each sense it belongs to.
a short simple song (or the words of a poem intended to be sung)
Synonyms, antonyms and the broader and narrower relations for ditty come from Princeton University’s WordNet. Full sources and licences.