One main concern in Europe is the preservation and promotion of cultural heritage. Music is a main component of such heritage and flamenco is a main part of Andalusian musical culture. Focusing on flamenco music, in this paper, we describe steps on the analysis and generation of flamenco music oriented towards the diffusion and promotion of this musical style. Specifically, the separation of meaningful musical audio elements from flamenco excerpts by means of the scheme that will be described provides a novel an interactive way of listening to flamenco music by enabling the user to select or emphasize audio elements at will. Also, the scheme for the interactive generation of flamenco music that will be presented allows the user to play and interact with flamenco music by means of a user friendly interface implemented for iOS devices.