lilypond-user
[Top][All Lists]
Advanced

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

Re: A Midi question


From: H. S. Teoh
Subject: Re: A Midi question
Date: Wed, 12 Sep 2018 16:29:45 -0700
User-agent: Mutt/1.10.1 (2018-07-13)

On Wed, Sep 12, 2018 at 12:57:01PM -0700, foxfanfare wrote:
[...]
> Thanks Theo and Guy for your solution. I tried them and I think I'll
> make a mix of both. I didn't think of the Tags for specific midi
> indications, and especially, the idea of making two separate scores,
> one for the layout and one for the midi is very good.
> 
> I can now merge the dynamics variables and sustain pedals on each
> voices which need them. This sounds good to me, although I still have
> more test to attempt! But thanks anyway for the first clues :-)
[...]

Just to add to what someone has said, if you're writing piano scores
where temporary voices often appear, you may get unexpected midi output.
For example:

        \new Staff = "rhs" {
                <c g e c'>1\p
                << { d1 }
                \\ { b4 a b c } >>
        }

If you look at the midi output, you'll discover that the \p only applies
to the `d1`, not the `b4 a b c`, because the << ... \\ ... >> construct
creates temporary anonymous Voices, and such Voices generally are
initialized with default settings (dynamic levels, etc.) instead of
inheriting from the current context.  The solution I've adopted is to
always explicitly name all voices, even temporary ones, and separate out
the dynamics and explicitly apply the dynamics to each voice in the midi
score.  E.g.:

        dynPart = {
                s1\p    % etc...
        }
        rightPart = \new Voice = "rhsA" {
                <c g e c'>1\p

                % NB: always name the voices, even if they're temporary
                << \context Voice="rhsA" { d1 }
                \\ \context Voice="rhsB" { b4 a b c } >>
        }
        \score {
                \removeWithTag #'layout
                <<
                        \new Staff = "rhs" <<
                                % Actual notes get pulled in here
                                \rightPart

                                % Explicitly apply dynamics to every
                                % named Voice.
                                { \context Voice="rhsA" \dynPart }
                                { \context Voice="rhsB" \dynPart }
                        >>
                        ... % etc.
                >>
                \midi {}
        }

For the printed score, this would produce tons of redundant dynamic
markings, so I always use a separate score just for layout, and stick
\dynPart into a Dynamics context between the upper and lower parts of
the piano score for nicer layout.

Hope this helps.


T

-- 
If you're not part of the solution, you're part of the precipitate.



reply via email to

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