Re: Question about eval-string

2019-03-02 Thread Paolo Cantamessa
So many greetings guys, you' ve solved a lot of my problems.

Both solutions work very well.

Thanks again and all the best.

Paolo




Il giorno sab 2 mar 2019 alle ore 13:41 Aaron Hill 
ha scritto:

> On 2019-03-02 4:38 am, Malte Meyn wrote:
> > Am 02.03.19 um 13:34 schrieb Aaron Hill:
> >> 
> >>$@(map eval-string '("voiceA" "voiceB"))
> >> 
> >>
> >> That should work too, I think.
> >
> > Wow, that’s cool! I think I have seen $@ in the past but I didn’t know
> > what it does ;) That should be enclosed in << >> though for Paolo’s
> > use case:
> >
> > <<
> >   $@(map eval-string '("voiceA" "voiceB"))
> >>>
>
> Correct.  I should have included a full snippet for clarity.
>
>  From Extending:
>
> "A further convenience can be the ‘list splicing’ operators $@ and #@
> for inserting the elements
> of a list in the surrounding context."
>
> -- Aaron Hill
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>

[image: Mailtrack]

Sender
notified by
Mailtrack

02/03/19,
22:04:22
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Question about eval-string

2019-03-02 Thread Aaron Hill

On 2019-03-02 4:38 am, Malte Meyn wrote:

Am 02.03.19 um 13:34 schrieb Aaron Hill:


   $@(map eval-string '("voiceA" "voiceB"))


That should work too, I think.


Wow, that’s cool! I think I have seen $@ in the past but I didn’t know
what it does ;) That should be enclosed in << >> though for Paolo’s
use case:

<<
  $@(map eval-string '("voiceA" "voiceB"))




Correct.  I should have included a full snippet for clarity.

From Extending:

"A further convenience can be the ‘list splicing’ operators $@ and #@ 
for inserting the elements

of a list in the surrounding context."

-- Aaron Hill

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


Re: Question about eval-string

2019-03-02 Thread Malte Meyn



Am 02.03.19 um 13:34 schrieb Aaron Hill:


   $@(map eval-string '("voiceA" "voiceB"))


That should work too, I think.


Wow, that’s cool! I think I have seen $@ in the past but I didn’t know 
what it does ;) That should be enclosed in << >> though for Paolo’s use 
case:


<<
  $@(map eval-string '("voiceA" "voiceB"))
>>

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


Re: Question about eval-string

2019-03-02 Thread Aaron Hill

On 2019-03-02 4:30 am, Malte Meyn wrote:

Am 02.03.19 um 13:06 schrieb Paolo Cantamessa:

%this doesn't work
<<
   $(map eval-string '("voiceA" "voiceB"))
 >>



The map returns a list which means that the 'elements of the
SequentialMusic (produced by << >>) is a list of lists instead of a
list.

Try the following and have a look at the output produced by 
\displayMusic:



\version "2.19.82"

voiceA = { e' f' g' }
voiceB = { c' d' e' }

%this works
\displayMusic <<
  $(eval-string "voiceA")
  $(eval-string "voiceB")




%this works too
$(make-music
  'SimultaneousMusic
  'elements
  (map eval-string '("voiceA" "voiceB")))





  $@(map eval-string '("voiceA" "voiceB"))


That should work too, I think.

-- Aaron Hill

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


Re: Question about eval-string

2019-03-02 Thread Malte Meyn



Am 02.03.19 um 13:06 schrieb Paolo Cantamessa:

%this doesn't work
<<
   $(map eval-string '("voiceA" "voiceB"))
 >>



The map returns a list which means that the 'elements of the 
SequentialMusic (produced by << >>) is a list of lists instead of a list.


Try the following and have a look at the output produced by \displayMusic:


\version "2.19.82"

voiceA = { e' f' g' }
voiceB = { c' d' e' }

%this works
\displayMusic <<
  $(eval-string "voiceA")
  $(eval-string "voiceB")
>>

%this works too
$(make-music
  'SimultaneousMusic
  'elements
  (map eval-string '("voiceA" "voiceB")))


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


Question about eval-string

2019-03-02 Thread Paolo Cantamessa
Hello guys,
anyone has a suggest about this problem?

Many thanks.

Cheers

%this work
<<
  $(eval-string "voiceA")
  $(eval-string "voiceB")
>>

%this doesn't work
<<
  $(map eval-string '("voiceA" "voiceB"))
>>





[image: Mailtrack]

Sender
notified by
Mailtrack

02/03/19,
13:06:25
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user