Re: tag and default
On 12 April 2018 at 14:16, David Kastrup wrote: > Gianmaria Lari writes: > > > On 12 April 2018 at 11:42, David Kastrup wrote: > >> > >> What are you trying to do? Basically you are asking whether you can > >> make LilyPond do something different without telling it to make > >> something different. > >> > >> You will need to provide more details of just what you want to be > >> providing via which channels and what not in order to have people figure > >> out what would better meet your requirement than just writing > >> \keepWithTag when you want it. > > > > > > 1) If it seemed I was complaining about lilypond behavior my > > apologies, not at all. > > It did not seem like that to me and LilyPond won't heed complaints > anyway. > > > 2) I paid much attention writing my question but, again my apologies, > > it was not clear. > > The question was clear but it was not clear which leap of logic was to > be assumed for answering it. > > > Let me try again with a different example. > > > > Sometimes I have an excerpt of music that occurs multiple time in a > piece. > > It occurs identically in many place except at the end of the score where > > the last note of the excerpt should be a pause (it is just an example). > > Without tag I would do something like this: > > > > excerpt = {a b c' d'} > > excerptB = {a b c' r} > > { > > % some music > > \excerpt > > > > % some music > > \excerpt > > > > % some music > > \excerptB > > } > > > > > > If I want to write the same thing with tag I would write: > > > > \version "2.19.81" > > excerpt = { > > a b c' > > \tag #'withd d' > > \tag #'withr r > > } > > > > { > > % some music > > \keepWithTag #'withd \excerpt > > > > % some music > > \keepWithTag #'withd \excerpt > > > > % some music > > \keepWithTag #'withr \excerpt > > } > > > > > > This is ok. > > > > Is there any way to obtain the same thing writing: > > > > { > > % some music > > \excerpt > > > > % some music > > \excerpt > > > > % some music > > \keepWithTag #'withr \excerpt > > } > > You probably would not stand for > > { > \keepWithTag #'withd { > % some music > \excerpt > > % some music > \excerpt > % some music >} >\keepWithTag #'withr \excerpt > } > > so your question amounts to some stuff autosuiciding. That's not really > something the tag system will do, but you may want to look at \pushToTag > and \appendToTag for some option of adding material only in specific > cases. > Ok. I had seen the \pushToTag and \appendToTag example in the manual. But I didn't understand the example. They are too complex for me. Anyway, I found a nice escamotage that probably it solves my problem. I put here in case other need. This was the original code: \version "2.19.81" excerpt = { a b c' \tag #'withd d' \tag #'withr r } { \keepWithTag #'withd \excerpt \keepWithTag #'withd \excerpt \keepWithTag #'withd \excerpt \keepWithTag #'withr \excerpt } And this is my solution: \version "2.19.81" music = { a b c' \tag #'lastnote d'} { \music \music \music \removeWithTag #'lastnote \music r } Thank anyway! g. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: tag and default
Gianmaria Lari writes: > On 12 April 2018 at 11:42, David Kastrup wrote: >> >> What are you trying to do? Basically you are asking whether you can >> make LilyPond do something different without telling it to make >> something different. >> >> You will need to provide more details of just what you want to be >> providing via which channels and what not in order to have people figure >> out what would better meet your requirement than just writing >> \keepWithTag when you want it. > > > 1) If it seemed I was complaining about lilypond behavior my > apologies, not at all. It did not seem like that to me and LilyPond won't heed complaints anyway. > 2) I paid much attention writing my question but, again my apologies, > it was not clear. The question was clear but it was not clear which leap of logic was to be assumed for answering it. > Let me try again with a different example. > > Sometimes I have an excerpt of music that occurs multiple time in a piece. > It occurs identically in many place except at the end of the score where > the last note of the excerpt should be a pause (it is just an example). > Without tag I would do something like this: > > excerpt = {a b c' d'} > excerptB = {a b c' r} > { > % some music > \excerpt > > % some music > \excerpt > > % some music > \excerptB > } > > > If I want to write the same thing with tag I would write: > > \version "2.19.81" > excerpt = { > a b c' > \tag #'withd d' > \tag #'withr r > } > > { > % some music > \keepWithTag #'withd \excerpt > > % some music > \keepWithTag #'withd \excerpt > > % some music > \keepWithTag #'withr \excerpt > } > > > This is ok. > > Is there any way to obtain the same thing writing: > > { > % some music > \excerpt > > % some music > \excerpt > > % some music > \keepWithTag #'withr \excerpt > } You probably would not stand for { \keepWithTag #'withd { % some music \excerpt % some music \excerpt % some music } \keepWithTag #'withr \excerpt } so your question amounts to some stuff autosuiciding. That's not really something the tag system will do, but you may want to look at \pushToTag and \appendToTag for some option of adding material only in specific cases. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: tag and default
On 12 April 2018 at 11:42, David Kastrup wrote: > Gianmaria Lari writes: > > > This code ... > > > > \version "2.19.81" > > var = { > > \tag #'mya {a} > > \tag #'myb {b} > > } > > > > { \keepWithTag #'mya \var } > > { \keepWithTag #'myb \var } > > { \var} > > > > creates three scores: > > > > 1) a > > 2) b > > 3) a b > > > > In the third case, where no \keepWithTag is specified, lilypond returns > all > > elements (a and b). > > > > Is there any way to make lilypond returning only one element (a sort of > > default element) and not all the elements IF I don't specify any > > \keepWithTag? > > What are you trying to do? Basically you are asking whether you can > make LilyPond do something different without telling it to make > something different. > > You will need to provide more details of just what you want to be > providing via which channels and what not in order to have people figure > out what would better meet your requirement than just writing > \keepWithTag when you want it. 1) If it seemed I was complaining about lilypond behavior my apologies, not at all. 2) I paid much attention writing my question but, again my apologies, it was not clear. Let me try again with a different example. Sometimes I have an excerpt of music that occurs multiple time in a piece. It occurs identically in many place except at the end of the score where the last note of the excerpt should be a pause (it is just an example). Without tag I would do something like this: excerpt = {a b c' d'} excerptB = {a b c' r} { % some music \excerpt % some music \excerpt % some music \excerptB } If I want to write the same thing with tag I would write: \version "2.19.81" excerpt = { a b c' \tag #'withd d' \tag #'withr r } { % some music \keepWithTag #'withd \excerpt % some music \keepWithTag #'withd \excerpt % some music \keepWithTag #'withr \excerpt } This is ok. Is there any way to obtain the same thing writing: { % some music \excerpt % some music \excerpt % some music \keepWithTag #'withr \excerpt } Thank you, g. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: tag and default
Gianmaria Lari writes: > This code ... > > \version "2.19.81" > var = { > \tag #'mya {a} > \tag #'myb {b} > } > > { \keepWithTag #'mya \var } > { \keepWithTag #'myb \var } > { \var} > > creates three scores: > > 1) a > 2) b > 3) a b > > In the third case, where no \keepWithTag is specified, lilypond returns all > elements (a and b). > > Is there any way to make lilypond returning only one element (a sort of > default element) and not all the elements IF I don't specify any > \keepWithTag? What are you trying to do? Basically you are asking whether you can make LilyPond do something different without telling it to make something different. You will need to provide more details of just what you want to be providing via which channels and what not in order to have people figure out what would better meet your requirement than just writing \keepWithTag when you want it. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
tag and default
This code ... \version "2.19.81" var = { \tag #'mya {a} \tag #'myb {b} } { \keepWithTag #'mya \var } { \keepWithTag #'myb \var } { \var} creates three scores: 1) a 2) b 3) a b In the third case, where no \keepWithTag is specified, lilypond returns all elements (a and b). Is there any way to make lilypond returning only one element (a sort of default element) and not all the elements IF I don't specify any \keepWithTag? Thank you, g. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user