Re: "Problematic" conversion from MIDI: c4*5, c1 (in 3/4 time) etc.

2016-07-29 Thread David Wright
On Fri 29 Jul 2016 at 14:29:57 (+0200), Mojca Miklavec wrote:
> I have a midi file that I wanted to convert into scores, but the
> scores simply don't look right.
> 
> While I have a real (relatively long) song in the MIDI, I believe that
> I can fully reproduce the problem with the following simple example:
> 
> \score {
>   \new Voice = "melody" {
> \set Staff.midiInstrument = "accordion"
> \time 3/4
> \relative c' {
>   c4 c c |
>   c1 d4 e |
>   f4*5 g4 |
>   f2.~ | % becomes f4*5
>   f2 e4 |
>   d4*3 | % becomes d2.
>   c4 c2~ | % becomes c1
>   c2
> }
>   }
>   \midi { \tempo 4 = 160 }
>   \layout {}
> }
> 
> (I picked accordion because one doesn't hear the duration with piano.)
> 
> The idea is to make midi from the above example first (lilypond
> test.ly), then convert midi to scores (midi2ly test.midi -o test2.ly)
> and typeset again (lilypond test2.ly).
> 
> 
> The resulting MIDI file sounds right, but the typesetting of it is
> very strange. I get just a single quarter note printed out rather than
> something that takes the duration of five times a quarter.
> 
> OK, that's probably expected when I consciously enter the above
> syntax, but not after conversion from a MIDI file.
> 
> I noticed that the whole idea of the asterisk operator is to print a
> single unit, but to prolong it in MIDI (or for other purposes). But
> there's a lot of inconsistency:
> - if I properly enter c2.~ c2, I get c4*5 from the midi conversion
> - if I properly enter c2~ c2, I get c1 which is "forbidden" inside 3/4
> - if I sloppily enter c4*3 which would typset in a very weird way, it
> comes out OK after the conversion as c2.
> 
> None of that makes any sense to me.
> 
> Sure I can manually fix the resulting plain text file, but I was
> wondering if there was really no better way to get this done properly
> and automatically.

In the absence of any output examples, I've attached what my system
produces from your source. Let us know what's incorrect. It looks to
me as if the original score is just what you (idiosyncratically) asked
for and the subsequent score has been "conventionalised" as one might
expect, because the midi performer has no way of representing your
odd notation.

(Ignore the addition of 00 to the midi filename; my lilypond command
postprocesses midi filenames to make them sort in the correct order.)

> (PS: please CC me in reply.)

This will happen automatically if you coerce you mail client into
including the header line:

 Reply-To: Mojca Miklavec , 
lilypond-u...@gnu.org

Cheers,
David.
\score {
  \new Voice = "melody" {
\set Staff.midiInstrument = "accordion"
\time 3/4
\relative c' {
  c4 c c |
  c1 d4 e |
  f4*5 g4 |
  f2.~ | % becomes f4*5
  f2 e4 |
  d4*3 | % becomes d2.
  c4 c2~ | % becomes c1
  c2
}
  }
  \midi { \tempo 4 = 160 }
  \layout {}
}


accord.pdf
Description: Adobe PDF document


accord-00.midi
Description: MIDI audio
% Lily was here -- automatically converted by 
/home/david/lilypond-2.19.44-1/lilypond/usr/bin/midi2ly from /tmp/accord-00.midi
\version "2.14.0"

\layout {
  \context {
\Voice
\remove "Note_heads_engraver"
\consists "Completion_heads_engraver"
\remove "Rest_engraver"
\consists "Completion_rest_engraver"
  }
}

trackAchannelA = {
  
  % [TEXT_EVENT] creator: 
  
  % [TEXT_EVENT] GNU LilyPond 2.19.44  
  
  \time 3/4 
  
  \tempo 4 = 160 
  
}

trackA = <<
  \context Voice = voiceA \trackAchannelA
>>


trackBchannelA = {
  
  % [INSTRUMENT_NAME] accordion
  
  \set Staff.instrumentName = "\new:melody"
  
}

trackBchannelB = \relative c {
  c'4 c c 
  | % 2
  c1 d4 e 
  | % 4
  f4*5 g4 
  | % 6
  f4*5 e4 
  | % 8
  d2. 
  | % 9
  c4 c1 
}

trackB = <<
  \context Voice = voiceA \trackBchannelA
  \context Voice = voiceB \trackBchannelB
>>


\score {
  <<
\context Staff=trackB \trackA
\context Staff=trackB \trackB
  >>
  \layout {}
  \midi {}
}


accord-00-midi.pdf
Description: Adobe PDF document
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: segfault in 2.19.45

2016-07-29 Thread Kevin Barry
> Hi, Fedora lilypond maintainer.  We've actually got our 2.19.45 patched, but
> the update was superceded by 2.19.46.  If you do sudo dnf update lilypond*
> --enablerepo=updates-testing you should get it.

Many thanks; this fixed it!

___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: segfault in 2.19.45

2016-07-29 Thread Jon Ciesla
On Fri, Jul 29, 2016 at 12:32 PM, Kevin Barry  wrote:

> Thank you for taking the time to test it. I'm using the package in
> Fedora's repo, so I suppose I should take it up with them? I'm not
> sure how to troubleshoot further. Reinstalling didn't help.
>
> Kevin
>
> ___
> bug-lilypond mailing list
> bug-lilypond@gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-lilypond
>

Hi, Fedora lilypond maintainer.  We've actually got our 2.19.45 patched,
but the update was superceded by 2.19.46.  If you do sudo dnf update
lilypond* --enablerepo=updates-testing you should get it.

-- 
http://cecinestpasunefromage.wordpress.com/

in your fear, seek only peace
in your fear, seek only love

-d. bowie
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: segfault in 2.19.45

2016-07-29 Thread Mark Knoop
At 18:32 on 29 Jul 2016, Kevin Barry wrote:
>Thank you for taking the time to test it. I'm using the package in
>Fedora's repo, so I suppose I should take it up with them? I'm not
>sure how to troubleshoot further. Reinstalling didn't help.

http://git.savannah.gnu.org/cgit/lilypond.git/commit/?id=b0dce76daf27721ba157cd2ac5d7662d4c8d75f8

This is fixed in git, we just need to wait for a new build in Fedora.

-- 
Mark Knoop

___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: segfault in 2.19.45

2016-07-29 Thread Kevin Barry
Thank you for taking the time to test it. I'm using the package in
Fedora's repo, so I suppose I should take it up with them? I'm not
sure how to troubleshoot further. Reinstalling didn't help.

Kevin

___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: segfault in 2.19.45

2016-07-29 Thread James

Hello,


On 29/07/16 15:41, Kevin Barry wrote:

Apologies if this is fixed in 2.19.46

It worked in previous versions of 2.19 (I'm not sure when it broke
cause it's not from something i worked on too recently). I am on Linux
64-bit (Fedora). A MWE follows (compiling with no options should
segfault). There must be some kind of problem caused by the slur and
tie ending in the same place.

\version "2.19.45"

{ a( b~ b) }

Starting lilypond 2.19.45 [test.ly]...
Processing `test.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Exited with exit status 1.

Works in current dev version (2.19.47 - on Ubuntu 16.04)

GNU LilyPond 2.19.47
Processing `test.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `/tmp/lilypond-5c5I5u'...
Converting to `test.pdf'...
Deleting `/tmp/lilypond-5c5I5u'...
Success: compilation successfully completed

James

___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: segfault in 2.19.45

2016-07-29 Thread James

Hello,


On 29/07/16 17:59, James wrote:

Hello,


On 29/07/16 15:41, Kevin Barry wrote:

Apologies if this is fixed in 2.19.46

It worked in previous versions of 2.19 (I'm not sure when it broke
cause it's not from something i worked on too recently). I am on Linux
64-bit (Fedora). A MWE follows (compiling with no options should
segfault). There must be some kind of problem caused by the slur and
tie ending in the same place.

\version "2.19.45"

{ a( b~ b) }

Starting lilypond 2.19.45 [test.ly]...
Processing `test.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Exited with exit status 1.

Works in current dev version (2.19.47 - on Ubuntu 16.04)

GNU LilyPond 2.19.47
Processing `test.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `/tmp/lilypond-5c5I5u'...
Converting to `test.pdf'...
Deleting `/tmp/lilypond-5c5I5u'...
Success: compilation successfully completed

James


And just for completeness

GNU LilyPond 2.19.45
Processing `test.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `/tmp/lilypond-K5sb1Z'...
Converting to `test.pdf'...
Deleting `/tmp/lilypond-K5sb1Z'...
Success: compilation successfully completed

This was built from commit

http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=commit;h=3166508fc708e83c8b691a823f9e3360366fba33

James

___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


segfault in 2.19.45

2016-07-29 Thread Kevin Barry
Apologies if this is fixed in 2.19.46

It worked in previous versions of 2.19 (I'm not sure when it broke
cause it's not from something i worked on too recently). I am on Linux
64-bit (Fedora). A MWE follows (compiling with no options should
segfault). There must be some kind of problem caused by the slur and
tie ending in the same place.

\version "2.19.45"

{ a( b~ b) }

Starting lilypond 2.19.45 [test.ly]...
Processing `test.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Exited with exit status 1.

___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: "Problematic" conversion from MIDI: c4*5, c1 (in 3/4 time) etc.

2016-07-29 Thread David Kastrup
Mojca Miklavec  writes:

> I have a midi file that I wanted to convert into scores, but the
> scores simply don't look right.
>
> While I have a real (relatively long) song in the MIDI, I believe that
> I can fully reproduce the problem with the following simple example:
>
> \score {
>   \new Voice = "melody" {
> \set Staff.midiInstrument = "accordion"
> \time 3/4
> \relative c' {
>   c4 c c |
>   c1 d4 e |
>   f4*5 g4 |
>   f2.~ | % becomes f4*5
>   f2 e4 |
>   d4*3 | % becomes d2.
>   c4 c2~ | % becomes c1
>   c2
> }
>   }
>   \midi { \tempo 4 = 160 }
>   \layout {}
> }
>
> (I picked accordion because one doesn't hear the duration with piano.)
>
> The idea is to make midi from the above example first (lilypond
> test.ly), then convert midi to scores (midi2ly test.midi -o test2.ly)
> and typeset again (lilypond test2.ly).
>
>
> The resulting MIDI file sounds right, but the typesetting of it is
> very strange. I get just a single quarter note printed out rather than
> something that takes the duration of five times a quarter.

Yes, this sucks.  The salient point is that the durations are not
necessarily detected correctly, and more importantly, that their
relation to the bar lines (which a single timing mistake will move who
knows where) is not really known to be correct.  So midi2ly does not try
meddling with ~ and such stuff but converts every note to a single
recognizable entity.

You can partly fix this up using the Completion_heads_engraver like
follows:

\score {
  \new Voice = "melody"
  \with {
\remove "Note_heads_engraver"
\remove "Rest_engraver"
\consists "Completion_heads_engraver"
\consists "Completion_rest_engraver"
completionUnit = #(ly:make-moment 3/4)
completionFactor = 1
  }
  {
\set Staff.midiInstrument = "accordion"
\time 3/4
\relative c' {
  c4 c c |
  c1 d4 e |
  f4*5 g4 |
  f2.~ | % becomes f4*5
  f2 e4 |
  d4*3 | % becomes d2.
  c4 c2~ | % becomes c1
  c2
}
  }
  \midi { \tempo 4 = 160 }
  \layout {}
}

But you'll notice that this still does not deliver perfect results.  You
won't get around reediting, really.

> I noticed that the whole idea of the asterisk operator is to print a
> single unit, but to prolong it in MIDI (or for other purposes). But
> there's a lot of inconsistency:
> - if I properly enter c2.~ c2, I get c4*5 from the midi conversion
> - if I properly enter c2~ c2, I get c1 which is "forbidden" inside 3/4
> - if I sloppily enter c4*3 which would typset in a very weird way, it
> comes out OK after the conversion as c2.
>
> None of that makes any sense to me.

midi2ly produces a single note/note-length and a maximum of one dot.
The rest it does by scaling.

I'm not going to defend it.  midi2ly is an old utility and it suffers
from being a batch tool.  An interactive tool that would correct
bar-lines as the user corrects recognized durations and then can
re-split durations after correction would have a lot more sanity going
for it.

> Sure I can manually fix the resulting plain text file, but I was
> wondering if there was really no better way to get this done properly
> and automatically.

Completion_* engravers fix a bit of the typeset result but not
necessarily enough, and the input stays ugly.

-- 
David Kastrup
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


"Problematic" conversion from MIDI: c4*5, c1 (in 3/4 time) etc.

2016-07-29 Thread Mojca Miklavec
Hello,

I have a midi file that I wanted to convert into scores, but the
scores simply don't look right.

While I have a real (relatively long) song in the MIDI, I believe that
I can fully reproduce the problem with the following simple example:

\score {
  \new Voice = "melody" {
\set Staff.midiInstrument = "accordion"
\time 3/4
\relative c' {
  c4 c c |
  c1 d4 e |
  f4*5 g4 |
  f2.~ | % becomes f4*5
  f2 e4 |
  d4*3 | % becomes d2.
  c4 c2~ | % becomes c1
  c2
}
  }
  \midi { \tempo 4 = 160 }
  \layout {}
}

(I picked accordion because one doesn't hear the duration with piano.)

The idea is to make midi from the above example first (lilypond
test.ly), then convert midi to scores (midi2ly test.midi -o test2.ly)
and typeset again (lilypond test2.ly).


The resulting MIDI file sounds right, but the typesetting of it is
very strange. I get just a single quarter note printed out rather than
something that takes the duration of five times a quarter.

OK, that's probably expected when I consciously enter the above
syntax, but not after conversion from a MIDI file.

I noticed that the whole idea of the asterisk operator is to print a
single unit, but to prolong it in MIDI (or for other purposes). But
there's a lot of inconsistency:
- if I properly enter c2.~ c2, I get c4*5 from the midi conversion
- if I properly enter c2~ c2, I get c1 which is "forbidden" inside 3/4
- if I sloppily enter c4*3 which would typset in a very weird way, it
comes out OK after the conversion as c2.

None of that makes any sense to me.

Sure I can manually fix the resulting plain text file, but I was
wondering if there was really no better way to get this done properly
and automatically.

Thank you,
Mojca

(PS: please CC me in reply.)

___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond