Previous topic

User’s Guide, Chapter 5: Lists of Lists, Functions, and Recursion

Next topic

User’s Guide, Chapter 7: Chords

Table Of Contents

Table Of Contents

This Page

User’s Guide, Chapter 6: Streams (II): Hierarchies, Recursion, and Flattening

We ended Chapter 4 (User’s Guide, Chapter 4: Lists, Streams (I) and Output) with a Stream that was contained within another Stream object. The only way to find out what was in the contained Stream that we demonstrated so far was the show() method using the (‘text’) argument:

{0.0} <music21.note.Note D#>
{1.0} < some notes>
        {0.0} <music21.note.Note C>
        {2.0} <music21.note.Note F#>
        {3.0} <music21.note.Note B->

Recursion in Streams

Flattening a Stream