music21.features.jSymbolic
The features implemented here are based on those found in jSymbolic and
defined in Cory McKay’s MA Thesis, “Automatic Genre Classification of MIDI Recordings”
The LGPL jSymbolic system can be found here: http://jmir.sourceforge.net/jSymbolic.html
Functions
-
music21.features.jSymbolic.
getCompletionStats
()
>>> features.jSymbolic.getCompletionStats()
completion stats: 70/111 (0.6306...)
-
music21.features.jSymbolic.
getExtractorByTypeAndNumber
(extractorType, number)
Typical usage:
>>> t5 = features.jSymbolic.getExtractorByTypeAndNumber('T', 5)
>>> t5.__name__
'VoiceEqualityNoteDurationFeature'
>>> bachExample = corpus.parse('bach/bwv66.6')
>>> fe = t5(bachExample)
Features unimplemented in jSymbolic but documented in the dissertation return None
>>> features.jSymbolic.getExtractorByTypeAndNumber('C', 20) is None
True
Totally unknown features return an exception:
>>> features.jSymbolic.getExtractorByTypeAndNumber('L', 900)
Traceback (most recent call last):
music21.features.jSymbolic.JSymbolicFeatureException: Could not find
any jSymbolic features of type L
>>> features.jSymbolic.getExtractorByTypeAndNumber('C', 200)
Traceback (most recent call last):
music21.features.jSymbolic.JSymbolicFeatureException: jSymbolic
features of type C do not have number 200
You could also find all the feature extractors this way:
>>> fs = features.jSymbolic.extractorsById
>>> for k in fs:
... for i in range(len(fs[k])):
... if fs[k][i] is not None:
... n = fs[k][i].__name__
... if fs[k][i] not in features.jSymbolic.featureExtractors:
... n += " (not implemented)"
... print("%s %d %s" % (k, i, n))
D 1 OverallDynamicRangeFeature (not implemented)
D 2 VariationOfDynamicsFeature (not implemented)
D 3 VariationOfDynamicsInEachVoiceFeature (not implemented)
D 4 AverageNoteToNoteDynamicsChangeFeature (not implemented)
I 1 PitchedInstrumentsPresentFeature
I 2 UnpitchedInstrumentsPresentFeature (not implemented)
I 3 NotePrevalenceOfPitchedInstrumentsFeature
I 4 NotePrevalenceOfUnpitchedInstrumentsFeature (not implemented)
I 5 TimePrevalenceOfPitchedInstrumentsFeature (not implemented)
I 6 VariabilityOfNotePrevalenceOfPitchedInstrumentsFeature
I 7 VariabilityOfNotePrevalenceOfUnpitchedInstrumentsFeature (not implemented)
I 8 NumberOfPitchedInstrumentsFeature
I 9 NumberOfUnpitchedInstrumentsFeature (not implemented)
I 10 PercussionPrevalenceFeature (not implemented)
I 11 StringKeyboardFractionFeature
I 12 AcousticGuitarFractionFeature
I 13 ElectricGuitarFractionFeature
I 14 ViolinFractionFeature
I 15 SaxophoneFractionFeature
I 16 BrassFractionFeature
I 17 WoodwindsFractionFeature
I 18 OrchestralStringsFractionFeature
I 19 StringEnsembleFractionFeature
I 20 ElectricInstrumentFractionFeature
M 1 MelodicIntervalHistogramFeature
M 2 AverageMelodicIntervalFeature
M 3 MostCommonMelodicIntervalFeature
M 4 DistanceBetweenMostCommonMelodicIntervalsFeature
M 5 MostCommonMelodicIntervalPrevalenceFeature
M 6 RelativeStrengthOfMostCommonIntervalsFeature
M 7 NumberOfCommonMelodicIntervalsFeature
M 8 AmountOfArpeggiationFeature
M 9 RepeatedNotesFeature
M 10 ChromaticMotionFeature
M 11 StepwiseMotionFeature
M 12 MelodicThirdsFeature
M 13 MelodicFifthsFeature
M 14 MelodicTritonesFeature
M 15 MelodicOctavesFeature
M 17 DirectionOfMotionFeature
M 18 DurationOfMelodicArcsFeature
M 19 SizeOfMelodicArcsFeature
P 1 MostCommonPitchPrevalenceFeature
P 2 MostCommonPitchClassPrevalenceFeature
P 3 RelativeStrengthOfTopPitchesFeature
P 4 RelativeStrengthOfTopPitchClassesFeature
P 5 IntervalBetweenStrongestPitchesFeature
P 6 IntervalBetweenStrongestPitchClassesFeature
P 7 NumberOfCommonPitchesFeature
P 8 PitchVarietyFeature
P 9 PitchClassVarietyFeature
P 10 RangeFeature
P 11 MostCommonPitchFeature
P 12 PrimaryRegisterFeature
P 13 ImportanceOfBassRegisterFeature
P 14 ImportanceOfMiddleRegisterFeature
P 15 ImportanceOfHighRegisterFeature
P 16 MostCommonPitchClassFeature
P 17 DominantSpreadFeature (not implemented)
P 18 StrongTonalCentresFeature (not implemented)
P 19 BasicPitchHistogramFeature
P 20 PitchClassDistributionFeature
P 21 FifthsPitchHistogramFeature
P 22 QualityFeature
P 23 GlissandoPrevalenceFeature (not implemented)
P 24 AverageRangeOfGlissandosFeature (not implemented)
P 25 VibratoPrevalenceFeature (not implemented)
R 1 StrongestRhythmicPulseFeature (not implemented)
R 2 SecondStrongestRhythmicPulseFeature (not implemented)
R 3 HarmonicityOfTwoStrongestRhythmicPulsesFeature (not implemented)
R 4 StrengthOfStrongestRhythmicPulseFeature (not implemented)
R 5 StrengthOfSecondStrongestRhythmicPulseFeature (not implemented)
R 6 StrengthRatioOfTwoStrongestRhythmicPulsesFeature (not implemented)
R 7 CombinedStrengthOfTwoStrongestRhythmicPulsesFeature (not implemented)
R 8 NumberOfStrongPulsesFeature (not implemented)
R 9 NumberOfModeratePulsesFeature (not implemented)
R 10 NumberOfRelativelyStrongPulsesFeature (not implemented)
R 11 RhythmicLoosenessFeature (not implemented)
R 12 PolyrhythmsFeature (not implemented)
R 13 RhythmicVariabilityFeature (not implemented)
R 14 BeatHistogramFeature (not implemented)
R 15 NoteDensityFeature
R 17 AverageNoteDurationFeature
R 18 VariabilityOfNoteDurationFeature (not implemented)
R 19 MaximumNoteDurationFeature
R 20 MinimumNoteDurationFeature
R 21 StaccatoIncidenceFeature
R 22 AverageTimeBetweenAttacksFeature
R 23 VariabilityOfTimeBetweenAttacksFeature
R 24 AverageTimeBetweenAttacksForEachVoiceFeature
R 25 AverageVariabilityOfTimeBetweenAttacksForEachVoiceFeature
R 30 InitialTempoFeature
R 31 InitialTimeSignatureFeature
R 32 CompoundOrSimpleMeterFeature
R 33 TripleMeterFeature
R 34 QuintupleMeterFeature
R 35 ChangesOfMeterFeature
T 1 MaximumNumberOfIndependentVoicesFeature
T 2 AverageNumberOfIndependentVoicesFeature
T 3 VariabilityOfNumberOfIndependentVoicesFeature
T 4 VoiceEqualityNumberOfNotesFeature (not implemented)
T 5 VoiceEqualityNoteDurationFeature (not implemented)
T 6 VoiceEqualityDynamicsFeature (not implemented)
T 7 VoiceEqualityMelodicLeapsFeature (not implemented)
T 8 VoiceEqualityRangeFeature (not implemented)
T 9 ImportanceOfLoudestVoiceFeature (not implemented)
T 10 RelativeRangeOfLoudestVoiceFeature (not implemented)
T 12 RangeOfHighestLineFeature (not implemented)
T 13 RelativeNoteDensityOfHighestLineFeature (not implemented)
T 15 MelodicIntervalsInLowestLineFeature (not implemented)
T 20 VoiceSeparationFeature (not implemented)
AcousticGuitarFractionFeature
-
class
music21.features.jSymbolic.
AcousticGuitarFractionFeature
(dataOrStream=None, *arguments, **keywords)
A feature exractor that extracts the fraction of all Note Ons belonging to
acoustic guitar patches (General MIDI patches 25 and 26).
>>> s1 = stream.Stream()
>>> s1.append(instrument.AcousticGuitar())
>>> s1.repeatAppend(note.Note(), 3)
>>> s1.append(instrument.Tuba())
>>> s1.append(note.Note())
>>> fe = features.jSymbolic.AcousticGuitarFractionFeature(s1)
>>> fe.extract().vector
[0.75]
AcousticGuitarFractionFeature
bases
AcousticGuitarFractionFeature
methods
Methods inherited from FeatureExtractor
:
AmountOfArpeggiationFeature
-
class
music21.features.jSymbolic.
AmountOfArpeggiationFeature
(dataOrStream=None, *arguments, **keywords)
Fraction of horizontal intervals that are repeated notes, minor thirds, major thirds,
perfect fifths, minor sevenths, major sevenths, octaves, minor tenths or major tenths.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.AmountOfArpeggiationFeature(s)
>>> f = fe.extract()
>>> f.name
'Amount of Arpeggiation'
>>> f.vector
[0.333...]
AmountOfArpeggiationFeature
bases
AmountOfArpeggiationFeature
methods
Methods inherited from FeatureExtractor
:
AverageMelodicIntervalFeature
-
class
music21.features.jSymbolic.
AverageMelodicIntervalFeature
(dataOrStream=None, *arguments, **keywords)
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.AverageMelodicIntervalFeature(s)
>>> f = fe.extract()
>>> f.vector
[2.44...]
AverageMelodicIntervalFeature
bases
AverageMelodicIntervalFeature
methods
Methods inherited from FeatureExtractor
:
AverageNoteDurationFeature
-
class
music21.features.jSymbolic.
AverageNoteDurationFeature
(dataOrStream=None, *arguments, **keywords)
Average duration of notes in seconds.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.AverageNoteDurationFeature(s)
>>> f = fe.extract()
>>> f.vector
[0.441717...]
>>> s.insert(0, tempo.MetronomeMark(number=240))
>>> fe = features.jSymbolic.AverageNoteDurationFeature(s)
>>> f = fe.extract()
>>> f.vector
[0.220858...]
AverageNoteDurationFeature
bases
AverageNoteDurationFeature
methods
Methods inherited from FeatureExtractor
:
AverageNumberOfIndependentVoicesFeature
-
class
music21.features.jSymbolic.
AverageNumberOfIndependentVoicesFeature
(dataOrStream=None, *arguments, **keywords)
Average number of different channels in which notes have sounded simultaneously.
Rests are not included in this calculation. Here, Parts are treated as voices
>>> s = corpus.parse('handel/rinaldo/lascia_chio_pianga')
>>> fe = features.jSymbolic.AverageNumberOfIndependentVoicesFeature(s)
>>> f = fe.extract()
>>> f.vector
[2.1...]
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.AverageNumberOfIndependentVoicesFeature(s)
>>> f = fe.extract()
>>> f.vector
[3.96...]
AverageNumberOfIndependentVoicesFeature
bases
AverageNumberOfIndependentVoicesFeature
methods
Methods inherited from FeatureExtractor
:
AverageRangeOfGlissandosFeature
-
class
music21.features.jSymbolic.
AverageRangeOfGlissandosFeature
(dataOrStream=None, *arguments, **keywords)
Not yet implemented in music21
Average range of MIDI Pitch Bends, where “range” is defined
as the greatest value of the absolute difference between 64 and the
second data byte of all MIDI Pitch Bend messages falling between the
Note On and Note Off messages of any note
AverageRangeOfGlissandosFeature
bases
AverageRangeOfGlissandosFeature
methods
Methods inherited from FeatureExtractor
:
AverageTimeBetweenAttacksFeature
-
class
music21.features.jSymbolic.
AverageTimeBetweenAttacksFeature
(dataOrStream=None, *arguments, **keywords)
Average time in seconds between Note On events (regardless of channel).
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.AverageTimeBetweenAttacksFeature(s)
>>> f = fe.extract()
>>> print(round(f.vector[0], 2))
0.35
AverageTimeBetweenAttacksFeature
bases
AverageTimeBetweenAttacksFeature
methods
Methods inherited from FeatureExtractor
:
AverageTimeBetweenAttacksForEachVoiceFeature
-
class
music21.features.jSymbolic.
AverageTimeBetweenAttacksForEachVoiceFeature
(dataOrStream=None, *arguments, **keywords)
Average of average times in seconds between Note On events on individual channels
that contain at least one note.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.AverageTimeBetweenAttacksForEachVoiceFeature(s)
>>> f = fe.extract()
>>> f.vector
[0.4428...]
AverageTimeBetweenAttacksForEachVoiceFeature
bases
AverageTimeBetweenAttacksForEachVoiceFeature
methods
Methods inherited from FeatureExtractor
:
AverageVariabilityOfTimeBetweenAttacksForEachVoiceFeature
-
class
music21.features.jSymbolic.
AverageVariabilityOfTimeBetweenAttacksForEachVoiceFeature
(dataOrStream=None, *arguments, **keywords)
Average standard deviation, in seconds, of time between Note On events on individual
channels that contain at least one note.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.AverageVariabilityOfTimeBetweenAttacksForEachVoiceFeature(s)
>>> f = fe.extract()
>>> f.vector
[0.1773926...]
AverageVariabilityOfTimeBetweenAttacksForEachVoiceFeature
bases
AverageVariabilityOfTimeBetweenAttacksForEachVoiceFeature
methods
Methods inherited from FeatureExtractor
:
BasicPitchHistogramFeature
-
class
music21.features.jSymbolic.
BasicPitchHistogramFeature
(dataOrStream=None, *arguments, **keywords)
A feature exractor that finds a features array with bins corresponding
to the values of the basic pitch histogram.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.BasicPitchHistogramFeature(s)
>>> f = fe.extract()
>>> f.vector
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.052631578..., 0.0, 0.0, 0.052631578...,
0.05263157894..., 0.2631578..., 0.0, 0.3157894..., 0.1052631...,
0.0, 0.052631..., 0.157894736..., 0.5263157..., 0.0, 0.368421052...,
0.6315789473..., 0.105263157..., 0.78947368..., 0.0, 1.0, 0.52631578...,
0.052631578..., 0.736842105..., 0.1578947..., 0.9473684..., 0.0,
0.36842105..., 0.47368421..., 0.0, 0.42105263..., 0.0, 0.36842105...,
0.0, 0.0, 0.052631578...,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
TODO: Better doctest...
BasicPitchHistogramFeature
bases
BasicPitchHistogramFeature
methods
Methods inherited from FeatureExtractor
:
BeatHistogramFeature
-
class
music21.features.jSymbolic.
BeatHistogramFeature
(dataOrStream=None, *arguments, **keywords)
Not yet implemented
A feature exractor that finds a feature array with entries corresponding to the frequency
values of each of the bins of the beat histogram (except the first 40 empty ones).
BeatHistogramFeature
bases
BeatHistogramFeature
methods
Methods inherited from FeatureExtractor
:
BrassFractionFeature
-
class
music21.features.jSymbolic.
BrassFractionFeature
(dataOrStream=None, *arguments, **keywords)
A feature exractor that extracts the fraction of all Note Ons
belonging to brass patches (General MIDI patches 57 through 68).
TODO: Conflict in source: only does 57-62?
>>> s1 = stream.Stream()
>>> s1.append(instrument.SopranoSaxophone())
>>> s1.repeatAppend(note.Note(), 6)
>>> s1.append(instrument.Tuba())
>>> s1.repeatAppend(note.Note(), 4)
>>> fe = features.jSymbolic.BrassFractionFeature(s1)
>>> print(fe.extract().vector[0])
0.4
BrassFractionFeature
bases
BrassFractionFeature
methods
Methods inherited from FeatureExtractor
:
ChangesOfMeterFeature
-
class
music21.features.jSymbolic.
ChangesOfMeterFeature
(dataOrStream=None, *arguments, **keywords)
A feature exractor that sets the feature to 1 if the time signature
is changed one or more times during the recording.
>>> s1 = stream.Stream()
>>> s1.append(meter.TimeSignature('3/4'))
>>> s2 = stream.Stream()
>>> s2.append(meter.TimeSignature('3/4'))
>>> s2.append(meter.TimeSignature('4/4'))
>>> fe = features.jSymbolic.ChangesOfMeterFeature(s1)
>>> fe.extract().vector
[0]
>>> fe.setData(s2) # change the data
>>> fe.extract().vector
[1]
ChangesOfMeterFeature
bases
ChangesOfMeterFeature
methods
Methods inherited from FeatureExtractor
:
CompoundOrSimpleMeterFeature
-
class
music21.features.jSymbolic.
CompoundOrSimpleMeterFeature
(dataOrStream=None, *arguments, **keywords)
Set to 1 if the initial meter is compound (numerator of time signature
is greater than or equal to 6 and is evenly divisible by 3) and to 0 if it is simple
(if the above condition is not fulfilled).
>>> s1 = stream.Stream()
>>> s1.append(meter.TimeSignature('3/4'))
>>> s2 = stream.Stream()
>>> s2.append(meter.TimeSignature('9/8'))
>>> fe = features.jSymbolic.CompoundOrSimpleMeterFeature(s1)
>>> fe.extract().vector
[0]
>>> fe.setData(s2) # change the data
>>> fe.extract().vector
[1]
CompoundOrSimpleMeterFeature
bases
CompoundOrSimpleMeterFeature
methods
Methods inherited from FeatureExtractor
:
DirectionOfMotionFeature
-
class
music21.features.jSymbolic.
DirectionOfMotionFeature
(dataOrStream=None, *arguments, **keywords)
Returns the fraction of melodic intervals that are rising rather than falling.
Unisons are omitted.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.DirectionOfMotionFeature(s)
>>> f = fe.extract()
>>> f.vector
[0.47...]
DirectionOfMotionFeature
bases
DirectionOfMotionFeature
methods
Methods inherited from FeatureExtractor
:
DominantSpreadFeature
-
class
music21.features.jSymbolic.
DominantSpreadFeature
(dataOrStream=None, *arguments, **keywords)
Largest number of consecutive pitch classes separated by perfect
5ths that accounted for at least 9% each of the notes.
DominantSpreadFeature
bases
DominantSpreadFeature
methods
Methods inherited from FeatureExtractor
:
DurationFeature
-
class
music21.features.jSymbolic.
DurationFeature
(dataOrStream=None, *arguments, **keywords)
A feature extractor that extracts the duration in seconds.
DurationFeature
bases
DurationFeature
methods
Methods inherited from FeatureExtractor
:
DurationOfMelodicArcsFeature
-
class
music21.features.jSymbolic.
DurationOfMelodicArcsFeature
(dataOrStream=None, *arguments, **keywords)
Average number of notes that separate melodic peaks and troughs in any channel.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.DurationOfMelodicArcsFeature(s)
>>> f = fe.extract()
>>> f.vector
[10.28...]
DurationOfMelodicArcsFeature
bases
DurationOfMelodicArcsFeature
methods
Methods inherited from FeatureExtractor
:
ElectricGuitarFractionFeature
-
class
music21.features.jSymbolic.
ElectricGuitarFractionFeature
(dataOrStream=None, *arguments, **keywords)
>>> s1 = stream.Stream()
>>> s1.append(instrument.ElectricGuitar())
>>> s1.repeatAppend(note.Note(), 4)
>>> s1.append(instrument.Tuba())
>>> s1.repeatAppend(note.Note(), 4)
>>> fe = features.jSymbolic.ElectricGuitarFractionFeature(s1)
>>> fe.extract().vector
[0.5]
ElectricGuitarFractionFeature
bases
ElectricGuitarFractionFeature
methods
Methods inherited from FeatureExtractor
:
ElectricInstrumentFractionFeature
-
class
music21.features.jSymbolic.
ElectricInstrumentFractionFeature
(dataOrStream=None, *arguments, **keywords)
>>> s1 = stream.Stream()
>>> s1.append(instrument.ElectricOrgan())
>>> s1.repeatAppend(note.Note(), 8)
>>> s1.append(instrument.Tuba())
>>> s1.repeatAppend(note.Note(), 2)
>>> fe = features.jSymbolic.ElectricInstrumentFractionFeature(s1)
>>> print(fe.extract().vector[0])
0.8
ElectricInstrumentFractionFeature
bases
ElectricInstrumentFractionFeature
methods
Methods inherited from FeatureExtractor
:
FifthsPitchHistogramFeature
-
class
music21.features.jSymbolic.
FifthsPitchHistogramFeature
(dataOrStream=None, *arguments, **keywords)
A feature array with bins corresponding to the values of the 5ths pitch class histogram.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.FifthsPitchHistogramFeature(s)
>>> f = fe.extract()
>>> f.vector
[0.0, 0.0, 0.375, 0.6875, 0.5, 0.875, 0.90625, 1.0, 0.4375, 0.03125, 0.09375, 0.1875]
FifthsPitchHistogramFeature
bases
FifthsPitchHistogramFeature
methods
Methods inherited from FeatureExtractor
:
GlissandoPrevalenceFeature
-
class
music21.features.jSymbolic.
GlissandoPrevalenceFeature
(dataOrStream=None, *arguments, **keywords)
Not yet implemented in music21
Number of Note Ons that have at least one MIDI Pitch Bend associated
with them divided by total number of pitched Note Ons.
GlissandoPrevalenceFeature
bases
GlissandoPrevalenceFeature
methods
Methods inherited from FeatureExtractor
:
ImportanceOfBassRegisterFeature
-
class
music21.features.jSymbolic.
ImportanceOfBassRegisterFeature
(dataOrStream=None, *arguments, **keywords)
Fraction of Notes between MIDI pitches 0 and 54.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.ImportanceOfBassRegisterFeature(s)
>>> fe.extract().vector
[0.18...]
ImportanceOfBassRegisterFeature
bases
ImportanceOfBassRegisterFeature
methods
Methods inherited from FeatureExtractor
:
ImportanceOfHighRegisterFeature
-
class
music21.features.jSymbolic.
ImportanceOfHighRegisterFeature
(dataOrStream=None, *arguments, **keywords)
Fraction of Notes between MIDI pitches 73 and 127.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.ImportanceOfHighRegisterFeature(s)
>>> fe.extract().vector
[0.049...]
ImportanceOfHighRegisterFeature
bases
ImportanceOfHighRegisterFeature
methods
Methods inherited from FeatureExtractor
:
ImportanceOfMiddleRegisterFeature
-
class
music21.features.jSymbolic.
ImportanceOfMiddleRegisterFeature
(dataOrStream=None, *arguments, **keywords)
Fraction of Notes between MIDI pitches 55 and 72
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.ImportanceOfMiddleRegisterFeature(s)
>>> fe.extract().vector
[0.766...]
ImportanceOfMiddleRegisterFeature
bases
ImportanceOfMiddleRegisterFeature
methods
Methods inherited from FeatureExtractor
:
InitialTempoFeature
-
class
music21.features.jSymbolic.
InitialTempoFeature
(dataOrStream=None, *arguments, **keywords)
Tempo in beats per minute at the start of the recording.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.InitialTempoFeature(s)
>>> f = fe.extract()
>>> f.vector # a default
[120.0]
InitialTempoFeature
bases
InitialTempoFeature
methods
Methods inherited from FeatureExtractor
:
InitialTimeSignatureFeature
-
class
music21.features.jSymbolic.
InitialTimeSignatureFeature
(dataOrStream=None, *arguments, **keywords)
A feature array with two elements. The first is the numerator of the first occurring
time signature and the second is the denominator of the first occurring time signature.
Both are set to 0 if no time signature is present.
>>> s1 = stream.Stream()
>>> s1.append(meter.TimeSignature('3/4'))
>>> fe = features.jSymbolic.InitialTimeSignatureFeature(s1)
>>> fe.extract().vector
[3, 4]
InitialTimeSignatureFeature
bases
InitialTimeSignatureFeature
methods
Methods inherited from FeatureExtractor
:
InstrumentFractionFeature
-
class
music21.features.jSymbolic.
InstrumentFractionFeature
(dataOrStream=None, *arguments, **keywords)
This subclass is in-turn subclassed by all FeatureExtractors that
look at the proportional usage of an Insutrment
InstrumentFractionFeature
bases
InstrumentFractionFeature
methods
Methods inherited from FeatureExtractor
:
IntervalBetweenStrongestPitchesFeature
-
class
music21.features.jSymbolic.
IntervalBetweenStrongestPitchesFeature
(dataOrStream=None, *arguments, **keywords)
Absolute value of the difference between the pitches of the two most common MIDI pitches.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.IntervalBetweenStrongestPitchesFeature(s)
>>> fe.extract().vector
[5]
IntervalBetweenStrongestPitchesFeature
bases
IntervalBetweenStrongestPitchesFeature
methods
Methods inherited from FeatureExtractor
:
MaximumNoteDurationFeature
-
class
music21.features.jSymbolic.
MaximumNoteDurationFeature
(dataOrStream=None, *arguments, **keywords)
Duration of the longest note (in seconds).
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.MaximumNoteDurationFeature(s)
>>> f = fe.extract()
>>> f.vector
[1.0]
MaximumNoteDurationFeature
bases
MaximumNoteDurationFeature
methods
Methods inherited from FeatureExtractor
:
MaximumNumberOfIndependentVoicesFeature
-
class
music21.features.jSymbolic.
MaximumNumberOfIndependentVoicesFeature
(dataOrStream=None, *arguments, **keywords)
Maximum number of different channels in which notes have sounded simultaneously.
Here, Parts are treated as channels.
>>> s = corpus.parse('handel/rinaldo/lascia_chio_pianga')
>>> fe = features.jSymbolic.MaximumNumberOfIndependentVoicesFeature(s)
>>> f = fe.extract()
>>> f.vector
[3]
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.MaximumNumberOfIndependentVoicesFeature(s)
>>> f = fe.extract()
>>> f.vector
[4]
MaximumNumberOfIndependentVoicesFeature
bases
MaximumNumberOfIndependentVoicesFeature
methods
Methods inherited from FeatureExtractor
:
MelodicIntervalHistogramFeature
-
class
music21.features.jSymbolic.
MelodicIntervalHistogramFeature
(dataOrStream=None, *arguments, **keywords)
A features array with bins corresponding to the values of the melodic interval histogram.
128 dimensions
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.MelodicIntervalHistogramFeature(s)
>>> f = fe.extract()
>>> f.vector[0:5]
[0.14..., 0.22..., 0.36..., 0.06..., 0.05...]
MelodicIntervalHistogramFeature
bases
MelodicIntervalHistogramFeature
methods
Methods inherited from FeatureExtractor
:
MinimumNoteDurationFeature
-
class
music21.features.jSymbolic.
MinimumNoteDurationFeature
(dataOrStream=None, *arguments, **keywords)
Duration of the shortest note (in seconds).
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.MinimumNoteDurationFeature(s)
>>> f = fe.extract()
>>> f.vector
[0.25]
MinimumNoteDurationFeature
bases
MinimumNoteDurationFeature
methods
Methods inherited from FeatureExtractor
:
MostCommonMelodicIntervalPrevalenceFeature
-
class
music21.features.jSymbolic.
MostCommonMelodicIntervalPrevalenceFeature
(dataOrStream=None, *arguments, **keywords)
Fraction of melodic intervals that belong to the most common interval.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.MostCommonMelodicIntervalPrevalenceFeature(s)
>>> f = fe.extract()
>>> f.vector
[0.364...]
MostCommonMelodicIntervalPrevalenceFeature
bases
MostCommonMelodicIntervalPrevalenceFeature
methods
Methods inherited from FeatureExtractor
:
MostCommonPitchClassFeature
-
class
music21.features.jSymbolic.
MostCommonPitchClassFeature
(dataOrStream=None, *arguments, **keywords)
Bin label of the most common pitch class.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.MostCommonPitchClassFeature(s)
>>> fe.extract().vector
[1]
MostCommonPitchClassFeature
bases
MostCommonPitchClassFeature
methods
Methods inherited from FeatureExtractor
:
MostCommonPitchClassPrevalenceFeature
-
class
music21.features.jSymbolic.
MostCommonPitchClassPrevalenceFeature
(dataOrStream=None, *arguments, **keywords)
Fraction of Notes corresponding to the most common pitch class.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.MostCommonPitchClassPrevalenceFeature(s)
>>> fe.extract().vector
[0.19...]
MostCommonPitchClassPrevalenceFeature
bases
MostCommonPitchClassPrevalenceFeature
methods
Methods inherited from FeatureExtractor
:
MostCommonPitchFeature
-
class
music21.features.jSymbolic.
MostCommonPitchFeature
(dataOrStream=None, *arguments, **keywords)
Bin label of the most common pitch divided by the number of possible pitches.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.MostCommonPitchFeature(s)
>>> fe.extract().vector
[0.47...]
MostCommonPitchFeature
bases
MostCommonPitchFeature
methods
Methods inherited from FeatureExtractor
:
MostCommonPitchPrevalenceFeature
-
class
music21.features.jSymbolic.
MostCommonPitchPrevalenceFeature
(dataOrStream=None, *arguments, **keywords)
Fraction of Notes corresponding to the most common pitch.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.MostCommonPitchPrevalenceFeature(s)
>>> fe.extract().vector[0]
0.11...
MostCommonPitchPrevalenceFeature
bases
MostCommonPitchPrevalenceFeature
methods
Methods inherited from FeatureExtractor
:
NoteDensityFeature
-
class
music21.features.jSymbolic.
NoteDensityFeature
(dataOrStream=None, *arguments, **keywords)
Gives the Average number of notes per second, taking into account
the tempo at any moment in the piece. N.B. unlike the jSymbolic
version, music21’s Feature Extraction methods can run on a subset
of the entire piece (measures, certain parts, etc.). However, unlike
jSymbolic, music21 quantizes notes from midi somewhat before running
this test, so it is better run on encoded midi scores than recorded
midi performances.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.NoteDensityFeature(s)
>>> f = fe.extract()
>>> f.vector
[12.368421...]
NoteDensityFeature
bases
NoteDensityFeature
methods
Methods inherited from FeatureExtractor
:
NotePrevalenceOfPitchedInstrumentsFeature
-
class
music21.features.jSymbolic.
NotePrevalenceOfPitchedInstrumentsFeature
(dataOrStream=None, *arguments, **keywords)
>>> s1 = stream.Stream()
>>> s1.append(instrument.AcousticGuitar())
>>> s1.repeatAppend(note.Note(), 4)
>>> s1.append(instrument.Tuba())
>>> s1.append(note.Note())
>>> fe = features.jSymbolic.NotePrevalenceOfPitchedInstrumentsFeature(s1)
>>> fe.extract().vector
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0.8..., 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2...,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
NotePrevalenceOfPitchedInstrumentsFeature
bases
NotePrevalenceOfPitchedInstrumentsFeature
methods
Methods inherited from FeatureExtractor
:
NumberOfCommonMelodicIntervalsFeature
-
class
music21.features.jSymbolic.
NumberOfCommonMelodicIntervalsFeature
(dataOrStream=None, *arguments, **keywords)
Number of melodic intervals that represent at least 9% of all melodic intervals.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.NumberOfCommonMelodicIntervalsFeature(s)
>>> f = fe.extract()
>>> f.vector
[3]
NumberOfCommonMelodicIntervalsFeature
bases
NumberOfCommonMelodicIntervalsFeature
methods
Methods inherited from FeatureExtractor
:
NumberOfCommonPitchesFeature
-
class
music21.features.jSymbolic.
NumberOfCommonPitchesFeature
(dataOrStream=None, *arguments, **keywords)
Number of pitches that account individually for at least 9% of all notes.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.NumberOfCommonPitchesFeature(s)
>>> fe.extract().vector
[3]
NumberOfCommonPitchesFeature
bases
NumberOfCommonPitchesFeature
methods
Methods inherited from FeatureExtractor
:
NumberOfPitchedInstrumentsFeature
-
class
music21.features.jSymbolic.
NumberOfPitchedInstrumentsFeature
(dataOrStream=None, *arguments, **keywords)
>>> s1 = stream.Stream()
>>> s1.append(instrument.AcousticGuitar())
>>> s1.append(note.Note())
>>> s1.append(instrument.Tuba())
>>> s1.append(note.Note())
>>> fe = features.jSymbolic.NumberOfPitchedInstrumentsFeature(s1)
>>> fe.extract().vector
[2]
NumberOfPitchedInstrumentsFeature
bases
NumberOfPitchedInstrumentsFeature
methods
Methods inherited from FeatureExtractor
:
NumberOfUnpitchedInstrumentsFeature
-
class
music21.features.jSymbolic.
NumberOfUnpitchedInstrumentsFeature
(dataOrStream=None, *arguments, **keywords)
Not implemented
Number of distinct MIDI Percussion Key Map patches that were used to play at
least one note. It should be noted that only instruments 35 to 81 are
included here, as they are the ones that are included in the official standard.
TODO: implement
NumberOfUnpitchedInstrumentsFeature
bases
NumberOfUnpitchedInstrumentsFeature
methods
Methods inherited from FeatureExtractor
:
OrchestralStringsFractionFeature
-
class
music21.features.jSymbolic.
OrchestralStringsFractionFeature
(dataOrStream=None, *arguments, **keywords)
>>> s1 = stream.Stream()
>>> s1.append(instrument.Violoncello())
>>> s1.repeatAppend(note.Note(), 4)
>>> s1.append(instrument.Tuba())
>>> s1.repeatAppend(note.Note(), 6)
>>> fe = features.jSymbolic.OrchestralStringsFractionFeature(s1)
>>> print(fe.extract().vector[0])
0.4
OrchestralStringsFractionFeature
bases
OrchestralStringsFractionFeature
methods
Methods inherited from FeatureExtractor
:
PitchClassDistributionFeature
-
class
music21.features.jSymbolic.
PitchClassDistributionFeature
(dataOrStream=None, *arguments, **keywords)
A feature array with 12 entries where the first holds the frequency
of the bin of the pitch class histogram with the highest frequency,
and the following entries holding the successive bins of the histogram,
wrapping around if necessary.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.PitchClassDistributionFeature(s)
>>> f = fe.extract()
>>> f.vector
[0.0, 1.0, 0.375, 0.03125, 0.5, 0.1875, 0.90625, 0.0, 0.4375, 0.6875, 0.09375, 0.875]
PitchClassDistributionFeature
bases
PitchClassDistributionFeature
methods
Methods inherited from FeatureExtractor
:
PitchClassVarietyFeature
-
class
music21.features.jSymbolic.
PitchClassVarietyFeature
(dataOrStream=None, *arguments, **keywords)
Number of pitch classes used at least once.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.PitchClassVarietyFeature(s)
>>> fe.extract().vector
[10]
PitchClassVarietyFeature
bases
PitchClassVarietyFeature
methods
Methods inherited from FeatureExtractor
:
PitchVarietyFeature
-
class
music21.features.jSymbolic.
PitchVarietyFeature
(dataOrStream=None, *arguments, **keywords)
Number of pitches used at least once.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.PitchVarietyFeature(s)
>>> fe.extract().vector
[24]
PitchVarietyFeature
bases
PitchVarietyFeature
methods
Methods inherited from FeatureExtractor
:
PitchedInstrumentsPresentFeature
-
class
music21.features.jSymbolic.
PitchedInstrumentsPresentFeature
(dataOrStream=None, *arguments, **keywords)
>>> s1 = stream.Stream()
>>> s1.append(instrument.AcousticGuitar())
>>> s1.append(note.Note())
>>> s1.append(instrument.Tuba())
>>> s1.append(note.Note())
>>> fe = features.jSymbolic.PitchedInstrumentsPresentFeature(s1)
>>> fe.extract().vector
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
PitchedInstrumentsPresentFeature
bases
PitchedInstrumentsPresentFeature
methods
Methods inherited from FeatureExtractor
:
PolyrhythmsFeature
-
class
music21.features.jSymbolic.
PolyrhythmsFeature
(dataOrStream=None, *arguments, **keywords)
Not yet implemented
Number of beat peaks with frequencies at least 30% of the highest frequency
whose bin labels are not integer multiples or factors
(using only multipliers of 1, 2, 3, 4, 6 and 8) (with an accepted
error of +/- 3 bins) of the bin label of the peak with the highest frequency.
This number is then divided by the total number of beat bins with frequencies
over 30% of the highest frequency.
PolyrhythmsFeature
bases
PolyrhythmsFeature
methods
Methods inherited from FeatureExtractor
:
PrimaryRegisterFeature
-
class
music21.features.jSymbolic.
PrimaryRegisterFeature
(dataOrStream=None, *arguments, **keywords)
Average MIDI pitch.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.PrimaryRegisterFeature(s)
>>> fe.extract().vector
[58.58...]
PrimaryRegisterFeature
bases
PrimaryRegisterFeature
methods
Methods inherited from FeatureExtractor
:
QualityFeature
-
class
music21.features.jSymbolic.
QualityFeature
(dataOrStream=None, *arguments, **keywords)
Set to 0 if the key signature indicates that
a recording is major, set to 1 if it indicates
that it is minor. In jSymbolic, this is set to 0 if key signature is unknown.
See features.native.QualityFeature for a music21 improvement on this method
Example: Handel, Rinaldo Aria (musicxml) is explicitly encoded as being in Major:
>>> s = corpus.parse('handel/rinaldo/lascia_chio_pianga')
>>> fe = features.jSymbolic.QualityFeature(s)
>>> f = fe.extract()
>>> f.vector
[0]
QualityFeature
bases
QualityFeature
methods
Methods inherited from FeatureExtractor
:
QuintupleMeterFeature
-
class
music21.features.jSymbolic.
QuintupleMeterFeature
(dataOrStream=None, *arguments, **keywords)
Set to 1 if numerator of initial time signature is 5, set to 0 otherwise.
>>> s1 = stream.Stream()
>>> s1.append(meter.TimeSignature('5/4'))
>>> s2 = stream.Stream()
>>> s2.append(meter.TimeSignature('3/4'))
>>> fe = features.jSymbolic.QuintupleMeterFeature(s1)
>>> fe.extract().vector
[1]
>>> fe.setData(s2) # change the data
>>> fe.extract().vector
[0]
QuintupleMeterFeature
bases
QuintupleMeterFeature
methods
Methods inherited from FeatureExtractor
:
RangeFeature
-
class
music21.features.jSymbolic.
RangeFeature
(dataOrStream=None, *arguments, **keywords)
Difference between highest and lowest pitches. In semitones
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.RangeFeature(s)
>>> fe.extract().vector
[34]
RangeFeature
bases
RangeFeature
methods
Methods inherited from FeatureExtractor
:
RelativeStrengthOfTopPitchesFeature
-
class
music21.features.jSymbolic.
RelativeStrengthOfTopPitchesFeature
(dataOrStream=None, *arguments, **keywords)
The frequency of the 2nd most common pitch divided by the frequency of the most common pitch.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.RelativeStrengthOfTopPitchesFeature(s)
>>> fe.extract().vector
[0.94...]
RelativeStrengthOfTopPitchesFeature
bases
RelativeStrengthOfTopPitchesFeature
methods
Methods inherited from FeatureExtractor
:
RhythmicLoosenessFeature
-
class
music21.features.jSymbolic.
RhythmicLoosenessFeature
(dataOrStream=None, *arguments, **keywords)
TODO: implement
Average width of beat histogram peaks (in beats per minute).
Width is measured for all peaks with frequencies at least 30% as high as the highest peak,
and is defined by the distance between the points on the peak in question that are
30% of the height of the peak.
RhythmicLoosenessFeature
bases
RhythmicLoosenessFeature
methods
Methods inherited from FeatureExtractor
:
SaxophoneFractionFeature
-
class
music21.features.jSymbolic.
SaxophoneFractionFeature
(dataOrStream=None, *arguments, **keywords)
>>> s1 = stream.Stream()
>>> s1.append(instrument.SopranoSaxophone())
>>> s1.repeatAppend(note.Note(), 6)
>>> s1.append(instrument.Tuba())
>>> s1.repeatAppend(note.Note(), 4)
>>> fe = features.jSymbolic.SaxophoneFractionFeature(s1)
>>> print(fe.extract().vector[0])
0.6
SaxophoneFractionFeature
bases
SaxophoneFractionFeature
methods
Methods inherited from FeatureExtractor
:
SizeOfMelodicArcsFeature
-
class
music21.features.jSymbolic.
SizeOfMelodicArcsFeature
(dataOrStream=None, *arguments, **keywords)
Average melodic interval separating the top note of melodic peaks and the
bottom note of melodic troughs.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.SizeOfMelodicArcsFeature(s)
>>> f = fe.extract()
>>> f.vector
[14.5]
SizeOfMelodicArcsFeature
bases
SizeOfMelodicArcsFeature
methods
Methods inherited from FeatureExtractor
:
StaccatoIncidenceFeature
-
class
music21.features.jSymbolic.
StaccatoIncidenceFeature
(dataOrStream=None, *arguments, **keywords)
Number of notes with durations of less than a 10th of a second divided by
the total number of notes in the recording.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.StaccatoIncidenceFeature(s)
>>> f = fe.extract()
>>> f.vector
[0.0]
StaccatoIncidenceFeature
bases
StaccatoIncidenceFeature
methods
Methods inherited from FeatureExtractor
:
StepwiseMotionFeature
-
class
music21.features.jSymbolic.
StepwiseMotionFeature
(dataOrStream=None, *arguments, **keywords)
Fraction of melodic intervals that corresponded to a minor or major second
StepwiseMotionFeature
bases
StepwiseMotionFeature
methods
Methods inherited from FeatureExtractor
:
StringKeyboardFractionFeature
-
class
music21.features.jSymbolic.
StringKeyboardFractionFeature
(dataOrStream=None, *arguments, **keywords)
Fraction of all Note Ons belonging to string keyboard patches
(GeneralMIDI patches 1 to 8).
>>> s1 = stream.Stream()
>>> s1.append(instrument.Piano())
>>> s1.repeatAppend(note.Note(), 9)
>>> s1.append(instrument.Tuba())
>>> s1.append(note.Note())
>>> fe = features.jSymbolic.StringKeyboardFractionFeature(s1)
>>> fe.extract().vector
[0.9...]
StringKeyboardFractionFeature
bases
StringKeyboardFractionFeature
methods
Methods inherited from FeatureExtractor
:
StrongTonalCentresFeature
-
class
music21.features.jSymbolic.
StrongTonalCentresFeature
(dataOrStream=None, *arguments, **keywords)
Number of peaks in the fifths pitch histogram that each account
for at least 9% of all Note Ons.
StrongTonalCentresFeature
bases
StrongTonalCentresFeature
methods
Methods inherited from FeatureExtractor
:
TimePrevalenceOfPitchedInstrumentsFeature
-
class
music21.features.jSymbolic.
TimePrevalenceOfPitchedInstrumentsFeature
(dataOrStream=None, *arguments, **keywords)
Not implemented
The fraction of the total time of the recording in
which a note was sounding for each (pitched) General
MIDI Instrument. There is one entry for each instrument,
which is set to the total time in seconds during which a
given instrument was sounding one or more notes divided by the total length
in seconds of the piece.’
TODO: implement
TimePrevalenceOfPitchedInstrumentsFeature
bases
TimePrevalenceOfPitchedInstrumentsFeature
methods
Methods inherited from FeatureExtractor
:
TripleMeterFeature
-
class
music21.features.jSymbolic.
TripleMeterFeature
(dataOrStream=None, *arguments, **keywords)
Set to 1 if numerator of initial time signature is 3, set to 0 otherwise.
>>> s1 = stream.Stream()
>>> s1.append(meter.TimeSignature('5/4'))
>>> s2 = stream.Stream()
>>> s2.append(meter.TimeSignature('3/4'))
>>> fe = features.jSymbolic.TripleMeterFeature(s1)
>>> fe.extract().vector
[0]
>>> fe.setData(s2) # change the data
>>> fe.extract().vector
[1]
TripleMeterFeature
bases
TripleMeterFeature
methods
Methods inherited from FeatureExtractor
:
UnpitchedInstrumentsPresentFeature
-
class
music21.features.jSymbolic.
UnpitchedInstrumentsPresentFeature
(dataOrStream=None, *arguments, **keywords)
Not yet implemented
Which unpitched MIDI Percussion Key Map instruments are present.
There is one entry for each instrument, which is set to 1.0 if there is
at least one Note On in the recording corresponding to the instrument and to
0.0 if there is not. It should be noted that only instruments 35 to 81 are included here,
as they are the ones that meet the official standard. They are numbered in this
array from 0 to 46.
TODO: implement
UnpitchedInstrumentsPresentFeature
bases
UnpitchedInstrumentsPresentFeature
methods
Methods inherited from FeatureExtractor
:
VariabilityOfNotePrevalenceOfPitchedInstrumentsFeature
-
class
music21.features.jSymbolic.
VariabilityOfNotePrevalenceOfPitchedInstrumentsFeature
(dataOrStream=None, *arguments, **keywords)
Standard deviation of the fraction of Note Ons played
by each (pitched) General MIDI instrument that is
used to play at least one note.
>>> s1 = stream.Stream()
>>> s1.append(instrument.AcousticGuitar())
>>> s1.repeatAppend(note.Note(), 5)
>>> s1.append(instrument.Tuba())
>>> s1.append(note.Note())
>>> fe = features.jSymbolic.VariabilityOfNotePrevalenceOfPitchedInstrumentsFeature(s1)
>>> fe.extract().vector
[0.33333...]
VariabilityOfNotePrevalenceOfPitchedInstrumentsFeature
bases
VariabilityOfNotePrevalenceOfPitchedInstrumentsFeature
methods
Methods inherited from FeatureExtractor
:
VariabilityOfNotePrevalenceOfUnpitchedInstrumentsFeature
-
class
music21.features.jSymbolic.
VariabilityOfNotePrevalenceOfUnpitchedInstrumentsFeature
(dataOrStream=None, *arguments, **keywords)
Not implemented
Standard deviation of the fraction of Note Ons played by each (unpitched) MIDI Percussion Key
Map instrument that is used to play at least one note. It should be noted that only
instruments 35 to 81 are included here, as they are the ones that are included in the
official standard.
TODO: implement
VariabilityOfNotePrevalenceOfUnpitchedInstrumentsFeature
bases
VariabilityOfNotePrevalenceOfUnpitchedInstrumentsFeature
methods
Methods inherited from FeatureExtractor
:
VariabilityOfNumberOfIndependentVoicesFeature
-
class
music21.features.jSymbolic.
VariabilityOfNumberOfIndependentVoicesFeature
(dataOrStream=None, *arguments, **keywords)
Standard deviation of number of different channels in which notes have sounded simultaneously.
Rests are not included in this calculation.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.VariabilityOfNumberOfIndependentVoicesFeature(s)
>>> f = fe.extract()
>>> f.vector
[0.19...]
VariabilityOfNumberOfIndependentVoicesFeature
bases
VariabilityOfNumberOfIndependentVoicesFeature
methods
Methods inherited from FeatureExtractor
:
VariabilityOfTimeBetweenAttacksFeature
-
class
music21.features.jSymbolic.
VariabilityOfTimeBetweenAttacksFeature
(dataOrStream=None, *arguments, **keywords)
Standard deviation of the times, in seconds, between Note On events (regardless of channel).
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.VariabilityOfTimeBetweenAttacksFeature(s)
>>> f = fe.extract()
>>> f.vector
[0.15000...]
VariabilityOfTimeBetweenAttacksFeature
bases
VariabilityOfTimeBetweenAttacksFeature
methods
Methods inherited from FeatureExtractor
:
VibratoPrevalenceFeature
-
class
music21.features.jSymbolic.
VibratoPrevalenceFeature
(dataOrStream=None, *arguments, **keywords)
Not yet implemented in music21
Number of notes for which Pitch Bend messages change direction at least twice divided by
total number of notes that have Pitch Bend messages associated with them.
VibratoPrevalenceFeature
bases
VibratoPrevalenceFeature
methods
Methods inherited from FeatureExtractor
:
ViolinFractionFeature
-
class
music21.features.jSymbolic.
ViolinFractionFeature
(dataOrStream=None, *arguments, **keywords)
>>> s1 = stream.Stream()
>>> s1.append(instrument.Violin())
>>> s1.repeatAppend(note.Note(), 2)
>>> s1.append(instrument.Tuba())
>>> s1.repeatAppend(note.Note(), 8)
>>> fe = features.jSymbolic.ViolinFractionFeature(s1)
>>> fe.extract().vector
[0.2...]
ViolinFractionFeature
bases
ViolinFractionFeature
methods
Methods inherited from FeatureExtractor
:
WoodwindsFractionFeature
-
class
music21.features.jSymbolic.
WoodwindsFractionFeature
(dataOrStream=None, *arguments, **keywords)
TODO: Conflict in source: does 69-79?
>>> s1 = stream.Stream()
>>> s1.append(instrument.Flute())
>>> s1.repeatAppend(note.Note(), 3)
>>> s1.append(instrument.Tuba())
>>> s1.repeatAppend(note.Note(), 7)
>>> fe = features.jSymbolic.WoodwindsFractionFeature(s1)
>>> print(fe.extract().vector[0])
0.3
WoodwindsFractionFeature
bases
WoodwindsFractionFeature
methods
Methods inherited from FeatureExtractor
: