Re: Accessing Context Properties

2016-02-25 Thread Ben Strecker

> On Feb 25, 2016, at 12:28 PM, tisimst  wrote:
> 
> David,
> 
> On Thu, Feb 25, 2016 at 9:55 AM, David Kastrup [via Lilypond] <[hidden email] 
> > wrote:
> tisimst <[hidden email] 
> > writes: 
> 
> > David, 
> > 
> > On Thu, Feb 25, 2016 at 9:28 AM, David Kastrup [via Lilypond] < 
> > [hidden email] > 
> > wrote: 
> > 
> >> Abraham Lee <[hidden email] 
> >>  >> >> writes:
> 
> >> 
> >> > All, 
> >> > 
> >> > In the docs are numerous sections that discuss how to modify context 
> >> > properties. This is not complicated. However, a handful of recent 
> >> threads 
> >> > on the user list have got me wondering about the correct way(s) of 
> >> > _accessing_ these properties within, for example, a music function. The 
> >> > music function may or may not modify the same or another context 
> >> property. 
> >> > If music functions are NOT the way to go, then what is preferred? 
> >> > 
> >> > Thanks, in advance, for all insights and instruction. 
> >> 
> >> I have no idea what you want.  Music functions are called when parsing 
> >> LilyPond source code.  At that time, there are no contexts and no 
> >> context properties.  Consequently, music functions have no way 
> >> whatsoever to read or modify context properties.  All they can do is 
> >> create music expressions (typically overrides or applyContext calls, 
> >> possibly as context modifications) that contain callbacks of some form 
> >> that, when ultimately called during iteration of the music expression, 
> >> will be able to access actual properties. 
> >> 
> >> So for your actual question, there is little insight and instruction to 
> >> be had. 
> > 
> > 
> > Thanks for your response. That helps knowing that music functions cannot 
> > read or modify context properties. 
> > 
> > Let me give some examples of what I might want to do: 
> > 
> > 1. Determine the currentBarNumber in order to print a custom stencil 
> > 2. Access the System or Staff's vertical position on the page in order to 
> > change it 
> > 3. Determine which page I'm on so I can print a particular stencil on that 
> > page only 
> > 4. Determine the current time signature so I can create a MMR of the exact 
> > size needed to fill a measure 
> > etc.
> All of that cannot be done from within a music function.  I repeat: All 
> they can do is create music expressions (typically overrides or 
> applyContext calls, possibly as context modifications) that contain 
> callbacks of some form that, when ultimately called during iteration of 
> the music expression, will be able to access actual properties. 
> 
> That has nothing to do with music functions at all but rather with the 
> kind of music expressions you'd want the music function to create.
> 
> I got that from your first message. I promise. I just am not sure what this 
> means. Can you point me to a snippet (in the LSR?) that shows this? That 
> would help a lot.
>  
> > These are just examples and I'm not even asking for specifics on how 
> > to do these (as they've partially been discussed in other 
> > threads). What approach would I want to follow in order to access the 
> > properties so I could make a change elsewhere? 
> 
> Have you read what I wrote?  Music functions are not able to access 
> properties.  Various music expressions (possibly created by music 
> functions) may contain callbacks that might be used for such purposes.
> 
> Thanks you for your reply. Yes, I definitely read what you wrote. I realize 
> that music functions aren't the way to go and you've made that perfectly 
> clear. I didn't even mean to imply in my previous response that I wanted to 
> do those things with music functions. I don't care what the mechanism is. I 
> just want to know what it is! That is exactly why I asked "what approach 
> would I follow in order to access the properties so I could make a change 
> elsewhere?". I have no idea where your statements are supposed to be leading 
> me. I'd really like to know, though. Would you be kind enough to show how YOU 
> would access a context property and use its value in an grob override? 
> Perhaps it's too dependent on what I'd actually like to do. If so, knowing 
> that helps, too.
> 
> I'm asking this because I know that if I can get my hands on a grob, I know 
> how to access its properties (with ly:grob-property) and use that property's 
> value to make a change if I want (e.g., with ly:grob-set-property!). I just 
> don't know the equivalent process for getting my hands on a context to access 
> its properties. I know there's ly:context-property, but I just don't have as 
> much experience with it as normal grobs.
> 
> Now, when you say a music expression that contains callbacks might be used, 
> do you mean like this (Warning: made-up, non-functional pseudo-code 

Re: variables in \book { }

2016-02-16 Thread Ben Strecker
Graham,

Have you tried putting each score inside it’s own \bookpart?

The documentation for ragged-last-bottom says:

ragged-last-bottom
 <> <>If this is set to false, then the last page, and the last page in each 
section created with a \bookpart block, will be vertically justified in the 
same way as the earlier pages.

If I’m reading that correctly, that means that unless each score is in a 
bookpart, ragged-last-bottom only applies to the very last page.

HTH
Ben

> On Feb 16, 2016, at 7:21 PM, Graham King  wrote:
> 
> On Wed, 2016-02-17 at 00:20 +0100, David Kastrup wrote:
>> 
>> Graham King > 
>> writes:
>> 
>> > On Tue, 2016-02-16 at 19:15 +0100, David Kastrup wrote:
>> > 
>> >
>> >> 
>> >> However, your original posting stated:
>> >> 
>> >> > (Alternatively, if there's a way to make book-titling.ily do a
>> >> > ragged-last-bottom for each piece, that would save even more work).
>> >> 
>> >> Have you actually tried
>> >> 
>> >> \layout {
>> >>   ragged-last-bottom = ##t
>> >> }
>> >> 
>> >> before anything else?  That should be taken as starting point for all
>> >> following \layout blocks.
>> >> 
>> >
>> > Thanks for your help.
>> >
>> > I can't pretend to have a very firm grasp of scoping in lilypond, but I
>> > have now (re-)tried by putting this \layout block in various places,
>> > including before the \include for each piece.  I've also tried inserting
>> > it in Nicolas Sceaux's example at the bottom of the book-titling.ily
>> > code (snippet 368).  All without success, alas.
>> 
>> "before anything else" means before anything else.  Namely first.
>> Particularly before loading book-titling.ily.
>> 
> I've tried it at the top of the master file that I compile to create the PDF 
> containing all the pieces:
>   \version "2.19.32"
>   #(ly:set-option 'point-and-click #f)
>   \layout {
>ragged-last-bottom = ##t
> }
> The last page of each piece is still as if ragged-last-bottom were ##f.  The 
> final piece might be affected but I can't tell because it fills the last page 
> with systems anyway.
> 
> Thanks for the clarification, but I'm thinking we're flogging a dead horse in 
> trying to get book-titling.ily to do this.
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: positioning a rest

2016-02-12 Thread Ben Strecker
This works for me.

\version "2.19.32"
{
\new Staff <<
\time 3/4
\new Voice { 
  \override Rest #'staff-position = #0
  \voiceOne r4 r4 g' }
\new Voice { \voiceTwo s4 c'2 }
>>
}

> On Feb 12, 2016, at 12:34 PM, Patrick Karl  wrote:
> 
> I'm trying to duplicate the following measure:
> 
> 
> 
> My attempt:
> 
> \version "2.19.32"
> {
> \new Staff <<
> \time 3/4
> \new Voice { \oneVoice r4 r \voiceOne g' }
> \new Voice { \voiceTwo s4 c'2 }
> >>
> }
> 
> This works fine for everything but the second quarter-rest, which is 
> positioned beneath the half-note middle-C:
> 
> 
> 
> I've tried several variations of the above snippet, but the rest either move 
> up to  the \voiceOne position or remains firmly beneath the middle-C.  How 
> can I get the second rest to be positioned in the middle of the staff, at the 
> same level as the first rest?
> 
> Thanks.
> Pat
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Edition-engraver: Multiple editions in same file

2016-01-24 Thread Ben Strecker
Thank you Jan-Peter and Kieren,

That helps clear up a lot of my confusion.

Ben

> On Jan 24, 2016, at 2:24 PM, Jan-Peter Voigt <jp.vo...@gmx.de> wrote:
> 
> Hi Ben,
> 
> I was about to write about the three dimension to watch. But I have to think 
> about it, if I can change this.
> For now there will one set of editiontags per compilation. So every call to 
> \addEdition and \removeEdition will affect the list of active 
> modification-layers for the whole run. The compilation of a file is done in 
> multiple steps. The called commands act on in the first step, the actual 
> typesetting is done in another step.
> In my use-cases, I always have one edition-set per file, e.g. full-score or 
> part for single instruments. But your use-case looks reasonable. I attached 
> your example slightly modified, where the first score is modified, but not 
> the second. To achieve this, I used \applyContext, so that the \removeEdition 
> command is performed, when beginning typesetting th second score. The command 
> could be wrapped inside a little helper command.
> This technique has the pro, that it matches your use-case, but a big con, in 
> that it remixes content and design again.
> So I would not recommend this over the solution, you already found.
> Perhaps another solution is found another day ;-)
> 
> HTH for now
> Cheers
> Jan-Peter
> 
> Am 22.01.2016 um 22:00 schrieb Ben Strecker:
>> I’m working on a project that would have the same melody appearing in 
>> different ranges in the same document.  Each range has its own set of 
>> modifications through the edition-engraver, but using \removeEdition 
>> anywhere in the file appears to remove that edition for all of the scores.  
>> What is the best practice for managing multiple editions in the same file?  
>> 
>> I have attached a very simple example where I have two scores:  one that 
>> should have a color modification applied, and another that should not have 
>> any editionMods applied.
>> 
>> Thanks,
>> Ben
>> 
>> 
>> 
>> ___
>> lilypond-user mailing list
>> lilypond-user@gnu.org <mailto:lilypond-user@gnu.org>
>> https://lists.gnu.org/mailman/listinfo/lilypond-user 
>> <https://lists.gnu.org/mailman/listinfo/lilypond-user>
> 
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Edition-engraver: Multiple editions in same file

2016-01-22 Thread Ben Strecker
I’m working on a project that would have the same melody appearing in different 
ranges in the same document.  Each range has its own set of modifications 
through the edition-engraver, but using \removeEdition anywhere in the file 
appears to remove that edition for all of the scores.  What is the best 
practice for managing multiple editions in the same file?  

I have attached a very simple example where I have two scores:  one that should 
have a color modification applied, and another that should not have any 
editionMods applied.

Thanks,
Ben



edition.ly
Description: Binary data
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Polyphonic Cues Using \cueDuring

2015-12-15 Thread Ben Strecker
All of the cue examples I’ve seen so far seem to only contain one voice, but 
it’s not uncommon to see cues containing the notes from multiple parts.  If the 
different parts have the same rhythm, it works nicely to just create a 
polyphonic quote:

\addQuote #”Two Voice Cue” {<< \partI \partII >>}

and later

\cueDuring #”Two Voice Cue” #DOWN ...

but many issues come about when rhythms differ (see example below).  I can take 
the time to make everything look good using \new CueVoice, but this makes a 
fair amount of extra work since I can’t (that I know of) just pull the music 
from the separate parts.

Any suggestions?

Ben


%%% polyphonic cues
partI = \relative c' { r2 r8 e8 g a bes1 a  }
partII = \relative c'' {r2 r2 g2 ~ g8 c, d-. e-. f1}

\addQuote #"Cue Test" { << \partI \partII >>}

\relative c'' {
  r2 \cueDuring #"Cue Test" #DOWN {r2 R1 r8 c8 d e f2}
}

\version "2.19.32"
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Trouble Selecting Correct Font-series

2015-08-25 Thread Ben Strecker
I'm using Lilypond version 2.19.25 on a mac running Yosemite, and I'm trying to
use the font family Iowan Old Style.  In addition to the regular styles (roman, 
bold, italic, bolditalic, etc.) this family comes with Black and BlackItalic 
styles.  in my small example below, the markup gets engraved using Iowan Old 
Style Black instead of Iowan Old Style Roman, and I can't seem 
to find a way to fix it.

\paper {
  fonts = #
  (make-pango-font-tree
   Iowan Old Style
   Optima
   Monaco
   (/ (* staff-height pt) 2.5))
}

\relative c' {
  c^\markup{Test} d e f g a b c
}

My suspicion is that it may have something to do with the organization of the
.ttc file where the font resides, but I don't know enough on the subject to 
fix it.


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user