Algorithms for electrophonic musical instruments or musical processing, e.g. for automatic composition or resource allocation