lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using functions "parenthesize" in lilypond 2.24.1


From: Виноградов Юрий
Subject: Using functions "parenthesize" in lilypond 2.24.1
Date: Tue, 11 Jul 2023 12:19:02 +0300

Hello. I'm typing an accordion part. And in my left hand I need to put a note in the \parenthesize function. But since this note takes up space in the measure. Example: beat 2/4 and note 1/8 - it turns out to be 5/8 in a beat. To make everything look good in the other hand, I either put the size of 5/8 in this tact and add an invisible pause (s8). Or I type in these bars with the \cadenzaOn function. Can you tell me how to leave the measure in the normal 2/4 size and have this note with the \parenthesize function not be counted in the measure.
 
Thank you all in advance.
 
Translated with www.DeepL.com/Translator (free version)
 
С уважением,
Виноградов Юрий.
 
 
 
04.04.2023, 03:53, "lilypond-user-request@gnu.org" <lilypond-user-request@gnu.org>:

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-request@gnu.org

You can reach the person managing the list at
        lilypond-user-owner@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. Creating Text with Hyperlinks (Ken Ledeen)
   2. Re: Creating Text with Hyperlinks (Jean Abou Samra)
   3. Re: Creating Text with Hyperlinks (Jean Abou Samra)
   4. Custom engraver to draw frame around notes (Nate Whetsell)
   5. Re: Custom engraver to draw frame around notes (Jean Abou Samra)


----------------------------------------------------------------------

Message: 1
Date: Mon, 3 Apr 2023 19:15:19 -0400
From: Ken Ledeen <kledeen@nevo.com>
To: lilypond-user@gnu.org
Subject: Creating Text with Hyperlinks
Message-ID:
        <CAHBGdwU+ELOfsRA2Y=8XsSTFS1EexKs5vDke2vof+GPevFWLOQ@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hello All,

I would like to be able to add conventional text to a score, but provide
associated hyperlinks in the PDF. FOr example, the title might have a
hyperlink to a youtube video of the score being performed.

So far, I've not found anything in the documentation that would support
this functionality

Ken Ledeen

Mobile: 617-817-3183

www.nevo.com
www.bitsbook.com
tiny.cc/KenLedeen <https://kledeen.wixsite.com/kenledeen/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnu.org/archive/html/lilypond-user/attachments/20230403/30024402/attachment.htm>

------------------------------

Message: 2
Date: Tue, 04 Apr 2023 01:25:22 +0200
From: Jean Abou Samra <jean@abou-samra.fr>
To: Ken Ledeen <kledeen@nevo.com>, lilypond-user@gnu.org
Subject: Re: Creating Text with Hyperlinks
Message-ID:
        <43ebef711865338fcc5472c2b3806358cccfd93b.camel@abou-samra.fr>
Content-Type: text/plain; charset="utf-8"

Le lundi 03 avril 2023 à 19:15 -0400, Ken Ledeen a écrit :

 Hello All,
 I would like to be able to add conventional text to a score, but provide associated hyperlinks in the PDF.  FOr example, the title might have a hyperlink to a youtube video of the score being performed.
 
 So far, I've not found anything in the documentation that would support this functionality


Look for “URL” in the notation manual's index

https://lilypond.org/doc/v2.24/Documentation/notation/lilypond-index.html

Best,

Jean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnu.org/archive/html/lilypond-user/attachments/20230404/aa65db93/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <https://lists.gnu.org/archive/html/lilypond-user/attachments/20230404/aa65db93/attachment.sig>

------------------------------

Message: 3
Date: Tue, 04 Apr 2023 01:27:31 +0200
From: Jean Abou Samra <jean@abou-samra.fr>
To: Ken Ledeen <kledeen@nevo.com>, lilypond-user@gnu.org
Subject: Re: Creating Text with Hyperlinks
Message-ID:
        <a2aa482b861482ab61f42996693069df5f91d9ae.camel@abou-samra.fr>
Content-Type: text/plain; charset="utf-8"

Le mardi 04 avril 2023 à 01:25 +0200, Jean Abou Samra a écrit :

 Le lundi 03 avril 2023 à 19:15 -0400, Ken Ledeen a écrit :
 
 > Hello All,
 > I would like to be able to add conventional text to a score, but provide associated hyperlinks in the PDF.  FOr example, the title might have a hyperlink to a youtube video of the score being performed.
 > So far, I've not found anything in the documentation that would support this functionality
 
 Look for “URL” in the notation manual's index
 https://lilypond.org/doc/v2.24/Documentation/notation/lilypond-index.html



PS: In version 2.25.3 (released last Saturday), there is also a `\qr-code` command, which may be better if you want to print the scores.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnu.org/archive/html/lilypond-user/attachments/20230404/0c6b4069/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <https://lists.gnu.org/archive/html/lilypond-user/attachments/20230404/0c6b4069/attachment.sig>

------------------------------

Message: 4
Date: Mon, 3 Apr 2023 20:12:51 -0400
From: Nate Whetsell <nathan.whetsell@gmail.com>
To: lilypond-user <lilypond-user@gnu.org>
Subject: Custom engraver to draw frame around notes
Message-ID: <30611163-4FCC-4BBE-B425-8D4D11D89641@gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi,

I’m trying to use an engraver that was shared on the lilypond-user list in 2012:

https://mail.gnu.org/archive/html/lilypond-user/2012-03/msg00363.html <https://mail.gnu.org/archive/html/lilypond-user/2012-03/msg00363.html>

This engraver draws a frame around notes, followed by an arrow.

I’ve been able to update this engraver so that it can be used in more recent versions of LilyPond; this is available at

https://github.com/nwhetsell/lilypond-frame-engraver/blob/main/frame-engraver.ily <https://github.com/nwhetsell/lilypond-frame-engraver/blob/main/frame-engraver.ily>

This engraver works when a score has a single staff, but compilation fails when a score has multiple staffs:

/usr/local/Cellar/lilypond-unstable/2.25.3/share/lilypond/2.25.3/ly/init.ly:64:2: error: Guile signaled an error for the _expression_ beginning here
#
 (let ((book-handler (if (defined? 'default-toplevel-book-handler)
In procedure ly:grob-property: Wrong type argument in position 1 (expecting Grob): ()

I can compile successfully if I comment out what happens in lines 183–6—

https://github.com/nwhetsell/lilypond-frame-engraver/blob/310c2f0776c217fcc486e933badde6a56940f9c1/frame-engraver.ily#L183-L186 <https://github.com/nwhetsell/lilypond-frame-engraver/blob/310c2f0776c217fcc486e933badde6a56940f9c1/frame-engraver.ily#L183-L186>

—like this—

           ;(if (ly:stream-event? (cdr event-drul))
           ; (begin (set! stub (ly:engraver-make-grob trans 'FrameStub (cdr event-drul)))
           ; (ly:grob-set-property! stub 'direction RIGHT)
           ; (ly:grob-set-object! stub 'frame span)))
       ))

—but I can only get frames in one staff (and it must be the first staff).

Because this engraver doesn’t mention staffs at all, I’m not sure how this is happening or how to fix it, and I’m hoping I’m missing something simple. Any help would be greatly appreciated! A small test program follows.

Many thanks,
Nate

\version "2.22.0"

\include "frame-engraver.ily"

music = \relative c'' {
  \override Stem.transparent = ##t
  \override Beam.transparent = ##t
  \once \override Frame.extender-length = #8
  \frameStart dis'8[ e f \frameEnd ges] s2
}

\score {
  <<
    \new Staff {
      \music
    }
    \new Staff {
      \music
    }
  >>
}

\layout {
  \context {
    \Global
    \grobdescriptions #all-grob-descriptions
  }
  \context {
    \Voice
    \consists \frameEngraver
  }
}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnu.org/archive/html/lilypond-user/attachments/20230403/87e74cef/attachment.htm>

------------------------------

Message: 5
Date: Tue, 04 Apr 2023 02:52:04 +0200
From: Jean Abou Samra <jean@abou-samra.fr>
To: Nate Whetsell <nathan.whetsell@gmail.com>, lilypond-user
        <lilypond-user@gnu.org>
Subject: Re: Custom engraver to draw frame around notes
Message-ID:
        <c83f8965fab4127e4ef6d9477edb44c4c919f42c.camel@abou-samra.fr>
Content-Type: text/plain; charset="utf-8"

Le lundi 03 avril 2023 à 20:12 -0400, Nate Whetsell a écrit :

 Because this engraver doesn’t mention staffs at all, I’m not sure how this is happening or how to fix it, and I’m hoping I’m missing something simple. Any help would be greatly appreciated! A small test program follows.


I see

```
#(lambda (context)
   (let ((span '())
         (stub '())
         (event-drul '(() . ())))
                     ^^^^^^^^^^^
```

then

```
     `((listeners
         (frame-event .
           ,(lambda (engraver event)
             (if (= START (ly:event-property event 'span-direction))
                 (set-car! event-drul event)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
                 (set-cdr! event-drul event)))))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
```

This is Bad (™). Quoting is a more subtle concept than many people think. For example, many beginner/intermediate and even advanced Scheme programmers do not realize that

```
$ LC_ALL=C.UTF-8 ~/lilies/2.25.3/bin/lilypond scheme-sandbox
GNU LilyPond 2.25.3 (running Guile 2.2)
Processing `/home/jean/lilies/2.25.3/share/lilypond/2.25.3/ly/scheme-sandbox.ly'
Parsing...
GNU Guile 2.2.7
Copyright (C) 1995-2019 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(#{ g123}#)> (define (f) (list 'a 'b 'c))
scheme@(#{ g123}#)> (eq? (f) (f))
$1 = #f
scheme@(#{ g123}#)> (define (f2) '(a b c))
scheme@(#{ g123}#)> (eq? (f2) (f2))
$2 = #t
```

When you quote something, you always get the same thing, as per `eq?`, i.e., identity. Therefore, the two engraver instances are sharing the same pair of events, which is obviously troublesome.

By the way, you can debug Scheme code by adding `#(ly:set-option 'compile-scheme-code)` (see [this](https://lilypond.org/doc/v2.25/Documentation/extending/debugging-scheme-code); caveat: does not work on Windows right now). If you do this, you will get a Guile error about attempting to mutate a literal pair.

If you read section 3.4 of the [R5RS](https://conservatory.scheme.org/schemers/Documents/Standards/R5RS/r5rs.pdf), you can find

“In many systems it is desirable for constants (i.e. the val-
ues of literal expressions) to reside in read-only-memory.
To express this, it is convenient to imagine that every
object that denotes locations is associated with a flag
telling whether that object is mutable or immutable. In
such systems literal constants and the strings returned by
symbol->string are immutable objects, while all objects
created by the other procedures listed in this report are
mutable. It is an error to attempt to store a new value
into a location that is denoted by an immutable object.”

Note that “it is an error” means the program is invalid, not that the implementation is required to detect the error. Guile does it for byte-compiled code (when you use `compile-scheme-code`). It unfortunately doesn't for interpreted code, as in the default mode in LilyPond.

The fix here is to change `'(() . ())` to `(cons '() '())` to create a fresh pair for each engraver.

Jean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnu.org/archive/html/lilypond-user/attachments/20230404/d114f371/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <https://lists.gnu.org/archive/html/lilypond-user/attachments/20230404/d114f371/attachment.sig>

------------------------------

Subject: Digest Footer

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


------------------------------

End of lilypond-user Digest, Vol 245, Issue 7
*********************************************


reply via email to

[Prev in Thread] Current Thread [Next in Thread]