def threeDimBoth(): from music21.musicxml.testFiles import mozartTrioK581Excerpt # @UnresolvedImport from music21.humdrum import testFiles as kernTest mozartStream = converter.parse(mozartTrioK581Excerpt) g = graph.Plot3DBarsPitchSpaceQuarterLength(mozartStream.flat) g.process() chopinStream = converter.parse(kernTest.mazurka6) g = graph.Plot3DBarsPitchSpaceQuarterLength(chopinStream.flat) g.process()
def demoGraphMozartChopin(): from music21.musicxml import testFiles as xmlTest from music21.humdrum import testFiles as kernTest dpi = 300 mozartStream = converter.parse(xmlTest.mozartTrioK581Excerpt) # @UndefinedVariable g = graph.Plot3DBarsPitchSpaceQuarterLength(mozartStream.stripTies(), dpi=dpi, title='Mozart Trio K. 581, Excerpt', colors=['#CD4F39'], alpha=.8) g.process() chopinStream = converter.parse(kernTest.mazurka6) g = graph.Plot3DBarsPitchSpaceQuarterLength(chopinStream.stripTies(), dpi=dpi, title='Chopin Mazurka 6, Excerpt', colors=['#6495ED'], alpha=.8) g.process()
def pitchQuarterLengthUsage3D(show=True): from music21.musicxml import testFiles as xml from music21.humdrum import testFiles as kern mozartStream = converter.parse( xml.mozartTrioK581Excerpt) # @UndefinedVariable g = graph.Plot3DBarsPitchSpaceQuarterLength(mozartStream.flat.stripTies(), colors=['r']) g.process() chopinStream = converter.parse(kern.mazurka6) g = graph.Plot3DBarsPitchSpaceQuarterLength(chopinStream.flat.stripTies(), colors=['b']) g.process()
def threeDimChopin(): from music21.humdrum import testFiles streamObject = converter.parse(testFiles.mazurka6) stream2 = streamObject.stripTies() g = graph.Plot3DBarsPitchSpaceQuarterLength(stream2) g.process()
def threeDimMozart(): from music21.musicxml.testFiles import mozartTrioK581Excerpt # @UnresolvedImport streamObject = converter.parse(mozartTrioK581Excerpt) # # stream2 = streamObject.stripTies() # adds one outlier that makes the graph difficult to read g = graph.Plot3DBarsPitchSpaceQuarterLength(streamObject.flat) g.process()
def threeDimChopin(): from music21.humdrum import testFiles streamObject = converter.parse(testFiles.mazurka6) # n1 = music21.note.Note("C7") # n1.duration.quarterLength = 3 # n1.tie = music21.note.Tie("start") # streamObject.append(n1) # # n2 = music21.note.Note("C7") # n2.duration.quarterLength = 3 # n2.tie = music21.note.Tie("stop") # streamObject.append(n2) stream2 = streamObject.stripTies() g = graph.Plot3DBarsPitchSpaceQuarterLength(stream2) g.process()
def pitchToNoteLength(): ''' get a quick 3D image of the relationship between pitch and notelength in trecento ballata cadences ''' allStream = stream.Stream() b = cadencebook.BallataSheet() for work in b: for snippet in work.snippets: if snippet is None: continue for thisStream in snippet.streams: allStream.append(thisStream) #c = music21.analysis.correlate.NoteAnalysis(allStream.flat) #c.noteAttributeCount() g = graph.Plot3DBarsPitchSpaceQuarterLength(allStream.flat) g.process()