Generating pitches depending on key signature

2018-04-28 Thread Lukas-Fabian Moser

Folks,

Assume I want a function that adds a second note a fifth a bove a given 
pitch (of course this is but an abstraction from a more complicated 
project).


The difficulty is that this should behave accoding to the key signature 
in place. Hence, the fifth should not be always perfect but instead be 
whatever occurs in the active key four note steps above the given pitch. 
(Quite as in figured bass accompaniment.) Hence:


\version "2.19.80"

addFifth = #(define-music-function (pitch dur) (ly:pitch? ly:duration?)
  (let*
   ((delta (+ 4 (ly:pitch-steps pitch)))
    (new-pitch (ly:make-pitch 0 delta 0))
    (pitches (list pitch new-pitch) )
    (chordNotes (map (lambda (p) (make-music
  'NoteEvent
  'duration dur
  'pitch p))
  pitches))
    )
   #{
 #(make-music 'EventChord 'elements chordNotes)
   #}
   )
  )

{
  \addFifth c' 1  % should yield  -> ok
  \addFifth cis' 1    % should yield  -> ok
  \key a \major
  \addFifth c' 1   % should yield  -> NOT OK
  \addFifth cis' 1  % should yield  -> NOT OK
}

I expect that this amounts to taking the alteration of my new-pitch from 
the alteration-alist that is "active". But from what I can gather from 
old postings on -user, this information seems not to be available at the 
time a music function is called (correct?). What would be the way to go 
for this?



Best
Lukas


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


RE: Generating pitches depending on key signature

2018-04-28 Thread Mark Stephen Mrotek
Lukas,

A snippet to create octaves. Perhaps you could modify.

http://lsr.di.unimi.it/LSR/Item?id=445

Mark

-Original Message-
From: lilypond-user [mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] 
On Behalf Of Lukas-Fabian Moser
Sent: Saturday, April 28, 2018 2:16 AM
To: lilypond-user 
Subject: Generating pitches depending on key signature

Folks, 

Assume I want a function that adds a second note a fifth a bove a given pitch 
(of course this is but an abstraction from a more complicated project).

The difficulty is that this should behave accoding to the key signature in 
place. Hence, the fifth should not be always perfect but instead be whatever 
occurs in the active key four note steps above the given pitch. 
(Quite as in figured bass accompaniment.) Hence:

\version "2.19.80"

addFifth = #(define-music-function (pitch dur) (ly:pitch? ly:duration?)
   (let*
((delta (+ 4 (ly:pitch-steps pitch)))
 (new-pitch (ly:make-pitch 0 delta 0))
 (pitches (list pitch new-pitch) )
 (chordNotes (map (lambda (p) (make-music
   'NoteEvent
   'duration dur
   'pitch p))
   pitches))
 )
#{
  #(make-music 'EventChord 'elements chordNotes)
#}
)
   )

{
   \addFifth c' 1  % should yield  -> ok
   \addFifth cis' 1% should yield  -> ok
   \key a \major
   \addFifth c' 1   % should yield  -> NOT OK
   \addFifth cis' 1  % should yield  -> NOT OK }

I expect that this amounts to taking the alteration of my new-pitch from the 
alteration-alist that is "active". But from what I can gather from old postings 
on -user, this information seems not to be available at the time a music 
function is called (correct?). What would be the way to go for this?


Best
Lukas


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Generating pitches depending on key signature

2018-04-28 Thread Lukas-Fabian Moser

Mark,


A snippet to create octaves. Perhaps you could modify.

http://lsr.di.unimi.it/LSR/Item?id=445
Thanks much for the pointer! This definitely helps me understand how to 
write something like that and integrate it with Lilypond.


I'm afraid, though, that this example does not tackle the aspect which 
is most difficult for me: The snippet makes perfect octaves, which is 
comparatively easy since you can copy a given pitch's alteration. I want 
neither that nor un-altered notes, but the alteration should be taken 
from the default alteration for this diatonic pitch class in the current 
key. Which I do not know how to access.


Lukas


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


An unusual feature request concerning FiguredBass

2018-04-28 Thread Robert Blackstone
Dear all,


I am asked to add to psalm-setting two different figured bass lines, separated 
by a line and with, at the beginning of the first bar, the words "Pretonal" and 
"Tonal", as can be seen in the screenshot:


Entering FiguredBass1 and FiguredBass2 did not give me anything but error 
messages, as expected

Has any of you done or seen this double BC line?

Thanks in advance for any advice or suggestion.

Best regards,

Robert Blackstone


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: An unusual feature request concerning FiguredBass

2018-04-28 Thread Noeck
Dear Robert,

I don't know this notation. So my advice is probably not the best solution.

> Entering FiguredBass1 and FiguredBass2 did not give me anything but
> error messages

You mean \new FiguredBass1 ? You cannot just invent context names. But
you can stack several contexts of the same type.

Here is one example that at least comes close:

\version "2.19.80"

<<
  \new Staff

  {
\clef bass
\key d \minor
\time 4/2

d1 2 a bes1 f a2 d a,1
  }
  \new FiguredBass
  \with { \override BassFigure.extra-offset = #'(0 . -3.5) }
  \figuremode { s1 s <5>2 <6> <6>1 s <_+> }
  \new RhythmicStaff
  \new FiguredBass
  \figuremode { s1 s2 s <6> s2 s1 s s }
>>

\layout {
  \context {
\RhythmicStaff
instrumentName = \markup \right-column {
  "Pretonal"  "Tonal"
}
\omit BarLine
\omit TimeSignature
  }
}

Of course, the following would be much simpler and you could try to draw
a line by hand (\markup or so):

<<
  \new Staff  {
\clef bass
\key d \minor
\time 4/2

d1 2 a bes1 f a2 d a,1
  }
  \new FiguredBass \figuremode { s1 s <5 6>2 <6> <6>1 s <_+> }
>>

Cheers,
Joram

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: An unusual feature request concerning FiguredBass

2018-04-28 Thread Lukas-Fabian Moser

Robert,

it's easier to help you if you provide a Minimal Working Example, 
otherwise it's hard to know what exactly you tried.


Anyway: It's not problem at all to create multiple 
FiguredBass-environments. The line between them is a bit more tricky; I 
once used a rhythm staff with all bar lines removed for this. For example:



\version "2.19.80"

<<
  \new StaffGroup <<
    \new Staff \relative f' { 1  }
    \new Staff \with {
  \override VerticalAxisGroup.staff-staff-spacing.basic-distance = 5
    }
    { \clef bass f1 c }
  >>
  \new FiguredBass \with {
    \override VerticalAxisGroup.nonstaff-unrelatedstaff-spacing = 
#'((basic-distance . 0)

(minimum-distance . 0)
(padding . 0.5)
(stretchability . 0))
  }
  \figuremode {
    <5>2 <6> <6>1
  }
  \new RhythmicStaff \with {
    \omit TimeSignature
    \omit BarLine
  } {
    s1*2
  }
  \new FiguredBass \with {
    \override VerticalAxisGroup.nonstaff-relatedstaff-spacing = 
#'((basic-distance . 0)

(minimum-distance . 0)
(padding . 0.5)
(stretchability . 0))
  } \figuremode {
    <6>1 <6>
  }
>>


Unfortunately there remains a line connecting the RhythmicStaff to the 
rest of the system; there is a way to remove this, but I do not have 
time to look it up at the moment, I'm sorry.


Best
Lukas



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: An unusual feature request concerning FiguredBass

2018-04-28 Thread Ben

On 4/28/2018 1:08 PM, Noeck wrote:

Dear Robert,

I don't know this notation. So my advice is probably not the best solution.


Entering FiguredBass1 and FiguredBass2 did not give me anything but
error messages

You mean \new FiguredBass1 ? You cannot just invent context names. But
you can stack several contexts of the same type.

Here is one example that at least comes close:


Cheers,
Joram



Also Robert, even though it's a bit unusual for this figured bass 
division, you could always worst-case just open the final SVG and delete 
that connecting line for the master PDF output. Ideally you want to do 
as much as you can within LilyPond of course, but at least a small 
Inkscape delete is an option if all else fails you. :)



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


ossia

2018-04-28 Thread bobr...@centrum.is
I want to set an ossia passage like the one in the attachment.  I have achieved 
partial success with the code below.  The actual musical content in the code is 
from the docs which I've attempted to modify to get my intended result.  I have 
managed to get the measure number on the main staff but not remove it from the 
ossia staff, nor have I gotten rid of the left bar line or the first bit of the 
ossia staff.  I'd also like to add the "ossia" indication as in the image.

Thanks,

David

%%%
\version "2.18.2"

\new Staff = "main" 
  \with {
   \consists "Bar_number_engraver" 
  }
  \relative c'' {
  c4 b d c \break
  <<
{ c4 b d c }
\new Staff \with {
\remove "Time_signature_engraver"
\remove "Bar_number_engraver"
\hide Clef
  \remove "Time_signature_engraver"
  alignAboveContext = #"main"
  fontSize = #-3
  \override StaffSymbol.staff-space = #(magstep -3)
  \override StaffSymbol.thickness = #(magstep -3)
  firstClef = ##f
}
{ e4 d f e }
  >>
  c4 b c2
}
%%%___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: An unusual feature request concerning FiguredBass

2018-04-28 Thread Torsten Hämmerle
Ahem,

If you want to get rid of the "connecting line", it might helpful to know
that this line is called
SystemStartBar
and it lives in the Score context.

So,
\omit Score.SystemStartBar 
will make it disappear without SVG manipulation.

HTH,
Torsten 



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: An unusual feature request concerning FiguredBass

2018-04-28 Thread Ben

On 4/28/2018 4:33 PM, Torsten Hämmerle wrote:

Ahem,

If you want to get rid of the "connecting line", it might helpful to know
that this line is called
SystemStartBar
and it lives in the Score context.

So,
\omit Score.SystemStartBar
will make it disappear without SVG manipulation.

HTH,
Torsten





Of course that's possible. :) Depending on what code approach he decides 
to take though, it may be more or less complicated - so it's worth 
knowing all possibilities as you move forward. There's several different 
ways to achieve this figured bass stacking...
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Making TextLength ignore some notes.

2018-04-28 Thread David Sumbler
\version "2.19.81"

<<
  \new Dynamics {
  s2 s2^\markup \column {"I would very much" "like this to take" "up
precisely a" "minim's width."} | s1*2 | }
  \new Staff {
b'2~ b'4\fermata a'4 \fermata | g'1~ | g'1 | }
>>

In the above example, I would like the words to occupy the horizontal
space between the 3rd beat of the first bar and the following barline.
In other words, the barline (and, hopefully) the final crotchet of the
first bar need to be moved suitable distances to the right.

\textLengthOn would be fine if the music underneath the text consisted
of only a minim, but of course it moves the crotchet on the 4th beat
past the end of the right-hand end of the text.

Is there any way of getting the effect I want, with the barline placed
after the text and the 4th-beat note placed evenly between the 3rd-beat 
note and the barline?

David

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Large set of parts

2018-04-28 Thread J Martin Rushton
On 28/04/18 04:46, Karlin High wrote:
> On 4/27/2018 8:28 PM, Andrew Bernard wrote:
>> It falls into the category of alliteration, which abounds in English
> 
> As a poetry form, too - "Beowulf" and J. R. R. Tolkien's unfinished work
> "The Fall of Arthur" come to mind. Sort of like "rhyming" the beginnings
> of the words instead of the endings.

Most poetry until Chaucer foisted the French custom of end-rhymes on us.
 See for example "Sir Gawaine and the Greene Knight" or "The vision of
Piers the Ploughman".



signature.asc
Description: OpenPGP digital signature
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


\magnifyStaff alters thickness of barlines

2018-04-28 Thread Brent Annable
Hi all,

I'm creating an organ part where the right-hand staff is supposed to be
slightly narrower than the left-hand staff. When I use \magnifyStaff to
achieve this effect, it also alters the thickness of the final barlines so
they don't match up:

\version "2.19.65"

\score {
\new PianoStaff <<
\new Staff = "right" \relative c'' {\magnifyStaff #6/7 a4 a a a \bar "|."}
\new Staff = "left" \relative c {\clef bass a4 a a a \bar "|."}
 >>
}

Is there anything that can be done about this, or am I doing something
wrong? I would appreciate any advice.

Kind regards,

Brent.


magnifyStaff.pdf
Description: Adobe PDF document
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user