Re: python-ly, ly.indent

2019-08-16 Thread Urs Liska
Just shortly: does

https://github.com/frescobaldi/python-ly/blob/master/ly/cli/main.py

and

https://github.com/frescobaldi/python-ly/blob/master/ly/cli/command.py#L116

help you further? I thought it would be best to look how the ly command line 
program does it.

Urs


Am 17. August 2019 03:00:47 MESZ schrieb ma...@masonhock.com:
>Hi all,
>
>The command line tools provided by python-ly are very
>convenient and easy to use, but I'm finding it a little harder to wrap
>my head around the Python module.
>
>For example, it is easy to automatically indent a file with
>
>$ ly "indent" file.ly
>
>or to indent the output of another command such as
>
>$ cat file.ly | ly "indent"
>
>I'd like to be able to do something similar in Python, using ly.indent
>to indent files or (preferably) strings. It seems that ly.indent might
>be what I want, but I'm having trouble figuring out how it works. The
>Indenter() class, with an indent() function, is defined here,[1] but
>I'm
>don't understand what a cursor object is or how to create and pass one.
>I next tried looking through Frescobaldi's code for example usage and
>found this,[2] but I think I would need to learn more about how
>Frescobaldi works in order to follow what's happening, which is deeper
>than I want to go to indent a string of Lilypond code.
>
>Is there a simple way to use ly.indent similarly to `ly "indent"`, or
>would I be better off invoking `ly "indent"` externally with
>os.system()?
>
>Thanks,
>
>Mason
>
>[1]
>https://github.com/frescobaldi/python-ly/blob/0d91ca2450ba01a8158f53ba05202af3e13bf78d/ly/indent.py
>
>[2]
>https://github.com/frescobaldi/frescobaldi/blob/09cae764126b505dedf0182beccd78d7934b2de4/frescobaldi_app/indent.py

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


python-ly, ly.indent

2019-08-16 Thread mason
Hi all,

The command line tools provided by python-ly are very
convenient and easy to use, but I'm finding it a little harder to wrap
my head around the Python module.

For example, it is easy to automatically indent a file with

$ ly "indent" file.ly

or to indent the output of another command such as

$ cat file.ly | ly "indent"

I'd like to be able to do something similar in Python, using ly.indent
to indent files or (preferably) strings. It seems that ly.indent might
be what I want, but I'm having trouble figuring out how it works. The
Indenter() class, with an indent() function, is defined here,[1] but I'm
don't understand what a cursor object is or how to create and pass one.
I next tried looking through Frescobaldi's code for example usage and
found this,[2] but I think I would need to learn more about how
Frescobaldi works in order to follow what's happening, which is deeper
than I want to go to indent a string of Lilypond code.

Is there a simple way to use ly.indent similarly to `ly "indent"`, or
would I be better off invoking `ly "indent"` externally with
os.system()?

Thanks,

Mason

[1] 
https://github.com/frescobaldi/python-ly/blob/0d91ca2450ba01a8158f53ba05202af3e13bf78d/ly/indent.py

[2] 
https://github.com/frescobaldi/frescobaldi/blob/09cae764126b505dedf0182beccd78d7934b2de4/frescobaldi_app/indent.py


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


Re: hairpins collide with markup

2019-08-16 Thread Rachel Knight via lilypond-user
This works, thanks!
Rachel

> On Aug 16, 2019, at 12:12 AM, Pierre Perol-Schneider 
>  wrote:
> 
> Hi Rachel,
> Remove the first '\down to avoid the message error.
> Here's a possible code:
> 
> \version "2.19.81"
> \language "english"
> 
> pedaldn = \markup \concat \vcenter \center-align { D \tiny\natural }
> pedalan = \markup \concat \vcenter \center-align { A \tiny\natural }
> pedaldf = \markup \concat \vcenter \center-align { D \tiny\flat }
> pedalgf = \markup \concat \vcenter \center-align { G \tiny\flat }
> 
> up = \change Staff = "treble" 
> down = \change Staff = "bass" 
> 
> Treble = { s2.*2 }
> 
> Bass = \relative c {
>   \clef bass
>   \time 6/8
>   gf16 ef' gf \up bf ef ef \down gf,, ef' bf' \up c ef ef |
>   \down f,, c' a' \up c f a \down bf,, f' bf \up df f bf |
> }
> 
> dyn = {
>   s2.\<-\pedalgf -\markup \concat \vcenter \center-align { C \tiny\natural }
>   s4.-\pedalan-\pedaldn s4-\pedaldf s16 s\!
> }
> 
> \score {
>   \new GrandStaff
>   <<
> \new Staff = "treble" { \Treble }
> \new Staff = "bass" { \Bass }
> \new Dynamics \with { \revert TextScript.font-shape  } { \dyn }
>   >>
> }
> 
> Cheers,
> Pierre
> 
> Le ven. 16 août 2019 à 04:25, Rachel Knight via lilypond-user 
> mailto:lilypond-user@gnu.org>> a écrit :
> 
> 
>> Begin forwarded message:
>> 
>> From: Rachel Knight mailto:knig8...@icloud.com>>
>> Subject: Re: hairpins collide with markup
>> Date: August 15, 2019 at 6:17:18 PM MST
>> To: Ben mailto:soundsfromso...@gmail.com>>
>> 
>> Hi Ben,
>> Thanks for replying. I’m still not sure how to fix the error. Aren’t “bass” 
>> and “treble” the same context type? Would you be able to send me code for 
>> this example without the collisions?
>> Best,
>> Rachel
> 
> ___
> 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


New call for participation: fine-tuning script glyphs in LaTeX documents

2019-08-16 Thread Urs Liska
Hi all,

as said a few days ago I'm rewriting the lilyglyphs package, and it turns out 
that it is now significantly easier to add new commands for better coverage. 
I've already replaced the number of rest commands (\wholeNoteRest, 
\halfNoteRest etc.) by one single command \lilyRest that can e.g. be used like 
\lilyRest{2} (for a half note rest), \lilyRest[classical]{4} (for a "classical" 
quarter note rest) or \lilyRest[noline]{M1} (for a MMR without the stafflines).

Now I've implemented a command \lilyScript to access all the script glyphs in 
Emmentaler, and it turns out that *declaring* glyphs in a list is much easier 
than writing individual macros for each one.

See the attached result of the generated test file (don't try compiling the 
.tex file, that won't work, it's just to show the input syntax). As you see 
there is much to be done about how the glyphs have to be positioned in the 
"alien" context of continuous text (for example: items like the fermata are 
horizontally centered, which is natural in a score but doesn't work within a 
paragraph of text). This is easily done by setting "design options" like 
voffset, scale, lpadding, rpadding. But it *has* to be done, and I'd be pleased 
to be joined by people who would like to use notation elements in LaTeX 
documents, have a sharp eye for these details but maybe wouldn't dare tackling 
such things from a programming side ...

Please get back to me to explain how things would have to be set up for testing 
and contributing.

Best
Urs


scripts.pdf
Description: Adobe PDF document


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


Re: hairpins collide with markup

2019-08-16 Thread Pierre Perol-Schneider
Hi Rachel,
Remove the first '\down to avoid the message error.
Here's a possible code:

\version "2.19.81"
\language "english"

pedaldn = \markup \concat \vcenter \center-align { D \tiny\natural }
pedalan = \markup \concat \vcenter \center-align { A \tiny\natural }
pedaldf = \markup \concat \vcenter \center-align { D \tiny\flat }
pedalgf = \markup \concat \vcenter \center-align { G \tiny\flat }

up = \change Staff = "treble"
down = \change Staff = "bass"

Treble = { s2.*2 }

Bass = \relative c {
  \clef bass
  \time 6/8
  gf16 ef' gf \up bf ef ef \down gf,, ef' bf' \up c ef ef |
  \down f,, c' a' \up c f a \down bf,, f' bf \up df f bf |
}

dyn = {
  s2.\<-\pedalgf -\markup \concat \vcenter \center-align { C \tiny\natural }
  s4.-\pedalan-\pedaldn s4-\pedaldf s16 s\!
}

\score {
  \new GrandStaff
  <<
\new Staff = "treble" { \Treble }
\new Staff = "bass" { \Bass }
\new Dynamics \with { \revert TextScript.font-shape  } { \dyn }
  >>
}

Cheers,
Pierre

Le ven. 16 août 2019 à 04:25, Rachel Knight via lilypond-user <
lilypond-user@gnu.org> a écrit :

>
>
> Begin forwarded message:
>
> *From: *Rachel Knight 
> *Subject: **Re: hairpins collide with markup*
> *Date: *August 15, 2019 at 6:17:18 PM MST
> *To: *Ben 
>
> Hi Ben,
> Thanks for replying. I’m still not sure how to fix the error. Aren’t
> “bass” and “treble” the same context type? Would you be able to send me
> code for this example without the collisions?
> Best,
> Rachel
>
>
> ___
> 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