Various tools and utilities to find correlations between disparate objects in a Stream.
See the chapter Overview: Importing File and Data Formats for more information and examples of converting formats into and out of music21.
Given a Stream, find if one object is active while another is also active.
Plotting routines to graph the output of dedicated methods in this class are available.
Sample output is as follows:
Create an analysis of pitch to dynamic symbol.
If dataPoints is True, all data matches between source and destination are returned. If False, 3 point weighted coordinates are created for each unique match.
No dynamics here.
>>> s = corpus.parse('bach/bwv8.6.xml') >>> am = analysis.correlate.ActivityMatch(s.parts.flat) >>> am.pitchToDynamic() Traceback (most recent call last): CorrelateException: cannot create correlation an object that is not found in the Stream: <class 'music21.dynamics.Dynamic'>
>>> s = corpus.parse('schoenberg') >>> am = analysis.correlate.ActivityMatch(s.parts.flat) >>> data = am.pitchToDynamic() >>> len(data) 39 >>> data [83.0, 7]