Re: Accessing Context Properties

2016-02-25 Thread tisimst
the top LilyPond directory will dig up a number of "concrete > examples", partly in the documentation, partly in snippets, partly in > code. > Thanks, David! Not sure why I didn't think of that before. I'll look through those search results and see if I can make sense

Re: Accessing Context Properties

2016-02-25 Thread David Kastrup
tisimst writes: > On Thu, Feb 25, 2016 at 11:03 AM, David Kastrup [via Lilypond] < > ml-node+s1069038n187726...@n5.nabble.com> wrote: > >> tisimst <[hidden email] >> > writes: >> >> > David, >> > >> >> All of that cannot be done from within a

Re: Accessing Context Properties

2016-02-25 Thread tisimst
ack > and not from music functions as David has said. So that leaves custom > engravers (although I don’t really know how \applyContext fits into this). > > Maybe that helps? > Very much! Thank you. Best, Abraham -- View this messag

Re: Accessing Context Properties

2016-02-25 Thread tisimst
u 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 ju

Re: Accessing Context Properties

2016-02-25 Thread Paul Morris
Hi Abraham, > On Feb 25, 2016, at 12:28 PM, tisimst wrote: > > 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 jus

Re: Accessing Context Properties

2016-02-25 Thread David Kastrup
n'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! So do you or don't you care

Re: Accessing Context Properties

2016-02-25 Thread Ben Strecker
. > > 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 pr

Re: Accessing Context Properties

2016-02-25 Thread tisimst
y 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 equiva

Re: Accessing Context Properties

2016-02-25 Thread David Kastrup
tisimst writes: > David, > > On Thu, Feb 25, 2016 at 9:28 AM, David Kastrup [via Lilypond] < > ml-node+s1069038n187720...@n5.nabble.com> wrote: > >> Abraham Lee <[hidden email] >> > writes: >> >> > All, >> > >> > In the docs are numerous secti

Re: Accessing Context Properties

2016-02-25 Thread tisimst
ics 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? Thanks, Abraham -- View this message in context: http://lilypond.1069038.n5.nabble.com/Accessing-Contex

Re: Accessing Context Properties

2016-02-25 Thread David Kastrup
Abraham Lee 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,

Accessing Context Properties

2016-02-25 Thread Abraham Lee
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 funct

Re: Accessing context properties (e.g. the current key) from a music function?

2015-05-05 Thread Leah Velleman
> > The problem arises because \applyContext is evaluated later than > \transpose. When music functions do their work, contexts have not been > created yet, > > The output shows that the original binding of k is in effect when > \transpose is called. > Aha! Thank you — that makes sense. _

Re: Accessing context properties (e.g. the current key) from a music function?

2015-05-01 Thread David Nalesnik
On Fri, May 1, 2015 at 7:48 AM, David Nalesnik wrote: test = > #(define-music-function (parser location music) (ly:music?) >(let ((k "ERROR")) > #{ > >\applyContext > >#(lambda (context) > > (set! k (ly:context-property context 'tonic)) > > (display k

Re: Accessing context properties (e.g. the current key) from a music function?

2015-05-01 Thread David Nalesnik
Hi Leah, On Thu, Apr 30, 2015 at 7:28 PM, Leah Velleman wrote: > To do something like you want, you really would need access to context >> properties >> > > Ok — good to know I haven't missed some simple solution. > > It seems like there ought to be some way of smuggling information out of >

Re: Accessing context properties (e.g. the current key) from a music function?

2015-04-30 Thread Leah Velleman
Oh goodness, something heinous happened to the formatting there. Let me try that again. k = "ERROR" test = #(define-music-function (parser location music) (ly:music?) #{ \applyContext #(lambda (context) (set! k (ly:context-property context 'tonic)) (display k) )

Re: Accessing context properties (e.g. the current key) from a music function?

2015-04-30 Thread Leah Velleman
> > To do something like you want, you really would need access to context > properties > Ok — good to know I haven't missed some simple solution. It seems like there ought to be some way of smuggling information out of an \applyContext. But I guess there's a variable scope issue that keeps y

Re: Accessing context properties (e.g. the current key) from a music function?

2015-04-30 Thread David Nalesnik
On Thu, Apr 30, 2015 at 6:41 PM, David Nalesnik wrote: > > > P.S. Now I'm going to set out to break it... > Well, with simultaneous music you do end up having to repeat the key. \test \new PianoStaff << \new Staff << \new Voice { \key re \major \voiceOne do''4 mi'' sol

Re: Accessing context properties (e.g. the current key) from a music function?

2015-04-30 Thread David Nalesnik
Leah, On Thu, Apr 30, 2015 at 6:34 PM, Leah Velleman wrote: > Ah! I hadn't even gotten as far as thinking about key-change events > *within* the scope of the music function, though you're right that those > would be an issue too (and your suggestion looks like a sensible way of > dealing with th

Re: Accessing context properties (e.g. the current key) from a music function?

2015-04-30 Thread David Nalesnik
Hi Harm, On Thu, Apr 30, 2015 at 6:36 PM, Thomas Morley wrote: > 2015-05-01 1:23 GMT+02:00 David Nalesnik : > > > > %% > > > > \version "2.18" > > > > \language "italiano" % the closest preset :) > > > > test = > > #(define-music-function (parser location music) > >(

Re: Accessing context properties (e.g. the current key) from a music function?

2015-04-30 Thread Thomas Morley
2015-05-01 1:23 GMT+02:00 David Nalesnik : > Hi Leah, > > On Thu, Apr 30, 2015 at 3:16 PM, Leah Velleman > wrote: >> >> I'm looking to write a \transpose-like music function that will need to be >> able to "find out" what the current key is. >> >> (In case it matters: The reason I'm doing this is

Re: Accessing context properties (e.g. the current key) from a music function?

2015-04-30 Thread Leah Velleman
Ah! I hadn't even gotten as far as thinking about key-change events *within* the scope of the music function, though you're right that those would be an issue too (and your suggestion looks like a sensible way of dealing with them). What I was trying to get at was the key that was current before t

Re: Accessing context properties (e.g. the current key) from a music function?

2015-04-30 Thread David Nalesnik
Hi Leah, On Thu, Apr 30, 2015 at 3:16 PM, Leah Velleman wrote: > I'm looking to write a \transpose-like music function that will need to be > able to "find out" what the current key is. > > (In case it matters: The reason I'm doing this is to make it possible to > enter music using movable-do so

Accessing context properties (e.g. the current key) from a music function?

2015-04-30 Thread Leah Velleman
I'm looking to write a \transpose-like music function that will need to be able to "find out" what the current key is. (In case it matters: The reason I'm doing this is to make it possible to enter music using movable-do solfege. The idea is to have a function \movableDo that will transpose from C