Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecursiveIterator.stream() emits StreamException for notes in inner streams #201

Open
jacobtylerwalls opened this issue Oct 30, 2022 · 2 comments
Labels

Comments

@jacobtylerwalls
Copy link
Member

jacobtylerwalls commented Oct 30, 2022

const n = new music21.note.Note("C#");
const m = new music21.stream.Measure();
m.append(n)
const p = new music21.stream.Part();
p.append(m);
const s = p.recurse().stream();
StreamException: An entry for this object is not stored in this Stream.
@mscuthbert
Copy link
Member

I've totally forgotten how this works on m21p let alone here. Does it use .template?

@jacobtylerwalls
Copy link
Member Author

jacobtylerwalls commented Nov 2, 2022

No, it just does getOffsetInHierarchy and then a bunch of coreAppend.

I think this is the missing piece:

const o = ss.elementOffset(e, stringReturns);
// try: getOffsetInHierarchy...
// string returns;
found.insert(o, <base.Music21Object><any> e);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants