Midi block gives errors with bar number checks

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

Midi block gives errors with bar number checks

ptoye
The following MWE gives bar number check errors. If you comment out the midi block they go away. Bizarre, but a definite bug IMHO.

 
Regards,

Peter
mailto:[hidden email]
www.ptoye.com

\version "2.19.52"

\language "english"


\score {
  \new Staff {
    \repeat volta 2 {
      c''1 1
    }
    \alternative {
      { \barNumberCheck #3 d''1  }
      { \barNumberCheck #3 e''1 }

    }
    { \barNumberCheck #4 f''1 | }
  }

  \layout {
    \set Score.alternativeNumberingStyle = #'numbers
    \override Score.BarNumber.break-visibility = ##(#t #t #t)
  }

%%%%%%%%%
% comment out the midi block to remove errors

  \midi {

  }

}


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

Re: Midi block gives errors with bar number checks

Carl Sorensen-3


On 11/26/19, 9:24 AM, "Peter Toye" <[hidden email]> wrote:

    The following MWE gives bar number check errors. If you comment out the midi block they go away. Bizarre, but a definite bug IMHO.

I don't think it's a bug at all.  Midi files require ascending bar numbers, IIUC.  You can't have two measure #2 in a midi file.

So you can label the bar with whatever bar number you want.  But when you run the midi, you'll just get incremented bar numbers.

Hence, the midi sees the fourth bar as bar 4, regardless of whether it is in an alternative or not.

If you put \barNumberCheck on your bars 1 and 2 and then unfold the repeats in your midi, you'll see errors on each bar number check.

\version "2.19.52"

\language "english"

music = {
    \new Staff {
    \repeat volta 2 {
      \barNumberCheck 1 c''1 \barNumberCheck 2 1
    }
    \alternative {
      { \barNumberCheck #3 d''1  }
      { \barNumberCheck #3 e''1 }

    }
    { \barNumberCheck #4 f''1 | }
}

}

\score {
  \music
  \layout {
    \set Score.alternativeNumberingStyle = #'numbers
    \override Score.BarNumber.break-visibility = ##(#t #t #t)
  }
}

%%%%%%%%%
% comment out the midi block to remove errors
\score {
  \unfoldRepeats
  \music
  \midi { }

}
   

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

Re: Midi block gives errors with bar number checks

ptoye
Dear Carl,

I take this point. I don't know MIDI at all - I thought it was more to do with sound generation than score output! Why should an instrumentalist be expected to know what bar number they're playing (until the conductor says "back to bar 52")?
I've just had a quick look at the MIDI spec, and it doesn't include bar numbers AFAICS. The timing is done with an hour/minute/second/frame format. Bar numbers would be far too coarse.
It's still 100% illogical for the sound output to need the same bar numbering as the performer.

Best regards,

Peter
mailto:[hidden email]
www.ptoye.com

-------------------------
Tuesday, November 26, 2019, 5:21:07 PM, Carl Sorensen wrote:



> On 11/26/19, 9:24 AM, "Peter Toye"
> <[hidden email]> wrote:

>     The following MWE gives bar number check
> errors. If you comment out the midi block they
> go away. Bizarre, but a definite bug IMHO.

> I don't think it's a bug at all.  Midi files
> require ascending bar numbers, IIUC.  You can't
> have two measure #2 in a midi file.

> So you can label the bar with whatever bar
> number you want.  But when you run the midi,
> you'll just get incremented bar numbers.

> Hence, the midi sees the fourth bar as bar 4,
> regardless of whether it is in an alternative or not.

> If you put \barNumberCheck on your bars 1 and 2
> and then unfold the repeats in your midi, you'll
> see errors on each bar number check.

> \version "2.19.52"

> \language "english"

> music = {
>     \new Staff {
>     \repeat volta 2 {
>       \barNumberCheck 1 c''1 \barNumberCheck 2 1
>     }
>     \alternative {
>       { \barNumberCheck #3 d''1  }
>       { \barNumberCheck #3 e''1 }

>     }
>     { \barNumberCheck #4 f''1 | }
> }

> }

> \score {
>   \music
>   \layout {
>     \set Score.alternativeNumberingStyle = #'numbers
>     \override Score.BarNumber.break-visibility = ##(#t #t #t)
>   }
> }

> %%%%%%%%%
> % comment out the midi block to remove errors
> \score {
>   \unfoldRepeats
>   \music
>   \midi { }

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

Re: Midi block gives errors with bar number checks

ptoye
In reply to this post by Carl Sorensen-3
Carl,

I've just found the MIDI "beat clock" - 24 per crotchet. Still no bar numbers though!

Best regards,

Peter
mailto:[hidden email]
www.ptoye.com

-------------------------
Tuesday, November 26, 2019, 5:21:07 PM, Carl Sorensen wrote:



> On 11/26/19, 9:24 AM, "Peter Toye"
> <[hidden email]> wrote:

>     The following MWE gives bar number check
> errors. If you comment out the midi block they
> go away. Bizarre, but a definite bug IMHO.

> I don't think it's a bug at all.  Midi files
> require ascending bar numbers, IIUC.  You can't
> have two measure #2 in a midi file.

> So you can label the bar with whatever bar
> number you want.  But when you run the midi,
> you'll just get incremented bar numbers.

> Hence, the midi sees the fourth bar as bar 4,
> regardless of whether it is in an alternative or not.

> If you put \barNumberCheck on your bars 1 and 2
> and then unfold the repeats in your midi, you'll
> see errors on each bar number check.

> \version "2.19.52"

> \language "english"

> music = {
>     \new Staff {
>     \repeat volta 2 {
>       \barNumberCheck 1 c''1 \barNumberCheck 2 1
>     }
>     \alternative {
>       { \barNumberCheck #3 d''1  }
>       { \barNumberCheck #3 e''1 }

>     }
>     { \barNumberCheck #4 f''1 | }
> }

> }

> \score {
>   \music
>   \layout {
>     \set Score.alternativeNumberingStyle = #'numbers
>     \override Score.BarNumber.break-visibility = ##(#t #t #t)
>   }
> }

> %%%%%%%%%
> % comment out the midi block to remove errors
> \score {
>   \unfoldRepeats
>   \music
>   \midi { }

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

Re: Midi block gives errors with bar number checks

Carl Sorensen-3


From: Peter Toye <[hidden email]>
Reply-To: Peter Toye <[hidden email]>
Date: Tuesday, November 26, 2019 at 11:43 AM
To: Carl Sorensen <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: Midi block gives errors with bar number checks

Carl,

I've just found the MIDI "beat clock" - 24 per crotchet. Still no bar numbers though!

Hmm, I’ve been using MIDI on a MacBook using GarageBand.  Apparently Apple has added a framework called Core MIDI that adds the concepts of Bars, Beats, and SubBeats to the MIDI time stream.  So I always have Bars in mm work.

I suppose that one could make the midi performer ignore \barNumberCheck.  The only time I can imagine that would be problematic is if one were only  using LilyPond to create a midi file.   And I suppose that as long as it were properly documented, users would not expect it to work.

Thanks,

Carl

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

Re: Midi block gives errors with bar number checks

ptoye
Carl,

I've been thinking about this, and my guess is that LP uses the bar number to calculate the beat clock. And when there are repeats, MIDI bar number != engraving bar number, so it goes wrong. This is presumably why the MIDI generator in LP doesn't handle repeats, and to make it do so would, I imagine, be a major programming task and probably not worth the effort.

I'm not sure how many LP user use the MIDI output anyway, given its restrictions. Personally, I use it for proof-reading only, so lack of repeats isn't an issue.

I think it needs a mention in the documentation as you suggest. I'll try to work something up - I already have one documentation issue that I promised to help with.

Best regards,

Peter
mailto:[hidden email]
www.ptoye.com

-------------------------
Tuesday, November 26, 2019, 7:12:47 PM, Carl Sorensen wrote:


 
 
From: Peter Toye <[hidden email]>
Reply-To: Peter Toye <[hidden email]>
Date: Tuesday, November 26, 2019 at 11:43 AM
To: Carl Sorensen <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: Midi block gives errors with bar number checks
 
Carl,

I've just found the MIDI "beat clock" - 24 per crotchet. Still no bar numbers though!
 
Hmm, I’ve been using MIDI on a MacBook using GarageBand.  Apparently Apple has added a framework called Core MIDI that adds the concepts of Bars, Beats, and SubBeats to the MIDI time stream.  So I always have Bars in mm work.
 
I suppose that one could make the midi performer ignore \barNumberCheck.  The only time I can imagine that would be problematic is if one were only  using LilyPond to create a midi file.   And I suppose that as long as it were properly documented, users would not expect it to work.
 
Thanks,

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

Re: Midi block gives errors with bar number checks

m.tarenskeen


On Wed, 27 Nov 2019, Peter Toye wrote:

> I'm not sure how many LP user use the MIDI output anyway, given its restrictions. Personally, I use it for proof-reading only, so lack of repeats isn't an issue.

I use MIDI output mainly for proofreading, but at occasions where I need
better MIDI output I always create separate scores for layout{} and
midi{}. In the midi-only version I copy/paste all music in the correct
order instead of using any repeat instructions. Also suitable for complex
Da Capo / Segno / Coda types of repeats. If I arrange my music in blocks
using variables and use my favorite texteditor it really isn't that much
extra work and it is a usable workaround for Lilypond's restrictions.

Sometimes even \unfoldRepeats doesn't do the trick.

--

MT

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

Re: Midi block gives errors with bar number checks

Nikolai Hedler
For what it's worth, I'm one of those users who makes use of the MIDI
output from LilyPond frequently, and while I have not needed to mess with
bar numbers on the MIDI side, I have found it's repeat support serviceable
aside from D.C./D.S. being unsupported. Unfortunately, in my current
project, I'm unable to use your trick of making separate blocks and
assembling them differently in the MIDI score than in the layout score.

- Nikolai

On Wed, Nov 27, 2019, 04:51 Martin Tarenskeen <[hidden email]>
wrote:

>
>
> On Wed, 27 Nov 2019, Peter Toye wrote:
>
> > I'm not sure how many LP user use the MIDI output anyway, given its
> restrictions. Personally, I use it for proof-reading only, so lack of
> repeats isn't an issue.
>
> I use MIDI output mainly for proofreading, but at occasions where I need
> better MIDI output I always create separate scores for layout{} and
> midi{}. In the midi-only version I copy/paste all music in the correct
> order instead of using any repeat instructions. Also suitable for complex
> Da Capo / Segno / Coda types of repeats. If I arrange my music in blocks
> using variables and use my favorite texteditor it really isn't that much
> extra work and it is a usable workaround for Lilypond's restrictions.
>
> Sometimes even \unfoldRepeats doesn't do the trick.
>
> --
>
> MT
>
> _______________________________________________
> bug-lilypond mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/bug-lilypond
>
_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond