main[popsize_,popsurvive_,probabilityOfAll_,inputChords_,maxgap_,mainkey_,speed_,generations_]:=Module[{population=NestList[geneticAlg[fitnessFunction,#,crossover,mutation,popsize,probabilityOfAll,popsurvive,2,4,maxgap,{0,1,2,3,4,5,6,7,8,9,10,11,12},probabilityOfAll,probabilityOfAll,probabilityOfAll,probabilityOfAll,probabilityOfAll,probabilityOfAll,probabilityOfAll,{0,1,2,3,4},{inputChords[;;;;2],inputChords[2;;;;2]},mainkey]&,initialPop[{0,1,2,3,4,5,6,7,8,9,10,11,12},{0,1,2,3,4}],generations]},population[[-1]][[All,2]]/=speed;Sound[SoundNote@@@Transpose[population[[-1,-1]]]]]