lilypond-user
[Top][All Lists]
Advanced

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

RE: \time; staccato MIDI output


From: Trevor Daniels
Subject: RE: \time; staccato MIDI output
Date: Sat, 23 Feb 2008 22:36:06 -0000

Hi Iain

Taking the \time's out of the definitions is the best
approach.  As timing is done by default at the score level
it is not necessary to include \time commands in both parts.
So I would write it this way (I prefer to explicitly declare
the Staves):

sectionOne  = \relative c' { c1 | }
sectionTwoA = \relative c' { c4 e4 f4 | }
sectionTwoB = \relative c' { a4 a4 d4 | }

instrumentOne = {
  \time 4/4 \sectionOne
  \time 3/4 \sectionTwoA
  \sectionTwoB
}
instrumentTwo = {
  \sectionOne
  R4*3
  {\transpose c f \sectionTwoA}
}

\score {
  \new StaffGroup <<
    \new Staff {
      \new Voice { \instrumentOne }
    }
    \new Staff {
      \new Voice { \instrumentTwo }
    }
  >>
  \layout {}
  \midi {}
}

There should be no problem with using barchecks.

Music functions can take rationals as type ly:moment?, I
believe.

It should be possible to replace a staccato note with one of
half the value followed by a spacer with the same duration
using Scheme, but you'd need to fully digest section 6 of
the Notation Reference first.  You would have to unpick the
input stream, look for staccatos, expand them, and rebuild
the input stream.

HTH

Trevor D

> -----Original Message-----
> From: address@hidden
> [mailto:lilypond-user-bounces+t.daniels=treda.co.u
> address@hidden Behalf Of
> Iain Nicol
> Sent: 23 February 2008 18:55
> To: address@hidden
> Subject: \time; staccato MIDI output
>
>
> Hi,
>
> I'm new to LilyPond, and I'm trying to engrave a
> piece I composed a
> while back. I've run into a couple of
> difficulties. Help would be
> greatly appreciated. N.B.: This is a bit long; sorry.
>
> 1. Time signatures
> ==================
> Consecutive "\time"s show up, even if they are
> both the same time
> signature. e.g. the following shows 3/4 in both bars:
>       \version "2.11.40"
>
>       \score
>       {
>               { \time 3/4 c1 | \time 3/4 c1 | }
>       }
>
> I would like to disable the second one from
> showing up, because I would
> like to be able to do something like:
>       \version "2.11.40"
>
>       sectionOne = \relative c' { \time 4/4 c1 | }
>       sectionTwoA = \relative c' { \time 3/4 c4 e4 f4 | }
>       sectionTwoB = \relative c' { a4 a4 d4 | }
>
>       instrumentOne = \new Voice { \sectionOne
> \sectionTwoA \sectionTwoB}
>       instrumentTwo = \new Voice { \sectionOne
> R4*3 {\transpose c f
> \sectionTwoA} }
>
>       \score
>       {
>               \new StaffGroup
>               <<
>                       \instrumentOne
>                       \instrumentTwo
>               >>
>               \layout {}
>               \midi {}
>       }
> That is, have imitative voices, a bit like a
> fugue. The problem above is
> that the 3/4 time change shows up twice.
>     I could move the "\time" outside of
> sectionTwoA's definition. The
> disadvantage to this is that I can't use bar
> checking, and I would have
> to insert "\time 3/4" manually in front of every
> use of sectionTwoA.
> However, I'm beginning to think it's the best solution...
>
> I did try to create a function which would only
> insert a time signature
> if it was different than the current one.
>     I'm able to query the current "measure length":
>       \applyContext #(lambda (c)
>               (format #t "\nMeasure length:
> ~a.\n" (ly:context-property c
> 'measureLength)))
>
> And I know the new time signature can by set in
> Lilypond using \time, or
> Scheme using (set-time-signature). The trouble
> I'm running into is that
> set-time-signature only works outside of an \applyContext.
>     So I need to query the measure length inside
> of an \applyContext,
> and save it to a variable I can access to compare
> to outside of the
> \applyContext. I don't know how to do that
> though, with the scoping of
> variables.
>     Is that possible? Or is this completely the
> wrong approach? Also: it
> is possible to create music functions that take
> fractions as input (e.g.
> 3/4, instead of having to input #3 #4 as two
> separate integers).
>
> 2. staccato MIDI output
> =======================
> The following two lines produce the identical
> MIDI output, although the
> first has a staccato:
>       \version "2.11.40" \score { { g4-. }
> \layout{} \midi{} }
> and
>       \version "2.11.40" \score { { g4 }
> \layout{} \midi{} }
>
> I'd like the staccato note to sound shorter: say,
> half the length. I was
> hoping LilyPond would do this for me, but it doesn't ;).
>
> As a workaround, I was thinking about creating a
> music (scheme) function
> possibly called unwindStaccato. This would be
> applied to expressions,
> and replace staccato notes (or chords) by notes
> of half the length,
> followed by a rest. Then I could output the MIDI using:
>        \score { \unwindStaccato \tune  \midi {} }
> and *not* apply unwindStaccato when using layout{}.
>     I'm certain this approach is possible, as
> there's something similar
> in the manual (7.3.4 Adding articulation to notes
> (example)).
>     Still, it doesn't seem particularly easy, so
> I was wondering if
> anybody knows of a better solution.
>
>
> Thanks for your input,
> --
> Iain Nicol
>
>
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/lilypond-user
>





reply via email to

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