Knowledge-based programming for music research