Replies: 1 comment 1 reply
-
I don't really see how this will sooner or later force a change or become a bottleneck. The recursion limit is just a setting. Aren't we allowed to extend it if we want to copy large objects? I might misunderstand it though, I'm no expert on this at all, but at least for completeness here's another solution:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The Timeline and its connected objects
The part contains a series of TimedObjects be it Notes, Measures, or other elements. Every timed object has a start and an end, and when these are well-defined they each have a series of starting objects and ending objects, which corresponds to TimePoints on the Timeline. This makes every Timed Object linked with other Timed Objects which themselves are linked with other Timed Objects and so on.
Issues with pickling and copying
When pickling or copying a score the function has to loop through all connected objects before starting the pickling or copying process which makes things dangerous and sometimes it breaks when the size of the score exceeds the recursion limit.
Solutions
Serialize a score before pickling or copying
Proposed by @neosatrapahereje the solution could be a function that goes through the TimedObjects in a Part and creates a new reduced serialized view which can then be used to recreate the original Part.
Connect objects to the Timeline with indices instead
Proposed by @manoskary the solution can be to change the connection of Timed Objects to the Timeline by enumerating all time objects and assigning a unique index. Then instead of linking every object directly, we can refer to it by its unique index. However, this could entail a major restructuring of the code.
Conclusion
Copying and pickling could potentially be a bottleneck of Partitura and sooner or later we would be forced to address this issue. Do you have any other proposals or ideas about how to solve this?
Beta Was this translation helpful? Give feedback.
All reactions