lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding a continuous drone to midi output


From: David Kastrup
Subject: Re: Adding a continuous drone to midi output
Date: Tue, 22 May 2018 21:06:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Karlin High <address@hidden> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]