A libretto is the text used in , or intended for , an extended musical work such as an opera , operetta , masque , oratorio , cantata or musical .
A libretto can also be the words for an oratorio , cantata , mass or a musical .