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

Export issues on explicitly placed rests via \rest command #147

Open
noctux opened this issue Oct 9, 2022 · 0 comments
Open

Export issues on explicitly placed rests via \rest command #147

noctux opened this issue Oct 9, 2022 · 0 comments

Comments

@noctux
Copy link

noctux commented Oct 9, 2022

Hello, thank you for the software in the first place! Unfortunately I seem to trigger a bug upon explicitely placed \rest commands:

Minimum failing example:

\version "2.22.2"

\score {
  <<
	\new Staff {
	  \time 2/4
	  \clef "treble" \key c \major
	  \relative b' {
		b4.  b8 \rest
	  }
	}
  >>
}

This simple snippet cannot be exported to musicxml:

Traceback (most recent call last):
  File "/usr/bin/ly", line 4, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/ly/cli/main.py", line 288, in main
    c.run(options, cursor, output)
  File "/usr/lib/python3.10/site-packages/ly/cli/command.py", line 222, in run
    xml = writer.musicxml()
  File "/usr/lib/python3.10/site-packages/ly/musicxml/lymus2musxml.py", line 156, in musicxml
    self.mediator.check_score()
  File "/usr/lib/python3.10/site-packages/ly/musicxml/ly2xml_mediator.py", line 314, in check_score
    self.score.merge_globally(self.score.glob_section, override=True)
  File "/usr/lib/python3.10/site-packages/ly/musicxml/xml_objs.py", line 261, in merge_globally
    p.merge_voice(section, override)
  File "/usr/lib/python3.10/site-packages/ly/musicxml/xml_objs.py", line 342, in merge_voice
    org_v.inject_voice(add_v, override, self.active_slur_count)
  File "/usr/lib/python3.10/site-packages/ly/musicxml/xml_objs.py", line 521, in inject_voice
    if new_voice.obj_list[0].has_attr():
IndexError: list index out of range

On the other hand, it exports just fine on lilypond itself and looks like valid lilypond to me. Rewriting the rest by replacing b8 \rest with r8 on the other hand works fine.

Version: 0.9.7.r1.gf24b840-1 (current git master)

Thanks for reading this far! Please let me know if you need any further information of I can be of any further assistance
~ Simon

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

No branches or pull requests

1 participant