Menu

#4779 Accept isolated durations as music function arguments

Verified
Enhancement
2016-03-22
2016-02-21
No

On 19/02/16 03:11, Peter Crighton wrote:

% As discussed on the User mailing list, isolated durations are currently not
% accepted as expressions of type ly:music?, thus making it impossible to
% create functions expecting either music or isolated durations with an
% arbitrary number of post events.
% http://lists.gnu.org/archive/html/lilypond-user/2016-02/msg00478.html

Example code not quoted: it demonstrated a limitedly useful circumvention rather than the problem. One straightforward fix would be to provide for supporting an event-list? predicate that would then deliver an arbitrary-length (including zero) list of post-events. Another somewhat more cumbersome way would be to allow the PostEvents container music type (used in some restricted manners inside of the parser) to package multiple events also for post-event function arguments. However, that would likely complicate matters for the user since it might make that music event pop up in a number of places where it's never seen before.

For better or worse, this issue here is only about allowing bare rhythmic durations, previously allowed only inside of music sequences, as proper function arguments.

Discussion

  • David Kastrup

    David Kastrup - 2016-02-26
    • summary: Add support for isolated durations as an expression (ly:music?) --> Accept isolated durations as music function arguments
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -4,27 +4,7 @@
     > % create functions expecting either music or isolated durations with an
     > % arbitrary number of post events.
     > % http://lists.gnu.org/archive/html/lilypond-user/2016-02/msg00478.html
    ->
    -> \version "2.19.33"
    ->
    -> tieFixSlash = #(define-music-function (parser location rhythm tie)
    ->                  (ly:duration? ly:event?)
    ->                  #{
    ->                    \shape #'((0.5 . 0) (0.5 . 0) (0.8 . 0) (0.8 . 0)) Tie
    ->                    $rhythm $tie
    ->                    \once \override TieColumn.tie-configuration = #'((2 . 1))
    ->                  #})
    ->
    -> \new Voice \with {
    ->   \consists "Pitch_squash_engraver"
    -> } {
    ->   \improvisationOn
    ->   \tieFixSlash 4~ 4 \tieFixSlash 4(~ 4)
    -> }
    ->
    -> _______________________________________________
    -> bug-lilypond mailing list
    -> bug-lilypond@gnu.org
    -> https://lists.gnu.org/mailman/listinfo/bug-lilypond
    ->
    ->
    +
    +Example code not quoted: it demonstrated a limitedly useful circumvention rather than the problem.  One straightforward fix would be to provide for supporting an `event-list?` predicate that would then deliver an arbitrary-length (including zero) list of post-events.  Another somewhat more cumbersome way would be to allow the PostEvents container music type (used in some restricted manners inside of the parser) to package multiple events also for post-event function arguments.  However, that would likely complicate matters for the user since it might make that music event pop up in a number of places where it's never seen before.
    +
    +For better or worse, this issue here is only about allowing bare rhythmic durations, previously allowed only inside of music sequences, as proper function arguments.
    
    • status: New --> Started
    • assigned_to: David Kastrup
     
  • David Kastrup

    David Kastrup - 2016-02-26

    Issue 4779: Accept isolated durations as music function arguments

    Also contains commits:

    Use new arguments of make_duration

    Let make_duration accept preexisting durations and factor

    Let make_music_from_simple accept numbers/durations

    parser.yy: factor out "multipliers" from "multiplied_duration"

    parser.yy: Remove redundant duration_length

    http://codereview.appspot.com/288380043

     
  • Anonymous

    Anonymous - 2016-02-26
    • Needs: -->
    • Patch: new --> review
    • Type: --> Enhancement
     
  • Anonymous

    Anonymous - 2016-02-26

    Passes make, make check and a full make doc.

     
  • Anonymous

    Anonymous - 2016-03-01
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2016-03-01

    Patch on countdown for March 4th - there is a comment on Rietveld from HoangMinh but it is not clear what point is being made.

     
  • Anonymous

    Anonymous - 2016-03-04
    • Patch: countdown --> push
     
  • Anonymous

    Anonymous - 2016-03-04

    Patch counted down - please push

     
  • Anonymous

    Anonymous - 2016-03-04
    • labels: --> Fixed_2_19_38
    • status: Started --> Fixed
    • Patch: push -->
     
  • Anonymous

    Anonymous - 2016-03-04

    author David Kastrup dak@gnu.org
    Thu, 25 Feb 2016 15:40:14 +0000 (16:40 +0100)
    committer David Kastrup dak@gnu.org
    Fri, 4 Mar 2016 11:37:16 +0000 (12:37 +0100)
    commit ce2a857e5a40690ef05451afcbb7c0dbc49bd718

     
  • Phil Holmes

    Phil Holmes - 2016-03-22
    • status: Fixed --> Verified
     
MongoDB Logo MongoDB