Slur from one voice to another emits warning

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Slur from one voice to another emits warning

Knute Snortum
I am trying to get a slur that goes from one voice to another.  I've found examples in the docs and the LSR, but I am still getting warnings, even though the output is correct.  Here's a smallish example:

------------------------------------
\version "2.19.61"
\language "english"

hideOneNote = {
  \once \omit Stem
  \once \omit Flag
}

\relative {
  \key ef \major
  \time 3/4
  <<
    {
      | f''4-> s2
      | d4 
    }
    \\
    {
      | r8 f, ^( <e g> <ef a> <d bf'> <c c'> 
      % \stemUp % doesn't help
      | << \hideOneNote d'8 ) r >> % works, emits warning
      %| << \hide Stem \hide Flag d'8 ) r >> % works, emits warning
      %| << \hideNotes d'8 ) \unHideNotes r >> % doesn't work
    }
  >>
}
-------------------------------

The warning says "warning: cannot have note heads and rests together on a stem."

I post to Mutopia so I can't have warnings.  Any thoughts?

---
Knute Snortum
(via Gmail)

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Slur from one voice to another emits warning

Kieren MacMillan
Hi Knute,

> I am trying to get a slur that goes from one voice to another.

You need to acutally *use* [independent] voices:

%%%  SNIPPET BEGINS
\version "2.19.61"
\language "english"

hideOneNote = {
  \once \omit Stem
  \once \omit Flag
}

\relative {
  \key ef \major
  \time 3/4
  <<
    {
      \voiceOne
      | f''4-> s2
      | d4
    }
    \\
    \new Voice {
      \voiceTwo
      | r8 f, ^( <e g> <ef a> <d bf'> <c c'>
      | \hideOneNote d'8 )
    }
    \\
    \new Voice {
      \voiceFour
      | s2.
      | r8
    }
  >>
}
%%%  SNIPPET ENDS

Hope this helps!
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Slur from one voice to another emits warning

Simon Albrecht-2
In reply to this post by Knute Snortum
On 04.06.2017 15:50, Knute Snortum wrote:
> I post to Mutopia so I can't have warnings.  Any thoughts?

Sometimes one has to accept warnings, so in future situations
ly:expect-warning might be your friend (unless it is banned from
Mutopia? I’d be surprised). It only needs the beginning of the warning
string, like
#(ly:expect-warning "cannot have")

Best, Simon

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Slur from one voice to another emits warning

Knute Snortum
In reply to this post by Kieren MacMillan
Thanks Kieren, that works.


---
Knute Snortum
(via Gmail)

On Sun, Jun 4, 2017 at 7:01 AM, Kieren MacMillan <[hidden email]> wrote:
Hi Knute,

> I am trying to get a slur that goes from one voice to another.

You need to acutally *use* [independent] voices:

%%%  SNIPPET BEGINS
\version "2.19.61"
\language "english"

hideOneNote = {
  \once \omit Stem
  \once \omit Flag
}

\relative {
  \key ef \major
  \time 3/4
  <<
    {
      \voiceOne
      | f''4-> s2
      | d4
    }
    \\
    \new Voice {
      \voiceTwo
      | r8 f, ^( <e g> <ef a> <d bf'> <c c'>
      | \hideOneNote d'8 )
    }
    \\
    \new Voice {
      \voiceFour
      | s2.
      | r8
    }
  >>
}
%%%  SNIPPET ENDS

Hope this helps!
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]



_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Slur from one voice to another emits warning

Knute Snortum
In reply to this post by Simon Albrecht-2
Thanks Simon, I'll keep that in mind.


---
Knute Snortum
(via Gmail)

On Sun, Jun 4, 2017 at 8:48 AM, Simon Albrecht <[hidden email]> wrote:
On 04.06.2017 15:50, Knute Snortum wrote:
I post to Mutopia so I can't have warnings.  Any thoughts?

Sometimes one has to accept warnings, so in future situations ly:expect-warning might be your friend (unless it is banned from Mutopia? I’d be surprised). It only needs the beginning of the warning string, like
#(ly:expect-warning "cannot have")

Best, Simon


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

ly:expect-warning (was Re: Slur from one voice to another emits warning)

Richard Shann-2
In reply to this post by Simon Albrecht-2
On Sun, 2017-06-04 at 17:48 +0200, Simon Albrecht wrote:
> On 04.06.2017 15:50, Knute Snortum wrote:
> > I post to Mutopia so I can't have warnings.  Any thoughts?
>
> Sometimes one has to accept warnings, so in future situations
> ly:expect-warning might be your friend (unless it is banned from
> Mutopia? I’d be surprised). It only needs the beginning of the warning
> string, like
> #(ly:expect-warning "cannot have")

Simon - I was intrigued by this comment of yours and wondered if you
could say where this bit of Scheme needs to be placed?.
I tried to suppress clashing note column warnings thus:

8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
\version "2.18.0"
#(ly:expect-warning (_ "ignoring too many clashing note columns"))
MvmntIVoiceI = {
         #(ly:expect-warning (_ "ignoring too many clashing note columns"))
         c''4 c'' c''
}
MvmntIVoiceII = {
         #(ly:expect-warning (_ "ignoring too many clashing note columns"))
         c''4 c'' c''
}
\score {
        \new Staff = "Part 1"  <<
                                   \new Voice = "MvmntIVoiceI"  \MvmntIVoiceI  
                                   \new Voice = "MvmntIVoiceII"     \MvmntIVoiceII
                                >>
       }
8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><

I found by trial-and-error that if I remove any of the three occurrences
of the ly:expect-warning the warning returns.

Where should it be called?

As an aside:
The documentation is somewhat sparse:

Function: ly:expect-warning str rest

    A Scheme callable function to register a warning to be expected and
subsequently suppressed. If the warning is not encountered, a warning
about the missing warning will be shown. The message should be
translated with (_ ...) and changing parameters given after the format
string.

from this I gather that the parameter "str" is a Scheme format string
(as expected by the Scheme format procedure I guess) and rest would be
needed if there were ~'s in the format string. In which case the
documentation shouldn't say "The message should be translated with ..."
but that the parameter "str" should be the English format string for the
error message enclosed with (_ ).


Richard







_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: ly:expect-warning (was Re: Slur from one voice to another emits warning)

David Kastrup
Richard Shann <[hidden email]> writes:

> On Sun, 2017-06-04 at 17:48 +0200, Simon Albrecht wrote:
>> On 04.06.2017 15:50, Knute Snortum wrote:
>> > I post to Mutopia so I can't have warnings.  Any thoughts?
>>
>> Sometimes one has to accept warnings, so in future situations
>> ly:expect-warning might be your friend (unless it is banned from
>> Mutopia? I’d be surprised). It only needs the beginning of the warning
>> string, like
>> #(ly:expect-warning "cannot have")
>
> Simon - I was intrigued by this comment of yours and wondered if you
> could say where this bit of Scheme needs to be placed?.
> I tried to suppress clashing note column warnings thus:
>
> 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> \version "2.18.0"
> #(ly:expect-warning (_ "ignoring too many clashing note columns"))
> MvmntIVoiceI = {
>          #(ly:expect-warning (_ "ignoring too many clashing note columns"))
>          c''4 c'' c''
> }
> MvmntIVoiceII = {
>          #(ly:expect-warning (_ "ignoring too many clashing note columns"))
>          c''4 c'' c''
> }
> \score {
>         \new Staff = "Part 1"  <<
>                                    \new Voice = "MvmntIVoiceI"  \MvmntIVoiceI  
>                                    \new Voice = "MvmntIVoiceII"     \MvmntIVoiceII
>                                 >>
>        }
> 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
>
> I found by trial-and-error that if I remove any of the three occurrences
> of the ly:expect-warning the warning returns.
>
> Where should it be called?

At the top, once for every expected warning.  It doesn't make sense
placing it in music expressions: its effect will be immediate anyway and
it does not become part of the music.

But you need to expect the right order and number of warnings.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: ly:expect-warning (was Re: Slur from one voice to another emits warning)

Richard Shann-2
On Mon, 2017-06-05 at 18:34 +0200, David Kastrup wrote:

> Richard Shann <[hidden email]> writes:
>
> > On Sun, 2017-06-04 at 17:48 +0200, Simon Albrecht wrote:
> >> On 04.06.2017 15:50, Knute Snortum wrote:
> >> > I post to Mutopia so I can't have warnings.  Any thoughts?
> >>
> >> Sometimes one has to accept warnings, so in future situations
> >> ly:expect-warning might be your friend (unless it is banned from
> >> Mutopia? I’d be surprised). It only needs the beginning of the warning
> >> string, like
> >> #(ly:expect-warning "cannot have")
> >
> > Simon - I was intrigued by this comment of yours and wondered if you
> > could say where this bit of Scheme needs to be placed?.
> > I tried to suppress clashing note column warnings thus:
> >
> > 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> > \version "2.18.0"
> > #(ly:expect-warning (_ "ignoring too many clashing note columns"))
> > MvmntIVoiceI = {
> >          #(ly:expect-warning (_ "ignoring too many clashing note columns"))
> >          c''4 c'' c''
> > }
> > MvmntIVoiceII = {
> >          #(ly:expect-warning (_ "ignoring too many clashing note columns"))
> >          c''4 c'' c''
> > }
> > \score {
> >         \new Staff = "Part 1"  <<
> >                                    \new Voice = "MvmntIVoiceI"  \MvmntIVoiceI  
> >                                    \new Voice = "MvmntIVoiceII"     \MvmntIVoiceII
> >                                 >>
> >        }
> > 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> >
> > I found by trial-and-error that if I remove any of the three occurrences
> > of the ly:expect-warning the warning returns.
> >
> > Where should it be called?
>
> At the top, once for every expected warning.  It doesn't make sense
> placing it in music expressions: its effect will be immediate anyway and
> it does not become part of the music.
>
> But you need to expect the right order
>  and number of warnings.

Ah, repeated calls to ly:expect-warning increment a counter for the
number of such warnings to be expected.
Thanks very much for this information.

Suggested update to docs:

Function: ly:expect-warning format-str rest

    A Scheme callable function to register a warning to be expected and
subsequently suppressed. If the warning is not encountered, a warning
about the missing warning will be shown. The format-str should be
translated with (_ ...) and rest should be any parameters expected by
format-str. The number and ordering of calls should match the number and
order of warnings to be suppressed.

Richard


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: ly:expect-warning (was Re: Slur from one voice to another emitswarning)

Trevor Daniels
In reply to this post by David Kastrup

David, you wrote  Monday, June 05, 2017 5:34 PM


> Richard Shann <[hidden email]> writes:
>
>> I found by trial-and-error that if I remove any of the three occurrences
>> of the ly:expect-warning the warning returns.
>>
>> Where should it be called?
>
> At the top, once for every expected warning.  It doesn't make sense
> placing it in music expressions: its effect will be immediate anyway and
> it does not become part of the music.

Why does it not make sense to place it in a music expression?  I find
keeping the suppression adjacent to the place the warning is triggered
helps to remind me why it is there.  For example, \change Staff causes
warnings when used with \partcombine, even though it actually works
correctly, so I suppress the warnings like this:

% The following \change Staff commands cause warnings
% about not being able to find a context to switch to,
% but in fact they work correctly.

#(ly:expect-warning "cannot find context to switch to")
  \change Staff = "PianoRHStaff"
  aes'4 f
#(ly:expect-warning "cannot find context to switch to")
  \change Staff = "PianoLHStaff"
  ees |  % 45

The close association makes everything clear in a way placing
the expect-warning at the top would not.

Or have I missed some subtlety?

Trevor


---
This email has been checked for viruses by AVG.
http://www.avg.com
_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: ly:expect-warning (was Re: Slur from one voice to another emitswarning)

David Kastrup
"Trevor Daniels" <[hidden email]> writes:

> David, you wrote  Monday, June 05, 2017 5:34 PM
>
>
>> Richard Shann <[hidden email]> writes:
>>
>>> I found by trial-and-error that if I remove any of the three occurrences
>>> of the ly:expect-warning the warning returns.
>>>
>>> Where should it be called?
>>
>> At the top, once for every expected warning.  It doesn't make sense
>> placing it in music expressions: its effect will be immediate anyway and
>> it does not become part of the music.
>
> Why does it not make sense to place it in a music expression?  I find
> keeping the suppression adjacent to the place the warning is triggered
> helps to remind me why it is there.

Music expressions can be invoked any number of times (including zero)
and in arbitrary order.  Putting ly:expect-warning inside of a music
expression suggests that trigger and suppression of the warning are
linked.  However, the trigger of the warning occurs when the music
expression is actually interpreted (and even then, it might be triggered
by different phases of interpretation) while the suppression is
registered at the moment ly:expect-warning is read from the input file.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user