Expand description
Reductions written into a score by its lyrics: music21’s
analysis.reduction.
A lyric starting :: marks its note for a reduction, saying how it is
written there: ::/p:e/o:5/nf:no/ta:3/g:Ursatz takes the E of a chord,
puts it in the fifth octave with a hollow notehead and the text 3
above, in the part for the group Ursatz. A ScoreReduction gathers
every note so marked into parts of their own, above the score with the
marks taken out of its lyrics. A PartReduction answers when, and how
loudly, each part or group of parts plays.
use music21_rs::analysis::reduction::ScoreReduction;
use music21_rs::stream::{Stream, StreamElement, StreamKind};
use music21_rs::tinynotation::from_tiny_notation;
let mut part = from_tiny_notation("4/4 c4 d e f g1")?;
part.set_kind(StreamKind::Part);
part.for_each_mut(&mut |_, element| {
if let StreamElement::Note(note) = element
&& note.pitch().name() == "E"
{
note.add_lyric("::/o:5/tb:3", None, false)
.expect("a note takes a lyric");
}
});
let mut score = Stream::with_kind(StreamKind::Score);
score.insert(0.0, part);
let mut reduction = ScoreReduction::new();
reduction.set_score(score);
let reduced = reduction.reduce()?;
let notes = reduced.parts()[0].notes();
assert_eq!(notes.len(), 1);Structs§
- Part
Activity - A part, or a group of parts, and the stretches it plays.
- Part
Group - A group of a score’s parts drawn as one: music21’s
partGroupsentry. - Part
Reduction - When and how loudly each part, or group of parts, of a score plays:
music21’s
PartReduction, whosegetGraphHorizontalBarWeightedDataPartReduction::weighted_spansanswers. - Reductive
Note - A note marked by a lyric for a reduction, with where it stands: music21’s
ReductiveNote. - Reductive
Parameters - How a lyric marks its note for a reduction: music21’s
ReductiveNoteparameters, each as the lyric writes it. The keys arepfor the pitch taken from a chord,othe octave,nfthe notehead fill,sdthe stem direction,gthe group,vthe voice,tatext above andtbtext below. - Score
Reduction - A score with its marked notes drawn out into parts of their own:
music21’s
ScoreReduction. - Weighted
Span - A stretch of a part’s playing, and how loud: one bar of music21’s weighted horizontal bar graph.