Canon-generator: algorithmic composition using music21 and python Written by Stefaan Himpe - 2013
Code available under GPLv3.
Simple tonal canon generator. The main function contains some parameters that can be edited by the user (for now, no UI/command line options available).
chords = "C F Am Dm G C" #You can insert a new chord progression here.
scale = music21.scale.MajorScale("C") #You can define a new scale in which the notes of the chords should be interpreted here
voices = 5 #Define the number of voices in your canon here
quarterLength = 2 #Define the length of the notes used to realize the chord progression #(don't choose them too short, since the automatic spicing-up will make them shorter)
spice_depth = 1
stacking = 1
voice_transpositions = { VOICE1 : +12, VOICE2 : 0, VOICE3 : -12, VOICE4: -24, VOICE5: 0 }