LaTeX forum ⇒ Conversion ToolsLilypond generated with MuseScore does not fit width of doc

Information and discussion about output converters related to LaTeX (e.g. dvips, ps2pdf, ...)
xirux-nefer69
Posts: 1
Joined: Mon Sep 22, 2014 3:56 pm

Lilypond generated with MuseScore does not fit width of doc

Postby xirux-nefer69 » Mon Sep 22, 2014 4:23 pm

I am using MuseScore 1.3 on Ubuntu 14.04 to write my scores. Then I save them as LilyPond files, and include them in my tex document using \lilypondfile, like this:

  1. \documentclass[a4paper]{article}
  2.  
  3. \begin{document}
  4.  
  5. Larger examples can be put into a separate file, and introduced with \verb+\lilypondfile+.
  6.  
  7. \lilypondfile[quote,noindent,line-width=50\mm]{scores/Exercise_1.05.ly}
  8.  
  9. \end{document}


LilyPond acts as a preprocessor, so, to compile, I do:

  1. $ lilypond-book --pdf solfeo.lytex
  2. $ xelatex solfeo.tex


However, the width of the inserted score doesn't fit into the document, and it extends beyond the limits of the page. You can see a screenshot clicking here.

Also, lilypond-book seems to be ignoring the settings I am passing to it in \lilypondfile[quote,noindent]{scores/Exercise_1.05.ly}. If I understood well, quote prints the notes before the score and noindent removes the indentation of the first line. Neither is it quoting the notes nor is it removing the indentation.

I would prefer to avoid editing the .ly file, since I will be generating a lot of files and I need some automation. So editing some settings in MuseScore would be more practical in my case.

I'm new to Lilypond and I have tried to change the margins of the document in MuseScore, and I tried some tex commands too, but I can't find the way to make it fit. If I compile the ly file with lilypond the PDF looks perfect (but in that case I only get the score). Its only when I embed a ly file into a lytex file that the score extends beyond the margins. Would appreciate your suggestions or corrections. ¿What am I doing wrong? Thanks!

P.D. Here is the ly code generated by MuseScore:

  1. %=============================================
  2. % created by MuseScore Version: 1.3
  3. %=============================================
  4.  
  5. \version "2.12.0"
  6.  
  7.  
  8.  
  9. #(set-default-paper-size "a4")
  10.  
  11. \paper {
  12. line-width = 190\mm
  13. left-margin = 10\mm
  14. top-margin = 10\mm
  15. bottom-margin = 20\mm
  16. %%indent = 0 \mm
  17. %%set to ##t if your score is less than one page:
  18. ragged-last-bottom = ##t
  19. ragged-bottom = ##f
  20. %% in orchestral scores you probably want the two bold slashes
  21. %% separating the systems: so uncomment the following line:
  22. %% system-separator-markup = \slashSeparator
  23. }
  24.  
  25. \header {
  26. }
  27.  
  28. AvoiceAA = \relative c'{
  29. \set Staff.instrumentName = #""
  30. \set Staff.shortInstrumentName = #""
  31. \clef treble
  32. %staffkeysig
  33. \key c \major
  34. %barkeysig:
  35. \key c \major
  36. %bartimesig:
  37. \time 4/4
  38. \tempo "Andante" 4 = 96 a'2 a | % 1
  39. a r | % 2
  40. r a | % 3
  41. r a | % 4
  42. a r | % 5
  43. a a | % 6
  44. a a4 a | % 7
  45. a r a2 | % 8
  46. r4 a a2 | % 9
  47. a4 r2 a4 | % 10
  48. a2 r4 a \bar "|." | % 11
  49. a2 r \bar "|."
  50. }% end of last bar in partorvoice
  51.  
  52.  
  53. \score {
  54. <<
  55. \context Staff = ApartA <<
  56. \context Voice = AvoiceAA \AvoiceAA
  57. >>
  58.  
  59.  
  60.  
  61.  
  62. \set Score.skipBars = ##t
  63. %%\set Score.melismaBusyProperties = #'()
  64. \override Score.BarNumber #'break-visibility = #end-of-line-invisible %%every bar is numbered.!!!
  65. %% remove previous line to get barnumbers only at beginning of system.
  66. #(set-accidental-style 'modern-cautionary)
  67. \set Score.markFormatter = #format-mark-box-letters %%boxed rehearsal-marks
  68. \override Score.TimeSignature #'style = #'() %%makes timesigs always numerical
  69. %% remove previous line to get cut-time/alla breve or common time
  70. \set Score.pedalSustainStyle = #'mixed
  71. %% make spanners comprise the note it end on, so that there is no doubt that this note is included.
  72. \override Score.TrillSpanner #'(bound-details right padding) = #-2
  73. \override Score.TextSpanner #'(bound-details right padding) = #-1
  74. %% Lilypond's normal textspanners are too weak:
  75. \override Score.TextSpanner #'dash-period = #1
  76. \override Score.TextSpanner #'dash-fraction = #0.5
  77. %% lilypond chordname font, like mscore jazzfont, is both far too big and extremely ugly (olagunde@start.no):
  78. \override Score.ChordName #'font-family = #'roman
  79. \override Score.ChordName #'font-size =#0
  80. %% In my experience the normal thing in printed scores is maj7 and not the triangle. (olagunde):
  81. \set Score.majorSevenSymbol = \markup {maj7}
  82. >>
  83.  
  84. %% Boosey and Hawkes, and Peters, have barlines spanning all staff-groups in a score,
  85. %% Eulenburg and Philharmonia, like Lilypond, have no barlines between staffgroups.
  86. %% If you want the Eulenburg/Lilypond style, comment out the following line:
  87. \layout {\context {\Score \consists Span_bar_engraver}}
  88. }%% end of score-block
  89.  
  90. #(set-global-staff-size 20)



Update 1

I'm pasting the output of the compilation of lilypond-book, although I'm not sure how useful it will be for you, since it it in Spanish:

  1. $ lilypond-book --pdf solfeo.lytex
  2.  
  3. lilypond-book (GNU LilyPond) 2.18.2
  4. Reading solfeo.lytex...
  5. Running `pdflatex' on file `/tmp/tmpN3IGhy.tex' to detect default page settings.
  6.  
  7. Dissecting...
  8. Writing snippets...
  9. Processing...
  10. Running lilypond...
  11. GNU LilyPond 2.18.2
  12. Procesando «snippet-map-3001632500490555250.ly»
  13. Analizando...
  14. Procesando «solfeo.lytex»
  15. Analizando...
  16. Renombrando la entrada a: «scores/Exercise_1.05.ly»
  17. Interpretando la música...[8]
  18. Preprocesando los objetos gráficos...
  19. Calculando los saltos de línea...
  20. Dibujando los sistemas...
  21. Salida de la página hacia «ba/lily-399811ac.eps»...
  22. Convirtiendo en «ba/lily-399811ac.pdf»...
  23. Salida de la página hacia «ba/lily-399811ac-1.eps»...
  24. Salida de la página hacia «ba/lily-399811ac-2.eps»...
  25. Convirtiendo en «ba/lily-399811ac-1.pdf»...
  26. Convirtiendo en «ba/lily-399811ac-2.pdf»...
  27. Escribiendo «ba/lily-399811ac-systems.texi»...
  28. Escribiendo «ba/lily-399811ac-systems.tex»...
  29. Escribiendo «ba/lily-399811ac-systems.count»...
  30. Enhorabuena. La compilación se ha completado satisfactoriamente.
  31. Linking files...
  32. Compiling /media/admin/DATOS/Dropbox/code/solfeo-book/out/solfeo.tex...
  33. Writing `/media/admin/DATOS/Dropbox/code/solfeo-book/out/solfeo.tex'...



I hope this helps


Update 2

I have tried another approach. I have exported from MuseScore to MusicXML instead. Then I have used:

  1. musicxml2ly Exercise_1.05.xml -o Exercise_1.05_.ly


to convert the .xml file into an .ly file, and compiled again. Still the width is not fitting the screen =( I have run out of ideas.

Return to “Conversion Tools”

Who is online

Users browsing this forum: No registered users and 1 guest