MELODIC FUNCTION AND MODAL PROCESS IN GREGORIAN CHANT