Table Of Contents

Previous topic

music21.features.jSymbolic

Next topic

music21.graph

music21.features.native

Original music21 feature extractors.

ComposerPopularity

Inherits from: FeatureExtractor

class music21.features.native.ComposerPopularity(dataOrStream=None, *arguments, **keywords)

composer’s popularity today, as measured by the number of Google search results (log-10)

>>> from music21 import *
>>> s = corpus.parse('mozart/k155', 2)
>>> fe = features.native.ComposerPopularity(s)
>>> fe.extract().vector
[7...]

ComposerPopularity attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

ComposerPopularity methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

DiminishedSeventhSimultaneityPrevalence

Inherits from: FeatureExtractor

class music21.features.native.DiminishedSeventhSimultaneityPrevalence(dataOrStream=None, *arguments, **keywords)

Percentage of all simultaneities that are diminished seventh chords.

>>> from music21 import *
>>> s = corpus.parse('hwv56/movement3-05.md')
>>> fe = features.native.DiminishedSeventhSimultaneityPrevalence(s)
>>> fe.extract().vector
[0.0]

DiminishedSeventhSimultaneityPrevalence attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

DiminishedSeventhSimultaneityPrevalence methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

DiminishedTriadSimultaneityPrevalence

Inherits from: FeatureExtractor

class music21.features.native.DiminishedTriadSimultaneityPrevalence(dataOrStream=None, *arguments, **keywords)

Percentage of all simultaneities that are diminished triads.

>>> from music21 import *
>>> s = corpus.parse('bwv66.6')
>>> fe = features.native.DiminishedTriadSimultaneityPrevalence(s)
>>> fe.extract().vector
[0.020408163265...]

DiminishedTriadSimultaneityPrevalence attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

DiminishedTriadSimultaneityPrevalence methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

DominantSeventhSimultaneityPrevalence

Inherits from: FeatureExtractor

class music21.features.native.DominantSeventhSimultaneityPrevalence(dataOrStream=None, *arguments, **keywords)

Percentage of all simultaneities that are dominant seventh.

>>> from music21 import *
>>> s = corpus.parse('hwv56/movement3-05.md')
>>> fe = features.native.DominantSeventhSimultaneityPrevalence(s)
>>> fe.extract().vector
[0.0]

DominantSeventhSimultaneityPrevalence attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

DominantSeventhSimultaneityPrevalence methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

FirstBeatAttackPrevalence

Inherits from: FeatureExtractor

class music21.features.native.FirstBeatAttackPrevalence(dataOrStream=None, *arguments, **keywords)
>>> from music21 import *
>>> s = corpus.parse('hwv56/movement3-05.md')
>>> fe = features.native.FirstBeatAttackPrevalence(s)

FirstBeatAttackPrevalence attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

FirstBeatAttackPrevalence methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

IncorrectlySpelledTriadPrevalence

Inherits from: FeatureExtractor

class music21.features.native.IncorrectlySpelledTriadPrevalence(dataOrStream=None, *arguments, **keywords)

Percentage of all triads that are spelled incorrectly. example: Mozart k155 movement 2 has a single instance of an incorrectly spelled triad (m. 17, where the C# of an A-major chord has a lower neighbor B# thus temporarily creating an incorrectly spelled A-minor chord). We would expect highly chromatic music such as Reger or Wagner to have a higher percentage, or automatically rendered MIDI transcriptions (which don’t distinguish between D# and Eb). (Aside to Mozart experts: shouldn’t m. 18 beat 2 also be B#? seems a mistake in most editions... – it doesn’t alter this analysis though since the A and E in the bass are gone)

>>> from music21 import *
>>> s = corpus.parse('mozart/k155', 2)
>>> fe = features.native.IncorrectlySpelledTriadPrevalence(s)
>>> fe.extract().vector
[0.00775...]

IncorrectlySpelledTriadPrevalence attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

IncorrectlySpelledTriadPrevalence methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

LandiniCadence

Inherits from: FeatureExtractor

class music21.features.native.LandiniCadence(dataOrStream=None, *arguments, **keywords)

Return a bolean if one or more Parts end with a Landini-like cadential figure.

>>> from music21 import *

LandiniCadence attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

LandiniCadence methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

MajorTriadSimultaneityPrevalence

Inherits from: FeatureExtractor

class music21.features.native.MajorTriadSimultaneityPrevalence(dataOrStream=None, *arguments, **keywords)

Percentage of all simultaneities that are major triads.

>>> from music21 import *
>>> s = corpus.parse('hwv56/movement3-05.md')
>>> fe = features.native.MajorTriadSimultaneityPrevalence(s)
>>> fe.extract().vector
[0.1666666666...]

MajorTriadSimultaneityPrevalence attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

MajorTriadSimultaneityPrevalence methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

MinorTriadSimultaneityPrevalence

Inherits from: FeatureExtractor

class music21.features.native.MinorTriadSimultaneityPrevalence(dataOrStream=None, *arguments, **keywords)

Percentage of all simultaneities that are minor triads.

>>> from music21 import *
>>> s = corpus.parse('hwv56/movement3-05.md')
>>> fe = features.native.MinorTriadSimultaneityPrevalence(s)
>>> fe.extract().vector # same as major in this work
[0.1666666666...]

MinorTriadSimultaneityPrevalence attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

MinorTriadSimultaneityPrevalence methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

MostCommonNoteQuarterLength

Inherits from: FeatureExtractor

class music21.features.native.MostCommonNoteQuarterLength(dataOrStream=None, *arguments, **keywords)
>>> from music21 import *
>>> s = corpus.parse('hwv56/movement3-05.md')
>>> fe = features.native.MostCommonNoteQuarterLength(s)
>>> fe.extract().vector
[0.5]

MostCommonNoteQuarterLength attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

MostCommonNoteQuarterLength methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

MostCommonNoteQuarterLengthPrevalence

Inherits from: FeatureExtractor

class music21.features.native.MostCommonNoteQuarterLengthPrevalence(dataOrStream=None, *arguments, **keywords)
>>> from music21 import *
>>> s = corpus.parse('hwv56/movement3-05.md')
>>> fe = features.native.MostCommonNoteQuarterLengthPrevalence(s)
>>> fe.extract().vector
[0.533333...]

MostCommonNoteQuarterLengthPrevalence attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

MostCommonNoteQuarterLengthPrevalence methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

MostCommonPitchClassSetSimultaneityPrevalence

Inherits from: FeatureExtractor

class music21.features.native.MostCommonPitchClassSetSimultaneityPrevalence(dataOrStream=None, *arguments, **keywords)

Fraction of all pitch class simultaneities that are the most common simultaneity.

>>> from music21 import *
>>> s = corpus.parse('hwv56/movement3-05.md')
>>> fe = features.native.MostCommonPitchClassSetSimultaneityPrevalence(s)
>>> fe.extract().vector
[0.166666666...]

MostCommonPitchClassSetSimultaneityPrevalence attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

MostCommonPitchClassSetSimultaneityPrevalence methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

MostCommonSetClassSimultaneityPrevalence

Inherits from: FeatureExtractor

class music21.features.native.MostCommonSetClassSimultaneityPrevalence(dataOrStream=None, *arguments, **keywords)

Fraction of all set class simultaneities that are the most common simultaneity.

>>> from music21 import *
>>> s = corpus.parse('hwv56/movement3-05.md')
>>> fe = features.native.MostCommonSetClassSimultaneityPrevalence(s)
>>> fe.extract().vector
[0.2916...]
>>> s2 = corpus.parse('schoenberg/opus19', 6)
>>> fe2 = features.native.MostCommonSetClassSimultaneityPrevalence(s2)
>>> fe2.extract().vector
[0.3846...]

MostCommonSetClassSimultaneityPrevalence attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

MostCommonSetClassSimultaneityPrevalence methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

QualityFeature

Inherits from: FeatureExtractor

class music21.features.native.QualityFeature(dataOrStream=None, *arguments, **keywords)

Extends the jSymbolic QualityFeature to automatically find mode Set to 0 if the key signature indicates that a recording is major, set to 1 if it indicates that it is minor. A Music21 addition: if no key mode is found in the piece, analyze the piece to discover what mode it is most likely in.

Example: Mozart k155, mvmt 2 (musicxml) is explicitly encoded as being in Major:

>>> from music21 import *
>>> mozart155mvmt2 = corpus.parse('mozart/k155', 2)
>>> fe = features.native.QualityFeature(mozart155mvmt2)
>>> f = fe.extract()
>>> f.vector
[0]

now we will try it with the last movement of Schoenberg’s opus 19 which has no mode explicitly encoded in the musicxml but which our analysis routines believe (having very little to go on) fits the profile of e-minor best.

>>> schoenberg19mvmt6= corpus.parse('schoenberg/opus19', 6)
>>> fe2 = features.native.QualityFeature(schoenberg19mvmt6)
>>> f2 = fe2.extract()
>>> f2.vector
[1]

QualityFeature attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

QualityFeature methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

RangeOfNoteQuarterLengths

Inherits from: FeatureExtractor

class music21.features.native.RangeOfNoteQuarterLengths(dataOrStream=None, *arguments, **keywords)

Difference between the longest and shortest quarter lengths.

>>> from music21 import *
>>> s = corpus.parse('hwv56/movement3-05.md')
>>> fe = features.native.RangeOfNoteQuarterLengths(s)
>>> fe.extract().vector
[3.75]

RangeOfNoteQuarterLengths attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

RangeOfNoteQuarterLengths methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

TriadSimultaneityPrevalence

Inherits from: FeatureExtractor

class music21.features.native.TriadSimultaneityPrevalence(dataOrStream=None, *arguments, **keywords)

Gives the proportion of all simultaneities which form triads (major, minor, diminished, or augmented)

>>> from music21 import *
>>> s = corpus.parse('bwv66.6')
>>> fe = features.native.TriadSimultaneityPrevalence(s)
>>> fe.extract().vector
[0.7142857142...]
>>> s2 = corpus.parse('schoenberg/opus19', 2)
>>> fe2 = features.native.TriadSimultaneityPrevalence(s2)
>>> fe2.extract().vector
[0.04...]

TriadSimultaneityPrevalence attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

TriadSimultaneityPrevalence methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

UniqueNoteQuarterLengths

Inherits from: FeatureExtractor

class music21.features.native.UniqueNoteQuarterLengths(dataOrStream=None, *arguments, **keywords)
>>> from music21 import *
>>> s = corpus.parse('hwv56/movement3-05.md')
>>> fe = features.native.UniqueNoteQuarterLengths(s)
>>> fe.extract().vector
[7]

UniqueNoteQuarterLengths attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

UniqueNoteQuarterLengths methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

UniquePitchClassSetSimultaneities

Inherits from: FeatureExtractor

class music21.features.native.UniquePitchClassSetSimultaneities(dataOrStream=None, *arguments, **keywords)

Number of unique pitch class simultaneities.

>>> from music21 import *
>>> s = corpus.parse('hwv56/movement3-05.md')
>>> fe = features.native.UniquePitchClassSetSimultaneities(s)
>>> fe.extract().vector
[15]

UniquePitchClassSetSimultaneities attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

UniquePitchClassSetSimultaneities methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()

UniqueSetClassSimultaneities

Inherits from: FeatureExtractor

class music21.features.native.UniqueSetClassSimultaneities(dataOrStream=None, *arguments, **keywords)

Number of unique set class simultaneities.

>>> from music21 import *
>>> s = corpus.parse('hwv56/movement3-05.md')
>>> fe = features.native.UniqueSetClassSimultaneities(s)
>>> fe.extract().vector
[7]

UniqueSetClassSimultaneities attributes

Attributes without Documentation: id

Attributes inherited from FeatureExtractor: normalize, description, stream, discrete, dimensions, data, isSequential, name

UniqueSetClassSimultaneities methods

Methods inherited from FeatureExtractor: extract(), getAttributeLabels(), getBlankFeature(), setData()