Clarification on Flatten() vs .flat vs. recurse()

21 views
Skip to first unread message

Taylor Akin

unread,
Feb 16, 2023, 10:39:26 PM2/16/23
to music21
Hello!

Even after reading through some posts and the documentation, I'm a little fuzzy on what the differences and benefits in flatten(), recurse(), and .flat are. Could someone help clarify what the differences are and/or when you might use one instead of the other?

Thank you!
Taylor

Michael Scott Cuthbert

unread,
Feb 17, 2023, 2:37:49 AM2/17/23
to music...@googlegroups.com
.flatten() replaced .flat recently. They are the same but .flat is deprecated. 

Flatten creates a new stream that can be iterated by offset across parts. (Breadth first search). Recurse is an iterator that follows one part first then the next. 

I’m recording a video about the differences next week but apologies that it won’t be available until fall. 

Best,
Michael

---
Sent from a phone (413-575-6024)
Apologies for typos or general brevity

On Feb 16, 2023, at 22:39, Taylor Akin <ta...@princeton.edu> wrote:

Hello!

Even after reading through some posts and the documentation, I'm a little fuzzy on what the differences and benefits in flatten(), recurse(), and .flat are. Could someone help clarify what the differences are and/or when you might use one instead of the other?

Thank you!
Taylor

--
--
To Post: email music...@googlegroups.com
To Unsubscribe: email music21list...@googlegroups.com
Archives, Options, etc: http://groups.google.com/group/music21list

---
You received this message because you are subscribed to the Google Groups "music21" group.
To unsubscribe from this group and stop receiving emails from it, send an email to music21list...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/music21list/60413850-a21d-4cc7-bf3a-f9c09e1ad864n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages