Adding a continuous drone to midi output

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

Adding a continuous drone to midi output

Sven Axelsson-3
I just tried the midi output to play back bagpipe music and was actually surprised the complex grace notes work pretty well. However, I'm wondering if there is some way to add the continuous drone to the music automatically without having to actually write them in as separate voices? I need two separate drone voices sounding the same note continuously during the entire playback. Should be possible with a little Scheme magic, right?

Regards,
Sven Axelsson

-- 
++++++++++[>++++++++++>+++++++++++>++++++++++>++++++
>++++<<<<<-]>++++.+.++++.>+++++.>+.<<-.>>+.>++++.<<.
+++.>-.<<++.>>----.<++.>>>++++++.<<<<.>>++++.<----.

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

Re: Adding a continuous drone to midi output

SoundsFromSound
On 5/22/2018 12:47 PM, Sven Axelsson wrote:
I just tried the midi output to play back bagpipe music and was actually surprised the complex grace notes work pretty well. However, I'm wondering if there is some way to add the continuous drone to the music automatically without having to actually write them in as separate voices? I need two separate drone voices sounding the same note continuously during the entire playback. Should be possible with a little Scheme magic, right?

Regards,
Sven Axelsson

-- 
++++++++++[>++++++++++>+++++++++++>++++++++++>++++++
>++++<<<<<-]>++++.+.++++.>+++++.>+.<<-.>>+.>++++.<<.
+++.>-.<<++.>>----.<++.>>>++++++.<<<<.>>++++.<----.



For just playback purposes? Does it have to be outputted in LilyPond and the input file though?

I guess you could create a low synthesized drone pitch but I don't know how you'd control it and manipulate it via playback as you are working on a score.
LilyPond is primarily an engraving package. :)

Maybe you could use an audio player outside LilyPond and play back the drone that way, then you'd have complete control of LilyPond as-is without worrying - total control over each element. Assuming it's just for playback purposes or composing tools.

Just an idea.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
composer | sound designer | asmr artist
LilyPond video tutorials: http://bit.ly/LearnLilyPond
Reply | Threaded
Open this post in threaded view
|

Re: Adding a continuous drone to midi output

Karlin High
In reply to this post by Sven Axelsson-3
On 5/22/2018 11:47 AM, Sven Axelsson wrote:
> However, I'm wondering if there is some way to add the continuous drone
> to the music automatically without having to actually write them in as
> separate voices? I need two separate drone voices sounding the same note
> continuously during the entire playback.

One option would be using a MIDI editor to add the drone tracks.
SpeedyMIDI is what I would use for this.
<http://speedymidi.sourceforge.net/>
Add new track, get the mouse-keyboard, set the drone notes, and mash the
spacebar until the duration's been recorded to desired length.

There might be a Scheme method, though. Things I've looked at here:

display-scheme-music
#(display (ly:music-length ...
\scaleDurations stuff
<https://lists.gnu.org/archive/html/lilypond-user/2017-10/msg00046.html>

I finally decided I was playing "sorcerer's apprentice" with those. But
in the past, I've been able to provoke a correct answer by posting an
incomplete or incorrect one. :)

% BEGIN LILYPOND CODE
\version "2.19.80"
% Pseudocode for generating continuous MIDI drone
% for instruments like bagpipes, hurdy-gurdy, etc

musicwithdrone = \repeat unfold 12 { c'4 e' g' c'' }

% Graphic output, no MIDI
\score {
   \musicwithdrone

   \layout { }
}

% MIDI output, no graphics
\score {
   <<
     \musicwithdrone
     % Somehow, find length of \musicwithdrone
     % and then play drone note for that duration
     % c'*scaledtomusic
   >>

   \midi { }
}
% END LILYPOND CODE
--
Karlin High
Missouri, USA

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

Re: Adding a continuous drone to midi output

David Kastrup
Karlin High <[hidden email]> writes:

> On 5/22/2018 11:47 AM, Sven Axelsson wrote:
>> However, I'm wondering if there is some way to add the continuous
>> drone to the music automatically without having to actually write
>> them in as separate voices? I need two separate drone voices
>> sounding the same note continuously during the entire playback.
>
> One option would be using a MIDI editor to add the drone
> tracks. SpeedyMIDI is what I would use for this.
> <http://speedymidi.sourceforge.net/>
> Add new track, get the mouse-keyboard, set the drone notes, and mash
> the spacebar until the duration's been recorded to desired length.
>
> There might be a Scheme method, though. Things I've looked at here:
>
> display-scheme-music
> #(display (ly:music-length ...
> \scaleDurations stuff
> <https://lists.gnu.org/archive/html/lilypond-user/2017-10/msg00046.html>
>
> I finally decided I was playing "sorcerer's apprentice" with
> those. But in the past, I've been able to provoke a correct answer by
> posting an incomplete or incorrect one. :)
>
> % BEGIN LILYPOND CODE
> \version "2.19.80"
> % Pseudocode for generating continuous MIDI drone
> % for instruments like bagpipes, hurdy-gurdy, etc
>
> musicwithdrone = \repeat unfold 12 { c'4 e' g' c'' }
>
> % Graphic output, no MIDI
> \score {
>   \musicwithdrone
>
>   \layout { }
> }
>
> % MIDI output, no graphics
> \score {
>   <<
>     \musicwithdrone
>     % Somehow, find length of \musicwithdrone
>     % and then play drone note for that duration
>     % c'*scaledtomusic
>   >>
>
>   \midi { }
> }
> % END LILYPOND CODE
Ok, this is _too_ much of a temptation.  So little to fill in
actually...


% BEGIN LILYPOND CODE
\version "2.19.80"
% Pseudocode for generating continuous MIDI drone
% for instruments like bagpipes, hurdy-gurdy, etc

musicwithdrone = \repeat unfold 12 { c'4 e' g' c'' }

% Graphic output, no MIDI
\score {
  \musicwithdrone

  \layout { }
}

% MIDI output, no graphics
\score {
  <<
    \musicwithdrone
    % Somehow, find length of \musicwithdrone
    % and then play drone note for that duration
    #(ly:music-compress #{ c'1 #} (ly:music-length musicwithdrone))
  >>

  \midi { }
}
% END LILYPOND CODE


Now it would be even nicer to be able to write

c'1*#(ly:music-length musicwithdrone)

and there is actually no compelling reason not to allow this I think.
I'll take a look to see what would be involved adding to the parser
here.

This really beats "LilyPond programmers are lazy jerks" solution-finding
approaches.

--
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: Adding a continuous drone to midi output

Sven Axelsson-3


On 22 May 2018 at 20:06, David Kastrup <[hidden email]> wrote:
Ok, this is _too_ much of a temptation.  So little to fill in
actually...

Now it would be even nicer to be able to write

c'1*#(ly:music-length musicwithdrone)

and there is actually no compelling reason not to allow this I think.
I'll take a look to see what would be involved adding to the parser
here.

This really beats "LilyPond programmers are lazy jerks" solution-finding
approaches.

That would be absolutely brilliant, David! If you do it I will start promoting the "Lilypond programmers are hard-working saints" meme. ☺

Another somewhat related question, would it be possible to automatically wrap the music with `\unfoldRepeats` when generating MIDI output? Isn't that what you always want anyways?

Thanks a lot,
Sven Axelsson

--
++++++++++[>++++++++++>+++++++++++>++++++++++>++++++
>++++<<<<<-]>++++.+.++++.>+++++.>+.<<-.>>+.>++++.<<.
+++.>-.<<++.>>----.<++.>>>++++++.<<<<.>>++++.<----.

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

Re: Adding a continuous drone to midi output

David Kastrup
Sven Axelsson <[hidden email]> writes:

> On 22 May 2018 at 20:06, David Kastrup <[hidden email]> wrote:
>
>> Ok, this is _too_ much of a temptation.  So little to fill in
>> actually...
>>
>> Now it would be even nicer to be able to write
>>
>> c'1*#(ly:music-length musicwithdrone)
>>
>> and there is actually no compelling reason not to allow this I think.
>> I'll take a look to see what would be involved adding to the parser
>> here.
>>
>> This really beats "LilyPond programmers are lazy jerks" solution-finding
>> approaches.
>>
>
> That would be absolutely brilliant, David! If you do it I will start
> promoting the "Lilypond programmers are hard-working saints" meme. ☺
>
> Another somewhat related question, would it be possible to automatically
> wrap the music with `\unfoldRepeats` when generating MIDI output? Isn't
> that what you always want anyways?

\score {
  \repeat volta 2 { c4 d e f }
  \layout { }
  \midi { }
}

What now?

--
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: Adding a continuous drone to midi output

Sven Axelsson-3
On 22 May 2018 at 21:10, David Kastrup <[hidden email]> wrote:
Sven Axelsson <[hidden email]> writes:

> Another somewhat related question, would it be possible to automatically
> wrap the music with `\unfoldRepeats` when generating MIDI output? Isn't
> that what you always want anyways?

\score {
  \repeat volta 2 { c4 d e f }
  \layout { }
  \midi { }
}

What now?

That is ok, but try this: 

\score {
  \repeat volta 2 { c4 d e f } \alternative { {e4} {c4} }
  \layout { }
  \midi { }
}

--
Sven Axelsson
++++++++++[>++++++++++>+++++++++++>++++++++++>++++++
>++++<<<<<-]>++++.+.++++.>+++++.>+.<<-.>>+.>++++.<<.
+++.>-.<<++.>>----.<++.>>>++++++.<<<<.>>++++.<----.

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

Re: Adding a continuous drone to midi output

David Kastrup
Sven Axelsson <[hidden email]> writes:

> On 22 May 2018 at 21:10, David Kastrup <[hidden email]> wrote:
>
>> Sven Axelsson <[hidden email]> writes:
>>
>> > Another somewhat related question, would it be possible to automatically
>> > wrap the music with `\unfoldRepeats` when generating MIDI output? Isn't
>> > that what you always want anyways?
>>
>> \score {
>>   \repeat volta 2 { c4 d e f }
>>   \layout { }
>>   \midi { }
>> }
>>
>> What now?
>>
>
> That is ok, but try this:
>
> \score {
>   \repeat volta 2 { c4 d e f } \alternative { {e4} {c4} }
>   \layout { }
>   \midi { }
> }

Your point being?

--
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: Adding a continuous drone to midi output

David Kastrup
In reply to this post by Sven Axelsson-3
Sven Axelsson <[hidden email]> writes:

> On 22 May 2018 at 20:06, David Kastrup <[hidden email]> wrote:
>
>> Ok, this is _too_ much of a temptation.  So little to fill in
>> actually...
>>
>> Now it would be even nicer to be able to write
>>
>> c'1*#(ly:music-length musicwithdrone)
>>
>> and there is actually no compelling reason not to allow this I think.
>> I'll take a look to see what would be involved adding to the parser
>> here.
>>
>> This really beats "LilyPond programmers are lazy jerks" solution-finding
>> approaches.
>>
>
> That would be absolutely brilliant, David! If you do it I will start
> promoting the "Lilypond programmers are hard-working saints" meme. ☺

Turns out that I don't have a good idea where to document this in the
manuals.  At least I added a (half-stolen) regtest that at least
illustrates how this can be used for your usage case.

Current branch: issue5327
Tracker issue: 5327 (https://sourceforge.net/p/testlilyissues/issues/5327/)
Rietveld issue: 346810043 (https://codereview.appspot.com/346810043)
Issue description:
  Allow Scheme/identifiers for duration multipliers   Also contains
  commit:  Regtest for computed duration multipliers


--
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: Adding a continuous drone to midi output

Karlin High
On 5/22/2018 3:57 PM, David Kastrup wrote:
> Turns out that I don't have a good idea where to document this in the
> manuals.

You've already considered this one?

<http://lilypond.org/doc/v2.19/Documentation/notation/writing-rhythms#scaling-durations>
--
Karlin High
Missouri, USA

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

Re: Re: Adding a continuous drone to midi output

Mats Bengtsson-4
In reply to this post by Sven Axelsson-3


On 2018-05-22 21:54, Sven Axelsson wrote:
> Another somewhat related question, would it be possible to
> automatically wrap the music with `\unfoldRepeats` when generating
> MIDI output? Isn't that what you always want anyways?
Not really, if you mainly use the MIDI for proof listening (which
corresponds to the level of ambition that the current MIDI output is
at), then unfolded repeats are just annoying, in my opinion.

    /Mats

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

Re: Adding a continuous drone to midi output

Gilles Sadowski
In reply to this post by Sven Axelsson-3
Hi.

On Tue, 22 May 2018 17:47:35 +0100, Sven Axelsson wrote:

> I just tried the midi output to play back bagpipe music and was
> actually
> surprised the complex grace notes work pretty well. However, I'm
> wondering
> if there is some way to add the continuous drone to the music
> automatically
> without having to actually write them in as separate voices? I need
> two
> separate drone voices sounding the same note continuously during the
> entire
> playback. Should be possible with a little Scheme magic, right?

This
   http://lsr.di.unimi.it/LSR/Item?id=997
answered the same question which I asked here a few years ago.

Regards,
Gilles

P.S. I've encountered an issue where the drone stops well before
      the melody it is supposed to double; it occurs when there
      are a lot of grace notes.

> Regards,
> Sven Axelsson


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

Re: Adding a continuous drone to midi output

David Kastrup
In reply to this post by Karlin High
Karlin High <[hidden email]> writes:

> On 5/22/2018 3:57 PM, David Kastrup wrote:
>> Turns out that I don't have a good idea where to document this in the
>> manuals.
>
> You've already considered this one?
>
> <http://lilypond.org/doc/v2.19/Documentation/notation/writing-rhythms#scaling-durations>

I've not considered _any_ part of the manuals yet.  You are likely
right, but no fun: this section of the manual would rather suggest that
\scaleDurations should likely be made to accept the same kind of
multiplier, and that appears, like, really icky.

Do we then need a predicate factor? that will accept either a number
pair (in lieu of a fraction) or a (non-negative?) rational or a moment?

The predicate fraction? remains necessary for indicating "musical"
fractions (used for meters and tuplets) which are not adequately
represented with rational numbers because 3/2 and 6/4 need to be
differentiated.

--
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: Adding a continuous drone to midi output

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

> Karlin High <[hidden email]> writes:
>
>> On 5/22/2018 3:57 PM, David Kastrup wrote:
>>> Turns out that I don't have a good idea where to document this in the
>>> manuals.
>>
>> You've already considered this one?
>>
>> <http://lilypond.org/doc/v2.19/Documentation/notation/writing-rhythms#scaling-durations>
>
> I've not considered _any_ part of the manuals yet.  You are likely
> right, but no fun: this section of the manual would rather suggest that
> \scaleDurations should likely be made to accept the same kind of
> multiplier, and that appears, like, really icky.
>
> Do we then need a predicate factor? that will accept either a number
> pair (in lieu of a fraction) or a (non-negative?) rational or a moment?
>
> The predicate fraction? remains necessary for indicating "musical"
> fractions (used for meters and tuplets) which are not adequately
> represented with rational numbers because 3/2 and 6/4 need to be
> differentiated.

Sigh.  Added basic documentation and harmonized the functionality.

Current branch: issue5327
Tracker issue: 5327 (https://sourceforge.net/p/testlilyissues/issues/5327/)
Rietveld issue: 346810043 (https://codereview.appspot.com/346810043)
Issue description:
  Allow Scheme/identifiers for duration multipliers   Also contains
  commit:  Regtest for computed duration multipliers


--
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: Adding a continuous drone to midi output

Karlin High
On Wed, May 23, 2018 at 5:05 PM, David Kastrup <[hidden email]> wrote:
> Sigh.  Added basic documentation and harmonized the functionality.

(APPLAUSE)

Does this get a changes entry?
--
Karlin High
Missouri, USA

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

Re: Adding a continuous drone to midi output

David Kastrup
Karlin High <[hidden email]> writes:

> On Wed, May 23, 2018 at 5:05 PM, David Kastrup <[hidden email]> wrote:
>> Sigh.  Added basic documentation and harmonized the functionality.
>
> (APPLAUSE)
>
> Does this get a changes entry?

It might.  It's not really Earth shaking functionality, to be honest.

--
David Kastrup

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