Skip to main content

realize_ornaments

Function realize_ornaments 

Source
pub fn realize_ornaments(stream: &Stream) -> Result<Stream>
Expand description

Every ornament the stream carries played out, in a stream of its own: music21’s stream.makeNotation.realizeOrnaments.

The answer is this stream’s Stream::clone_empty with each element appended after the one before and every nested stream realized the same way, so a gap between two elements closes – which is what music21 does and what the comment in its own source calls a thing to fix. A note carrying ornaments is replaced by the notes each of them plays, read in the key signature in force where the note stands, and nothing else by nothing: an ornament is handed the note as it stands rather than what the ornament before it left, so a note carrying two is heard twice, once for each.

That is not crate::expressions::realize_ornaments, which is music21’s function of the same name in its expressions module: there the ornaments of one note are chained, each playing what the one before left.

§Errors

An ornament on anything but a note – a chord, a rest, an unpitched stroke – which music21 cannot play either, since it asks whatever it is given for its one pitch. And any ornament that cannot play the note it is on.