New algorithm to select tenor and alto notes according to harmony rules