Menu

#3648 Patch: Isolated durations in music sequences now stand for unpitched notes

Verified
nobody
Enhancement
2014-02-16
2013-11-05
Anonymous
No

Originally created by: *anonymous

Originally created by: dak@gnu.org
Originally owned by: dak@gnu.org

Isolated durations in music sequences now stand for unpitched notes

This allows for things like

\new RhythmicStaff { 4 4. 8 4 | 4 \tuplet 3/2 { 2 4 } 4 }

"unpitched" simply means that this is rendered as a normal NoteEvent,
but the pitch information is missing and has to be filled in by some
other means (RhythmicStaff is an exception since it ignores specified
pitches anyway).

Also contains commits:

Regtest for rhythmic sequences.

Interpret #{ -3 #} as postevent rather than negative number

Since #{ 4 #} is interpreted as duration rather than number, interpreting
negative integers as numbers rather than fingering is not really helpful.

Let #{ 4 #} be a duration while #{ 4 \cm #} stays a length

An UNSIGNED not followed by a NUMERIC_IDENTIFIER inside of #{ ... #}
is interpreted as a duration rather than a number.  Also, inside
of #{ ... #} no "numeric expressions" using binary operators +-*/ are
interpreted.

The behavior of (signed and unsigned) integers and numeric expressions
in assignments and as function arguments rather than inside
of #{ ... #} is not affected.

http://codereview.appspot.com/22120043

Related

Issues: #185

Discussion

  • Google Importer

    Google Importer - 2013-11-05

    Originally posted by: dak@gnu.org

    (No comment was entered for this change.)

    Owner: dak@gnu.org

     
  • Google Importer

    Google Importer - 2013-11-05

    Originally posted by: dak@gnu.org

    Patchy the autobot says: passes tests.

    Labels: -Patch-new Patch-review

     
  • Google Importer

    Google Importer - 2013-11-07

    Originally posted by: pkx1...@gmail.com

    Patch on countdown for Nov 10th - 06:00 GMT

    Labels: -Patch-review Patch-countdown

     
  • Google Importer

    Google Importer - 2013-11-08

    Originally posted by: dak@gnu.org

    Be more thorough.  A bit of enthusiasm for this one, please.

    http://codereview.appspot.com/22120043

    Labels: -Patch-countdown Patch-new

     
  • Google Importer

    Google Importer - 2013-11-08

    Originally posted by: pkx1...@gmail.com

    Patchy the autobot says: passes make, make check and a full make doc.

    Labels: -Patch-new Patch-review

     
  • Google Importer

    Google Importer - 2013-11-08

    Originally posted by: lemzw...@googlemail.com

    Here's my enthusiasm: Hip, hip, horray :-)

    To be serious: It looks great, but since I don't use RhythmicStaff normally, I can judge it from a `theoretical' point only; I simply don't have a real feeling how it makes life easier.  I really appreciate your efforts to further simplify and regularize lilypond's input language.

     
  • Google Importer

    Google Importer - 2013-11-08

    Originally posted by: dak@gnu.org

    Well, the first person I remember calling for that syntax is a certain Werner Lemberg: <URL:http://lists.gnu.org/archive/html/lilypond-devel/2012-09/msg00860.html>.

    It also allows to replace the Mars example:

    rhythm =
    #(define-music-function (parser location p) (ly:pitch?)
       "Make the rhythm in Mars (the Planets) at the given pitch"
      #{ \tuplet 3/2 { $p 8 $p $p } $p 4 $p $p 8 $p $p 4 #})

    with the somewhat more readable

    rhythm =
    #(define-music-function (parser location p) (ly:pitch?)
       "Make the rhythm in Mars (the Planets) at the given pitch"
      #{ \tuplet 3/2 { $p 8 8 8 } 4 4 8 8 4 #})

    which has the additional advantage that it does not go bonkers in \relative mode.

    In general, it makes mostly rhythmical input more straightforward.  But it does not apply to chords, and it does not copy articulations.  Stuff like that could be done using explicit music functions, but it can't be the default.  A comment somewhere explains why this would be a really bad idea: basically it would cause chords and articulations to creep into unrelated material that's supposed to be rhythm-only.  The same creep will happen for pitches, but that just means that rhythm-only applications should ignore pitches.

     
  • Google Importer

    Google Importer - 2013-11-08

    Originally posted by: lemzw...@googlemail.com

    *blush* How embarassing.  But this just emphasizes the fact that I don't use RhythmicStaff, since I couldn't remember this suggestion.

     
  • Google Importer

    Google Importer - 2013-11-08

    Originally posted by: dak@gnu.org

    Here's an earlier Lemberg, again having nothing to do with RhythmicStaff:
    <URL:http://lists.gnu.org/archive/html/lilypond-user/2009-04/msg00111.html>.

    There's so much more enthusiasm for features as long as it is not feasible to implement them.

    Now I'm not overly happy about the relation with chords and/or q and/or articulations.  But I don't see that it can reasonably be helped.

    At first I wanted to keep this patch rhythm-only, without propagating missing pitches.  But when I changed an orchestra example, this would have required writing

    { tamb4 tamb8 tamb8 tamb4. ... }
    for a thing supposed to end up in both a RhythmicStaff and in midi, more or less defeating half of the concept of being able to enter rhythms.

     
  • Google Importer

    Google Importer - 2013-11-08

    Originally posted by: lemzw...@googlemail.com

    :-)  In this case, the `q' solution was better – and this is feature I use *very* often.

     
  • Google Importer

    Google Importer - 2013-11-09

    Originally posted by: dak@gnu.org

    A bit more documentation

    http://codereview.appspot.com/22120043

    Labels: -Patch-review Patch-new

     
  • Google Importer

    Google Importer - 2013-11-09

    Originally posted by: pkx1...@gmail.com

    Patchy the autobot says: passes make, make check and a full make doc.

    Labels: -Patch-new Patch-review

     
  • Google Importer

    Google Importer - 2013-11-13

    Originally posted by: pkx1...@gmail.com

    Patch on countdown for Nov 16 - 06:00

    Labels: -Patch-review Patch-countdown

     
  • Google Importer

    Google Importer - 2013-11-14

    Originally posted by: dak@gnu.org

    Implement chord repetition, make RhythmicStaff examples more defensive in return

    http://codereview.appspot.com/22120043

    Labels: -Patch-countdown Patch-new

     
  • Google Importer

    Google Importer - 2013-11-14

    Originally posted by: dak@gnu.org

    Patchy the autobot says: passes tests.  Slightly more lookups of 'elements and 'element properties, to be expected from the additional pass over all the music.

    Labels: -Patch-new Patch-review

     
  • Google Importer

    Google Importer - 2013-11-16

    Originally posted by: pkx1...@gmail.com

    Patch on countdown for Nov 19th - 06:00 GMT

    Labels: -Patch-review Patch-countdown

     
  • Google Importer

    Google Importer - 2013-11-19

    Originally posted by: dak@gnu.org

    Well, countdown is formally over, there has been zero reaction to the latest iteration making everything hunky-dory with chords, so in order to be able to start rebasing other parser issues, I'm pushing this to staging as
    *   commit [r5385d029e3e4e89c1a7dba20d3e136f594321816]
    |\&nbsp; Merge: fc830bf 703dca1
    | | Author: David Kastrup <dak@gnu.org>
    | | Date:   Tue Nov 19 11:15:03 2013 +0100
    | |
    | |     Merge branch 'issue3648' into staging
    | |    
    | |     Contains enough related commits that its better to do as one merge
    | |     commit for the sake of bisection and/or reverting.
    | |  
    | * commit [r703dca1fd6b202716cbfdc650c604dd835795b01]
    | | Author: David Kastrup <dak@gnu.org>
    | | Date:   Thu Nov 14 15:48:24 2013 +0100
    | |
    | |     Run scripts/auxiliar/makelsr.py
    | |  
    | * commit [rb570097f37f1aa89e81da7b48e3a9827d9f7184c]
    | | Author: David Kastrup <dak@gnu.org>
    | | Date:   Thu Nov 7 20:16:57 2013 +0100
    | |
    | |     Issue 3648/7: Give several examples of durations without explicit pitches
    | |  
    | * commit [r80e4d58800a5722ba8dd6940d23573e740a159cc]
    | | Author: David Kastrup <dak@gnu.org>
    | | Date:   Tue Nov 5 21:55:13 2013 +0100
    | |
    | |     Issue 3648/6: Regtest for rhythmic sequences.
    | |  
    | * commit [rf1163b25f88ad7b6b3953894dc452dfaad36fa81]
    | | Author: David Kastrup <dak@gnu.org>
    | | Date:   Sat Nov 9 15:46:53 2013 +0100
    | |
    | |     Issue 3648/5: Explain isolated durations in NR "Rhythms"
    | |  
    | * commit [r33dd448c34f9f667c3d1c4722f5bc7c229251b6b]
    | | Author: David Kastrup <dak@gnu.org>
    | | Date:   Fri Nov 8 18:40:41 2013 +0100
    | |
    | |     Issue 3648/4: Let \displayLilyMusic deal with pure rhythms
    | |  
    | * commit [r1a1c0afedeea1756a002fc97178167d90458d7f1]
    | | Author: David Kastrup <dak@gnu.org>
    | | Date:   Fri Nov 8 18:14:52 2013 +0100
    | |
    | |     Issue 3648/3: Pitchless durations inherit previous pitch when scorifying
    | |    
    | |     This turns { c4 4 4 4 } into { c4 c4 c4 c4 } and
    | |     \drummode { tamb4 4 4 4 } into \drummode { tamb4 tamb4 tamb4 tamb4 }.
    | |  
    | * commit [r795861191510f457ab2294b02ec3b3c64c40602c]
    | | Author: David Kastrup <dak@gnu.org>
    | | Date:   Thu Nov 14 14:26:23 2013 +0100
    | |
    | |     Let copy-repeat-chord return the copy target for efficiency
    | |  
    | * commit [r2527d439536f4b4423dcb3324bb2bbbfa6c71662]
    | | Author: David Kastrup <dak@gnu.org>
    | | Date:   Wed Nov 13 22:13:10 2013 +0100
    | |
    | |     Issue 3648/2: Slight documentation amendment for RhythmicStaff in NR
    | |  
    | * commit [r3dc88bc7db19bb06b89d8649d801f435f3bdd4d3]
    |/  Author: David Kastrup <dak@gnu.org>
    |   Date:   Sat Aug 31 14:11:32 2013 +0200
    |  
    |       Issue 3648/1: Isolated durations in music sequences now stand for unpitched notes
    |      
    |       This allows for things like
    |      
    |       \new RhythmicStaff { 4 4. 8 4 | 4 \tuplet 3/2 { 2 4 } 4 }
    |      
    |       "unpitched" simply means that this is rendered as a normal NoteEvent,
    |       but the pitch information is missing and has to be filled in by some
    |       other means.  The example using RhythmicStaff is not actually
    |       commendable as the MIDI rendition still requires a pitch or drum
    |       type.  It's just that as of this patch, there are no immediately
    |       useful applications.  The rhythmic shorthand { c4 4. 8 4 } is
    |       introduced by a later patch.

    * commit [rfc830bf324e4d90a474c9ced031ff598766c26a7]
    | Author: David Kastrup <dak@gnu.org>
    | Date:   Tue Nov 5 19:03:31 2013 +0100
    |
    |     Interpret #{ -3 #} as postevent rather than negative number
    |    
    |     Since #{ 4 #} is interpreted as duration rather than number, interpreting
    |     negative integers as numbers rather than fingering is not really helpful.

    * commit [r92ae8d86790e42b63c15b0613078899cca5c5341]
    | Author: David Kastrup <dak@gnu.org>
    | Date:   Fri Nov 8 18:46:53 2013 +0100
    |
    |     Use #{ 4 #} and #{ c #} for duration/pitch in optional-args regtest

    * commit [rde97ffe8a26be14f4187ff26315f18b9a39224bd]
    | Author: David Kastrup <dak@gnu.org>
    | Date:   Tue Nov 5 17:12:17 2013 +0100
    |
    |     Let #{ 4 #} be a duration while #{ 4 \cm #} stays a length
    |    
    |     An UNSIGNED not followed by a NUMERIC_IDENTIFIER inside of #{ ... #}
    |     is interpreted as a duration rather than a number.  Also, inside
    |     of #{ ... #} no "numeric expressions" using binary operators +-*/ are
    |     interpreted.
    |    
    |     The behavior of (signed and unsigned) integers and numeric expressions
    |     in assignments and as function arguments rather than inside
    |     of #{ ... #} is not affected.

    Labels: -Patch-countdown Fixed_2_19_0
    Status: Fixed

     
  • Google Importer

    Google Importer - 2014-01-06

    Originally posted by: Elu...@gmail.com

    (No comment was entered for this change.)

    Status: Verified

     
  • Google Importer

    Google Importer - 2014-02-16

    Originally posted by: dak@gnu.org

    The following auxiliary commit has also been pushed to stable/2.18:
    commit [re96a0230c940b7c38fb5dbc000231cde71e06d3b]
    Author: David Kastrup <dak@gnu.org>
    Date:   Thu Nov 14 14:26:23 2013 +0100

        Let copy-repeat-chord return the copy target for efficiency