Re: A separate line for dynamics?

2018-09-17 Thread foxfanfare
Thomas Morley-2 wrote
> 2018-09-17 12:40 GMT+02:00 Bernhard Kleine 

> bernhard.kleine@

> :
>> I found it.
>> However without the -"legato" the \f is centered , with the -"legato" it
>> is
>> not. How to draw them on the same line?
>>
>> dynOrgel = {
>>   {
>>s2\f s4-"legato"
>>   }
>> }
>>
> 
> \new Dynamics = "dynOrgel"
>   \with { \override TextScript.Y-offset = #(scale-by-font-size -0.6) }
> {  \dynOrgel }
> 
> See:
> http://lists.gnu.org/archive/html/bug-lilypond/2018-08/msg00061.html
> 
> Cheers,
>   Harm
> 
> ___
> lilypond-user mailing list

> lilypond-user@

> https://lists.gnu.org/mailman/listinfo/lilypond-user

In certain case, I find it useful to make the text seen as a dynamic:

\version "2.19.81"

legato = #(make-dynamic-script #{
  \markup {
\with-dimensions #'(0 . 0) #'(0 . 0)
\general-align #Y #CENTER
\override #'(font-name . "TeXGyreSchola, Italic")
"legato" }#})

dynOrgel = {
  {
   s2\f s4\legato
  }
}

\new Dynamics = "dynOrgel" {  \dynOrgel }




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

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


Re: Exclude single notes from ChordNames?

2018-09-17 Thread Aaron Hill

On 2018-09-17 3:21 pm, sg2002 wrote:

Currently running ChordNames on the example I presented produces this:
D Dm/A F Dm/A D Dm/A F Dm/A E E7/G# G# E7/G# E E7/G# G# E7/G#
That's too much clutter for me so I would prefer only seeing the 
chords:

Dm/A Dm/A Dm/A Dm/A E7/G# E7/G# E7/G# E7/G#
Even better if the output could only have the chords shown during the 
changes:

Dm/A E7/G#


I think what you want is something like this:


\version "2.19.82"
<< \new ChordNames \chordmode { d1*2:m/a | e1*2:7/gis }
   \new Staff { \clef bass
 d4 \chordmode { d:m/a } f, q | d4 q f, q |
 e,4 \chordmode { e:7^5/gis } gis, q | e,4 q gis, q } >>


ChordNames does not do magic with the notes provided.  You cannot just 
duplicate notes intended for a staff and get useful results.  Instead, 
use that context specifically when you want a chord to appear.  In 
addition to specifying durations for the chord changes, use \skip (or s) 
as needed when there is no associated chord.


-- Aaron Hill

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


Re: Exclude single notes from ChordNames?

2018-09-17 Thread Simon Albrecht

On 18.09.2018 00:21, sg2002 wrote:

Currently running ChordNames on the example I presented produces this:
D Dm/A F Dm/A D Dm/A F Dm/A E E7/G# G# E7/G# E E7/G# G# E7/G#
That's too much clutter for me so I would prefer only seeing the chords:
Dm/A Dm/A Dm/A Dm/A E7/G# E7/G# E7/G# E7/G#
Even better if the output could only have the chords shown during the 
changes:

Dm/A E7/G#


Then why don’t you type exactly that? And how would you have the bass 
represented? I could just guess:


%%%
\version "2.18.2"

<<
  \new ChordNames \chordmode {
    d1:m/a
    e:7^5/gis
  }
  \new Staff {
    \clef bass
    d4 f d f
    e gis e gis
  }
>>
%%

but I have my doubts if that helps.

Best, Simon

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


Re: Exclude single notes from ChordNames?

2018-09-17 Thread sg2002

Currently running ChordNames on the example I presented produces this:
D Dm/A F Dm/A D Dm/A F Dm/A E E7/G# G# E7/G# E E7/G# G# E7/G#
That's too much clutter for me so I would prefer only seeing the chords:
Dm/A Dm/A Dm/A Dm/A E7/G# E7/G# E7/G# E7/G#
Even better if the output could only have the chords shown during the 
changes:

Dm/A E7/G#

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


Re: Exclude single notes from ChordNames?

2018-09-17 Thread Simon Albrecht

On 17.09.2018 19:13, sg2002 wrote:

\new ChordNames {
   d \chordmode { d:m/a } f, q d q f, q  e, \chordmode { e:7^5/gis }  
gis, q e, q gis, q

 }

Since chords are often inverted and I'm not a proficient player by any 
means, having chord is nice. On the other hand I have no problems 
sight reading single notes. So ideally I want to exclude them from 
showing. For the example above that would mean only showing Dm and E7 
chords. 


This example seems to mix up some concepts and it’s not clear to me what 
you really want; could you give an example of what the output should 
look like (even if faked with another program or just drawn on a piece 
of paper)?


Best, Simon

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


Re: Preventing a cautionary accidental

2018-09-17 Thread Aaron Hill

On 2018-09-17 2:38 pm, David Sumbler wrote:

%%
\version "2.19.82"

\language "english"

\score {
  \new Staff \with { \accidentalStyle modern } {
\relative {
  \time 9/8
  e''8 fs gs a b c d e fs | g8 fs e d c b a g fs |
  } } }
%%

In the above example, a cautionary natural is given to the penultimate
note.  However, here it is not only unnecessary but is actually a
little confusing.

What is the simplest way of preventing the accidental from being
printed?


You could change the accidental style temporarily:


  e''8 fs gs a b c d e fs | g8 fs e d c b a \once \accidentalStyle 
forget g fs



-- Aaron Hill

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


Re: Preventing a cautionary accidental

2018-09-17 Thread Malte Meyn




Am 17.09.18 um 23:38 schrieb David Sumbler:

What is the simplest way of preventing the accidental from being
printed?


\once \omit Accidental

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


Preventing a cautionary accidental

2018-09-17 Thread David Sumbler
%%
\version "2.19.82"

\language "english"

\score {
  \new Staff \with { \accidentalStyle modern } {
\relative {
  \time 9/8
  e''8 fs gs a b c d e fs | g8 fs e d c b a g fs |
  } } }
%%

In the above example, a cautionary natural is given to the penultimate
note.  However, here it is not only unnecessary but is actually a
little confusing.

What is the simplest way of preventing the accidental from being
printed?

David

example.ps
Description: PostScript document
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: A separate line for dynamics?

2018-09-17 Thread Thomas Morley
2018-09-17 12:40 GMT+02:00 Bernhard Kleine :
> I found it.
> However without the -"legato" the \f is centered , with the -"legato" it is
> not. How to draw them on the same line?
>
> dynOrgel = {
>   {
>s2\f s4-"legato"
>   }
> }
>

\new Dynamics = "dynOrgel"
  \with { \override TextScript.Y-offset = #(scale-by-font-size -0.6) }
{  \dynOrgel }

See:
http://lists.gnu.org/archive/html/bug-lilypond/2018-08/msg00061.html

Cheers,
  Harm

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


Re: Shape the angle of a broken hairpin's first part

2018-09-17 Thread Thomas Morley
2018-09-17 12:05 GMT+02:00 Thomas Morley :
> 2018-09-17 11:55 GMT+02:00 Urs Liska :
>> thanks for this, which gives me a handle to the first part of the hairpin at
>> least.
>>
>> But my problem is not solved with the 'height property.
> [...]
>
>> See my updated example
> [...]
>
> I'll have a look in the evening, now I have to run for my regular job ...
>
> Cheers,
>   Harm

Hi Urs,

as said before you'll need to go for the 'stencil.
Though, ly:hairpin::print, the default-stencil, is coded in C++. There
the defaults-heights for broken hairpins are set to 1/3 and 2/3 of
'height.
Thus we need a scheme-rewrite of the stencil-procedure to reset them.
Below I slightly extend a coding by David Nalesnik from
https://lists.gnu.org/archive/html/lilypond-user/2018-02/msg00181.html

Btw, the rest of the linked thread is very interesting as well:
Once you have a scheme-rewrite it's possible to add a plethora of
other features...

Back on topic.
Attached you'll find David's coding. My addition is to add a
'broken-heights-property.
Now you can adjust the values and call the scheme-stencil afterwards,
instead of the default-stencil.

Cheers,
  Harm
\version "2.19.23"

%% After:
%% https://lists.gnu.org/archive/html/lilypond-user/2018-02/msg00181.html
%% by David Nalesnik

#(define (define-grob-property symbol type? description)
   (if (not (equal? (object-property symbol 'backend-doc) #f))
   (ly:error (_ "symbol ~S redefined") symbol))

   (set-object-property! symbol 'backend-type? type?)
   (set-object-property! symbol 'backend-doc description)
   symbol)

#(for-each
  (lambda (x)
(apply define-grob-property x))

  `(
 (circled-tip-radius ,number? "Radius for hairpin circled tip")
 (broken-heights ,number-list? "Determines the height of broken Hairpins")
 ; add more properties here
 ))


#(define broken-neighbor
   (lambda (grob)
 (let* ((pieces (ly:spanner-broken-into (ly:grob-original grob)))
(me-list (member grob pieces)))
   (if (> (length me-list) 1)
   (cadr me-list)
   '()

#(define (interval-dir-set i val dir)
   (cond ((= dir LEFT) (set-car! i val))
 ((= dir RIGHT) (set-cdr! i val))
 (else (ly:error "dir must be LEFT or RIGHT"

#(define (other-dir dir) (- dir))

#(define hairpin::print-scheme
   (lambda (grob)
 (let ((grow-dir (ly:grob-property grob 'grow-direction)))
   (if (not (ly:dir? grow-dir))
   (begin
(ly:grob-suicide! grob)
'()))
   
   (let* ((padding (ly:grob-property grob 'bound-padding 0.5))
  (bounds (cons (ly:spanner-bound grob LEFT)
(ly:spanner-bound grob RIGHT)))
  (broken (cons
   (not (= (ly:item-break-dir (car bounds)) CENTER))
   (not (= (ly:item-break-dir (cdr bounds)) CENTER)
 
 (if (cdr broken)
 (let ((next (broken-neighbor grob)))
   (if (ly:spanner? next)
   (begin
(ly:grob-property next 'after-line-breaking)
(set-cdr! broken (grob::is-live? next)))
   (set-cdr! broken #f
 
 (let* ((common
 (ly:grob-common-refpoint (car bounds) (cdr bounds) X))
(x-points (cons 0 0))
(circled-tip (ly:grob-property grob 'circled-tip))
(height (* (ly:grob-property grob 'height 0.2)
  (ly:staff-symbol-staff-space grob)))
;(rad (* 0.525 height))
(rad (ly:grob-property grob 'circled-tip-radius (* 0.525 height)))
; commented out is directly from C++, but it leads to think lines when
; no circled tip!
;(thick 1.0)
;(thick (if circled-tip
;(* (ly:grob-property grob 'thickness 1.0)
;(ly:staff-symbol-line-thickness grob))
;thick))
(thick (* (ly:grob-property grob 'thickness 1.0)
 (ly:staff-symbol-line-thickness grob
   
   (define (inner dir)
 (let* ((b (interval-bound bounds dir))
(e (ly:generic-bound-extent b common))) ; X-AXIS assumed
   (interval-dir-set
x-points (ly:grob-relative-coordinate b common X) dir)
   
   (if (interval-bound broken dir)
   (if (= dir LEFT)
   (interval-dir-set
x-points (interval-bound e (other-dir dir)) dir)
   (let* ((broken-bound-padding
   (ly:grob-property grob 'broken-bound-padding 0.0))
  (chp (ly:grob-object grob 'concurrent-hairpins)))
 (let loop ((i 0))
   (if (and (ly:grob-array? chp) ; hmm...why no test in C++ needed?
(< i 

Re: variables for specific kinds of markup?

2018-09-17 Thread David Kastrup
"Marc Evanstein"  writes:

> Thanks so much – changing it to define-event-function worked
> perfectly. Is a markup considered an "event" rather than "music"?

No.  But ^\markup ... is.

> Was define-music-function somehow returning that event attached to
> empty music or something?

The decision whether to attach is made when the function is _called_,
not when it returns.

If you write something like

\displayLilyMusic c \displayLilyMusic d

then LilyPond cannot tentatively call the second \displayLilyMusic
before the first in order to decide whether it might return some
articulation to attach to the c before it calls the first
\displayLilyMusic .

LilyPond 2.20 has an additional sweepup stage that will let

\displayLilyMusic c \displayLilyMusic ^"Hi"

attach the ^"Hi" from the second \displayLilyMusic call to the finished
c from the first \displayLilyMusic call so that while the order of
evaluation gets messed up you would not get to see the same error
message as you do with your version.

This will likely reduce the number of complaints, but evaluation order
will not likely be always what one would expect.

-- 
David Kastrup

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


Exclude single notes from ChordNames?

2018-09-17 Thread sg2002

Hello.

I've decided to learn a couple of songs on bayan, which is a Russian 
chromatic accordion.


Basic bayan bass parts often have a single bass notes followed by a 
chord, e. g.:


\new ChordNames {
   d \chordmode { d:m/a } f, q d q f, q  e, \chordmode { e:7^5/gis }  
gis, q e, q gis, q

 }

Since chords are often inverted and I'm not a proficient player by any 
means, having chord is nice. On the other hand I have no problems sight 
reading single notes. So ideally I want to exclude them from showing. 
For the example above that would mean only showing Dm and E7 chords.


Even better, I wish there was a way to get \set chordChanges = ##t 
working here, so that not only I would only see the names of real 
chords, but also only see them during changes.


Any tips? I had the idea of hacking a function that replaces single 
notes with rests, but maybe there's a simpler way?



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


Re: variables for specific kinds of markup?

2018-09-17 Thread Marc Evanstein
Thanks so much – changing it to define-event-function worked perfectly. Is a 
markup considered an "event" rather than "music"? Was define-music-function 
somehow returning that event attached to empty music or something?

At any rate, glad to hear that this is getting simpler in the near future, and 
many thanks for all the help!

September 17, 2018 8:01 AM, "David Kastrup"  wrote:

> "Marc Evanstein (formerly Evans)"  writes:
> 
>> Hi all,
>> 
>> I'm trying to create a variable to handle a certain type of markup
>> text. For instance, I'd like percussion strikings to be in small caps
>> above the staff, and what I really want is to define some sort of
>> macro that replaces all instances of "\striking { theText }" with
>> "^\markup\smallCaps { theText }".
>> 
>> The following clearly doesn't work (much as I would like it to):
>> 
>> striking = ^\markup\smallCaps
> 
> Current master will allow
> 
> striking = ^\markup \smallCaps \etc
> 
>> From searching around, it seems like I need to define a function using
>> scheme. I tried this:
>> 
>> striking = #(define-music-function (parser location text)
>> (string?)
>> #{
>> ^\markup\smallCaps { #text }
>> #})
>> 
>> ... and while the single line "\striking mallet" seems to render the
>> word mallet as a smallCaps markup above a dummy staff, when I try to
>> incorporate it into a series of notes, e.g.:
>> 
>> {c'4 \striking mallet d'4 e'4 f'4 }
>> 
>> I get an "error: unexpected post-event". What exactly does that mean?
> 
> Current master would have worked as expected for this use...
> 
> At any rate, you are pretty close (whether we are talking about 2.18 or
> 2.19). Just use define-event-function instead of define-music-function
> .
> 
> And rejoice that LilyPond will have fewer stumbling blocks in the near
> future. Or at least will be better at hiding the stumbling blocks so
> you'll just get hit by them when digging deeper.
> 
> --
> David Kastrup


"I'm a random guy. I shake a hand and make a friend. I don't do egotistical 
things." 
– Vanilla Ice

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


Re: Hacklily now supports LilyPond 2.19.82

2018-09-17 Thread Joshua Netterfield







Hi Federico,
I think sharing Hacklily on the Easier Editing page would be great! Though 
never perfect, I feel that it is mature enough to be helpful. Let me know if 
there is anything you would like to see before listing it.
Thanks!




Joshua Netterfield





On Mon, Sep 17, 2018 at 9:40 AM -0400, "Federico Bruni"  
wrote:










Hey Joshua

I had a quick look at hacklily and it seems pretty cool!
When you think the project is mature enough, it may be mentioned here:
http://lilypond.org/easier-editing.html



Il giorno lun 17 set 2018 alle 15:19, Joshua Netterfield 
 ha scritto:
> Hello all,
> 
> Hacklily, an online LilyPond editor, now supports LilyPond 2.19.82. 
> To use it, go to https://www.hacklily.org and make sure your song 
> includes a 2.19 version statement (e.g., \version "2.19.82"). I 
> intend to support the most recent stable and unstable versions going 
> forward.
> 
> As always, please let me know if you have any feedback by replying to 
> this email, emailing me directly, or creating an issue on GitHub 
> (https://github.com/hacklily/hacklily). Patches are also welcome.
> 
> Best,
> Joshua Netterfield
> https://www.hacklily.org
> 
> 
> 
> ___
> 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


Re: crash running translator

2018-09-17 Thread David Kastrup
Jan-Peter Voigt  writes:

> Dear all,
>
> I stumbled over something that looks like a bug.
> If one uses ly:run-translator to process some music a dotted rest
> crashes lilypond:
>
> \version "2.19.82"
> #(ly:run-translator #{ r2. #} #{ \layout {} #})
>
> The error message is:
> Wrong number of arguments to #
>
> Does anybody know a way to circumvent this?

Well, looking up the definition of ly:run-translator I read:

LY_DEFINE (ly_run_translator, "ly:run-translator",
   2, 1, 0, (SCM mus, SCM output_def),
   "Process @var{mus} according to @var{output-def}.  An"
   " interpretation context is set up, and @var{mus} is"
   " interpreted with it.  The context is returned in its"
   " final state.\n"
   "\n"
   "Optionally, this routine takes an object-key to"
   " to uniquely identify the score block containing it.")
[...]

Which makes me barf.  The final paragraph is just gobbledygook.  It
doesn't help that this mysterious optional object-key is _accepted_ but
the function signature does not even contain a parameter declaration for
it.

Ok, onward.  Running with -dverbose I get

-*- mode: compilation; default-directory: "/tmp/" -*-
Compilation started at Mon Sep 17 15:45:07

lilypond -dverbose gok.ly
GNU LilyPond 2.21.0
]
]
]
]
]
[... we should probably do something about those, dozens more]
Processing `gok.ly'
Parsing...
Interpreting music...Backtrace:
In unknown file:
   ?:  0* [lilypond-main ("gok.ly")]
In /usr/local/share/lilypond/2.21.0/scm/lily.scm:
1032:  1* (let* ((failed #)) (if (ly:get-option #) (begin #)) ...)
1032:  2* [lilypond-all ("gok.ly")]
1045:  3  (let* ((failed #) (separate-logs #) (ping-log #) ...) (gc) ...)
1057:  4* [for-each # ("gok.ly")]
In unknown file:
   ?:  5* [# "gok.ly"]
In /usr/local/share/lilypond/2.21.0/scm/lily.scm:
1059:  6* (let* (# # #) (if separate-logs #) (if ping-log #) ...)
1070:  7* [lilypond-file # "gok.ly"]
1105:  8  [catch ly-file-failed # #]
In unknown file:
   ?:  9* [#]
In /usr/local/share/lilypond/2.21.0/scm/lily.scm:
1106: 10* [ly:parse-file "gok.ly"]
In gok.ly:
   Now it's getting interesting:

   2: 11* [ly:run-translator # #]
In unknown file:
   ?: 12* [# #]
   ?: 13* [# # #]
   ?: 14* [# # # ...]
   ?: 15* [ly:rest::width #]
   ?: 16* [lookup-font # ((# # # #) (# # # # ...) ())]

ERROR: In procedure lookup-font:
ERROR: Wrong number of arguments to #

Compilation exited abnormally with code 1 at Mon Sep 17 15:45:08

Ok, so we have
SCM
Rest::width (SCM smob)
{
  return generic_extent_callback (unsmob (smob), X_AXIS);
}

and

Rest::generic_extent_callback (Grob *me, Axis a)
{
  /*
Don't want ledgers: ledgers depend on Y position, which depends on
rest collision, which depends on stem size which depends on beam
slop of opposite note column.

consequence: we get too small extents and potential collisions
with ledgered rests.
  */
  SCM m = brew_internal_stencil (me, a != X_AXIS);
  return ly_interval2scm (unsmob (m)->extent (a));
}

and

Rest::brew_internal_stencil (Grob *me, bool ledgered)
{
  SCM durlog_scm = me->get_property ("duration-log");
  if (!scm_is_number (durlog_scm))
return Stencil ().smobbed_copy ();

  int durlog = scm_to_int (durlog_scm);

  string style = robust_symbol2string (me->get_property ("style"), "default");

  Font_metric *fm = Font_interface::get_default_font (me);
  string font_char = glyph_name (me, durlog, style, ledgered, 0.0);
  Stencil out = fm->find_by_name (font_char);
  if (out.is_empty ())
me->warning (_f ("rest `%s' not found", font_char.c_str ()));

  return out.smobbed_copy ();
}


Actually, looking at the traceback it would seem like lookup-font is not
actually called with the wrong number of arguments but something is
confused by the first argument being *undefined*.  Which is a value that
usually is used in the C API for signifying "there isn't a proper Scheme
value here", so passing it around can lead to surprises.

This appears to be the problem from

Font_metric *
Font_interface::get_default_font (Grob *me)
{
  Font_metric *fm = unsmob (me->get_property ("font"));
  if (!fm)
{
  SCM chain = music_font_alist_chain (me);

  fm = select_font (me->layout (), chain);
  me->set_property ("font", fm->self_scm ());
}

  return fm;
}

And likely because of me->layout () being unsuitable.  Or not.

The problem only occurs with dotted rests.  Maybe the dots rely on work
being done already by the rest itself but get typeset first?

I don't really know.  This is sort of as deep as I get right now.

-- 
David Kastrup

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


Re: variables for specific kinds of markup?

2018-09-17 Thread David Kastrup
"Marc Evanstein (formerly Evans)"  writes:

> Hi all,
>
> I'm trying to create a variable to handle a certain type of markup
> text. For instance, I'd like percussion strikings to be in small caps
> above the staff, and what I really want is to define some sort of
> macro that replaces all instances of "\striking { theText }" with
> "^\markup\smallCaps { theText }".
>
> The following clearly doesn't work (much as I would like it to):
>
> striking = ^\markup\smallCaps

Current master will allow

striking = ^\markup \smallCaps \etc

> From searching around, it seems like I need to define a function using
> scheme. I tried this:
>
> striking = #(define-music-function (parser location text)
>  (string?)
>  #{
>    ^\markup\smallCaps { #text }
>  #})
>
> ... and while the single line "\striking mallet" seems to render the
> word mallet as a smallCaps markup above a dummy staff, when I try to
> incorporate it into a series of notes, e.g.:
>
> {c'4 \striking mallet d'4 e'4 f'4 }
>
> I get an "error: unexpected post-event". What exactly does that mean?

Current master would have worked as expected for this use...

At any rate, you are pretty close (whether we are talking about 2.18 or
2.19).  Just use define-event-function instead of define-music-function
.

And rejoice that LilyPond will have fewer stumbling blocks in the near
future.  Or at least will be better at hiding the stumbling blocks so
you'll just get hit by them when digging deeper.

-- 
David Kastrup

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


Re: lyluatex: wrapper with both lilypond code and optional arguments

2018-09-17 Thread Malte Meyn



Am 17.09.18 um 16:30 schrieb Malte Meyn:

Hi list,

I have the following problem: I want to use a wrapper for the ly 
environment that contains some \layout code, music function definitions 
etc. *And* I would like to use lyluatex’s label argument. Any idea how 
to do both? The following example shows both a ly environment with label 
and a wrapper called “aly”. But I haven’t found a way to label the aly 
environment.


Thanks in advance for any hints and help!
Malte


Forgot to mention: I tried to use \begin{dly}[…] here instead of \ly:


\newenvironment{aly}{
\ly
\layout {
   \context {
     \Voice
     \override NoteHead.color = ##blue
   }
}
}{\endly}


But then the LilyPond code is processed by LuaLaTeX. And LuaLaTeX 
complains that it doesn’t know the \layout command ;)


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


lyluatex: wrapper with both lilypond code and optional arguments

2018-09-17 Thread Malte Meyn

Hi list,

I have the following problem: I want to use a wrapper for the ly 
environment that contains some \layout code, music function definitions 
etc. *And* I would like to use lyluatex’s label argument. Any idea how 
to do both? The following example shows both a ly environment with label 
and a wrapper called “aly”. But I haven’t found a way to label the aly 
environment.


Thanks in advance for any hints and help!
Malte

%%%

\documentclass[a4paper,12pt]{article}
\usepackage{lipsum}

\usepackage[nofragment,labelprefix=nbsp:]{lyluatex}

\newcommand{\preLilyPondExample}{\par\medskip}
\newcommand{\postLilyPondExample}{\par\medskip}

\newenvironment{aly}{
\ly
\layout {
  \context {
\Voice
\override NoteHead.color = ##blue
  }
}
}{\endly}

\begin{document}
\textbf{\pageref{nbsp:test}}

\lipsum
\begin{ly}[label=test]
  \new Staff \with {
instrumentName = "Octobass"
  } \relative {
c'1 R1*20
  }
\end{ly}
\lipsum
\begin{aly}
  \new Staff \with {
instrumentName = "Octobass"
  } \relative {
c'1 R1*20
  }
\end{aly}
\lipsum
\end{document}

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


Re: Hacklily now supports LilyPond 2.19.82

2018-09-17 Thread Federico Bruni

Hey Joshua

I had a quick look at hacklily and it seems pretty cool!
When you think the project is mature enough, it may be mentioned here:
http://lilypond.org/easier-editing.html



Il giorno lun 17 set 2018 alle 15:19, Joshua Netterfield 
 ha scritto:

Hello all,

Hacklily, an online LilyPond editor, now supports LilyPond 2.19.82. 
To use it, go to https://www.hacklily.org and make sure your song 
includes a 2.19 version statement (e.g., \version "2.19.82"). I 
intend to support the most recent stable and unstable versions going 
forward.


As always, please let me know if you have any feedback by replying to 
this email, emailing me directly, or creating an issue on GitHub 
(https://github.com/hacklily/hacklily). Patches are also welcome.


Best,
Joshua Netterfield
https://www.hacklily.org



___
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


variables for specific kinds of markup?

2018-09-17 Thread Marc Evanstein (formerly Evans)

Hi all,

I'm trying to create a variable to handle a certain type of markup text. 
For instance, I'd like percussion strikings to be in small caps above 
the staff, and what I really want is to define some sort of macro that 
replaces all instances of "\striking { theText }" with 
"^\markup\smallCaps { theText }".


The following clearly doesn't work (much as I would like it to):

striking = ^\markup\smallCaps

From searching around, it seems like I need to define a function using 
scheme. I tried this:


striking = #(define-music-function (parser location text)
 (string?)
 #{
   ^\markup\smallCaps { #text }
 #})

... and while the single line "\striking mallet" seems to render the 
word mallet as a smallCaps markup above a dummy staff, when I try to 
incorporate it into a series of notes, e.g.:


{c'4 \striking mallet d'4 e'4 f'4 }

I get an "error: unexpected post-event". What exactly does that mean?

I did notice something close to what I want here:

http://lilypond.org/doc/v2.19/Documentation/extending/new-markup-command-definition.en.html

But it still would require me to put something like \markup\striking, as 
opposed to \striking.


I'm pretty new to lilypond, so apologies if I've said something that 
betrays a lack of understanding. I guess I'd just mostly like to know 
what that "unexpected post-event" error means.


Thanks in advance!

Marc


--
Marc Evans
PhD Candidate in Music Composition at UCSB
Stanford BA '10, Music; MA '11, Music, Science and Technology
www.marcevansmusic.com

---

"I'm a random guy. I shake a hand and make a friend. I don't do egotistical 
things."
– Vanilla Ice


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


Hacklily now supports LilyPond 2.19.82

2018-09-17 Thread Joshua Netterfield

Hello all,

Hacklily, an online LilyPond editor, now supports LilyPond 2.19.82. To 
use it, go to https://www.hacklily.org and make sure your song includes 
a 2.19 version statement (e.g., \version "2.19.82"). I intend to support 
the most recent stable and unstable versions going forward.


As always, please let me know if you have any feedback by replying to 
this email, emailing me directly, or creating an issue on GitHub 
(https://github.com/hacklily/hacklily). Patches are also welcome.


Best,
Joshua Netterfield
https://www.hacklily.org



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


crash running translator

2018-09-17 Thread Jan-Peter Voigt
Dear all,

I stumbled over something that looks like a bug.
If one uses ly:run-translator to process some music a dotted rest
crashes lilypond:

\version "2.19.82"
#(ly:run-translator #{ r2. #} #{ \layout {} #})

The error message is:
Wrong number of arguments to #

Does anybody know a way to circumvent this?

Jan-Peter

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


Re:A separate line for dynamics?

2018-09-17 Thread Peter Toye
Bruno,

I think what you're looking for is a \new Dynamics staff.

A Dynamics context is available to engrave dynamics on their own horizontal 
line. Use spacer
rests to indicate timing. (Notes in a Dynamics context will also take up 
musical time, but will
not be engraved.) The Dynamics context can usefully contain some other items 
such as text
scripts, text spanners, and piano pedal marks. 

It's very well hidden. Try the Notation manual under "Dynamics". Page 123 in 
version 2.19.52.


Best regards,

Peter
mailto:lilyp...@ptoye.com
www.ptoye.com

-
Monday, September 17, 2018, 11:41:00 AM, lilypond-user-requ...@gnu.org wrote:

> Send lilypond-user mailing list submissions to
> lilypond-user@gnu.org

> To subscribe or unsubscribe via the World Wide Web, visit
>
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> or, via email, send a message with subject or body 'help' to
> lilypond-user-requ...@gnu.org

> You can reach the person managing the list at
> lilypond-user-ow...@gnu.org

> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of lilypond-user digest..."


> Today's Topics:

>1. A separate line for dynamics? (Bernhard Kleine)
>2. Re:A separate line for dynamics? (Sam Bivens)
>3. Re:Shape the angle of a broken hairpin's first part
>   (Thomas Morley)
>4. Re:Shape the angle of a broken hairpin's first part (Urs Liska)
>5. Re:Shape the angle of a broken hairpin's first part
>   (Thomas Morley)
>6. Re:A separate line for dynamics? (Bernhard Kleine)


> --

> Message: 1
> Date: Mon, 17 Sep 2018 11:28:43 +0200
> From: Bernhard Kleine 
> To: lilypond-user 
> Subject: A separate line for dynamics?
> Message-ID:
> 
> Content-Type: text/plain; charset="utf-8"

> Hi,

> I remember vaguely that one can have a "staff" for the dynamics in an
> score, but I can not find it in the
> documentation of 2.19.82. Can you
> please point me to that.

> Thanks a lot!

> Bernhard


> -- 
> spitzhalde9
> D-79853 lenzkirch
> bernhard.kle...@gmx.net
> www.b-kleine.com, www.urseetal.net
> -
> thunderbird mit enigmail
> GPG schl?ssel: D5257409
> fingerprint:
> 08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09


> -- next part --
> A non-text attachment was scrubbed...
> Name: signature.asc
> Type: application/pgp-signature
> Size: 833 bytes
> Desc: OpenPGP digital signature
> URL:
> <http://lists.gnu.org/archive/html/lilypond-user/attachments/20180917/8b802668/attachment.pgp>

> --

> Message: 2
> Date: Mon, 17 Sep 2018 05:31:36 -0400
> From: Sam Bivens 
> To: lilypond-user@gnu.org
> Subject: Re: A separate line for dynamics?
> Message-ID:
> <6250ff32-dea4-c78b-0a26-cf75d2fbd...@gmail.com>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"

> Hi Bernhard,

> Are you referring to centered dynamics within a piano score in the
> snippet repository?

> http://lsr.di.unimi.it/LSR/Item?id=357

> Take care,

> Sam


> On 09/17/2018 05:28 AM, Bernhard Kleine wrote:
>> Hi,

>> I remember vaguely that one can have a "staff" for the dynamics in an
>> score, but I can not find it in the documentation of 2.19.82. Can you
>> please point me to that.

>> Thanks a lot!

>> Bernhard




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

> -- 
> Sam Bivens, Ph.D.
> Music Theory Faculty
> Cleveland Institute of Music
> 11021 East Boulevard
> Cleveland, OH 44106
> sam.biv...@cim.edu
> -- next part --
> An HTML attachment was scrubbed...
> URL:
> <http://lists.gnu.org/archive/html/lilypond-user/attachments/20180917/ff1908aa/attachment.html>

> --

> Message: 3
> Date: Mon, 17 Sep 2018 11:49:36 +0200
> From: Thomas Morley 
> To: Urs Liska 
> Cc: lilypond-user 
> Subject: Re: Shape the angle of a broken hairpin's first part
> Message-ID:
>
> 
> Content-Type: text/plain; charset="UTF-8"

> 2018-09-17 8:43 GMT+02:00 Urs Liska
> :
>> I have a broken hairpin whose first part is pretty short. As a consequence
>> its internal angle looks too wide for my taste (see attached PNG). I would
>> like to have the two lines wider apart with a narrower angle to more
>> adequately reflect the overall length of the hairpin, similar to the second
>> attached image fro

Re: A separate line for dynamics?

2018-09-17 Thread Torsten Hämmerle
Bernhard Kleine wrote
> I remember vaguely that one can have a "staff" for the dynamics in an
> score, but I can not find it in the documentation of 2.19.82. Can you
> please point me to that.

Hi Bernhard,

I guess it's the Dynamics context you're having in mind. And, yes, it's hard
to find in the documentation.

A feeble hint is hidden in  1.3.1. Expressive marks attached to notes

  
(scroll about half-way down) where it says "The Dynamics context is
available to engrave dynamics on their own horizontal line"...

In  4.4.1 Flexible vertical spacing within systems

 
, the Dynamics context is mentioned, too.

References for keyboards

  
states "Dynamics may be placed in a Dynamics context, between the two Staff
contexts to align the dynamic marks on a horizontal line centered between
the staves; see Dynamics."

HTH,
Torsten




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

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


Re: A separate line for dynamics?

2018-09-17 Thread Simon Albrecht

On 17.09.2018 11:28, Bernhard Kleine wrote:

Hi,

I remember vaguely that one can have a "staff" for the dynamics in an
score, but I can not find it in the documentation of 2.19.82. Can you
please point me to that.


That’s indeed not easy to find, I didn’t in the quick search I just 
did…  Maybe we could add the LSR snippet Sam linked to to the docs, with 
appropriate indexing?


Best, Simon

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


Re: A separate line for dynamics?

2018-09-17 Thread Bernhard Kleine
I found it.
However without the -"legato" the \f is centered , with the -"legato" it
is not. How to draw them on the same line?

dynOrgel = {
  {
       s2\f s4-"legato"
  }
}
...
\new Dynamics = "dynOrgel" {  \dynOrgel }


Am 17.09.2018 um 11:31 schrieb Sam Bivens:
>
> Hi Bernhard,
>
> Are you referring to centered dynamics within a piano score in the
> snippet repository?
>
> http://lsr.di.unimi.it/LSR/Item?id=357
>
> Take care,
>
> Sam
>
>
> On 09/17/2018 05:28 AM, Bernhard Kleine wrote:
>> Hi,
>>
>> I remember vaguely that one can have a "staff" for the dynamics in an
>> score, but I can not find it in the documentation of 2.19.82. Can you
>> please point me to that.
>>
>> Thanks a lot!
>>
>> Bernhard
>>
>>
>>
>>
>> ___
>> lilypond-user mailing list
>> lilypond-user@gnu.org
>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
> -- 
> Sam Bivens, Ph.D.
> Music Theory Faculty
> Cleveland Institute of Music
> 11021 East Boulevard
> Cleveland, OH 44106
> sam.biv...@cim.edu
>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user

-- 
spitzhalde9
D-79853 lenzkirch
bernhard.kle...@gmx.net
www.b-kleine.com, www.urseetal.net
-
thunderbird mit enigmail
GPG schlüssel: D5257409
fingerprint:
08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09



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


Re: Shape the angle of a broken hairpin's first part

2018-09-17 Thread Thomas Morley
2018-09-17 11:55 GMT+02:00 Urs Liska :
> thanks for this, which gives me a handle to the first part of the hairpin at
> least.
>
> But my problem is not solved with the 'height property.
[...]

> See my updated example
[...]

I'll have a look in the evening, now I have to run for my regular job ...

Cheers,
  Harm

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


Re: Shape the angle of a broken hairpin's first part

2018-09-17 Thread Urs Liska

Hi Harm,

thanks for this, which gives me a handle to the first part of the 
hairpin at least.


But my problem is not solved with the 'height property.


Am 17.09.2018 um 11:49 schrieb Thomas Morley:

2018-09-17 8:43 GMT+02:00 Urs Liska :

I have a broken hairpin whose first part is pretty short. As a consequence
its internal angle looks too wide for my taste (see attached PNG). I would
like to have the two lines wider apart with a narrower angle to more
adequately reflect the overall length of the hairpin, similar to the second
attached image from the corresponding music without line break.

I would only know about the "height" property of a hairpin, but that's not
what I need, and it doesn't help me towards tweaking the first part only ...

I'd be glad about any suggestions or solution.

Thanks
Urs

Hi Urs,

iiuc, you will need to tackle the stencil of the first part. Going
directly for 'height doesn't work for me. Iirc there are some
procedures setting the heights of broken hairpins, without the
possibility to customize it.

But you can set the desired 'height for the selected hairpin-part and
call the default stencil afterwards . Leading to:

{
 \override Hairpin.stencil =
 #(lambda (grob)
   (let* ((orig (ly:grob-original grob))
  (siblings (if (ly:grob? orig)
(ly:spanner-broken-into orig) '() )))
 (if (and (pair? siblings) (equal? grob (car siblings)))
 (ly:grob-set-property! grob 'height 5))
 ly:hairpin::print))
 c'1\<
 \break
 s4
 c'2.\!
}
The value 5 is ofcourse only for the show. Adjust as you wish.



See my updated example (only the line with the start of the hairpin is 
changed):


{
    \override Hairpin.stencil =
    #(lambda (grob)
  (let* ((orig (ly:grob-original grob))
 (siblings (if (ly:grob? orig)
   (ly:spanner-broken-into orig) '() )))
    (if (and (pair? siblings) (equal? grob (car siblings)))
    (ly:grob-set-property! grob 'height 5))
    ly:hairpin::print))
    c'2 c'32\>
    \break
    s4
    c'2.\!
}

Here you can see nicely how the angles of the first hairpin are too 
steep, it looks like the hairpin would be closed shortly after the 
barline. Is there any way to modify either the angle of that sibling's 
line or for example the "height" at the point where the hairpin is cut off?


Thanks
Urs





HTH,
   Harm



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


Re: Shape the angle of a broken hairpin's first part

2018-09-17 Thread Thomas Morley
2018-09-17 8:43 GMT+02:00 Urs Liska :
> I have a broken hairpin whose first part is pretty short. As a consequence
> its internal angle looks too wide for my taste (see attached PNG). I would
> like to have the two lines wider apart with a narrower angle to more
> adequately reflect the overall length of the hairpin, similar to the second
> attached image from the corresponding music without line break.
>
> I would only know about the "height" property of a hairpin, but that's not
> what I need, and it doesn't help me towards tweaking the first part only ...
>
> I'd be glad about any suggestions or solution.
>
> Thanks
> Urs

Hi Urs,

iiuc, you will need to tackle the stencil of the first part. Going
directly for 'height doesn't work for me. Iirc there are some
procedures setting the heights of broken hairpins, without the
possibility to customize it.

But you can set the desired 'height for the selected hairpin-part and
call the default stencil afterwards . Leading to:

{
\override Hairpin.stencil =
#(lambda (grob)
  (let* ((orig (ly:grob-original grob))
 (siblings (if (ly:grob? orig)
   (ly:spanner-broken-into orig) '() )))
(if (and (pair? siblings) (equal? grob (car siblings)))
(ly:grob-set-property! grob 'height 5))
ly:hairpin::print))
c'1\<
\break
s4
c'2.\!
}
The value 5 is ofcourse only for the show. Adjust as you wish.



HTH,
  Harm

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


Re: A separate line for dynamics?

2018-09-17 Thread Sam Bivens

Hi Bernhard,

Are you referring to centered dynamics within a piano score in the 
snippet repository?


http://lsr.di.unimi.it/LSR/Item?id=357

Take care,

Sam


On 09/17/2018 05:28 AM, Bernhard Kleine wrote:

Hi,

I remember vaguely that one can have a "staff" for the dynamics in an
score, but I can not find it in the documentation of 2.19.82. Can you
please point me to that.

Thanks a lot!

Bernhard




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


--
Sam Bivens, Ph.D.
Music Theory Faculty
Cleveland Institute of Music
11021 East Boulevard
Cleveland, OH 44106
sam.biv...@cim.edu
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


A separate line for dynamics?

2018-09-17 Thread Bernhard Kleine
Hi,

I remember vaguely that one can have a "staff" for the dynamics in an
score, but I can not find it in the documentation of 2.19.82. Can you
please point me to that.

Thanks a lot!

Bernhard


-- 
spitzhalde9
D-79853 lenzkirch
bernhard.kle...@gmx.net
www.b-kleine.com, www.urseetal.net
-
thunderbird mit enigmail
GPG schlüssel: D5257409
fingerprint:
08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09




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


Shape the angle of a broken hairpin's first part

2018-09-17 Thread Urs Liska
I have a broken hairpin whose first part is pretty short. As a 
consequence its internal angle looks too wide for my taste (see attached 
PNG). I would like to have the two lines wider apart with a narrower 
angle to more adequately reflect the overall length of the hairpin, 
similar to the second attached image from the corresponding music 
without line break.


I would only know about the "height" property of a hairpin, but that's 
not what I need, and it doesn't help me towards tweaking the first part 
only ...


I'd be glad about any suggestions or solution.

Thanks
Urs

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