Hi! I've found a good site about Folie.
http://www.folias.nl/htmlx.html
And there is some information about Marais Folie written by Ransom Wilson for the documentation of his vinyl recording. Hope you will find the answer to your question.
**********
"Marin Marais (1656-1728) was the greatest viola da gamba virtuoso of his day. His mastery was recognized at an early age by Louis IV of France, who immediately made him a soloist in the royal orchestra. At the age of thirty he published his first composition, a set of pieces for one and two viols. Along with later successful operas, oratorios and concerti, h produced in all four volumes of these Piès de Violes. It was in the second that the Folies d'Espagne appeared.
The piece is a set of variations on the famous Folies theme, which was used by countless 17th and 18th Century composers, including J.S. Bach, Vivaldi, Corelli, and Pergolesi. Interestingly, Les Folies is not really Spanish at all, but rather of Portuguese origin. It was a noisy dance accompanied by tambourines and performed by men dressed as women who worked themselves into an insane frenzy, hence the word 'folies' (literally, 'crazies').
The viola da gamba being a six-stringed and partially polyphonic instrument, one would think a version for flute would be impractical. But in the preface to the volume, Marais writes of the pieces,
'I have given attention in composing them to render them proper to be played on all sorts of instruments like the organ, harpsichord, theorbo, lute, violin, and German flute ...' Of the 32 couplets of the original version, 25 are presented here, and
the original key of d minor has been shifted to e minor to better accommodate the flute."