lilypond-user
[Top][All Lists]
Advanced

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

Re: Emacs integration


From: Thomas Morley
Subject: Re: Emacs integration
Date: Sat, 31 Aug 2013 20:03:40 +0200

2013/8/31 Jan Nieuwenhuizen <address@hidden>:
> Hi,
>
> I was inspired by pair of video's this morning
>
>     http://www.youtube.com/watch?v=qZU8dm9MtHo
>     http://www.youtube.com/watch?v=qZU8dm9MtHo
>
> in which George Hess shows how to create a scale sheet in Finale and in
> MuseScore.
>
> It looks to me as a most cumbersome process, dabbling through menus and
> obnoxious dialogues that apparently insist that you supply information
> beforehand, such as title and composer before you can even enter a
> single note.
>
> Moreover, it takes about 10 minutes to enter something that can be
> easily typed in under a minute, or two minutes if you type slow and
> provide instructions for a screencast.
>
>     http://lilypond.org/~janneke/major-scales-and-primary-triads.ly
>     http://lilypond.org/~janneke/major-scales-and-primary-triads.pdf
>
> While I was in the process of creating a screencast using Frescobaldi,
> it dawned on my how weird that is, because I'm realy bad at editing
> text in something that's not Emacs.  However, Frescobaldi has become
> much, friendlier than our Emacs mode.
>
> Below is something I hacked-up to auto-create PDF-preview and
> compilation windows, but don't touch the layout if they are already
> visible; while skipping the awkward compile? save? and view? questions
> all the time.  It seems that point and click is not possible in this
> setup (docview does not support direct-PDF, and embedding evince through
> XWidgets hasn't been merged)?
>
> Greetings, Jan
>
>
>
> --
> Jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
> Freelance IT http://JoyofSource.com | AvatarĀ®  http://AvatarAcademy.nl
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>

Hi Jan,

I had a look at your ly-file.
I don't know what exactly you want to show, though, one advantage of
LilyPond is the possibility of using custom-functions created by users
themselves.

Maybe you're interested in:

\version "2.17.25"

scalesAndTriads =
#(define-music-function (parser location m music)(ly:music? ly:music?)
  (let* ((elts (ly:music-property m 'elements))
         (pitches (map (lambda (x) (ly:music-property x 'pitch)) elts))
         (pitch-octaves (map (lambda (x) (ly:pitch-octave x)) pitches))
         (pitch-notename (map (lambda (x) (ly:pitch-notename x)) pitches))
         (pitch-alteration (map (lambda (x) (ly:pitch-alteration x)) pitches)))
  #{
    $(make-simultaneous-music
        (map
           (lambda (octave note alter)
              #{
                 \new Staff
                   \transpose c $(ly:make-pitch octave note alter)
                   \relative $music
              #})
           pitch-octaves pitch-notename pitch-alteration))
  #}))

% EXAMPLE

\header {
  title = "Major Scales and Primary Triads"
  composer = "George Hess"
  arranger = "Jan Nieuwenhuizen"
}

\layout {
  ragged-last = ##f
  indent = 0
  \context {
    \Staff
    \remove "Time_signature_engraver"
    \override KeyCancellation.break-visibility = ##(#f #t #f)
    explicitKeySignatureVisibility = ##(#f #t #t)
    \override VerticalAxisGroup.staff-staff-spacing = #'((padding . 3.5))
  }
  \context {
    \Score
    \override SystemStartBar.stencil = ##f
  }
}

scale = \relative {
  \cadenzaOn
  \key c\major
  c'1 d e f g a b c
  \bar "|"
  \chordmode {
    c_"I" f_"IV" g_"V"
  }
  \bar ""
  \break
}

\scalesAndTriads { c f bes ees aes des ges g d a e b fis } \scale



Franky, it took me more than two minutes, although I recycled some old
code for tranposing sequential music, but less than 30 min.

_And_ I now have two functions to reuse again and again: One for
sequential and another for simultaneous music.


Cheers,
  Harm



reply via email to

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