Re: to make a function with argument list or vector

2016-09-04 Thread Оксана Крымина
Great! It works! It works!
Thank You!

2016-09-04 20:15 GMT+03:00, Simon Albrecht <simon.albre...@mail.de>:
> Hi Oxana,
>
> I _guess_ the reason it doesn’t work is because the parser doesn’t
> accept a Scheme expression instead of the number after \repeat unfold.
> The solution is creating music via Scheme. As a first step, you can
> always use something like
>
> %%%
> \version "2.19.47"
> \displayMusic { \repeat unfold 2 { c'1 } }
> %%%
>
> to see what the music looks like on the Scheme level:
>
> ;
> (make-music
>'SequentialMusic
>'elements
>(list (make-music
>'UnfoldedRepeatedMusic
>'elements
>'()
>'repeat-count
>2
>'element
>(make-music
>  'SequentialMusic
>  'elements
>  (list (make-music
>  'NoteEvent
>  'duration
>  (ly:make-duration 0)
>  'pitch
>  (ly:make-pitch 0 0)))
> ;
>
> Now I built a music function using that information:
>
> %%%
> \version "2.18.2"
>
> createRepeats =
> #(define-music-function (parser location nums mus end) (list? ly:music?
> ly:music?)
> (let ((repeater (lambda (n) (make-music
>  'SequentialMusic
>  'elements
>  (list (make-music
>  'UnfoldedRepeatedMusic
>  'elements
>  '()
>  'repeat-count
>  n
>  'element
>  mus)
>end)
> (make-sequential-music (map repeater nums
> \createRepeats #'(2 3 7) { c'1 } { \bar "||" }
> 
>
> If you have further questions, feel free to ask back.
>
> Best, Simon
>
> PS. In recent development versions, one may use nicer syntax:
>
> 
> \version "2.19.47"
>
> createRepeats =
> #(define-music-function (nums mus end) (list? ly:music? ly:music?)
> (let ((repeater (lambda (n) (make-music
>  'SequentialMusic
>  'elements
>  (list (make-music
>  'UnfoldedRepeatedMusic
>  'elements
>  '()
>  'repeat-count
>      n
>  'element
>  mus)
>end)
> (make-sequential-music (map repeater nums
> \createRepeats 2,3,7 { c'1 } { \bar "||" }
> 
>
> On 04.09.2016 18:52, Оксана Крымина wrote:
>> hello all!
>>
>> please, help me to write a function to convert several numbers like (5
>> 7 10 8) to musical string like
>>   \repeat unfold 5 {c2} \bar ""
>>   \repeat unfold 7 {c2} \bar ""
>>   \repeat unfold 10 {c2} \bar ""
>>   \repeat unfold 8 {c2} \bar ""
>>
>> my code produces errors only:
>> \version "2.18.2"
>> musSpisok = #(define-scheme-function (parser location llen)(list?)
>>  (if (not (null? llen))
>> #{
>>\repeat unfold $(car llen) {c2} \bar ""  (
>> \musSpisok #'(cdr llen))  )
>>  #})
>>
>> thanx,
>> Oxana
>>
>> ___
>> 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


to make a function with argument list or vector

2016-09-04 Thread Оксана Крымина
hello all!

please, help me to write a function to convert several numbers like (5
7 10 8) to musical string like
 \repeat unfold 5 {c2} \bar ""
 \repeat unfold 7 {c2} \bar ""
 \repeat unfold 10 {c2} \bar ""
 \repeat unfold 8 {c2} \bar ""

my code produces errors only:
\version "2.18.2"
musSpisok = #(define-scheme-function (parser location llen)(list?)
(if (not (null? llen))
#{
  \repeat unfold $(car llen) {c2} \bar ""  (
\musSpisok #'(cdr llen))  )
#})

thanx,
Oxana

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


Re: Variables: multiple use with multiple stanza

2015-10-18 Thread Оксана Крымина
Michael,
Thank You a lot! I will use this way.

I would just write a plain simple melody and whereever you need
> additional lyrics just add another line of lyrics, like here
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Variables: multiple use with multiple stanza

2015-10-16 Thread Оксана Крымина
Hello all!
I engrave ancient russian church music in original notation (by \lyricmode)
and common score. This is single-voice music: one score + one string of
ancient notation ( + one string of words). But SOMETIMES there is TWO
strings of ancient notation under 1-2-3 notes. There I use construction
with \new Voise inside my music and \lyricsto this voice (new and context).
In case of multiple use of some music I use variables. The problem is: if
variable containes  \new voice = ... { ... } I can use this voice only
once. Secon use has no lyrics to this voice.
What's wrong?

Sample:

kulism = \relative c'  { e4( f) g( f) e( f e d)  \new Voice = "cdcb" { c( d
c b) } a1 }
slov = \lyricmode {  mifa solfa mifamire  l  }
\score
  {
  <<
\new Staff   <<   \new Voice = "one" { \relative c'  \kulism
\kulism \kulism }>>
\new Lyrics = "drob" \lyricsto "cdcb"{  "malozakr" }

\new Lyrics = "kr"  \lyricsto "one"   { \slov  \slov  \slov  }
\context Lyrics = "kr"  \lyricsto "cdcb" { doredosi }

  >>
  }

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