Macaroni was a slightly derisive term used in England to describe a style of dress which sought to emulate the latest fashions from the Continent (France). Wigs, lace, ruffles were put together in manners excessive and gaudy. Concurrent with this quest or craze for sartorial equivalence the culinary world was enjoying Pasta. In this period the generic was Macaroni not pasta and the same folks going overboard with the clothing served macaroni morning noon and night to show their culture and refinement in all things. The more staid folks laughed at them and applied the term Macaroni to those they thought deserved it.

Flash across the sea where soldiers camped sometimes within earshot of each other. The Red Coats sang the song Yankee Doodle to deride the competition.

Yankee Doodle (Doodle is as it was then a word associated with Fool, when you doodle you fool around)

Went to town riding on a pony ( The English were proud of their Calvary made up of well bred livestock where the colonist made do with a mix of not so pretty horses)

Stuck a feather in his hat and called it Macaroni (The far extremes of sartorial style represented here to diminish the colonial even more.) I do not remember which battle but a large number of Red Coats were captured and marched to internment with the Colonial Soldiers singing that tune to the embarrassed British soldiers. There after Yankee Doodle was adopted as a slap in the face to those who thought so little of the Colonist Soldier.