Skip to content

Instantly share code, notes, and snippets.

@kroger
Created February 17, 2012 02:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kroger/1849934 to your computer and use it in GitHub Desktop.
Save kroger/1849934 to your computer and use it in GitHub Desktop.
Test Contour on music21
notes1 = tinyNotation.TinyNotationStream("c4 d8 f g16 a g f#", "3/4")
notes2 = tinyNotation.TinyNotationStream("g4 a8 b c16 a b c#", "3/4")
c1 = contour.Contour(notes1)
c2 = contour.Contour(notes2)
c3 = contour.Contour([0, 3, 1, 2])
bach = corpus.parseWork('bach/bwv295')
soprano = bach.parts[0].flat.notes
c4 = contour.Contour(soprano)
print c1, c2, c3
print c4
print c1 + c2 + c3
print c1.rotation(2) + c2.rotation(3)
print c1.plot()
print c1.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment