lilypond-user
[Top][All Lists]
Advanced

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

Duration comparison and swinging MIDI output


From: Christopher R. Maden
Subject: Duration comparison and swinging MIDI output
Date: Fri, 06 May 2011 13:46:22 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10

The attached file is good enough for me.

It includes (duration-equals?) which may be of general interest.

It also includes the \sw function, which, given a sequence, returns two
tagged sequences:

  \sw {
    \relative c' {
      a'4 a8 b a fs e d |
    }
  }

becomes

  {
     \tag #'layout {
       \relative c' {
         a'4 a8 b a fs e d |
       }
     }
     \tag #'midi {
       \relative c' {
         a'4
         \times 2/3 a4 \times 2/3 b8
         \times 2/3 a4 \times 2/3 fs8
         \times 2/3 e4 \times 2/3 d8 |
       }
     }
  }

It can then be used with

 \keepWithTag #'layout \theTune
 \keepWithTag #'midi \theTune

Caveats:

1) The swung result is suitable for MIDI output, but not for print
layout; as it was done by tweaking internals, it lacks the proper
triplet brackets around the pairs of notes.

2) This is strictly sufficient to my needs.  In particular, \sw assumes
that its content is a relative sequence, and will produce odd results
otherwise.  It does work with chords, as long as all the notes in the
chord are the same duration.  It does not handle un-paired eighth notes.
 It probably handles eighth rests, but I haven’t checked yet.

If anyone wants to make this a more general and better utility, please
feel free.

~Chris
-- 
Chris Maden, text nerd  <URL: http://crism.maden.org/ >
Does this mean we can have our civil liberties back now?
GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319

Attachment: swing.ly
Description: Text Data


reply via email to

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