Re: How can I print only some parts of a score (staves, but no chords)?

2023-05-01 Thread Kieren MacMillan
Hi Werner,

>> \include “chorded.ily”
> Just to avoid potential problems: This must be
>  \include "chorded.ily"
> i.e., straight doublequotes.

Thanks for that.

I recently switched over to a "new" [2014] Mac Mini (because my 2011 iMac 
finally died), and the auto-smart-quotes feature was still on from the initial 
OS install — I’ve now turned it off, so the only “smart quotes” will be the 
ones I’m smart enough to generate myself.  ;)

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: How can I print only some parts of a score (staves, but no chords)?

2023-05-01 Thread Werner LEMBERG

> Sure! Just
> 
> \include “chorded.ily”

Just to avoid potential problems: This must be

  \include "chorded.ily"

i.e., straight doublequotes.


Werner


Re: How can I print only some parts of a score (staves, but no chords)?

2023-05-01 Thread Kieren MacMillan
Hi Alessandro,

> Let me explain, because I'm afraid I fell into the XY problem (if that's
> true I apologize for the time wasted). I have a directory with all the
> songs I transcribed, like:
> .
> ├── song1.ly
> ├── song2.ly
> ├── song3.ly
> └── song4.ly
> 
> I would like to be able to compose each song separately (so that I can
> quickly inspect what I am doing, and in case print out a single sheet
> per time), and then maybe have a file (LaTeX or Lilypond) that includes
> different songs.

This is exactly what I do, for most of my projects. I write operas and musicals 
and other large-scale multi-movement works for the “musical stage”. Take, for 
example, my current front-burner project, “The Quest” (a two-act 
“Broadway-style” musical about four Grade 9 girls who play a D game 
called “Quest”… It has 24 musical songs/cues in it. I have 24 _notes.ily files

  Prologue_notes.ily
  StuckInsideASchool_notes.ily
  etc.

In each, I have a variable which creates a “full score” for that song, and I 
have a file

  editing.ly

with which I can work on any given single song/cue by simply changing which 
notes file I \include. Finally, I have all the different output scores I need:

  TheQuest_pianoconductor.ly
  TheQuest_pianovocal.ly
  TheQuest_vocalchoral.ly
  TheQuest_score.ly
  TheQuest_keyboard.ly
  TheQuest_bass.ly
  etc.

In those, I \include the appropriate style file (musical_parts_20pt.ily or 
musical_pianoconductor.ily or whatever) so that the output is exactly what I 
want/need.

> I would like to control whether to print chords or not
> depending on a option (even better a CLI argument,
> but I don’t think it's possible).

I’m quite sure a CLI argument could be passed, and then the appropriate Scheme 
code in your Lilypond file could include/exclude chords as instructed.

Hope this helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: How can I print only some parts of a score (staves, but no chords)?

2023-05-01 Thread Alessandro Bertulli
Follow up: indeed, a thing like


\version "2.24.1"

\layout{
  \context{
\ChordNames
\remove Chord_name_engraver
  }
}

\include "Del-Tuo-Spirito-Signore.ly"
\include "Ô-Toi-l-au-delà-de-tout.ly"



seems to WORK! Yay! But is this ok? Are there more idiomatic ways to do this?

-- 
Alessandro Bertulli



Re: How can I print only some parts of a score (staves, but no chords)?

2023-05-01 Thread Alessandro Bertulli


Thanks, this is the idea I would like to do, since I need to combine
multiple files together, and thus I cannot simply use variables: I
should use distinct names for everything, not to mention that I couldn't
just "test out" a new piece while I'm writing it without recomposing the
entire "book".

Let me explain, because I'm afraid I fell into the XY problem (if that's
true I apologize for the time wasted). I have a directory with all the
songs I transcribed, like:

.
├── song1.ly
├── song2.ly
├── song3.ly
└── song4.ly

I would like to be able to compose each song separately (so that I can
quickly inspect what I am doing, and in case print out a single sheet
per time), and then maybe have a file (LaTeX or Lilypond) that includes
different songs. There, I would like to control whether to print chords
or not depending on a option (even better a CLI argument, but I don't
think it's possible).

> Sure! Just
>
> \include “chorded.ily”
>
> or not, depending on whether you want chords — then be sure to \remove the 
> relevant engravers in your main file, and \consist them in chorded.ily and 
> voila!  :)

Yeah I too was thinking about style sheets, but I am still a beginner
and I don't know how to use them. Can I disable an engraver for an
entire file, for instance? Because if so then it's trivial, I can just
place at the beginning of the "main" file whether I want chords or not,
then simply \include the song files(?)

-- 
Alessandro Bertulli



Re: How can I print only some parts of a score (staves, but no chords)?

2023-05-01 Thread Kieren MacMillan
Hi Alessandro!

> For comparison, LaTeX's songs package
> (https://songs.sourceforge.net/) can change the type of document
> produced by changing one single option in the document preamble (say,
> from chorded to lyric). Let's see if I can do the same in Lilypond.

Sure! Just

\include “chorded.ily”

or not, depending on whether you want chords — then be sure to \remove the 
relevant engravers in your main file, and \consist them in chorded.ily and 
voila!  :)

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: How can I print only some parts of a score (staves, but no chords)?

2023-05-01 Thread Alessandro Bertulli


>> P.S. I am happy there are other solution other than lilypond-book,
>> because to me it seems a very fragile solution (copying the doc and then
>> composing manually), especially if you are embedding music in a complex
>> LaTeX document. There is lyluatex with LuaLaTeX but I don't know if the
>> output is the same in terms of quality
>
> If you’re talking about the lyluatex that Urs Liska was working on,
> the quality is superb — if I only had time to retool my workflow, I
> would probably move it all to that framework.

Actually I was referring to just the CTAN package lyluatex
(https://ctan.org/pkg/lyluatex). Didn't know Urs Liska's lyluatexmp
existed, tho for now it seem still WIP?

Anyway, now I'll try tweaking a bit with \book{} commands, let's see if
I can achieve what I need. For comparison, LaTeX's songs package
(https://songs.sourceforge.net/) can change the type of document
produced by changing one single option in the document preamble (say,
from chorded to lyric). Let's see if I can do the same in Lilypond.

-- 
Alessandro Bertulli



Re: How can I print only some parts of a score (staves, but no chords)?

2023-04-30 Thread Kieren MacMillan
Hi Alessandro,

>> blocks will already do the trick. You can even have multiple parts (using 
>> \bookpart { ... } or even multiple separate books from the same source file 
>> using \book { ... }).
> 
> Do you mean that different pdfs will be produced?

Yes: each \book block will result in a separate PDF output file.

> P.S. I am happy there are other solution other than lilypond-book,
> because to me it seems a very fragile solution (copying the doc and then
> composing manually), especially if you are embedding music in a complex
> LaTeX document. There is lyluatex with LuaLaTeX but I don't know if the
> output is the same in terms of quality

If you’re talking about the lyluatex that Urs Liska was working on, the quality 
is superb — if I only had time to retool my workflow, I would probably move it 
all to that framework.

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: How can I print only some parts of a score (staves, but no chords)?

2023-04-30 Thread Alessandro Bertulli


Many thanks to all!

> Doing multiple
>
> \score { ... }
>
> blocks will already do the trick. You can even have multiple parts (using 
> \bookpart { ... } or even multiple separate books from the same source file 
> using \book { ... }).

Do you mean that different pdfs will be produced?

> Now, there are many ways of having selective content. Using tags certainly is 
> one of them. This is nice if you put the content of your \score into a 
> variable, for then you can simply do
>
> \score { \removeWithTag #'chords \myMusic }

Yes, in the end I found a way to do what I was thinking using tags and a
custom Makefile, but it is really cumbersome and I need to touch
multiple things every song added.

By the way, I see that you added some Scheme in your solution: which
parts of the manual should I read to learn what do they do?

Thanks!

P.S. I am happy there are other solution other than lilypond-book,
because to me it seems a very fragile solution (copying the doc and then
composing manually), especially if you are embedding music in a complex
LaTeX document. There is lyluatex with LuaLaTeX but I don't know if the
output is the same in terms of quality

-- 
Alessandro Bertulli



Re: How can I print only some parts of a score (staves, but no chords)?

2023-04-30 Thread Valentin Petzel
Hello Alessandro,

lilypond-book is for embedding Lilypond snippets into a document typeset by 
LaTeX. If you simply want to combine multiple scores into one scorebook 
lilypond can do that by itself.

Doing multiple

\score { ... }

blocks will already do the trick. You can even have multiple parts (using 
\bookpart { ... } or even multiple separate books from the same source file 
using \book { ... }).

Now, there are many ways of having selective content. Using tags certainly is 
one of them. This is nice if you put the content of your \score into a 
variable, for then you can simply do

\score { \removeWithTag #'chords \myMusic }

like this:

%

\version "2.24.1"

\language "italiano"

\paper {
  % annotate-spacing = ##t
  system-system-spacing.basic-distance = #20
}

\header {
  title = "Ô toi l'au-delà de tout"
  composer = "Taizé"
  opus = "149"
}

removeVoice =
#(define-music-function (music) (ly:music?)
   (music-map
(lambda (m)
  (if (eqv? (ly:music-property m 'context-type) 'Voice)
  (ly:music-set-property!
   m
   'property-operations
   '((remove "Note_heads_engraver"
  m)
music))

muteStaffWithTag =
#(define-music-function (tags music) (symbol-list-or-symbol? ly:music?)
   (music-map
(lambda (m)
  (if (not ((tags-remove-predicate tags) m))
  (make-music
   'ContextSpeccedMusic
   'create-new #t
   'property-operations '((accepts "Voice"))
   'context-type 'Devnull
   'element (removeVoice (ly:music-property m 'element)))
  m))
music))

scoreMusic =
<<
  \tag #'chords \chords {
 \set chordChanges = ##t
 \partial 8 s8 | re2.:m | re2.:m | fa4 sol2:m7 | do2:7 fa4 |
 sol1:m7 fa2 | re2:m la:7 | re:m la:7
  }

  \tag #'music \new Staff \new Voice = "voice" \relative {
\clef "treble"
\key re \minor
\overrideTimeSignatureSettings
3/4% timeSignatureFraction
1/8% baseMomentFraction
2,2,2% beatStructure
#'()   % beamExceptions
\overrideTimeSignatureSettings
4/4% timeSignatureFraction
1/8% baseMomentFraction
2,2,2,2% beatStructure
#'()   % beamExceptions
\numericTimeSignature % to display 4/4 instead of C
\time 3/4

\partial 8 re'8\( \bar ".|:" re4 mi8 sol fa mi | re2\) fa8\( sol | la4 sib 
sib8 la | sol2\) la8\( re |
re4 do sib8 la | sol4 la2\) | \time 4/4 la8\( re, mi fa sol4. la8 | fa4 
sol8 fa mi4.\) re8 \bar ":|." 
  }

  \tag #'lyrics \new Lyrics \lyricsto "voice" {
Ô Toi l'au -- de -- là de tout,
quel es -- prit peut Te sai -- sir?
Tous les ê -- tres Te cé -- lè -- brent,
le dé -- sir de tous a -- spi -- re vers Toi. Ô
  }
>>

\markup "Everything"

\score{
  \layout{}
  \scoreMusic
}

\markup "No chords"

\score{
  \layout{}
  \removeWithTag #'chords \scoreMusic
}

\markup "No lyrics"

\score{
  \layout{}
  \removeWithTag #'lyrics \scoreMusic
}

\markup "No music"

\score{
  \layout {
\context {
  \Lyrics
  \consists Bar_engraver
  \override BarLine.bar-extent = #'(-1.5 . 1.5)
  \override BarLine.self-alignment-Y = #-0.7
  \override BarLine.Y-offset = #self-alignment-interface::y-aligned-on-self
  %\override BarLine.extra-spacing-width = #'( . 1)
}
\context {
  \Score
  \override SpacingSpanner.strict-note-spacing = ##t
}
  }
  \muteStaffWithTag #'music \scoreMusic
}


%%

There are many ways to achieve your goal, an the best way might depend on your 
circumstances and preferences.

Cheers,
Valentin

Am Sonntag, 30. April 2023, 13:19:42 CEST schrieb Alessandro Bertulli:
> Hi all,
> 
> I'm playing around a bit with Lilypond and I have copied some sheets I
> have purchased in order to build a custom songbook. Since I play rhythmic
> guitar, I have decorated the staves with chords at the top:



signature.asc
Description: This is a digitally signed message part.


Re: How can I print only some parts of a score (staves, but no chords)?

2023-04-30 Thread Federico Bruni
Il giorno dom 30 apr 2023 alle 13:19:42 +0200, Alessandro Bertulli 
 ha scritto:

However, the singers do not need the chords,
so I would like to omit them and simply print a version of the 
document
with only the staves. Is it possible to do this using the SAME 
lilypond

source file?

I have read something about using tags, but I don't know how should I
use them in my file, which by the way is this:


Don't use tags.

Just use one variable name (say, music) for the \relative block and 
another variable name (say, chords) for the \chords block.
Then call only music in the score block for the singers; and music + 
chords in the score block for the guitar player.


You can find many examples in the documentation about using variables.






Re: How can I print only some parts of a score (staves, but no chords)?

2023-04-30 Thread Kieren MacMillan
Hi Alessandro,


> I want to place multiple scores in a single document

I do this with bookparts:

\bookpart {
  \header { stuff for this bookpart }
  \score {
score with chords
  }
}

\bookpart {
  \header { stuff for this bookpart }
  \score {
score without chords
  }
}

etc.

> I have read something about using tags, but I don't know how should I use them

One *could* do this with tags… but that wouldn’t be my choice.

Hope that helps!
Kieren.

__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.