Gagliano wrote an enormous quantity of music, both sacred and secular, for the Medici; in addition, he was a singer and instrumentalist who entertained them privately. His works include fourteen published operas, of which two survive, "La Flora" (1628) set to a libretto by Andrea Salvadori and "La Dafne" (1608). "La Dafne" was praised as the best setting of the libretto by Rinuccini—even by Jacopo Peri, the first to write an opera on the text. Meanwhile, Gagliano or somebody else revised Rinuccini's poetry for the libretto so extensively that in some places it is impossible to find traces of the original. Peri indicated that Gagliano's way of setting text to music came closer to actual speech than any other, therefore accomplishing the aim of the Florentine Camerata of decades before, who sought to recapture that (supposed) aspect of ancient Greek music.