-
Notifications
You must be signed in to change notification settings - Fork 30
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
Problem with shifting #7
Comments
Could you please provide more information about this bug? What code triggered it? The traceback you have provided mentions |
This error is not caused directly by Arguably, that is not something that you should be doing but the error message is indeed confusing. The problem is two-fold: (1) modifying start and end times does not actually move the interval up or down the tier, which (2) confuses |
We are currently working on an improved representation of Annotations that prevents these kind of problems. For the moment I would recommend to create a new Tier and to add Annotation 0-50 (in your script) as well as the shifted Annotations to this new Tier. Then remove the old Tier and add the new Tier to the TextGrid object. |
Thank you guys for the feedback. @hbuschme the suggestion is fine, but somewhat cumbersome, if I have to do it each repetition in a highly repetitive song, maybe I would type the words in the end :( |
I see. I think what you are trying to achieve should be perfectly for anno in a[51:-1]:
anno.end_time += shiftTime
anno.start_time += shiftTime
tier.add_interval(anno) create a new shifted annotation like this: for anno in a[51:-1]:
anno_shifted = tgt.Interval(anno.start_time + shiftTime,
anno.end_time + shiftTime,
anno.text)
tier.add_interval(anno_shifted) Hope this helps! |
If I run this script with last line commented I dont get an error.
The error seems to be raised on
tgt.write_to_file
. which is confusing. I guess it should be raised already ontier.add_interval()
The text was updated successfully, but these errors were encountered: