Skip to content

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

@noctux

Description

@noctux

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions