DrumVoice Polyphony and MIDI

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

DrumVoice Polyphony and MIDI

Stefano Antonelli
Greetings List,

I'm trying to understand why one syntax results in MIDI output, while
another syntax does not.  I'm new to lilypond and clearly missing
something.

Below is the working case:

tagCymbals = \drummode { \voiceOne   cymc4 cymc4 cymc4 cymc4 }
tagDrums =   \drummode { \voiceTwo   s4    sn4   s4    sn4   }
tagKick =    \drummode { \voiceThree bd4   s4    bd4   s4    }

\score {
  \new DrumStaff <<
    \set Staff.instrumentName = #"Drums"
    \new DrumVoice { \tagCymbals }
    \new DrumVoice { \tagDrums }
    \new DrumVoice { \tagKick }
  >>
  \layout { }
  \midi {
    \tempo 4 = 84
  }
}
\version "2.18.2"

That is not always a convenient format for working with drum parts
though.  I would like to be able to use a syntax more like the
following:

test = \drummode {
  <<
  { \voiceOne cymc4 cymc4 cymc4 cymc4 }
  { \voiceOne s4    sn4   s4    sn4   }
  \\
  { \voiceTwo bd4   s4    bd4   s4    }
  >>
}

\score {
  \new DrumStaff {
    <<
      \set Staff.instrumentName = #"Drums"
      \new DrumVoice {
        \test
%       \morePolyphonicPieces
      }
    >>
  }
  \layout { }
  \midi {
    \tempo 4 = 84
  }
}
\version "2.18.2"

The above code generates a score just fine, but the MIDI file is empty
(aside from a header).

I don't actually know much about MIDI.  I'm just using the play button
in Frescobaldi.  It's helpful when transcribing.

Thanks,
Stef


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

Re: DrumVoice Polyphony and MIDI

Federico Bruni-2
Il giorno lun 26 ago 2019 alle 20:08, Stefano Antonelli
<[hidden email]> ha scritto:

> That is not always a convenient format for working with drum parts
> though.  I would like to be able to use a syntax more like the
> following:
>
> test = \drummode {
>   <<
>   { \voiceOne cymc4 cymc4 cymc4 cymc4 }
>   { \voiceOne s4    sn4   s4    sn4   }
>   \\
>   { \voiceTwo bd4   s4    bd4   s4    }
>   >>
> }
>
> \score {
>   \new DrumStaff {
>     <<
>       \set Staff.instrumentName = #"Drums"
>       \new DrumVoice {
>         \test
> %       \morePolyphonicPieces
>       }
>     >>
>   }
>   \layout { }
>   \midi {
>     \tempo 4 = 84
>   }
> }
> \version "2.18.2"
>
> The above code generates a score just fine, but the MIDI file is empty
> (aside from a header).
>
> I don't actually know much about MIDI.  I'm just using the play button
> in Frescobaldi.  It's helpful when transcribing.

The MIDI file is not empty when I compile above snippet.
And I don't see why it should happen to you.
Did you check carefully? Are you working on a saved file or a draft in
Frescobaldi?
Operating system?




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

Re: DrumVoice Polyphony and MIDI

Stefano Antonelli
On Wed, 2019-08-28 at 09:01 +0200, Federico Bruni wrote:

> Il giorno lun 26 ago 2019 alle 20:08, Stefano Antonelli 
> <[hidden email]> ha scritto:
> >
> > That is not always a convenient format for working with drum parts
> > though.  I would like to be able to use a syntax more like the
> > following:
> >
> > test = \drummode {
> >   <<
> >   { \voiceOne cymc4 cymc4 cymc4 cymc4 }
> >   { \voiceOne s4    sn4   s4    sn4   }
> >   \\
> >   { \voiceTwo bd4   s4    bd4   s4    }
> >   >>
> > }
> >
> > \score {
> >   \new DrumStaff {
> >     <<
> >       \set Staff.instrumentName = #"Drums"
> >       \new DrumVoice {
> >         \test
> > %       \morePolyphonicPieces
> >       }
> >     >>
> >   }
> >   \layout { }
> >   \midi {
> >     \tempo 4 = 84
> >   }
> > }
> > \version "2.18.2"
> >
> > The above code generates a score just fine, but the MIDI file is
> > empty
> > (aside from a header).
> >
> > I don't actually know much about MIDI.  I'm just using the play
> > button
> > in Frescobaldi.  It's helpful when transcribing.
> The MIDI file is not empty when I compile above snippet.
> And I don't see why it should happen to you.
> Did you check carefully? Are you working on a saved file or a draft
> in 
> Frescobaldi?
> Operating system?

Thanks for the help.

Working from a saved file.  I've deleted the output files (both pdf and
midi) and pressed the engrave button.  New files are generated.
 Frescobaldi loads the midi, but doesn't seem to do anything when
pressing the play button.

The midi from the above (not working) code is 174 bytes (the header I
assume).  When I open this file up in audacity, it's recognised as a
midi file, but there is no data on any channels.

The midi from the working code is 216 bytes.  When I open this file up
in audacity, there is data.

OS is Windows 7 on a computer I don't use often.  Frescobaldi is
version 3.0.1.  Lilypond is 2.18.2.

I also just tried it on my primary linux machine.  Similar results.
 Bad file is 162 bytes and the good file is 216 bytes.  The bad file
doesn't work in audacity, but the good file does.  Using lilypond from
the command line.  Version is 2.18.2.

Seems to be consistent with this version of lilypond.  What version are
you using?

Thanks,
Stef

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

Re: Re: DrumVoice Polyphony and MIDI

Mats Bengtsson-4

On 2019-08-28 13:14, Stefano Antonelli wrote:

> On Wed, 2019-08-28 at 09:01 +0200, Federico Bruni wrote:
>> Il giorno lun 26 ago 2019 alle 20:08, Stefano Antonelli
>> <[hidden email]> ha scritto:
>>> That is not always a convenient format for working with drum parts
>>> though.  I would like to be able to use a syntax more like the
>>> following:
>>>
>>> test = \drummode {
>>>    <<
>>>    { \voiceOne cymc4 cymc4 cymc4 cymc4 }
>>>    { \voiceOne s4    sn4   s4    sn4   }
>>>    \\
>>>    { \voiceTwo bd4   s4    bd4   s4    }
>>>    >>
>>> }
>>>
>>> \score {
>>>    \new DrumStaff {
>>>      <<
>>>        \set Staff.instrumentName = #"Drums"
>>>        \new DrumVoice {
>>>          \test
>>> %       \morePolyphonicPieces
>>>        }
>>>      >>
>>>    }
>>>    \layout { }
>>>    \midi {
>>>      \tempo 4 = 84
>>>    }
>>> }
>>> \version "2.18.2"
>>>
>>> The above code generates a score just fine, but the MIDI file is
>>> empty
>>> (aside from a header).
>>>
>>> I don't actually know much about MIDI.  I'm just using the play
>>> button
>>> in Frescobaldi.  It's helpful when transcribing.
>> The MIDI file is not empty when I compile above snippet.
>> And I don't see why it should happen to you.
>> Did you check carefully? Are you working on a saved file or a draft
>> in
>> Frescobaldi?
>> Operating system?
> ...
> OS is Windows 7 on a computer I don't use often.  Frescobaldi is
> version 3.0.1.  Lilypond is 2.18.2.
>
> I also just tried it on my primary linux machine.  Similar results.
>   Bad file is 162 bytes and the good file is 216 bytes.  The bad file
> doesn't work in audacity, but the good file does.  Using lilypond from
> the command line.  Version is 2.18.2.
>
> Seems to be consistent with this version of lilypond.  What version are
> you using?

I can confirm that the problem appears in 2.18.2, but seems to have been
fixed in 2.19, several years ago. As has already been stated many times
on this list, there's no reason whatsoever to avoid the "unstable"
version 2.19.83. If you really want to keep 2.18.2 for some strange
reason, just add the following at the top of your file


%%%\midi{
   \context {
     \Staff
     \name DrumStaff
     \alias Staff
     midiInstrument = #"drums"
     \denies Voice
     \accepts DrumVoice
     \defaultchild DrumVoice
   }
   \context {
     \Voice
     \name DrumVoice
     \alias Voice
     \remove "Note_performer"
     \consists "Drum_note_performer"
   }
}


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

Re: Re: DrumVoice Polyphony and MIDI

Mats Bengtsson-4
In reply to this post by Stefano Antonelli
Sorry, I pushed "Send" before finishing. Here comes the correct version
of the email.


On 2019-08-28 13:14, Stefano Antonelli wrote:

> On Wed, 2019-08-28 at 09:01 +0200, Federico Bruni wrote:
>> Il giorno lun 26 ago 2019 alle 20:08, Stefano Antonelli
>> <[hidden email]> ha scritto:
>>> That is not always a convenient format for working with drum parts
>>> though.  I would like to be able to use a syntax more like the
>>> following:
>>>
>>> test = \drummode {
>>>   <<
>>>   { \voiceOne cymc4 cymc4 cymc4 cymc4 }
>>>   { \voiceOne s4    sn4   s4    sn4   }
>>>   \\
>>>   { \voiceTwo bd4   s4    bd4   s4    }
>>>   >>
>>> }
>>>
>>> \score {
>>>   \new DrumStaff {
>>>     <<
>>>       \set Staff.instrumentName = #"Drums"
>>>       \new DrumVoice {
>>>         \test
>>> %       \morePolyphonicPieces
>>>       }
>>>     >>
>>>   }
>>>   \layout { }
>>>   \midi {
>>>     \tempo 4 = 84
>>>   }
>>> }
>>> \version "2.18.2"
>>>
>>> The above code generates a score just fine, but the MIDI file is
>>> empty
>>> (aside from a header).
>>>
>>> I don't actually know much about MIDI.  I'm just using the play
>>> button
>>> in Frescobaldi.  It's helpful when transcribing.
>> The MIDI file is not empty when I compile above snippet.
>> And I don't see why it should happen to you.
>> Did you check carefully? Are you working on a saved file or a draft
>> in
>> Frescobaldi?
>> Operating system?
> ...
> OS is Windows 7 on a computer I don't use often.  Frescobaldi is
> version 3.0.1.  Lilypond is 2.18.2.
>
> I also just tried it on my primary linux machine.  Similar results.
>  Bad file is 162 bytes and the good file is 216 bytes.  The bad file
> doesn't work in audacity, but the good file does.  Using lilypond from
> the command line.  Version is 2.18.2.
>
> Seems to be consistent with this version of lilypond.  What version are
> you using?

I can confirm that the problem appears in 2.18.2, but seems to have been
fixed in 2.19, several years ago. As has already been stated many times
on this list, there's no reason whatsoever to avoid the "unstable"
version 2.19.83. If you really want to keep 2.18.2 for some strange
reason, just add the following at the top of your file


%%% Corrected definitions of the DrumStaff and DrumVoice performers,
from version 2.19.x:
\midi{
   \context {
     \Staff
     \name DrumStaff
     \alias Staff
     midiInstrument = #"drums"
     \denies Voice
     \accepts DrumVoice
     \defaultchild DrumVoice
   }
   \context {
     \Voice
     \name DrumVoice
     \alias Voice
     \remove "Note_performer"
     \consists "Drum_note_performer"
   }
}

    /Mats

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

Re: Re: DrumVoice Polyphony and MIDI

Stefano Antonelli
On Thu, 2019-08-29 at 09:53 +0200, Mats Bengtsson wrote:

> I can confirm that the problem appears in 2.18.2, but seems to have
> been 
> fixed in 2.19, several years ago. As has already been stated many
> times 
> on this list, there's no reason whatsoever to avoid the "unstable" 
> version 2.19.83. If you really want to keep 2.18.2 for some strange 
> reason, just add the following at the top of your file
>
>
> %%% Corrected definitions of the DrumStaff and DrumVoice performers, 
> from version 2.19.x:
> \midi{
>    \context {
>      \Staff
>      \name DrumStaff
>      \alias Staff
>      midiInstrument = #"drums"
>      \denies Voice
>      \accepts DrumVoice
>      \defaultchild DrumVoice
>    }
>    \context {
>      \Voice
>      \name DrumVoice
>      \alias Voice
>      \remove "Note_performer"
>      \consists "Drum_note_performer"
>    }
> }

Many thanks Mats.  This worked great.

I'm not avoiding 2.19.x by the way.  This just happens to be the
version available in my repo.



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