using run-translator

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

using run-translator

Jan-Peter Voigt
Hi list,

I am using `ly:run-translator` to analyze a music expression.
If I use << \\ >> simultaneous expressions with voice separator and set
a key signature at the start of the expression, no voice separation is
done and lily gives a bunch of warnings about colliing notes:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% voicify does not work in ly:run-translator, when a keysignature is given
%mymusic = \new Staff { \time 3/4 \key f \major \relative << { bes'4 }
\\ { g8 f } >> }
%mymusic = \new Staff { \key f \major \relative << { bes'4 } \\ { g8 f }
 >> }
% this works without a problem
mymusic = \new Staff { \time 3/4 \relative << { bes'4 } \\ { g8 f } >> }
mylayout = \layout {}

#(ly:run-translator mymusic mylayout)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Do I have to consist some special engraver to the layout used in
run-translator? Or do I have to look for something else?

TIA
Jan-Peter

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: using run-translator

David Kastrup
Jan-Peter Voigt <[hidden email]> writes:

> Hi list,
>
> I am using `ly:run-translator` to analyze a music expression.
> If I use << \\ >> simultaneous expressions with voice separator and
> set a key signature at the start of the expression, no voice
> separation is done and lily gives a bunch of warnings about colliing
> notes:
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> % voicify does not work in ly:run-translator, when a keysignature is given
> %mymusic = \new Staff { \time 3/4 \key f \major \relative << { bes'4 }
> \\ { g8 f } >> }
> %mymusic = \new Staff { \key f \major \relative << { bes'4 } \\ { g8 f
> }
>>> }
> % this works without a problem
> mymusic = \new Staff { \time 3/4 \relative << { bes'4 } \\ { g8 f } >> }
> mylayout = \layout {}
>
> #(ly:run-translator mymusic mylayout)
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> Do I have to consist some special engraver to the layout used in
> run-translator? Or do I have to look for something else?

You should scorify the music expression: a number of stock
transformations including voicification are done when doing that.

--
David Kastrup

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: using run-translator

Jan-Peter Voigt
Am 13.04.2017 um 22:01 schrieb David Kastrup:

> Jan-Peter Voigt <[hidden email]> writes:
>
>> Hi list,
>>
>> I am using `ly:run-translator` to analyze a music expression.
>> If I use << \\ >> simultaneous expressions with voice separator and
>> set a key signature at the start of the expression, no voice
>> separation is done and lily gives a bunch of warnings about colliing
>> notes:
>>
>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> % voicify does not work in ly:run-translator, when a keysignature is given
>> %mymusic = \new Staff { \time 3/4 \key f \major \relative << { bes'4 }
>> \\ { g8 f } >> }
>> %mymusic = \new Staff { \key f \major \relative << { bes'4 } \\ { g8 f
>> }
>>>> }
>> % this works without a problem
>> mymusic = \new Staff { \time 3/4 \relative << { bes'4 } \\ { g8 f } >> }
>> mylayout = \layout {}
>>
>> #(ly:run-translator mymusic mylayout)
>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>
>> Do I have to consist some special engraver to the layout used in
>> run-translator? Or do I have to look for something else?
>
> You should scorify the music expression: a number of stock
> transformations including voicification are done when doing that.
>

Thank you!
That was the missing piece.

Jan-Peter


_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: using run-translator

Thomas Morley-2
2017-04-14 9:13 GMT+02:00 Jan-Peter Voigt <[hidden email]>:

> Am 13.04.2017 um 22:01 schrieb David Kastrup:
>>
>> Jan-Peter Voigt <[hidden email]> writes:
>>
>>> Hi list,
>>>
>>> I am using `ly:run-translator` to analyze a music expression.
>>> If I use << \\ >> simultaneous expressions with voice separator and
>>> set a key signature at the start of the expression, no voice
>>> separation is done and lily gives a bunch of warnings about colliing
>>> notes:
>>>
>>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>> % voicify does not work in ly:run-translator, when a keysignature is
>>> given
>>> %mymusic = \new Staff { \time 3/4 \key f \major \relative << { bes'4 }
>>> \\ { g8 f } >> }
>>> %mymusic = \new Staff { \key f \major \relative << { bes'4 } \\ { g8 f
>>> }
>>>>>
>>>>> }
>>>
>>> % this works without a problem
>>> mymusic = \new Staff { \time 3/4 \relative << { bes'4 } \\ { g8 f } >> }
>>> mylayout = \layout {}
>>>
>>> #(ly:run-translator mymusic mylayout)
>>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>>
>>> Do I have to consist some special engraver to the layout used in
>>> run-translator? Or do I have to look for something else?
>>
>>
>> You should scorify the music expression: a number of stock
>> transformations including voicification are done when doing that.
>>
>
> Thank you!
> That was the missing piece.
>
> Jan-Peter



Hi Jan-Peter,

I never used ly:run-translator myself.

May I ask for a more meaningful code-example? Currently I've no clue
what it's all about.

Thanks,
  Harm

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: using run-translator

Jan-Peter Voigt
Hi Harm,


Am 14.04.2017 um 11:18 schrieb Thomas Morley:

> 2017-04-14 9:13 GMT+02:00 Jan-Peter Voigt <[hidden email]>:
>> Am 13.04.2017 um 22:01 schrieb David Kastrup:
>>>
>>> Jan-Peter Voigt <[hidden email]> writes:
>>>
>>>>  ...
>>>> Do I have to consist some special engraver to the layout used in
>>>> run-translator? Or do I have to look for something else?
>>>
>>>
>>> You should scorify the music expression: a number of stock
>>> transformations including voicification are done when doing that.
>>>
>>
>> Thank you!
>> That was the missing piece.
>>
>> Jan-Peter
>
>
>
> Hi Jan-Peter,
>
> I never used ly:run-translator myself.
>
> May I ask for a more meaningful code-example? Currently I've no clue
> what it's all about.
>
> Thanks,
>   Harm
>

I am working on code, I am going share, when its readable ... and when
easter vacation is over ;-)
The interesting part in using ly:run-translator is that you can let
(scheme-)engravers work on your music without actually engraving it.
Technically this seems to be used for preparing quoted music and other
stuff, when there is a message "interpreting music" (more than once).
Right now I am collecting music by catching note- and rest-events and
store it by time and voice in a hierarchical manner. That way I can
serialize the collected music as lilypond strings and reuse music,
collected by quoting individual instruments, in a piano part. The result
has to be adapted in several ways, but at least, I have the right notes
in place.
And there is another more important use case I will present later, when
its in a presentable stage.

Jan-Peter




_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel