Re: \tweak Accidental stencil within chord

2019-05-01 Thread David Kastrup
dtsmarin  writes:

> Oops! Wrong minimal example!
>
>
> #(define enh-acc
>   (lambda (grob)
> (let* ((stencil (ly:accidental-interface::print grob))
>(new-stil 
>  (grob-interpret-markup grob 
>(markup 
> #:hspace 1
> #:musicglyph "accidentals.flat"
> #:hspace -2
> #:transparent 
> #:stencil  
>stencil
> new-stil))) 
>
>
>
> \relative c' {
>  
>   1
>   2
>   2 
>
> }

Sigh.  An example of what you would want to work.  Not an example of
what is needed to make this work.

-- 
David Kastrup

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


Re: \tweak Accidental stencil within chord

2019-05-01 Thread dtsmarin
Oops! Wrong minimal example!


#(define enh-acc
  (lambda (grob)
(let* ((stencil (ly:accidental-interface::print grob))
   (new-stil 
 (grob-interpret-markup grob 
   (markup 
#:hspace 1
#:musicglyph "accidentals.flat"
#:hspace -2
#:transparent 
#:stencil  
   stencil
new-stil))) 



\relative c' {
 
  1
  2
  2 

}





--
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: \tweak Accidental stencil within chord

2019-05-01 Thread David Kastrup
dtsmarin  writes:

> This was an example to show what I'm after.
> I need to *change* the stencil (e.g. flat to be sharp ) not the colour etc.
> I know how to change stencil for a single accidental with \override but
> \tweak Accidental.stencil doesn't work. 

Minimal example exhibiting the problem?

-- 
David Kastrup

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


Re: \tweak Accidental stencil within chord

2019-05-01 Thread dtsmarin
This was an example to show what I'm after.
I need to *change* the stencil (e.g. flat to be sharp ) not the colour etc.
I know how to change stencil for a single accidental with \override but
\tweak Accidental.stencil doesn't work. 

The closest I've got is this:
#(define rhomb-acc
  (lambda (grob)
(let* ((stencil (ly:accidental-interface::print grob))
   (new-stil 
 (grob-interpret-markup grob 
   (markup 
#:hspace 1
#:musicglyph "accidentals.flat"
#:hspace -2
#:transparent 
#:stencil  
   stencil
new-stil))) 

But i'm hiding the sharp, I would like to override it.




--
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: \tweak Accidental stencil within chord

2019-05-01 Thread David Kastrup
dtsmarin  writes:

> Is it possible to tweak the stencil for an accidental within a chord?
>
> Something similar in functionality with:

> \tweak Stem.color #red
> \tweak Beam.color #green c8 e
> 4

Uh, what is wrong with exactly that?

-- 
David Kastrup

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


\tweak Accidental stencil within chord

2019-05-01 Thread dtsmarin
Is it possible to tweak the stencil for an accidental within a chord?

Something similar in functionality with:

\tweak Stem.color #red
\tweak Beam.color #green c8 e
4





--
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


octaves within a chord

2019-04-23 Thread Rick Kimpel
Jay,
I recently came across your octaves script from back in 2008. I was wondering 
if there was any way to make it only octavate the top (or bottom) note in a 
chord? I arrange for handbells, and this is a common technique. I was going to 
try to do it myself, but I can't get the original script to work in version 
2.18.

I was also going to try something based on Gianmaria's and Aaron's work with 
parallel thirds, but I couldn't get that script to work in 2.18 either. Might 
be time to upgrade. :\

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


Re: How to retain string numbers when using `q` chord repeater?

2019-04-03 Thread Federico Bruni




Il giorno mer 3 apr 2019 alle 0:30, Stig Brautaset  
ha scritto:


I've got this score:

\version "2.19.82"
\new TabStaff {  q }

It results in the following tab, which is not what I want:


:---
:To-
:A--4---
:B--4-4-
:---2-2-
:---

Is there any way to retain the fingering from the full chord when 
using

the `q` chord repeater?



Yes, you can use \tabChordRepeats:
http://lilypond.org/doc/v2.19/Documentation/notation/common-notation-for-fretted-strings#index-_005ctabChordRepeats-1


\version "2.19.82"
\new TabStaff {
 \tabChordRepeats {
q
 }
}





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


How to retain string numbers when using `q` chord repeater?

2019-04-02 Thread Stig Brautaset

I've got this score:

\version "2.19.82"
\new TabStaff {  q }

It results in the following tab, which is not what I want:



q4.pdf
Description: weird tab

:---
:To-
:A--4---
:B--4-4-
:---2-2-
:---

Is there any way to retain the fingering from the full chord when using
the `q` chord repeater?

Regards,

Stig

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


Re: Dispositioned notehead in chord when staffsize=14 and clef=bass

2019-03-24 Thread Martin Tarenskeen



On Sun, 24 Mar 2019, Martin Tarenskeen wrote:


See attached example "staffsize14.ly" and "staffsize14.pdf" output.
Using lilypond 2.19.82 on Linux Fedora.

What's happening here?


I tried some more staffsizes. I'm seeing dispositioned noteheads when 
staffsize is 13, 14, or 19. No problems when staffsize is 12, 15, 16, 18, 
20. See new attached examples.


--

MT

staffsize14.pdf
Description: Adobe PDF document
\version "2.19.82"
\pointAndClickOff

mymusic = \relative {
  \clef treble
4   | |
}

\paper {
  indent = 0
}

\score {
  \new Staff { 
\mymusic
  }
  \header { piece = "default staffsize" }
  \layout {}
}

\score {
  \new Staff { 
\mymusic
  }
  \header { piece = "staffsize 19" }
  \layout {
#(layout-set-staff-size 19)
  }
}

\score {
  \new Staff { 
\mymusic
  }
  \header { piece = "staffsize 18" }
  \layout {
#(layout-set-staff-size 18)
  }
}
\score {
  \new Staff { 
\mymusic
  }
  \header { piece = "staffsize 17" }
  \layout {
#(layout-set-staff-size 17)
  }
}

\score {
  \new Staff { 
\mymusic
  }
  \header { piece = "staffsize 16" }
  \layout {
#(layout-set-staff-size 16)
  }
}

\score {
  \new Staff { 
\mymusic
  }
  \header { piece = "staffsize 15" }
  \layout {
#(layout-set-staff-size 15)
  }
}

\score {
  \new Staff { 
\mymusic
  }
  \header { piece = "staffsize 14" }
  \layout {
#(layout-set-staff-size 14)
  }
}

\score {
  \new Staff { 
\mymusic
  }
  \header { piece = "staffsize 13" }
  \layout {
#(layout-set-staff-size 13)
  }
}

\score {
  \new Staff { 
\mymusic
  }
  \header { piece = "staffsize 12" }
  \layout {
#(layout-set-staff-size 12)
  }
}

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


Re: Dispositioned notehead in chord when staffsize=14 and clef=bass

2019-03-24 Thread Thomas Morley
Am So., 24. März 2019 um 14:25 Uhr schrieb Martin Tarenskeen
:
>
>
> Hi,
>
> A bumped into a strange bug with a dispositioned notehead.
>
> See attached example "staffsize14.ly" and "staffsize14.pdf" output.
> Using lilypond 2.19.82 on Linux Fedora.
>
> What's happening here?

Looks like
#5303 layout-set-staff-space confuses chord note head placement in a
certain situation
https://sourceforge.net/p/testlilyissues/issues/5303/

Some discussion here:
http://lists.gnu.org/archive/html/lilypond-user/2016-10/msg00263.html

Sorry to be of not more help,
  Harm

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


Re: Dispositioned notehead in chord when staffsize=14 and clef=bass

2019-03-24 Thread Phil Holmes
- Original Message - 
From: "Federico Bruni" 

To: "Martin Tarenskeen" 
Cc: "bug-lilypond mailinglist" ; "lilypond-user 
mailinglist" 

Sent: Sunday, March 24, 2019 5:14 PM
Subject: Re: Dispositioned notehead in chord when staffsize=14 and clef=bass





Il giorno dom 24 mar 2019 alle 14:22, Martin Tarenskeen 
 ha scritto:


Hi,

A bumped into a strange bug with a dispositioned notehead.

See attached example "staffsize14.ly" and "staffsize14.pdf" output.
Using lilypond 2.19.82 on Linux Fedora.

What's happening here?



I confirm it. Same problem with a lilypond binary built from the 
translation branch.


Version 2.18.2 works correctly.



2.18 doesn't scale the staff space, so there's a lot of room for the 
noteheads.


--
Phil Holmes 



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


Re: Dispositioned notehead in chord when staffsize=14 and clef=bass

2019-03-24 Thread Federico Bruni




Il giorno dom 24 mar 2019 alle 14:22, Martin Tarenskeen 
 ha scritto:


Hi,

A bumped into a strange bug with a dispositioned notehead.

See attached example "staffsize14.ly" and "staffsize14.pdf" output.
Using lilypond 2.19.82 on Linux Fedora.

What's happening here?



I confirm it. Same problem with a lilypond binary built from the 
translation branch.


Version 2.18.2 works correctly.




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


Dispositioned notehead in chord when staffsize=14 and clef=bass

2019-03-24 Thread Martin Tarenskeen


Hi,

A bumped into a strange bug with a dispositioned notehead.

See attached example "staffsize14.ly" and "staffsize14.pdf" output.
Using lilypond 2.19.82 on Linux Fedora.

What's happening here?

--

MT\version "2.19.82"
\pointAndClickOff

mymusic = \relative c{
  \clef bass
  4| |
}

\score {
  \new Staff { 
\mymusic
  }
  \header { piece = "default staffsize" }
  \layout {}
}

\score {
  \new Staff { 
\mymusic
  }
  \header { piece = "staffsize 16" }
  \layout {
#(layout-set-staff-size 16)
  }
}

\score {
  \new Staff { 
\mymusic
  }
  \header { piece = "staffsize 14" }
  \layout {
#(layout-set-staff-size 14)
  }
}

\score {
  \new Staff { 
\mymusic
  }
  \header { piece = "staffsize 12" }
  \layout {
#(layout-set-staff-size 12)
  }
}



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


Re: select a note in a chord

2019-02-02 Thread Valentin Villenave
On 2/2/19, David Kastrup  wrote:
> What you flatteringly call "my" thought would additionally maintain
> "circular" order of the pitches, basically rotating pitches and then
> octavating as needed to make sure that later pitches don't end up before
> earlier pitches.

Yep. That would be a great idea… now that you mention it :-)

> Maybe the cleanest in a musical sense would be if an "inversion" split
> the set of pitches into two, the ones preceding the inversion point and
> the ones afterwards and then raise the octaves of the preceding pitches
> en bloc such that the first inverted pitch becomes higher than the last
> non-inverted pitch.

That’s more or less what I have in mind. Now I have to devise a
somehow not-entirely-ugly implementation, which is where it gets
unnatural to me.

> That would not be exactly like repeated application of \raiseNote (which
> could in theory end up "flattening" more than one interval happening to
> be larger than an octave)

Indeed. Flattened intervals are the antithesis of what we’re looking
for here (if anything, interesting voicings come down to doing the
opposite: injecting larger-than-octave intervals inside clustered
chords primarily consisting of many seconds and thirds).

Cheers,
V.

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


Re: select a note in a chord

2019-02-02 Thread David Kastrup
Valentin Villenave  writes:

> On 1/29/19, Davide Bonetti  wrote:
>> Ok, now it works well!
>
> Greetings everybody,
>
> David K. raised an interesting question with regard to the
> \invertChords function:
> https://codereview.appspot.com/365840043/#msg18
>
> Basically (IIUC), he’s thinking that
>
> \invertChords 1 
>
> should ideally result in
>
> 
>
> rather than
>
> 
>
> (as the current implementation produces).
>
> Any thoughts?

David Kastrup did not think anything like that.  While it seems like an
actually quite worthwhile thought, my concern in the review rather was
that with the c'' ending up in the middle of the result chord, it will
come up earlier for another octavation in higher-numbered inversions
than the f'' would.  So my idea rather was to not use repeatedly a 2nd
inversion for the sake of generating higher inversions but rather figure
out the notes to be octavated from the initial chord and then octavate
all of them at once, not disturbing their relative order.

What you flatteringly call "my" thought would additionally maintain
"circular" order of the pitches, basically rotating pitches and then
octavating as needed to make sure that later pitches don't end up before
earlier pitches.

That could end up saner and it would actually work in repeated
application of \raiseNote without requiring rewriting the internals of
\invertChords .

My objection was more addressing a mathematical/programming
inconsistency rather than bothering with musical sense.  But addressing
this from the musical end, regarding its actual effect rather than its
logical ramifications, might be a saner approach.

Maybe the cleanest in a musical sense would be if an "inversion" split
the set of pitches into two, the ones preceding the inversion point and
the ones afterwards and then raise the octaves of the preceding pitches
en bloc such that the first inverted pitch becomes higher than the last
non-inverted pitch.

That would not be exactly like repeated application of \raiseNote (which
could in theory end up "flattening" more than one interval happening to
be larger than an octave) but probably be the most "musically" correct
and predictable way to do this.

-- 
David Kastrup

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


Re: select a note in a chord

2019-02-02 Thread Valentin Villenave
On 1/29/19, Davide Bonetti  wrote:
> Ok, now it works well!

Greetings everybody,

David K. raised an interesting question with regard to the
\invertChords function:
https://codereview.appspot.com/365840043/#msg18

Basically (IIUC), he’s thinking that

\invertChords 1 

should ideally result in



rather than



(as the current implementation produces).

Any thoughts?

Cheers,
V.

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


Re: select a note in a chord

2019-01-29 Thread Davide Bonetti

Ok, now it works well!

D.

Il 28/01/2019 21:11, Valentin Villenave ha scritto:

On 1/28/19, Davide Bonetti  wrote:

It reminds me something that happens when a variable in lilypond is
called with $ instead of # , but in scheme I don't see this difference.
Could it be something like that?

Nope, it turned out to be a lot more idiotic: I was modifying the
'octavation property of some notes… then not taking that into account
when sorting the pitches. (And, as David noted, I was displacing the
pitches onto the notes without moving any articulations they might
have attached.)

Here’s the new updated function, now it sort of works!

#(define-public (move-chord-note n direction)
(_i "Transpose a note (numbered as @var{n}) by one octave in
@var{direction}.")
(lambda (music)
  (let* ((elts (ly:music-property music 'elements))
 (l (length elts))
 ;; if direction is up, count from the bottom note upward,
 ;; if direction is down, count from the top note downward.
 (count-from (cond ((= direction UP) (- n 1))
   ((= direction DOWN) (- l n
 ;; Notes may not have been entered from bottom to top;
 ;; extract the pitches and their possible octavation.
 (pitches (map
   (lambda (x)
 (let ((oct (ly:music-property x 'octavation))
   (p (ly:music-property x 'pitch)))
   (if (null? oct) p
   (ly:pitch-transpose p
 (ly:make-pitch oct 0 0)
   (filter
(lambda (y)
  (music-is-of-type? y 'note-event))
elts
(if (and (music-is-of-type? music 'event-chord)
 (not (zero? n)) (>= l n))
(begin
 ;; Sort the actual notes, depending on their pitch.
 (set! elts
   (sort elts
 (lambda (a b)
   (ly:pitch

---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus


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


Re: select a note in a chord

2019-01-28 Thread Valentin Villenave
On 1/28/19, Davide Bonetti  wrote:
> It reminds me something that happens when a variable in lilypond is
> called with $ instead of # , but in scheme I don't see this difference.
> Could it be something like that?

Nope, it turned out to be a lot more idiotic: I was modifying the
'octavation property of some notes… then not taking that into account
when sorting the pitches. (And, as David noted, I was displacing the
pitches onto the notes without moving any articulations they might
have attached.)

Here’s the new updated function, now it sort of works!

#(define-public (move-chord-note n direction)
   (_i "Transpose a note (numbered as @var{n}) by one octave in
@var{direction}.")
   (lambda (music)
 (let* ((elts (ly:music-property music 'elements))
(l (length elts))
;; if direction is up, count from the bottom note upward,
;; if direction is down, count from the top note downward.
(count-from (cond ((= direction UP) (- n 1))
  ((= direction DOWN) (- l n
;; Notes may not have been entered from bottom to top;
;; extract the pitches and their possible octavation.
(pitches (map
  (lambda (x)
(let ((oct (ly:music-property x 'octavation))
  (p (ly:music-property x 'pitch)))
  (if (null? oct) p
  (ly:pitch-transpose p
(ly:make-pitch oct 0 0)
  (filter
   (lambda (y)
 (music-is-of-type? y 'note-event))
   elts
   (if (and (music-is-of-type? music 'event-chord)
(not (zero? n)) (>= l n))
   (begin
;; Sort the actual notes, depending on their pitch.
(set! elts
  (sort elts
(lambda (a b)
  (ly:pitchhttps://lists.gnu.org/mailman/listinfo/lilypond-user


Re: select a note in a chord

2019-01-28 Thread Davide Bonetti

Hi Valentin and everybody.

So, now the chord name is preserved when \dropNote or \raiseNote is 
applied once, but not when is applied twice or more.


It reminds me something that happens when a variable in lilypond is 
called with $ instead of # , but in scheme I don't see this difference.


Could it be something like that?

BTW I prefeer \riseNote instead of \raiseNote .

Regards

Davide

Il 23/01/2019 23:10, Valentin Villenave ha scritto:

On 1/19/19, Davide Bonetti  wrote:

For the sake of the discussion, I copy there the code as it now is:

Greetings Davide and everybody,
although these chord-transform functions were only intended for
written voicings (i.e. not ChordNames), David K. had a brilliant idea:
by setting the 'octavation property for every transposed pitch, we can
print the intended voicing *without* causing the chord to loose its
name.

Problem: the version I tried to modify (see below) works nicely for
primary \dropNote and \raiseNote commands, but when they’re nested
(e.g. with \invertChords) it gives erratic results. There’s obviously
something I missed; could anybody give it a try and tell me where it’s
going off the rails?

%

\version "2.21.0"

#(define-public (move-chord-note n direction)
(_i "Transpose a note (numbered as @var{n}) by one octave in
@var{direction}.")
(lambda (music)
  (let* ((elts (ly:music-property music 'elements))
 (l (length elts))
 ;; if direction is up, count from the bottom note upward,
 ;; if direction is down, count from the top note downward.
 (count-from (cond ((= direction UP) (- n 1))
   ((= direction DOWN) (- l n
 ;; Notes may not have been entered from bottom to top;
 ;; extract the pitches and put them in order.
 (pitches (map (lambda (x) (ly:music-property x 'pitch))
(filter
 (lambda (y)
   (music-is-of-type? y 'note-event))
 elts)))
 (sorted (sort pitches ly:pitch= l n))
(begin
 ;; first apply the sorted pitches
 ;; to the actual notes.
 (map (lambda (e p)
(ly:music-set-property! e 'pitch p))
   elts sorted)
 ;; then transpose the note up or
 ;; down, depending on direction.
 (let* ((note (list-ref elts count-from))
(oct (ly:music-property note 'octavation)))
   (list-set! elts count-from
 (ly:music-transpose note
   (ly:make-pitch
(cond
 ((= direction UP) +1)
 ((= direction DOWN) -1))
0)))
   (ly:music-set-property! note 'octavation
 (+ (cond
 ((= direction UP) 1)
 ((= direction DOWN) -1))
   (if (null? oct) 0 oct
 ))
music)))

dropNote =
#(define-music-function (parser location num music) (integer? ly:music?)
(_i "Drop a note of any chords in @var{music}, in @var{num}
position from above.")
(music-map (move-chord-note num down) music))

raiseNote =
#(define-music-function (parser location num music) (integer? ly:music?)
(_i "Raise a note of any chords in @var{music}, in @var{num}
position from below.")
(music-map (move-chord-note num up) music))

invertChords =
#(define-music-function (num music) (integer? ly:music?)
(_i "Invert any chords in @var{music} into their @var{num}-th position.
(Chord inversions may be directed downwards using negative integers.)")
(let loop ((num num) (music music))
  (cond ((zero? num) music)
((negative? num) (loop (1+ num) (dropNote 1 music)))
(else (loop (1- num) (raiseNote 1 music))


ac =
\chordmode {
   \dropNote 2 c:maj
   \raiseNote 1 d:m7
   \invertChords 2 e:m7
}

<<
   \chords { \ac }
   {
 <>^\markup \sans "(should be: C△, Dm7 and Em7)"
 \ac  \bar "||"
   }
%

Thanks!

V.


---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus


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


Re: select a note in a chord

2019-01-23 Thread Valentin Villenave
On 1/19/19, Davide Bonetti  wrote:
> For the sake of the discussion, I copy there the code as it now is:

Greetings Davide and everybody,
although these chord-transform functions were only intended for
written voicings (i.e. not ChordNames), David K. had a brilliant idea:
by setting the 'octavation property for every transposed pitch, we can
print the intended voicing *without* causing the chord to loose its
name.

Problem: the version I tried to modify (see below) works nicely for
primary \dropNote and \raiseNote commands, but when they’re nested
(e.g. with \invertChords) it gives erratic results. There’s obviously
something I missed; could anybody give it a try and tell me where it’s
going off the rails?

%

\version "2.21.0"

#(define-public (move-chord-note n direction)
   (_i "Transpose a note (numbered as @var{n}) by one octave in
@var{direction}.")
   (lambda (music)
 (let* ((elts (ly:music-property music 'elements))
(l (length elts))
;; if direction is up, count from the bottom note upward,
;; if direction is down, count from the top note downward.
(count-from (cond ((= direction UP) (- n 1))
  ((= direction DOWN) (- l n
;; Notes may not have been entered from bottom to top;
;; extract the pitches and put them in order.
(pitches (map (lambda (x) (ly:music-property x 'pitch))
   (filter
(lambda (y)
  (music-is-of-type? y 'note-event))
elts)))
(sorted (sort pitches ly:pitch= l n))
   (begin
;; first apply the sorted pitches
;; to the actual notes.
(map (lambda (e p)
   (ly:music-set-property! e 'pitch p))
  elts sorted)
;; then transpose the note up or
;; down, depending on direction.
(let* ((note (list-ref elts count-from))
   (oct (ly:music-property note 'octavation)))
  (list-set! elts count-from
(ly:music-transpose note
  (ly:make-pitch
   (cond
((= direction UP) +1)
((= direction DOWN) -1))
   0)))
  (ly:music-set-property! note 'octavation
(+ (cond
((= direction UP) 1)
((= direction DOWN) -1))
  (if (null? oct) 0 oct
))
   music)))

dropNote =
#(define-music-function (parser location num music) (integer? ly:music?)
   (_i "Drop a note of any chords in @var{music}, in @var{num}
position from above.")
   (music-map (move-chord-note num down) music))

raiseNote =
#(define-music-function (parser location num music) (integer? ly:music?)
   (_i "Raise a note of any chords in @var{music}, in @var{num}
position from below.")
   (music-map (move-chord-note num up) music))

invertChords =
#(define-music-function (num music) (integer? ly:music?)
   (_i "Invert any chords in @var{music} into their @var{num}-th position.
(Chord inversions may be directed downwards using negative integers.)")
   (let loop ((num num) (music music))
 (cond ((zero? num) music)
   ((negative? num) (loop (1+ num) (dropNote 1 music)))
   (else (loop (1- num) (raiseNote 1 music))


ac =
\chordmode {
  \dropNote 2 c:maj
  \raiseNote 1 d:m7
  \invertChords 2 e:m7
}

<<
  \chords { \ac }
  {
<>^\markup \sans "(should be: C△, Dm7 and Em7)"
\ac  \bar "||"
  }
>>

%

Thanks!

V.

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


Re: select a note in a chord

2019-01-19 Thread Aaron Hill

On 2019-01-19 9:32 am, Davide Bonetti wrote:

%% rise a note of a chord, in num position from below
riseNote =


If a little pedantry is permitted, the verb should be "raise" not 
"rise".  The subtlety involves that we are *causing* a note to rise, 
therefore we are raising the note.


Of course, perhaps this is an imperative: "Rise, note!"  ;-)


-- Aaron Hill

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


Re: select a note in a chord

2019-01-19 Thread Davide Bonetti

For the sake of the discussion, I copy there the code as it now is:

(thanks to Valentin and David)

D.

%%

#(define-public (move-chord-note n direction)
   (_i "Transpose a note (numbered as @var{n}) by one octave in 
@var{direction}."

 )
   (lambda (music)
 (let* ((elts (ly:music-property music 'elements))
    (l (length elts))
    ;; if direction is up, count from the bottom note upward,
    ;; if direction is down, count from the top note downward.
    (count-from (cond ((= direction UP) (- n 1))
  ((= direction DOWN) (- l n
    ;; Notes may not have been entered from bottom to top;
    ;; extract the pitches and put them in order.
    (pitches (map (lambda (x) (ly:music-property x 'pitch))
   (filter
    (lambda (y)
  (music-is-of-type? y 'note-event))
    elts)))
    (sorted (sort pitches ly:pitch= l n))
   (begin
    ;; first apply the sorted pitches
    ;; to the actual notes.
    (map (lambda (e p)
   (ly:music-set-property! e 'pitch p))
  elts sorted)
    ;; then transpose the note up or
    ;; down, depending on direction.
    (list-set! elts count-from
  (ly:music-transpose
   (list-ref elts count-from)
   (ly:make-pitch
    (cond
 ((= direction UP) +1)
 ((= direction DOWN) -1))
    0)
   music)))

%% drop a note of a chord, in num position from above
dropNote =
#(define-music-function (parser location num music) (integer? ly:music?)
   (_i "Drop a note of any chords in @var{music}, in @var{num} position 
from abo

  ve.")
   (music-map (move-chord-note num down) music))

%% rise a note of a chord, in num position from below
riseNote =
#(define-music-function (parser location num music) (integer? ly:music?)
   (_i "Rise a note of any chords in @var{music}, in @var{num} position 
from bel

  ow.")
   (music-map (move-chord-note num up) music))

%% invert chords
invertChords =
#(define-music-function (num music) (integer? ly:music?)
   (_i "Invert any chords in @var{music} into their @var{num}-th position.
       (Chord inversions may be directed downwards using negative 
integers.)")

   (let loop ((num num) (music music))
 (cond ((zero? num) music)
   ((negative? num) (loop (1+ num) (dropNote 1 music)))
   (else (loop (1- num) (riseNote 1 music))


ac = \relative c' {2  \chordmode {c:maj es:6}}

{
  <>^\markup "chords"
  \ac
  \bar "||"
  <>^\markup "drop 2"
  \dropNote 2 \ac
  \bar "||"
  <>^\markup "drop 4"
  \dropNote 4 \ac
  \bar "||"
  <>^\markup "drop 2 and 4"
  \dropNote 2 \dropNote 4 \ac
  \bar "||"
  <>^\markup "rise 1"
  \riseNote 1 \ac
  \bar "||"
  <>^\markup "rise 3"
  \riseNote 3 \ac
  \bar "||"
  <>^\markup "2nd inversion"
  \invertChords 2 \ac
  \bar "||"
  <>^\markup "\"down\" inversion"
  \invertChords -1 \ac
  \bar "||"
}

%


---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus


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


Re: select a note in a chord

2019-01-19 Thread Davide Bonetti

Il 19/01/2019 08:36, Valentin Villenave ha scritto:

On 1/18/19, David Kastrup  wrote:

Music functions share the same namespace as all other Scheme functions
and variables

OK, perhaps a better name would be \dropNote then (much like \hideNotes etc.).

Good choice.

Anyway, I like these functions (thanks to both of you guys) and I
wonder if they could be made part of the default distribution?

I like them too, and many thanks to you and David.

D.


---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus


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


Re: select a note in a chord

2019-01-18 Thread Valentin Villenave
On 1/18/19, David Kastrup  wrote:
> Music functions share the same namespace as all other Scheme functions
> and variables

OK, perhaps a better name would be \dropNote then (much like \hideNotes etc.).

Anyway, I like these functions (thanks to both of you guys) and I
wonder if they could be made part of the default distribution?

Just in case, I’ve drafted a proposal here:
https://sourceforge.net/p/testlilyissues/issues/5464/
http://codereview.appspot.com/365840043

Cheers,
V.

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


Power chord display name

2019-01-18 Thread Oliver Nicolson
Hi,

Is there any way in lilypond to display a chord name of the form "C5",
which commonly denotes a power chord without the 3rd?

Would be much appreciated!

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


Power chord symbols

2019-01-18 Thread Oliver Nicolson
Hi,

Is there any way in lily pond to display a chord name of the form "C5",
which commonly denotes a power chord without the 3rd?

Would be much appreciated!

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


Power chord chord symbol

2019-01-18 Thread Oliver Nicolson
Hi,

Is there any way in lilypond to display a chord name of the form "C5",
which commonly denotes a power chord without the 3rd?

Would be much appreciated!

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


Re: select a note in a chord

2019-01-18 Thread David Kastrup
Davide Bonetti  writes:

> Great!
> Everything very interesting.
> In this case, drop is a lilypond music function, so I assume it will
> not interfere with slri (but I don't know what slri is)

(srfi srfi-1), not slri, sorry for messing this up.  It is a standard
module of Scheme for list processing and is by default imported into
LilyPond.  Defining a shadowing binding is not the best idea since it
may be used by other LilyPond code.

Music functions share the same namespace as all other Scheme functions
and variables (markup commands are a bit more complicated).  Indeed,
with 2.19 you can call music functions as if they were Scheme functions.

-- 
David Kastrup

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


Re: select a note in a chord

2019-01-18 Thread Davide Bonetti
Great!
Everything very interesting.
In this case, drop is a lilypond music function, so I assume it will not 
interfere with slri (but I don't know what slri is) 

Cheers
D. 



Il 18 gennaio 2019 01:21:31 CET, David Kastrup  ha scritto:
>David Kastrup  writes:
>
>> Valentin Villenave  writes:
>>
>>> On 1/18/19, David Kastrup  wrote:
 This is not really an issue for string-manipulation.
>>>
>>> Agreed. Nevertheless, I was pleasantly surprised to see that
>>> ly:parser-include-string could accept an incomplete expression.
>>> (Previously, ly:parser-parse-string would have been much less
>flexible
>>> here.)
>>>
 Let's rather do this in a sane manner:
>>>
>>> Indeed, a named "let" loop is clearly the preferred way to go!
>>>
>>> That being said, I still wonder if there’d be any way of making it
>>> work with either iota or make-list without having to go through
>string
>>> manipulations. (It would remove the need for a loop with an
>>> incremented counter.)
>>
>> You can use something like
>> (fold (if (negative? num) drop rise)
>>   music
>>   (make-list (abs num) 1))
>>
>> but I don't like creating lists for the sake of controlling loop
>size.
>
>By the way: `drop' is a function imported from (slri slri-1) and it's
>probably not a good idea to redefine it.
>
>-- 
>David Kastrup

-- 
Inviato dal mio dispositivo Android con K-9 Mail. Perdonate la brevità.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: select a note in a chord

2019-01-17 Thread David Kastrup
David Kastrup  writes:

> Valentin Villenave  writes:
>
>> On 1/18/19, David Kastrup  wrote:
>>> This is not really an issue for string-manipulation.
>>
>> Agreed. Nevertheless, I was pleasantly surprised to see that
>> ly:parser-include-string could accept an incomplete expression.
>> (Previously, ly:parser-parse-string would have been much less flexible
>> here.)
>>
>>> Let's rather do this in a sane manner:
>>
>> Indeed, a named "let" loop is clearly the preferred way to go!
>>
>> That being said, I still wonder if there’d be any way of making it
>> work with either iota or make-list without having to go through string
>> manipulations. (It would remove the need for a loop with an
>> incremented counter.)
>
> You can use something like
> (fold (if (negative? num) drop rise)
>   music
>   (make-list (abs num) 1))
>
> but I don't like creating lists for the sake of controlling loop size.

By the way: `drop' is a function imported from (slri slri-1) and it's
probably not a good idea to redefine it.

-- 
David Kastrup

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


Re: select a note in a chord

2019-01-17 Thread David Kastrup
Valentin Villenave  writes:

> On 1/18/19, David Kastrup  wrote:
>> This is not really an issue for string-manipulation.
>
> Agreed. Nevertheless, I was pleasantly surprised to see that
> ly:parser-include-string could accept an incomplete expression.
> (Previously, ly:parser-parse-string would have been much less flexible
> here.)
>
>> Let's rather do this in a sane manner:
>
> Indeed, a named "let" loop is clearly the preferred way to go!
>
> That being said, I still wonder if there’d be any way of making it
> work with either iota or make-list without having to go through string
> manipulations. (It would remove the need for a loop with an
> incremented counter.)

You can use something like
(fold (if (negative? num) drop rise)
  music
  (make-list (abs num) 1))

but I don't like creating lists for the sake of controlling loop size.

> And btw, why does mapping onto (iota num) require a lambda (x)
> function even though that x argument does absolutely nothing? My
> instinct would be to use lambda (), but that throws an error.

You cannot call functions with a different number of arguments than they
are defined.  A map is a _map_.  Of course it takes an argument.  If you
want to express "this function ignores whatever arguments it may
receives" you can write (lambda _ ... ) and the whole argument list
would be assigned to _ (by convention a subsequently ignored binding).

>>((negative? num) (loop (1+ num) #{ \drop 1 #music #}))
>>(else (loop (1- num) #{ \rise 1 #music #})
>
> Why #music and not $music inside the #{ #}? (I suspect there’s no
> difference in this case, but $music is the more familiar syntax
> inherited from before your parser/lexer improvements.)

#music is an as-is Scheme expression, $music is evaluated and copied
before assigning a syntactical category.  If you aren't using the
expression elsewhere, those copies are unnecessary.

I mean, it's documented.  The "Extending LilyPond Guide" has this to
say:


1.2.1 LilyPond Scheme syntax


The Guile interpreter is part of LilyPond, which means that Scheme can
be included in LilyPond input files.  There are several methods for
including Scheme in LilyPond.

   The simplest way is to use a hash mark ‘#’ before a Scheme
expression.

   Now LilyPond’s input is structured into tokens and expressions, much
like human language is structured into words and sentences.  LilyPond
has a lexer that recognizes tokens (literal numbers, strings, Scheme
elements, pitches and so on), and a parser that understands the syntax,
*note (lilypond-contributor)LilyPond grammar::.  Once it knows that a
particular syntax rule applies, it executes actions associated with it.

   The hash mark ‘#’ method of embedding Scheme is a natural fit for
this system.  Once the lexer sees a hash mark, it calls the Scheme
reader to read one full Scheme expression (this can be an identifier, an
expression enclosed in parentheses, or several other things).  After the
Scheme expression is read, it is stored away as the value for an
‘SCM_TOKEN’ in the grammar.  Once the parser knows how to make use of
this token, it calls Guile for evaluating the Scheme expression.  Since
the parser usually requires a bit of lookahead from the lexer to make
its parsing decisions, this separation of reading and evaluation between
lexer and parser is exactly what is needed to keep the execution of
LilyPond and Scheme expressions in sync.  For this reason, you should
use the hash mark ‘#’ for calling Scheme whenever this is feasible.

   Another way to call the Scheme interpreter from LilyPond is the use
of dollar ‘$’ instead of a hash mark for introducing Scheme expressions.
In this case, LilyPond evaluates the code right after the lexer has read
it.  It checks the resulting type of the Scheme expression and then
picks a token type (one of several ‘xxx_IDENTIFIER’ in the syntax) for
it.  It creates a _copy_ of the value and uses that for the value of the
token.  If the value of the expression is void (Guile’s value of
‘*unspecified*’), nothing at all is passed to the parser.

   This is, in fact, exactly the same mechanism that LilyPond employs
when you call any variable or music function by name, as ‘\name’, with
the only difference that the name is determined by the LilyPond lexer
without consulting the Scheme reader, and thus only variable names
consistent with the current LilyPond mode are accepted.

   The immediate action of ‘$’ can lead to surprises, see *note
Importing Scheme in LilyPond::.  Using ‘#’ where the parser supports it
is usually preferable.  Inside of music expressions, expressions created
using ‘#’ _are_ interpreted as music.  However, they are _not_ copied
before use.  If they are part of some structure that might still get
used, you may need to use ‘ly:music-deep-copy’ explicitly.


-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org

Re: select a note in a chord

2019-01-17 Thread Valentin Villenave
On 1/18/19, David Kastrup  wrote:
> This is not really an issue for string-manipulation.

Agreed. Nevertheless, I was pleasantly surprised to see that
ly:parser-include-string could accept an incomplete expression.
(Previously, ly:parser-parse-string would have been much less flexible
here.)

> Let's rather do this in a sane manner:

Indeed, a named "let" loop is clearly the preferred way to go!

That being said, I still wonder if there’d be any way of making it
work with either iota or make-list without having to go through string
manipulations. (It would remove the need for a loop with an
incremented counter.)

And btw, why does mapping onto (iota num) require a lambda (x)
function even though that x argument does absolutely nothing? My
instinct would be to use lambda (), but that throws an error.

>((negative? num) (loop (1+ num) #{ \drop 1 #music #}))
>(else (loop (1- num) #{ \rise 1 #music #})

Why #music and not $music inside the #{ #}? (I suspect there’s no
difference in this case, but $music is the more familiar syntax
inherited from before your parser/lexer improvements.)

V.

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


Re: select a note in a chord

2019-01-17 Thread David Kastrup
Valentin Villenave  writes:

> On 1/17/19, Davide Bonetti  wrote:
>> I worked on your example, and here is the result.
>
> Nice!
>
>> I'm sure there is a better way to write the inversion function, but I
>> haven't find a way to program the repetition of a function in scheme.
>
> This is certainly not the most elegant way, but it seems to work:
>
> inversion =
> #(define-music-function (num music) (integer? ly:music?)
>(let ((str "")
>  (up? (> num 0)))
>  (map (lambda (x)
> (set! str
>   (string-append str
> (if up? "\\rise 1 " "\\drop 1 ")))
> str)
>(iota (abs num)))

There is append-map but seriously?

  (string-concatenate (make-list (abs num)
 (if (negative? num) "\\drop 1 " "\\rise 1 ")))


>  #{ $(ly:parser-include-string str) $music #}))

This is not really an issue for string-manipulation.

> Can you verify that it works as you intended? (If you’re running 2.18,
> you’ll need to add "parser" after ly:parser-include-string.)

And parser location before num in (num music).

Let's rather do this in a sane manner:

inversion =
#(define-music-function (num music) (integer? ly:music?)
  (let loop ((num num) (music music))
 (cond ((zero? num) music)
   ((negative? num) (loop (1+ num) (drop 1 music))
   (else (loop (1- num) (rise 1 music)))

Assuming 2.18, music functions are not directly callable from Scheme
which would render this as

inversion =
#(define-music-function (parser location num music) (integer? ly:music?)
  (let loop ((num num) (music music))
 (cond ((zero? num) music)
   ((negative? num) (loop (1+ num) #{ \drop 1 #music #}))
   (else (loop (1- num) #{ \rise 1 #music #})

This does not mess with internal parsers.  And the 2.19 version does not
even engage the parser for the looping.

-- 
David Kastrup

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


Re: select a note in a chord

2019-01-17 Thread Valentin Villenave
On 1/17/19, Davide Bonetti  wrote:
> I worked on your example, and here is the result.

Nice!

> I'm sure there is a better way to write the inversion function, but I
> haven't find a way to program the repetition of a function in scheme.

This is certainly not the most elegant way, but it seems to work:

inversion =
#(define-music-function (num music) (integer? ly:music?)
   (let ((str "")
 (up? (> num 0)))
 (map (lambda (x)
(set! str
  (string-append str
(if up? "\\rise 1 " "\\drop 1 ")))
str)
   (iota (abs num)))
 #{ $(ly:parser-include-string str) $music #}))

Can you verify that it works as you intended? (If you’re running 2.18,
you’ll need to add "parser" after ly:parser-include-string.)

Cheers,
V.

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


Re: select a note in a chord

2019-01-17 Thread Davide Bonetti

I worked on your example, and here is the result.

The "\drop n" function drop the nth note from above, an can be nested 
(to do drop 2 drop 4)


The funcion "\rise n" function rise the nth note from below, an can be 
nested too


The "\inversion n" function do the inversions of the chord.

I'm sure there is a better way to write the inversion function, but I 
haven't find a way to program the repetition of a function in scheme.


%


#(define (move-a-note n direction)
   (lambda (music)
 (let* ((elts (ly:music-property music 'elements))
    (l (length elts))
    ;; if the direction is up, we count from the bottom note 
upward,
    ;; if the direction is down, we count from the top note 
downward

    (count-from (cond ((= direction up) (- n 1))
  ((= direction down) (- l n
    ;; The user may not have entered the notes
    ;; from the lowest to the uppermost;
    ;; let’s extract the pitches…
    (pitches (map (lambda (x) (ly:music-property x 'pitch))
   (filter
    (lambda (y)
  (music-is-of-type? y 'note-event))
    elts)))
    ;; … and put them in order.
    (sorted (sort pitches ly:pitch= l n))
   (begin
    ;; first apply the sorted pitches
    ;; to the actual notes.
    (map
 (lambda (e p)
   (ly:music-set-property! e 'pitch p))
 elts sorted)
    ;; then transpose the specified note
    (list-set! elts count-from
  (ly:music-transpose
   (list-ref elts count-from)
   (ly:make-pitch (cond
   ;; transpose the note up or down,
   ;;depending on direction
   ((= direction up) +1)
   ((= direction down) -1)) 0)
   music)))

%% drop a note of a chord, in num position from above
drop =
#(define-music-function (parser location num music) (integer? ly:music?)
   #{ \musicMap #(move-a-note num down) $music #})

%% rise a note of a chord, in num position from below
rise =
#(define-music-function (parser location num music) (integer? ly:music?)
   #{ \musicMap #(move-a-note num up) $music #})

inversion =
#(define-music-function (parser location num music) (integer? ly:music?)
   (cond ((= num 1) #{ \rise 1 $music #})
 ((= num 2) #{ \rise 1 \rise 1 $music #})
 ((= num 3) #{ \rise 1 \rise 1 \rise 1 $music #})
 ((= num 4) #{ \rise 1 \rise 1 \rise 1 \rise 1 $music #})
 ((= num 5) #{ \rise 1 \rise 1 \rise 1 \rise 1 \rise 1 $music #})
 ((= num 6) #{ \rise 1 \rise 1 \rise 1 \rise 1 \rise 1 \rise 1 
$music #})

 ((= num -1) #{ \drop 1 $music #})
 ((= num -2) #{ \drop 1 \drop 1 $music #})
 ((= num -3) #{ \drop 1 \drop 1 \drop 1 $music #})
 ((= num -4) #{ \drop 1 \drop 1 \drop 1 \drop 1 $music #})
 ((= num -5) #{ \drop 1 \drop 1 \drop 1 \drop 1 \drop 1 $music #})
 ((= num -6) #{ \drop 1 \drop 1 \drop 1 \drop 1 \drop 1 \drop 1 
$music #})

 (else #{ $music #})
 ))


ac = \relative c' {2  \chordmode {c:maj es:6}}

{
  <>^\markup "chords"
  \ac
  \bar "||"
  <>^\markup "drop 2"
  \drop 2 \ac
  \bar "||"
  <>^\markup "drop 4"
  \drop 4 \ac
  \bar "||"
  <>^\markup "drop 2 and 4"
  \drop 2 \drop 4 \ac
  \bar "||"
  <>^\markup "rise 1"
  \rise 1 \ac
  \bar "||"
  <>^\markup "rise 3"
  \rise 3 \ac
  \bar "||"
  <>^\markup "2nd inversion"
  \inversion 2 \ac
  \bar "||"
  <>^\markup "\"down\" inversion"
  \inversion -1 \ac
  \bar "||"
}

%

Cheers.
Davide

Il 16/01/2019 00:15, David Kastrup ha scritto:

Valentin Villenave  writes:


On 1/15/19, Davide Bonetti  wrote:

I modified
 (if (and (music-is-of-type? music 'event-chord)
  (> l n))
with
 (if (and (music-is-of-type? music 'event-chord)
  (>= l n))

Nice catch! I’ve updated the snippet as well.

Additionally, beware that the LSR version uses
#(define-music-function (parser location music)
whereas the syntax for LilyPond 2.19 would be
#(define-music-function (music)

Not much to beware here since convert-ly knows its way around this and
2.19 will do argument counting in order to provide backwards
compatibility.




---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus

#(define (move-a-note n direction)
   (lambda (music)
 (let* ((elts (ly:music-property music 'elements))
(l (length elts))
;; if the direction is up, we count

Re: select a note in a chord

2019-01-15 Thread David Kastrup
Valentin Villenave  writes:

> On 1/15/19, Davide Bonetti  wrote:
>> I modified
>> (if (and (music-is-of-type? music 'event-chord)
>>  (> l n))
>> with
>> (if (and (music-is-of-type? music 'event-chord)
>>  (>= l n))
>
> Nice catch! I’ve updated the snippet as well.
>
> Additionally, beware that the LSR version uses
> #(define-music-function (parser location music)
> whereas the syntax for LilyPond 2.19 would be
> #(define-music-function (music)

Not much to beware here since convert-ly knows its way around this and
2.19 will do argument counting in order to provide backwards
compatibility.

-- 
David Kastrup

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


Re: select a note in a chord

2019-01-15 Thread Valentin Villenave
On 1/15/19, Davide Bonetti  wrote:
> I modified
> (if (and (music-is-of-type? music 'event-chord)
>  (> l n))
> with
> (if (and (music-is-of-type? music 'event-chord)
>  (>= l n))

Nice catch! I’ve updated the snippet as well.

Additionally, beware that the LSR version uses
#(define-music-function (parser location music)
whereas the syntax for LilyPond 2.19 would be
#(define-music-function (music)

That being said, one can also use
\musicMap #(drop-n ) { … }
without an additional wrapper.

Cheers,
V.

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


Re: select a note in a chord

2019-01-15 Thread Davide Bonetti

Hello!

Il 15/01/2019 11:46, Davide Bonetti ha scritto:
But I noticed that it doesn't work on the lowest pitch of a chord 
(drop 4 on a four note chord, drop 3 on a three note chord)



I modified

   (if (and (music-is-of-type? music 'event-chord)
    (> l n))

with

   (if (and (music-is-of-type? music 'event-chord)
    (>= l n))

and now it works even on the lowest pitch.

Here the complete code:

%%

#(define (drop-n n)

   (lambda (music)
 (let* ((elts (ly:music-property music 'elements))
    (l (length elts))
    ;; The user may not have entered the notes
    ;; from the lowest to the uppermost;
    ;; let’s extract the pitches…
    (pitches (map (lambda (x) (ly:music-property x 'pitch))
   (filter
    (lambda (y)
  (music-is-of-type? y 'note-event))
    elts)))
    ;; … and put them in order.
    (sorted (sort pitches ly:pitch= l n))
   (begin
    ;; first apply the sorted pitches
    ;; to the actual notes.
    (map
 (lambda (e p)
   (ly:music-set-property! e 'pitch p))
 elts sorted)
    ;; then transpose the specified note
    ;; (strangely, jazzmen tend to
    ;; count from the top note downward).
    (list-set! elts (- l n)
  (ly:music-transpose
   (list-ref elts (- l n))
   (ly:make-pitch -1 0)

   music)))

%

cheers

Davide


---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus


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


Re: select a note in a chord

2019-01-15 Thread Davide Bonetti

Now it sorts the pitches too!

It can be easily converted to transpose a pitch an octave up changing 
(ly:make-pitch -1 0) to (ly:make-pitch +1 0)


But I noticed that it doesn't work on the lowest pitch of a chord (drop 
4 on a four note chord, drop 3 on a three note chord)


Cheers

Davide

Il 15/01/2019 10:35, Valentin Villenave ha scritto:

On 1/15/19, Valentin Villenave  wrote:

(It would be possible to first re-order the notes
automatically and then apply the transformation, but I’m too lazy to
add it right now :-)

OK, here’s an improved version:
http://lsr.di.unimi.it/LSR/Item?id=1082

Cheers,
V.


---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus


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


Re: select a note in a chord

2019-01-15 Thread Valentin Villenave
On 1/15/19, Valentin Villenave  wrote:
> (It would be possible to first re-order the notes
> automatically and then apply the transformation, but I’m too lazy to
> add it right now :-)

OK, here’s an improved version:
http://lsr.di.unimi.it/LSR/Item?id=1082

Cheers,
V.

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


Re: select a note in a chord

2019-01-14 Thread Valentin Villenave
On 1/14/19, Davide Bonetti  wrote:
> I'm looking for a function to select a note in a chord.
> This can be useful for automatic inversions, or to change the voicing
> (like the drop 2 in a four note chord).

Hello Davide,
Here’s how I would do it (using list-ref and list-set!), but this
assumes that the user always enters chords from the lowest to the
uppermost pitch. (It would be possible to first re-order the notes
automatically and then apply the transformation, but I’m too lazy to
add it right now :-)



#(define (drop-n n)
   (lambda (music)
 (let* ((elts (ly:music-property music 'elements))
(l (length elts)))
   (if (and (music-is-of-type? music 'event-chord)
(> l n))
   (list-set! elts (- l n)
 (ly:music-transpose
  (list-ref elts (- l n))
  (ly:make-pitch -1 0
   music)))

dropTwo =
#(define-music-function (music) (ly:music?)
   #{ \musicMap #(drop-n 2) $music #})

\dropTwo \relative {
   
  \chordmode { d2:maj7 }
}



V.

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


Re: select a note in a chord

2019-01-14 Thread Malte Meyn



Am 14.01.19 um 09:54 schrieb Davide Bonetti:

Hello everyone.

I'm looking for a function to select a note in a chord.

This can be useful for automatic inversions, or to change the voicing 
(like the drop 2 in a four note chord).

Hi Davide,

what exactly are you looking for? A music function that takes a chord 
and a number as arguments and returns a pitch or a note?


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


select a note in a chord

2019-01-14 Thread Davide Bonetti

Hello everyone.

I'm looking for a function to select a note in a chord.

This can be useful for automatic inversions, or to change the voicing 
(like the drop 2 in a four note chord).


Cheers.

Davide


---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus


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


Re: note collision when in a chord there is a second above or below an unison

2019-01-13 Thread Davide Bonetti

Il 13/01/2019 00:46, Carl Sorensen ha scritto:


I think that Lilypond does the right thing.


Thank you for your opinion, but I think a collision is not a right thing.


There should never be a unison and a second in a chord.


I know that is not a very common situation. I'll show you two examples.

The notes of the Dsus4 chord on a ukulele are, in absolute notation:  g' 
d' g' a'


The resulting chord is:  ; as you can see, is a chord with 
a second above an unison.


The Ebsus4 chord has the following notes: as' es' as' bes' ; a second 
above an unison, both with accidentals.


In the cluster of whole notes without a stem, it seems harmless enough 
to move the notehead.  But if this same chord had a stem (e.g., 
half-note or shorter), you’d see that moving the notehead away to 
eliminate the collision also takes it away from the stem, which is 
musically wrong.


To properly show the notes in your example in a half-note chord, you 
will need two stems, which means you need two voices.  And if it is 
needed for half notes, it is also needed for whole notes, at least in 
my opinion.



Take a look at this examples, in the snippets:

http://lilypond.org/doc/v2.18/Documentation/snippets/simultaneous-notes#simultaneous-notes-displaying-complex-chords

To get what you want, you can manually move the note head with its 
associated accidentals.  I believe that is the proper approach, since 
it is inconsistent with standard engraving techniques.


Yes, I have found the solution for now, moving the note head and its 
associated accidentals.


I'd like however to know where in the code is the placement of the note 
in a chord, just to experiment.


regards

Davide


Sincerely,

Carl




---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: note collision when in a chord there is a second above or below an unison

2019-01-13 Thread Davide Bonetti

Hi Paolo,

your solution works but generates collision between the sharp and the 
time signature :)


I tried this:

\score {
  {
    1
  }
}

and there is no collision with time signature.

However, if the chord is  my code doesn't work well 
again.


I think that there is not an easy solution that fits all.

Thank you again, I learned something about \tweak and about extra-offset.

Cheers

Davide


Il 12/01/2019 23:22, Paolo Cantamessa ha scritto:

Hi David,
maybe this solution works but it is not really professional:

\score {
  {
    \once \override Accidental.extra-offset = #'(-1.5 . 0)
      1
  }
}

Good luck.

Paolo

Il sab 12 gen 2019, 22:00 Davide Bonetti <mailto:d...@davidebonetti.it>> ha scritto:


Thank you Paolo,

it works well for whole note without alteration.

If the note is altered, however, there is a collision with the
alteration, as you can see with this code:

\score {
   1
}

Do you (or someone else) know where in the source code is handled
the position of the notes in a chord?

Cheers

Davide

Il 09/01/2019 13:18, Paolo Cantamessa ha scritto:


Hi Davide,
try this:
\score {
   1
}

Bye.

Paolo



Mailtrack

<https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
Sender notified by
Mailtrack

<https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
09/01/19, 13:18:35  


Il giorno mer 9 gen 2019 alle ore 12:43 Davide Bonetti
mailto:d...@davidebonetti.it>> ha scritto:

Hi Malte,

The output could be like in the attached image. I obtained it in
Musescore, manually moving the notes.

Cheers.

Davide

Il 08/01/2019 08:15, Malte Meyn ha scritto:
> Hi Davide,
>
> please tell us what output you expected.
Am 06.01.19 um 18:41 schrieb Malte Meyn:
>> Long answer: You can do almost anything in LilyPond. In
your case you
>> could try changing the output (f. e. extra-offset) or the
inpult (f.
>> e. use multiple voices). But you have to know what the
output should
>> look like. LilyPond cannot guess that ;)
>


---
Questa e-mail è stata controllata per individuare virus con
Avast antivirus.
https://www.avast.com/antivirus
___
lilypond-user mailing list
lilypond-user@gnu.org <mailto:lilypond-user@gnu.org>
https://lists.gnu.org/mailman/listinfo/lilypond-user




<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
Mail priva di virus. www.avast.com

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>


<#m_3208058608710158921_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>




---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: note collision when in a chord there is a second above or below an unison

2019-01-12 Thread Carl Sorensen


From: Davide Bonetti 
Date: Saturday, January 12, 2019 at 2:00 PM
To: Paolo Cantamessa 
Cc: Malte Meyn , 
Subject: Re: note collision when in a chord there is a second above or below an 
unison


Do you (or someone else) know where in the source code is handled the position 
of the notes in a chord?
I think that Lilypond does the right thing.  There should never be a unison and 
a second in a chord.  In the cluster of whole notes without a stem, it seems 
harmless enough to move the notehead.  But if this same chord had a stem (e.g., 
half-note or shorter), you’d see that moving the notehead away to eliminate the 
collision also takes it away from the stem, which is musically wrong.

To properly show the notes in your example in a half-note chord, you will need 
two stems, which means you need two voices.  And if it is needed for half 
notes, it is also needed for whole notes, at least in my opinion.

To get what you want, you can manually move the note head with its associated 
accidentals.  I believe that is the proper approach, since it is inconsistent 
with standard engraving techniques.

Sincerely,

Carl

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


Re: note collision when in a chord there is a second above or below an unison

2019-01-12 Thread Paolo Cantamessa
Hi David,
maybe this solution works but it is not really professional:

\score {
  {
\once \override Accidental.extra-offset = #'(-1.5 . 0)
  1
  }
}

Good luck.

Paolo

Il sab 12 gen 2019, 22:00 Davide Bonetti  ha scritto:

> Thank you Paolo,
>
> it works well for whole note without alteration.
>
> If the note is altered, however, there is a collision with the alteration,
> as you can see with this code:
> \score {
>1
> }
>
> Do you (or someone else) know where in the source code is handled the
> position of the notes in a chord?
>
> Cheers
>
> Davide
>
> Il 09/01/2019 13:18, Paolo Cantamessa ha scritto:
>
> Hi Davide,
> try this:
> \score {
>1
> }
>
> Bye.
>
> Paolo
>
>
>
> [image: Mailtrack]
> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>  Sender
> notified by
> Mailtrack
> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>  09/01/19,
> 13:18:35
>
> Il giorno mer 9 gen 2019 alle ore 12:43 Davide Bonetti <
> d...@davidebonetti.it> ha scritto:
>
>> Hi Malte,
>>
>> The output could be like in the attached image. I obtained it in
>> Musescore, manually moving the notes.
>>
>> Cheers.
>>
>> Davide
>>
>> Il 08/01/2019 08:15, Malte Meyn ha scritto:
>> > Hi Davide,
>> >
>> > please tell us what output you expected.
>> Am 06.01.19 um 18:41 schrieb Malte Meyn:
>> >> Long answer: You can do almost anything in LilyPond. In your case you
>> >> could try changing the output (f. e. extra-offset) or the inpult (f.
>> >> e. use multiple voices). But you have to know what the output should
>> >> look like. LilyPond cannot guess that ;)
>> >
>>
>>
>> ---
>> Questa e-mail è stata controllata per individuare virus con Avast
>> antivirus.
>> https://www.avast.com/antivirus
>> ___
>> lilypond-user mailing list
>> lilypond-user@gnu.org
>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>>
>
>
> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
>  Mail
> priva di virus. www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
> <#m_3208058608710158921_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: note collision when in a chord there is a second above or below an unison

2019-01-12 Thread Davide Bonetti

Thank you Paolo,

it works well for whole note without alteration.

If the note is altered, however, there is a collision with the 
alteration, as you can see with this code:


\score {
   1
}

Do you (or someone else) know where in the source code is handled the 
position of the notes in a chord?


Cheers

Davide

Il 09/01/2019 13:18, Paolo Cantamessa ha scritto:


Hi Davide,
try this:
\score {
   1
}

Bye.

Paolo



Mailtrack 
<https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;> 
	Sender notified by
Mailtrack 
<https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;> 
09/01/19, 13:18:35 	



Il giorno mer 9 gen 2019 alle ore 12:43 Davide Bonetti 
mailto:d...@davidebonetti.it>> ha scritto:


Hi Malte,

The output could be like in the attached image. I obtained it in
Musescore, manually moving the notes.

Cheers.

Davide

Il 08/01/2019 08:15, Malte Meyn ha scritto:
> Hi Davide,
>
> please tell us what output you expected.
Am 06.01.19 um 18:41 schrieb Malte Meyn:
>> Long answer: You can do almost anything in LilyPond. In your
case you
>> could try changing the output (f. e. extra-offset) or the
inpult (f.
>> e. use multiple voices). But you have to know what the output
should
>> look like. LilyPond cannot guess that ;)
>


---
Questa e-mail è stata controllata per individuare virus con Avast
antivirus.
https://www.avast.com/antivirus
___
lilypond-user mailing list
lilypond-user@gnu.org <mailto:lilypond-user@gnu.org>
https://lists.gnu.org/mailman/listinfo/lilypond-user




---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: note collision when in a chord there is a second above or below an unison

2019-01-09 Thread Paolo Cantamessa
Hi Davide,
try this:
\score {
   1
}

Bye.

Paolo



[image: Mailtrack]

Sender
notified by
Mailtrack

09/01/19,
13:18:35

Il giorno mer 9 gen 2019 alle ore 12:43 Davide Bonetti 
ha scritto:

> Hi Malte,
>
> The output could be like in the attached image. I obtained it in
> Musescore, manually moving the notes.
>
> Cheers.
>
> Davide
>
> Il 08/01/2019 08:15, Malte Meyn ha scritto:
> > Hi Davide,
> >
> > please tell us what output you expected.
> Am 06.01.19 um 18:41 schrieb Malte Meyn:
> >> Long answer: You can do almost anything in LilyPond. In your case you
> >> could try changing the output (f. e. extra-offset) or the inpult (f.
> >> e. use multiple voices). But you have to know what the output should
> >> look like. LilyPond cannot guess that ;)
> >
>
>
> ---
> Questa e-mail è stata controllata per individuare virus con Avast
> antivirus.
> https://www.avast.com/antivirus
> ___
> 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: note collision when in a chord there is a second above or below an unison

2019-01-09 Thread Davide Bonetti

Hi Malte,

The output could be like in the attached image. I obtained it in
Musescore, manually moving the notes.

Cheers.

Davide

Il 08/01/2019 08:15, Malte Meyn ha scritto:

Hi Davide,

please tell us what output you expected.

Am 06.01.19 um 18:41 schrieb Malte Meyn:

Long answer: You can do almost anything in LilyPond. In your case you
could try changing the output (f. e. extra-offset) or the inpult (f.
e. use multiple voices). But you have to know what the output should
look like. LilyPond cannot guess that ;)





---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: note collision when in a chord there is a second above or below an unison

2019-01-07 Thread Malte Meyn

Hi Davide,

please tell us what output you expected.

Am 06.01.19 um 18:41 schrieb Malte Meyn:
Long answer: You can do almost anything in LilyPond. In your case you 
could try changing the output (f. e. extra-offset) or the inpult (f. e. 
use multiple voices). But you have to know what the output should look 
like. LilyPond cannot guess that ;)

Apart from that: Please read http://lilypond.org/bug-reports.html
If you find a bug (or something that *might* be a bug) you should 
contact the bug mailing list first and don’t create issues on 
sourceforge yourself. If the problem is considered a bug by others too, 
it will added to the tracker (and marked “Accepted” instead of “New”). A 
simple „I haven’t got a satisfying answer on the user list for two days“ 
doesn’t qualify a problem to be a bug ;)


You set yourself as owner of the issues you created (5454, 5455, 5457, 
5458). That field normally tells who is working on that issue. I see 
that you proposed some changes in the comments. New developers are 
always welcome! Please have a look at the Contributor’s Guide: 
http://lilypond.org/doc/v2.19/Documentation/contributor/ There you’ll 
find how to make patches using git. You can either ask for write access 
to the issue tracker and use the tool git-cl to put your patches into 
the regular review cycle or email them to the devel list, see 
http://lilypond.org/doc/v2.19/Documentation/contributor/patches


Cheers,
Malte

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


Re: note collision when in a chord there is a second above or below an unison

2019-01-06 Thread Malte Meyn




Am 06.01.19 um 16:08 schrieb Davide Bonetti:

Hello everyone!

Is there a way to avoid the note collision that appears in this example?

\score {
   1
}


Short answer: yes.

Long answer: You can do almost anything in LilyPond. In your case you 
could try changing the output (f. e. extra-offset) or the inpult (f. e. 
use multiple voices). But you have to know what the output should look 
like. LilyPond cannot guess that ;)


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


note collision when in a chord there is a second above or below an unison

2019-01-06 Thread Davide Bonetti

Hello everyone!

Is there a way to avoid the note collision that appears in this example?

\score {
  1
}

thanks.

Davide


---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus


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


Re: Engraving chord names in Linux

2018-12-23 Thread Federico Bruni




Il giorno dom 23 dic 2018 alle 11:57, Thomas Morley 
 ha scritto:


how comes you're using 2.18.2 with Ghostscript 9.26?
This ly-version is released with Ghostscript 8.70.



He's probably using a package installed from the repository instead of 
lilypond.org installer.
Linux packagers try to avoid bundling dependencies which are already 
available in the distro.





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


Re: Engraving chord names in Linux

2018-12-23 Thread Thomas Morley
Am Fr., 21. Dez. 2018 um 17:54 Uhr schrieb Jogchum Reitsma
:
>
> Hi list,
>
> I use lilypond 2.18 on OpenSuse Tumbleweed (the rolling distro from Suse). On 
> that combination, displaying chord names in .pdf-form gives error messages 
> grom ghostscript (gs) in the transition from a .ps-file to a .pdf-file. When 
> for example the snippet from 
> http://lilypond.org/doc/v2.18/Documentation/learning/notes-and-chords.nl.html 
> is fed to lilypond, with logging set to its maximum,, the last messages are:
>
> Opmaakuitvoer naar `Akkoorden.ps'...
> [/usr/share/fonts/truetype/CenturySchL-Roma.otf]
> [/usr/share/fonts/truetype/Roboto-Regular.ttf]
> [/usr/share/lilypond/2.18.2/ps/music-drawing-routines.ps]
> [/usr/share/lilypond/2.18.2/ps/lilyponddefs.ps]
> Converting to `./Akkoorden.pdf'...
> Aanroepen van 'gs -dSAFER -dDEVICEWIDTHPOINTS=595.28 
> -dDEVICEHEIGHTPOINTS=841.89 -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -r1200 
> -sDEVICE=pdfwrite -sOutputFile=./Akkoorden.pdf -c.setpdfwrite 
> -fAkkoorden.ps'...
>
> GPL Ghostscript 9.26 (2018-11-20)
> Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.
> This software comes with NO WARRANTY: see the file PUBLIC for details.
> Error: /invalidfont in --glyphshow--
> Operand stack:
>1.7072   43.7677   -7.0809   D
> Execution stack:
>%interp_exit   .runexec2   --nostringval--   --nostringval--   
> --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   
> --nostringval--   false   1   %stopped_push   2029   1   3   %oparray_pop   
> 2028   1   3   %oparray_pop   2009   1   3   %oparray_pop   1868   1   3   
> %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval-- 
>   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   0 
>   --nostringval--   %repeat_continue   --nostringval--
> Dictionary stack:
>--dict:960/1684(ro)(G)--   --dict:0/20(G)--   --dict:114/200(L)--
> Current allocation mode is local
> Current file position is 946206
> GPL Ghostscript 9.26: Warning: 'loca' length 13 is greater than numGlyphs 1 
> in the font Roboto-Regular.
> GPL Ghostscript 9.26: Unrecoverable error, exit code 1
>
> Generating the .ps-file goes withjout warning, but if one opens that .ps in a 
> viewer, one does ee the triangle above  the fist bar (between the last 2 
> quarter notes), but no chord names.
>
> The .pdf-file is not generated by gs.
>
> The snippet reads as follows:
>
> \version "2.18.2"
>
> melody = \relative c' {
>   \clef treble
>   \key c \major
>   \time 4/4
>
>   f4 e8[ c] d4 g
>   a2 ~ a
> }
>
> harmonies = \chordmode {
>   c4:m f:min7 g:maj c:aug
>   d2:dim b:sus
> }
>
> \score {
>   <<
> \new ChordNames {
>   \set chordChanges = ##t
>   \harmonies
> }
> \new Staff \melody
>   >>
>   \layout{ }
>   \midi { }
> }
>
> When I comment out the two lines in the chormode section, everything is OK.
>
> What can be/can I do to display chord names?
>
> regards, Jogchum Reitsma

Hi,

how comes you're using 2.18.2 with Ghostscript 9.26?
This ly-version is released with Ghostscript 8.70.

You're problem sounds like missing fonts (the triangle is drawn, not
from a font).

I was not able to reproduce your problem, although I've build 2.18.2
from the stable/2.18-branch with Ghostscript 9.27.



Sorry to be of not more help,
  Harm

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


Engraving chord names in Linux

2018-12-21 Thread Jogchum Reitsma

Hi list,

I use lilypond 2.18 on OpenSuse Tumbleweed (the rolling distro from 
Suse). On that combination, displaying chord names in .pdf-form gives 
error messages grom ghostscript (gs) in the transition from a .ps-file 
to a .pdf-file. When for example the snippet from 
http://lilypond.org/doc/v2.18/Documentation/learning/notes-and-chords.nl.html 
is fed to lilypond, with logging set to its maximum,, the last messages 
are:


   Opmaakuitvoer naar `Akkoorden.ps'...
   [/usr/share/fonts/truetype/CenturySchL-Roma.otf]
   [/usr/share/fonts/truetype/Roboto-Regular.ttf]
   [/usr/share/lilypond/2.18.2/ps/music-drawing-routines.ps]
   [/usr/share/lilypond/2.18.2/ps/lilyponddefs.ps]
   Converting to `./Akkoorden.pdf'...
   Aanroepen van 'gs -dSAFER -dDEVICEWIDTHPOINTS=595.28
   -dDEVICEHEIGHTPOINTS=841.89 -dCompatibilityLevel=1.4 -dNOPAUSE
   -dBATCH -r1200 -sDEVICE=pdfwrite -sOutputFile=./Akkoorden.pdf
   -c.setpdfwrite -fAkkoorden.ps'...

   GPL Ghostscript 9.26 (2018-11-20)
   Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.
   This software comes with NO WARRANTY: see the file PUBLIC for details.
   Error: /invalidfont in --glyphshow--
   Operand stack:
   1.7072   43.7677   -7.0809   D
   Execution stack:
   %interp_exit   .runexec2   --nostringval-- --nostringval--  
   --nostringval--   2   %stopped_push --nostringval--  
   --nostringval--   --nostringval--   false 1   %stopped_push   2029  
   1   3   %oparray_pop   2028   1   3 %oparray_pop   2009   1   3  
   %oparray_pop   1868   1   3 %oparray_pop   --nostringval--  
   %errorexec_pop   .runexec2 --nostringval--   --nostringval--  
   --nostringval--   2 %stopped_push   --nostringval--   0  
   --nostringval-- %repeat_continue   --nostringval--
   Dictionary stack:
   --dict:960/1684(ro)(G)--   --dict:0/20(G)-- --dict:114/200(L)--
   Current allocation mode is local
   Current file position is 946206
   GPL Ghostscript 9.26: Warning: 'loca' length 13 is greater than
   numGlyphs 1 in the font Roboto-Regular.
   GPL Ghostscript 9.26: Unrecoverable error, exit code 1

Generating the .ps-file goes withjout warning, but if one opens that .ps 
in a viewer, one does ee the triangle above  the fist bar (between the 
last 2 quarter notes), but no chord names.


The .pdf-file is not generated by gs.

The snippet reads as follows:

\version "2.18.2"

melody = \relative c' {
  \clef treble
  \key c \major
  \time 4/4

  f4 e8[ c] d4 g
  a2 ~ a
}

harmonies = \chordmode {
  c4:m f:min7 g:maj c:aug
  d2:dim b:sus
}

\score {
  <<
    \new ChordNames {
  \set chordChanges = ##t
  \harmonies
    }
    \new Staff \melody
  >>
  \layout{ }
  \midi { }
}

When I comment out the two lines in the chormode section, everything is OK.

What can be/can I do to display chord names?

regards, Jogchum Reitsma

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


Re: Generate staff-less chord and lyrics sheet

2018-12-12 Thread Annette Kusma
Hi Kieren,

thanks for your replies. Your first solution was sort of working for
me. Seems like a good idea to develop a better solution.

One problem I immediately ran into was syncopes at measure boundaries.
Assume that the information given to Lilypond is for example that a
syllable starts at the last eigth of a measure and continues into the
next measure. In a chord sheet you would want to place the chord
symbol right on top of that syllable, not between it and the next one,
which will make the sheet harder to read.

I guess, one might give directions to Lilypond in some way to to
straighten syncoped syllables, either by comparing the length of the
tone before and after the measure boundary, or by setting a certain
value, for Pop/Rock for example one eight: If a syllable stretches
over a measure boundary and the first measure contains only one eigth,
then ignore that eigth.

I am not a very frequent user of Lilypond and won't be able to
technically help develop any solution, so I will follow the further
development of this mailing thread and issue only when time allows.

Thanks all, and Happy Christmas Season!
Annette

2018-12-07 16:02 GMT+01:00, Kieren MacMillan :
> Hi Carl (et al.),
>
>> I really find Kieren's solution to be interesting.
>
> I’m glad!
>
> Below, I’ve done a little custom-context-building, in the hopes we might
> crowd-source a real solution to this problem (which crops up on the list
> fairly often). I’ve added a way (using tags) to break lyrics at appropriate
> spots, independent of breaks in the musical score. I’ve also shown how
> lyrics could be "centred" on the page (using indents, etc.); of course, this
> could also be done using margins, but I wanted to see if it could be done on
> a single page (equiv. in a single bookpart).
>
> Best,
> Kieren.
>

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


Re: Generate staff-less chord and lyrics sheet

2018-12-09 Thread Thomas Morley
Am Sa., 8. Dez. 2018 um 10:08 Uhr schrieb Johan Vromans :
>
> On Thu, 6 Dec 2018 21:15:43 +0100, Annette Kusma 
> wrote:
>
> > The output should look something like this:
> >
> > C   F C
> > Mary had a little lamb
> >  F   G  C
> > Its fleece was white as snow
> >
> > I could simply write my sheet in some office programme,
>
> Instead of trying to abuse office programs, why not take a look at
> https://www.chordpro.org ?

I doubt the initial request will ever work sufficiently with LilyPond.

Well, it's possible to eleminate the hyphen and the space it creates,
yes, but ligatures are not possible.
It's the same as in markup, regard
\markup \override #'(word-space . 0) \line { f i }

If one "joins" the texts, in markup one could do \markup \concat { f i
}, then for LyricText you would need to "join" the duration as well.
How to place ChordName then?

Evenwithout Hyphen
<<
  \new ChordNames \chordmode { c4:7 c:7.13 }
  \new Devnull { c' c' }
  \new Lyrics \lyricmode { f i }
>>

the manually joined result looks strange in both cases

<<
  \new ChordNames \chordmode { c4:7 c:7.13 }
  \new Devnull { c' c' }
  \new Lyrics \lyricmode { fi2 }
>>

The warning about "staff-affinities should only decrease" may be cured
easily, though

Admittedly even with a text-editing program placing two chords with
extensions over a very short syllable may lead to unsatisfying
results.

So for now I'd like to second Johan pointing to a different program.



Cheers,
  Harm

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


Re: Generate staff-less chord and lyrics sheet

2018-12-08 Thread Johan Vromans
On Thu, 6 Dec 2018 21:15:43 +0100, Annette Kusma 
wrote:

> The output should look something like this:
> 
> C   F C
> Mary had a little lamb
>  F   G  C
> Its fleece was white as snow
> 
> I could simply write my sheet in some office programme,

Instead of trying to abuse office programs, why not take a look at
https://www.chordpro.org ?

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


Re: Generate staff-less chord and lyrics sheet

2018-12-07 Thread Kieren MacMillan
Hi Carl (et al.),

> I really find Kieren's solution to be interesting.

I’m glad!

Below, I’ve done a little custom-context-building, in the hopes we might 
crowd-source a real solution to this problem (which crops up on the list fairly 
often). I’ve added a way (using tags) to break lyrics at appropriate spots, 
independent of breaks in the musical score. I’ve also shown how lyrics could be 
"centred" on the page (using indents, etc.); of course, this could also be done 
using margins, but I wanted to see if it could be done on a single page (equiv. 
in a single bookpart).

Best,
Kieren.

\version "2.19.80"

\paper {
  indent = 0
  ragged-right = ##t
  system-system-spacing = #'((basic-distance . 6) (minimum-distance . 6) 
(padding . 2.5) (stretchability . 0))
  score-system-spacing.padding = #12
}

\layout {
  \context {
\ChordNames
\override VerticalAxisGroup.staff-affinity = #DOWN
\override VerticalAxisGroup.nonstaff-relatedstaff-spacing =
#'((basic-distance . 2.5) (minimum-distance . 2.5) (padding . 1.25) 
(stretchability . 0))
  }
  \context {
\Lyrics
\override VerticalAxisGroup.staff-affinity = #UP
\override VerticalAxisGroup.nonstaff-relatedstaff-spacing =
#'((basic-distance . 5.5) (minimum-distance . 5.5) (padding . 1.25) 
(stretchability . 0))
  }
  \context {
\ChordNames
\name LyricSheetChords
\alias ChordNames
\inherit-acceptability LyricSheetChords ChordNames
\override VerticalAxisGroup.nonstaff-nonstaff-spacing =
#'((basic-distance . 1) (minimum-distance . 1) (padding . 1) 
(stretchability . 0))
  }
  \context {
\Lyrics
\name LyricSheetLyrics
\alias Lyrics
\inherit-acceptability LyricSheetLyrics Lyrics
\override VerticalAxisGroup.staff-affinity = #UP
\override VerticalAxisGroup.nonstaff-relatedstaff-spacing =
#'((basic-distance . 3) (minimum-distance . 3) (padding . 2) 
(stretchability . 0))
\override LyricHyphen.minimum-length = #0
\override LyricHyphen.minimum-distance = #0
\override LyricText.self-alignment-X = #-0.9
  }
}

lyricsbreak =  \tag #'lyricsheet { \bar "" \break }

theMelody = {
  e'4 d' c' d'
  e'4 4 4 \lyricsbreak 4
  d'4 4 e' d'
  c'2. r4
}

theChords = \chordmode {
  c2 f
  c1
  f2:6 g
  c1
}

theWords = \lyricmode {
  Mar -- y had a lit -- tle lamb,
  Its fleece was white as snow.
}

\score {
  \removeWithTag #'lyricsheet <<
\new ChordNames \theChords
\new Staff \new Voice = "melody" \theMelody
\new Lyrics \lyricsto "melody" \theWords
  >>
  \layout {
ragged-right = ##f
  }
}

\score {
  \keepWithTag #'lyricsheet <<
\new ChordNames \theChords
\new Devnull = "melody" \theMelody
\new LyricSheetLyrics \lyricsto "melody" \theWords
  >>
  \layout {
line-width = 6\in
indent = 2\in
short-indent = 2\in
\context {
  \Score
  \remove "Bar_number_engraver"
}
  }
}


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: Generate staff-less chord and lyrics sheet

2018-12-06 Thread Carl Sorensen


On 12/6/18, 6:41 PM, "Carl Sorensen"  wrote:



What I've been using is Chordii/ChordPro.  It's not as powerful as 
LilyPond, but also not as complicated.


Oops -- that's my mistake.  I haven't been using Chordii, I've been using the 
gchords package in LaTeX, which is similar.

Thanks,

Carl



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


Re: Generate staff-less chord and lyrics sheet

2018-12-06 Thread Carl Sorensen


On 12/6/18, 1:15 PM, "Annette Kusma"  wrote:

Hi,

I have a working .ly-file that displays a staff with notes, lyrics and
chordnames, all correctly counted/aligned.

I wonder if there is any command to generate a sheet with only chords
and lyrics, no staves.

The output should look something like this:


C   F C
Mary had a little lamb
 F   G  C
Its fleece was white as snow


    with the chord names printed nicely above the corresponding syllable
(the .ly-file could calculate the alignment from combining the given
lyrics- and notes-information), but hyphens removed, and linebreaks
at, say every given number of measures.

What would be the term to search for, in case there already is some
ready-to-learn solution?

I could simply write my sheet in some office programme, but it will be
easier to transpose things forth and back and to regenerate sheets
from new and modified files, so I'd really look forward to a solution.

I really find Kieren's solution to be interesting.  I have made a number of 
guitar chord/lyrics sheets like this, and I generally don't use LilyPond. Maybe 
for the benefit of transposing I'll start using LilyPond.

What I've been using is Chordii/ChordPro.  It's not as powerful as LilyPond, 
but also not as complicated.

HTH,

Carl


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


Re: Generate staff-less chord and lyrics sheet

2018-12-06 Thread Kieren MacMillan
Hi Annette,

Here’s a simpler version that seems to work.

Kieren.

\version "2.19.80"

theMelody = {
  e'4 d' c' d'
  e'4 4 4 4
  d'4 4 e' d'
  c'2. r4
}

theChords = \chordmode {
  c2 f
  c1
  f2 g
  c1
}

theWords = \lyricmode {
  Mar -- y had a lit -- tle lamb,
  Its fleece was white as snow.
}

\score {
  <<
\new ChordNames \theChords
\new Staff \new Voice = "melody" \theMelody
\new Lyrics \lyricsto "melody" \theWords
  >>
  \layout {
ragged-right = ##f
  }
}

\score {
  <<
\new Devnull = "melody" \theMelody
\new ChordNames \theChords
\new Lyrics \lyricsto "melody" \theWords
  >>
  \layout {
ragged-right = ##f
  }
}

Cheers,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: Generate staff-less chord and lyrics sheet

2018-12-06 Thread Kieren MacMillan
Hi Annette,

> I wonder if there is any command to generate a sheet with only chords
> and lyrics, no staves.

Here’s one attempt. You should be able to take it from here.

Hope this helps!
Kieren.

%%%  SNIPPET BEGINS

\version "2.19.80"

theMelody = {
  e'4 d' c' d'
  e'4 4 4 4
  d'4 4 e' d'
  c'2. r4
}

theChords = \chordmode {
  c2 f
  c1
  f2 g
  c1
}

theWords = \lyricmode {
  Mar4 -- y had a lit -- tle lamb,
  Its fleece was white as snow.2
}

\score {
  <<
\new ChordNames \theChords
\new Staff \new Voice = "melody" \theMelody
\new Lyrics \lyricsto "melody" \theWords
  >>
  \layout {
ragged-right = ##f
  }
}

\score {
  <<
\new Devnull \new NullVoice = "melody" \theMelody
\new ChordNames \theChords
\new Lyrics \lyricsto "melody" \theWords
  >>
  \layout {
ragged-right = ##f
\context {
  \Staff
  \omit StaffSymbol
  \omit BarLine
  \omit Clef
  \omit TimeSignature
}
  }
}

%%%  SNIPPET ENDS


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: Generate staff-less chord and lyrics sheet

2018-12-06 Thread Andrew Bernard
Hi Annette,

A minimal working example would be good (MWE).

But can't you simply hide the staff?

See NR for 2.19.82 Section 1.6.2, subsection Hiding Staves. [Works in
earlier lilypond versions as well.]

"Staff lines can be hidden by removing the Staff_symbol_engraver from the
Staff context. As an alternative, \stopStaff may be used. "

Andrew


On Fri, 7 Dec 2018 at 08:38, Annette Kusma  wrote:

>
> I wonder if there is any command to generate a sheet with only chords
> and lyrics, no staves.
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Generate staff-less chord and lyrics sheet

2018-12-06 Thread Annette Kusma
Hi,

I have a working .ly-file that displays a staff with notes, lyrics and
chordnames, all correctly counted/aligned.

I wonder if there is any command to generate a sheet with only chords
and lyrics, no staves.

The output should look something like this:


C   F C
Mary had a little lamb
 F   G  C
Its fleece was white as snow


with the chord names printed nicely above the corresponding syllable
(the .ly-file could calculate the alignment from combining the given
lyrics- and notes-information), but hyphens removed, and linebreaks
at, say every given number of measures.

What would be the term to search for, in case there already is some
ready-to-learn solution?

I could simply write my sheet in some office programme, but it will be
easier to transpose things forth and back and to regenerate sheets
from new and modified files, so I'd really look forward to a solution.

Thanks,
Annette

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


Re: parenthesized chord symbols

2018-12-02 Thread Tim McNamara
Here is something I have used for years with good results.  Someone on the list 
created this off the cuff.  I have not tried it with 2.19.x.  No doubt it could 
be improved, but it is short and simple.

\version "2.18.0"

#(define (left-parenthesis-ignatzek-chord-names in-pitches bass inversion 
context)
(markup #:line ("( " (ignatzek-chord-names in-pitches bass inversion context

#(define (right-parenthesis-ignatzek-chord-names in-pitches bass inversion 
context)
(markup #:line ((ignatzek-chord-names in-pitches bass inversion context) " )")))

LPC = { \set chordNameFunction = #left-parenthesis-ignatzek-chord-names }
RPC = { \set chordNameFunction = #right-parenthesis-ignatzek-chord-names }
NPC = { \unset chordNameFunction }

%%%%%%
% \LPC first-chord \NPC more chords \RPC last-chord \NPC
%%
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: parenthesized chord symbols

2018-12-01 Thread Robin Bannister

Sandro Santilli wrote:

How do I put chord symbols in parenthesis, across
two measures ?



Look at
http://lists.gnu.org/archive/html/lilypond-user/2016-10/msg00565.html
for some suggestions re turnaround brackets.


Cheers,
Robin

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


parenthesized chord symbols

2018-12-01 Thread Sandro Santilli
How do I put chord symbols in parenthesis, across
two measures ?

Like in (fixed-width fonts needed):

Em7  ( D7 A   A7 )
  ||   ||


--strk;


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


Re: chord duration

2018-10-31 Thread Torsten Hämmerle
Gianmaria Lari wrote
> Ciao Torsten,
> 
> I'm sorry, I don't understand. Why I would like to display twice a chord
> if
> I write c4~4 ? Maybe could you write a simple example (if possible!).

Ah, yes, right, Gianmaria!

I only was thinking of chord changes in general, but now I see that it's
primarily about the tie.
And, I agree, there is no reason why one would want to display a tied-over
chord name.
Except, perhaps after line breaks (cf. accidentals). 

All the best,
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: chord duration

2018-10-31 Thread Gianmaria Lari
On Wed, 31 Oct 2018 at 15:45, Torsten Hämmerle 
wrote:

> Gianmaria Lari wrote
> > But I was wondering why it should not work my
> > obvious solution :)
>
> Ciao Gianmanria,
>
> Probably because your obvious solution isn't that obvious from a technical
> point of view.
> In this simple example, it is totally clear that we only want to see
> changes.
> But just imagine the beginning of a new section (rehearsal mark, repeat
> volta bracket, Coda, etc.) where we definitely *want* to clearly re-instate
> the Chord name for several reasons.
>
> I think it is necessary to deliberately set chordChanges to ##t or ##f in
> many cases.
>
> Besides, I'll opt for ##t as the default setting.


Ciao Torsten,

I'm sorry, I don't understand. Why I would like to display twice a chord if
I write c4~4 ? Maybe could you write a simple example (if possible!).

Thank you Torsten!
g.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: chord duration

2018-10-31 Thread Torsten Hämmerle
Gianmaria Lari wrote
> But I was wondering why it should not work my
> obvious solution :)

Ciao Gianmanria,

Probably because your obvious solution isn't that obvious from a technical
point of view.
In this simple example, it is totally clear that we only want to see
changes.
But just imagine the beginning of a new section (rehearsal mark, repeat
volta bracket, Coda, etc.) where we definitely *want* to clearly re-instate
the Chord name for several reasons.

I think it is necessary to deliberately set chordChanges to ##t or ##f in
many cases.

Besides, I'll opt for ##t as the default setting.

All the best,
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: chord duration

2018-10-31 Thread Gianmaria Lari
On Wed, 31 Oct 2018 at 09:21, David Kastrup  wrote:

> Gianmaria Lari  writes:
>
> > The following code...
> >
> > \version "2.19.82"
> > \new ChordNames \chordmode { c8~c2 }
> >
> >
> > displays C C. How can I make it display a single C chord that last 8~2?
>
> You got a number of workarounds in different answers.  There may also be
> some point in treating this as a bug.


:)

The three solution  Schmaus, Meyn, Moser, Hill (and Barker) proposed work
well (thank you all of you!). But I was wondering why it should not work my
obvious solution :)

Thank you David!
Best regards, g.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: chord duration

2018-10-31 Thread David Kastrup
Gianmaria Lari  writes:

> The following code...
>
> \version "2.19.82"
> \new ChordNames \chordmode { c8~c2 }
>
>
> displays C C. How can I make it display a single C chord that last 8~2?

You got a number of workarounds in different answers.  There may also be
some point in treating this as a bug.

-- 
David Kastrup

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


Re: chord duration

2018-10-31 Thread Lukas-Fabian Moser

Am 31.10.18 um 09:00 schrieb Gianmaria Lari:

The following code...

\version "2.19.82"
\new ChordNames \chordmode { c8~c2 }


displays C C. How can I make it display a single C chord that last 8~2?


Durations may be modified using factors: since 2 is 4x 8 (hehe), you can 
write \chordmode { c8*5 }.


(Alternatively, replace the second chord by a skip: s2)

Lukas


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


Re: chord duration

2018-10-31 Thread Aaron Hill

On 2018-10-31 1:00 am, Gianmaria Lari wrote:

The following code...

\version "2.19.82"
\new ChordNames \chordmode { c8~c2 }


displays C C. How can I make it display a single C chord that last 8~2?


Would either "c8 s2" or "c8*5" work for you?  (I think the second one 
would be needed for MIDI output to work correctly.)


-- Aaron Hill

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


Re: chord duration

2018-10-31 Thread Malte Meyn



Am 31.10.18 um 09:00 schrieb Gianmaria Lari:

The following code...

\version "2.19.82"
\new ChordNames \chordmode { c8~c2 }


displays C C. How can I make it display a single C chord that last 8~2?


There are several possibilities:

%%%
\version "2.19.82"

\new ChordNames \with {
  chordChanges = ##t % don’t repeat unchanged chord
} \chordmode { c8 c2 }

\new ChordNames \chordmode { c8 s2 } % set a spacer rest instead of c2

\new ChordNames \chordmode { c8*5 } % chord with duration 8*5 = 8~2
%%%

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


Re: chord duration

2018-10-31 Thread Robert Schmaus
Try C8*5. 

Best,
Robert

> On 31 Oct 2018, at 09:00, Gianmaria Lari  wrote:
> 
> The following code... 
> 
> \version "2.19.82"
> \new ChordNames \chordmode { c8~c2 }
> 
> displays C C. How can I make it display a single C chord that last 8~2?
> 
> Thank you, g.
> ___
> 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


chord duration

2018-10-31 Thread Gianmaria Lari
The following code...

\version "2.19.82"
\new ChordNames \chordmode { c8~c2 }


displays C C. How can I make it display a single C chord that last 8~2?

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


Re: Function or command to omit only certain accidentals of a chord?

2018-10-28 Thread Pedro Pessoa
Hello Jan! I'm just testing out EE and I've come across the need to adress a
noteHead tweak in a note inside a chord. Looking for a solution, I came to
this post. Is this implemented?



--
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: How to parenthesise bass note in chord symbol?

2018-10-07 Thread Peter Crighton
On Sun, 7 Oct 2018 at 21:12, Thomas Morley  wrote:

> Am So., 7. Okt. 2018 um 19:53 Uhr schrieb Peter Crighton
> :
>
> > How would I go about either shifting the parentheses vertically or
> making them smaller? They probably make sense how they are now with regard
> to sharps/flats and possible lowercase letters, but they still look off,
> especially with the C(/G) example. Although I’m just realising – looking at
> the characters I just typed in – that such alignment of parentheses is
> probably typographically common. I would have expected them to be exactly
> as tall as all other characters in the example.
>
> A ChordName is not a simple line of characters, but a tailored markup,
> containing strings and musicglyphs, additional they are used with
> different fontsize and probably raised etc.
> Look at the far simpler
> \markup { "(/" \sharp ")" }
> to get an impression ...
>
> Nevertheless, you can adjust fontsize and apply \raise (and what ever you
> like).
> To make it more easy I switched (partly) to ly-syntax for the
> chordNoteNamer:
>
> \new ChordNames
>   \chordmode {
> \set slashChordSeparator = ""
> \set chordNoteNamer =
>   #(lambda (pitch lowercase?)
> #{
>   \markup {
> \fontsize #-1.5 \raise #0.21 "("
> "/"
> #(note-name->markup pitch lowercase?)
> \fontsize #-1.5 \raise #0.21 ")"
>   }
> #})
>
> cis:5.9.13/fis
> c/g
>   }
>
> Cheers,
>   Harm


Thanks a lot! Scheme still always throws me off …

--
Peter Crighton | Musician & Music Engraver based in Mainz, Germany
http://www.petercrighton.de
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: How to parenthesise bass note in chord symbol?

2018-10-07 Thread Thomas Morley
Am So., 7. Okt. 2018 um 19:53 Uhr schrieb Peter Crighton
:

> How would I go about either shifting the parentheses vertically or making 
> them smaller? They probably make sense how they are now with regard to 
> sharps/flats and possible lowercase letters, but they still look off, 
> especially with the C(/G) example. Although I’m just realising – looking at 
> the characters I just typed in – that such alignment of parentheses is 
> probably typographically common. I would have expected them to be exactly as 
> tall as all other characters in the example.

A ChordName is not a simple line of characters, but a tailored markup,
containing strings and musicglyphs, additional they are used with
different fontsize and probably raised etc.
Look at the far simpler
\markup { "(/" \sharp ")" }
to get an impression ...

Nevertheless, you can adjust fontsize and apply \raise (and what ever you like).
To make it more easy I switched (partly) to ly-syntax for the chordNoteNamer:

\new ChordNames
  \chordmode {
\set slashChordSeparator = ""
\set chordNoteNamer =
  #(lambda (pitch lowercase?)
#{
  \markup {
\fontsize #-1.5 \raise #0.21 "("
"/"
#(note-name->markup pitch lowercase?)
\fontsize #-1.5 \raise #0.21 ")"
  }
#})

cis:5.9.13/fis
c/g
  }

Cheers,
  Harm

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


Re: How to parenthesise bass note in chord symbol?

2018-10-07 Thread Peter Crighton
On Sun, 7 Oct 2018 at 00:27, Thomas Morley  wrote:

> Am Sa., 6. Okt. 2018 um 23:48 Uhr schrieb Peter Crighton
> :
> >
> > Hello all,
> >
> > I need the bass note of a chord symbol to be in parentheses, like so:
> > C(/G)
> >
> > How could I achieve this? I am, sadly, clueless.
> >
> > \version "2.19.82"
> > \new ChordNames {
> >   \chordmode {
> > % like this, but with only the /G in parentheses -> C(/G)
> > \parenthesize c1/g
> >   }
> > }
> >
> > Thanks,
> > Peter
>
> Hi,
>
> probably:
>
> \new ChordNames
>   \chordmode {
> \set slashChordSeparator = ""
> \set chordNoteNamer =
> #(lambda (pitch lowercase?)
>   (make-line-markup (list "(/" (note-name->markup pitch lowercase?)
> ")")))
> c/fis
> c/g
>   }
>
> HTH,
>   Harm


Thanks!
How would I go about either shifting the parentheses vertically or making
them smaller? They probably make sense how they are now with regard to
sharps/flats and possible lowercase letters, but they still look off,
especially with the C(/G) example. Although I’m just realising – looking at
the characters I just typed in – that such alignment of parentheses is
probably typographically common. I would have expected them to be exactly
as tall as all other characters in the example.

--
Peter Crighton | Musician & Music Engraver based in Mainz, Germany
http://www.petercrighton.de
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: How to parenthesise bass note in chord symbol?

2018-10-07 Thread Thomas Morley
Am So., 7. Okt. 2018 um 00:55 Uhr schrieb David Kastrup :
>
> Thomas Morley  writes:
>
> > Am Sa., 6. Okt. 2018 um 23:48 Uhr schrieb Peter Crighton
> > :
> >>
> >> Hello all,
> >>
> >> I need the bass note of a chord symbol to be in parentheses, like so:
> >> C(/G)
> >>
> >> How could I achieve this? I am, sadly, clueless.
> >>
> >> \version "2.19.82"
> >> \new ChordNames {
> >>   \chordmode {
> >> % like this, but with only the /G in parentheses -> C(/G)
> >> \parenthesize c1/g
> >>   }
> >> }
> >>
> >> Thanks,
> >> Peter
> >
> > Hi,
> >
> > probably:
> >
> > \new ChordNames
> >   \chordmode {
> > \set slashChordSeparator = ""
> > \set chordNoteNamer =
> > #(lambda (pitch lowercase?)
> >   (make-line-markup (list "(/" (note-name->markup pitch lowercase?) 
> > ")")))
>
> I'd have said make-concat-markup instead of make-line-markup, but it
> would appear that word space is removed anyway.  Seems a bit weird to
> me.

Well, word-space is set to 0.0 in the ChordName-grob.
Current definitions for the ChordName uses line-markup with
0.0-word-space at several instances.
Sometimes inserting adjusted hspace-markup where wished (see:
accidental->markup-italian and conditional-kern-before).
Also chordNameSeparator is set to a hspace-markup.

Current implementation obviously is done caring about different
horizontal spacing-wishes.
Not sure whether it's the best possible coding using zero word-space
and adjusted hspace-markups.

Honestly, I stopped any attempt to improve current situation after
"Improving ChordNames" became a GSoC-project.

Cheers,
  Harm


>
> > c/fis
> > c/g
> >   }
>
> --
> David Kastrup

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


Re: How to parenthesise bass note in chord symbol?

2018-10-06 Thread David Kastrup
Thomas Morley  writes:

> Am Sa., 6. Okt. 2018 um 23:48 Uhr schrieb Peter Crighton
> :
>>
>> Hello all,
>>
>> I need the bass note of a chord symbol to be in parentheses, like so:
>> C(/G)
>>
>> How could I achieve this? I am, sadly, clueless.
>>
>> \version "2.19.82"
>> \new ChordNames {
>>   \chordmode {
>> % like this, but with only the /G in parentheses -> C(/G)
>> \parenthesize c1/g
>>   }
>> }
>>
>> Thanks,
>> Peter
>
> Hi,
>
> probably:
>
> \new ChordNames
>   \chordmode {
> \set slashChordSeparator = ""
> \set chordNoteNamer =
> #(lambda (pitch lowercase?)
>   (make-line-markup (list "(/" (note-name->markup pitch lowercase?) ")")))

I'd have said make-concat-markup instead of make-line-markup, but it
would appear that word space is removed anyway.  Seems a bit weird to
me.

> c/fis
> c/g
>   }

-- 
David Kastrup

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


Re: How to parenthesise bass note in chord symbol?

2018-10-06 Thread Thomas Morley
Am Sa., 6. Okt. 2018 um 23:48 Uhr schrieb Peter Crighton
:
>
> Hello all,
>
> I need the bass note of a chord symbol to be in parentheses, like so:
> C(/G)
>
> How could I achieve this? I am, sadly, clueless.
>
> \version "2.19.82"
> \new ChordNames {
>   \chordmode {
> % like this, but with only the /G in parentheses -> C(/G)
> \parenthesize c1/g
>   }
> }
>
> Thanks,
> Peter

Hi,

probably:

\new ChordNames
  \chordmode {
\set slashChordSeparator = ""
\set chordNoteNamer =
#(lambda (pitch lowercase?)
  (make-line-markup (list "(/" (note-name->markup pitch lowercase?) ")")))
c/fis
c/g
  }

HTH,
  Harm

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


How to parenthesise bass note in chord symbol?

2018-10-06 Thread Peter Crighton
Hello all,

I need the bass note of a chord symbol to be in parentheses, like so:
C(/G)

How could I achieve this? I am, sadly, clueless.

\version "2.19.82"
\new ChordNames {
  \chordmode {
% like this, but with only the /G in parentheses -> C(/G)
\parenthesize c1/g
  }
}

Thanks,
Peter

--
Peter Crighton | Musician & Music Engraver based in Mainz, Germany
http://www.petercrighton.de
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: slash to indicate repeated chord?

2018-10-03 Thread DrTechDaddy
Robin Bannister-2 wrote
> Well there was a suggestion in 2012
> http://lists.gnu.org/archive/html/lilypond-user/2012-02/msg00417.html
> I don't know if anything came of this.

Thanks.  It took me a while to get around to it,
but I tried the Scheme solution from Francisco Vila(?) and it worked.

Joe Austin



--
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: Intervalic Chord Names

2018-08-29 Thread Aaron Hill

On 2018-08-29 10:25, Tom Swan wrote:

continued reply... Re: accidentals, yes that will be necessary. Do you
have an idea about how to go about that?


Hi Tom,

Building upon the code from scm/chord-name.scm (and related files) as 
well as (LSR #750)[1], here is a more complete version of the 
interval-based chord root namer:


[1]:http://lsr.di.unimi.it/LSR/Item?id=750

```lilypond
\version "2.18.2"

#(define (intervalic-namer pitch lowercase?)
  (let ((handle-case (if lowercase? string-downcase (lambda (x) x)))
(alt (ly:pitch-alteration pitch)))
(make-line-markup (list
  (make-simple-markup (handle-case
(vector-ref #("I" "II" "III" "IV" "V" "VI" "VII")
  (ly:pitch-notename pitch
  (if (= 0 alt) empty-markup
(alteration->text-accidental-markup alt))

#(define (intervalic-namer-custom-alts pitch lowercase?)
  (let ((handle-case (if lowercase? string-downcase (lambda (x) x)))
(alt (ly:pitch-alteration pitch))
(custom-alts `((,FLAT . "b") (,SHARP . "#"
(make-line-markup (list
  (make-simple-markup (handle-case
(vector-ref #("I" "II" "III" "IV" "V" "VI" "VII")
  (ly:pitch-notename pitch
  (if (= 0 alt) empty-markup
(make-small-markup (make-raise-markup 0.7 (make-text-markup
  (ly:assoc-get alt custom-alts "?")

theChords = \chordmode { c8 d/fis e:m7 f:maj7 g:7 a:m bes:sus4 b:dim 
}

\score { << \new ChordNames \chordmode {
  \omit Score.BarNumber
  \override Score.RehearsalMark.self-alignment-X = #-1
  \mark "Default naming"
  \theChords \break
  \mark "Interval-based naming"
  \set chordRootNamer = #intervalic-namer
  \theChords \break
  \mark "Lowercase minor"
  \set chordNameLowercaseMinor = ##t
  \theChords \break
  \mark "Custom alterations"
  \set chordRootNamer = #intervalic-namer-custom-alts
  \theChords
} >> \layout { indent = 0 } }
```

The above namer comes in two flavors, depending on whether you prefer 
the normal glyphs for alterations or if you want to customize the 
symbols.


The one thing this does not handle is ensuring the tonic of the current 
key signature appears as "I".  To do that appears to require more work 
as `chordRootNamer` does not provide access to the context in order to 
query for the current key.  I believe you might need to go down the 
route of a custom engraver.  If you search on this mailing list, there 
has been prior discussion about supporting the Nashville numbering 
system (which admittedly is much more than just interval-based naming).  
But in that thread, there is a lot of potentially relevant material to 
this topic, such as getting the key signature information into the 
ChordNames context.


-- Aaron Hill

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


Re: Intervalic Chord Names

2018-08-29 Thread Tom Swan
continued reply... Re: accidentals, yes that will be necessary. Do you have an 
idea about how to go about that?

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


Re: Intervalic Chord Names

2018-08-29 Thread Tom Swan
That worked perfectly! Thank you. I am not very familiar with lilypond 
internals, but now I am also intrigued by your solution. I am determined now to 
learn scheme. :-)

> 
> Do you need lowercase numbers (i to vii) too? And how about accidentals?
> 

I am comfortable with IVm7 or IV-7 but I am curious how you would select 
lowercase ii, vi, etc.? If the chord is c:m7 would that choose lowercase 
somehow? That would be pretty cool. Now I'm thinking of expanding this to 
respect the key (e.g. if the key is changed to F, would the intervalic chords 
remain unchanged in the output?) I don't really need to do that; just wondering 
aloud.

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


Re: Intervalic Chord Names

2018-08-28 Thread Malte Meyn



Am 28.08.18 um 18:57 schrieb Jacques Menu Muzhic:

Do I guess it right that you’d like tonality-relative numbers, i.e. V7 for A7 
in D major?


That’s indeed probable. There are two possibilities what to do about that:

1. Get the tonic from the key signature as it is done in these snippets: 
http://lsr.di.unimi.it/LSR/Search?q=tonic

2. Use \transpose to transpose the chords to C.

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


Re: Intervalic Chord Names

2018-08-28 Thread Jacques Menu Muzhic
Hello Tom,

Do I guess it right that you’d like tonality-relative numbers, i.e. V7 for A7 
in D major?

JM

> Le 28 août 2018 à 16:27, Malte Meyn  a écrit :
> 
> 
> 
> Am 28.08.18 um 15:29 schrieb Tom Swan:
>> Sorry for duplication but my previous try didn't seem to go through.)
> 
> It came through; it just seems like it was overlooked by many.
> 
>> I need some help figuring out how to change chord names (C, F, G) into 
>> intervals such as (I, IV, V). The short example below displays a timing 
>> diagram for a melodic line, but I would also like to display the chords C7, 
>> F7 as generic intervals I7 IV7. Manually setting the text would okay -- I'm 
>> not looking for some kind of automatic translation, although that would be 
>> neat. I know I can do this with markup, but I do not want to add markup 
>> statements to noteValues! Do I need to set chordRootNamer somehow? Or is 
>> there another solution? Thanks for any advice.
> 
> Setting chordRootNamer probably is the easiest way, yes. I took the original 
> definition of note-name->markup (which is the default chordRootNamer) from 
> the file scm/chord-name.scm and modified it to use the roman numerals I to 
> VII instead of letters C to B:
> 
> %
> \layout {
>  \context {
>\ChordNames
>chordRootNamer =
>#(lambda (pitch lowercase?)
>   (make-simple-markup
>(vector-ref #("I" "II" "III" "IV" "V" "VI" "VII")
>  (ly:pitch-notename pitch
>  }
> }
> %
> 
> Of course you can use that in a \with block instead of a layout-context 
> block; or just \set chordRootNamer = … somewhere else ;)
> 
> Do you need lowercase numbers (i to vii) too? And how about accidentals?
> 
> ___
> 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: Intervalic Chord Names

2018-08-28 Thread Malte Meyn



Am 28.08.18 um 15:29 schrieb Tom Swan:

Sorry for duplication but my previous try didn't seem to go through.)


It came through; it just seems like it was overlooked by many.


I need some help figuring out how to change chord names (C, F, G) into 
intervals such as (I, IV, V). The short example below displays a timing diagram 
for a melodic line, but I would also like to display the chords C7, F7 as 
generic intervals I7 IV7. Manually setting the text would okay -- I'm not 
looking for some kind of automatic translation, although that would be neat. I 
know I can do this with markup, but I do not want to add markup statements to 
noteValues! Do I need to set chordRootNamer somehow? Or is there another 
solution? Thanks for any advice.


Setting chordRootNamer probably is the easiest way, yes. I took the 
original definition of note-name->markup (which is the default 
chordRootNamer) from the file scm/chord-name.scm and modified it to use 
the roman numerals I to VII instead of letters C to B:


%
\layout {
  \context {
\ChordNames
chordRootNamer =
#(lambda (pitch lowercase?)
   (make-simple-markup
(vector-ref #("I" "II" "III" "IV" "V" "VI" "VII")
  (ly:pitch-notename pitch
  }
}
%

Of course you can use that in a \with block instead of a layout-context 
block; or just \set chordRootNamer = … somewhere else ;)


Do you need lowercase numbers (i to vii) too? And how about accidentals?

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


Intervalic Chord Names

2018-08-28 Thread Tom Swan
Hello. (Trying this again in plain text. Sorry for duplication but my previous 
try didn't seem to go through.) 

I need some help figuring out how to change chord names (C, F, G) into 
intervals such as (I, IV, V). The short example below displays a timing diagram 
for a melodic line, but I would also like to display the chords C7, F7 as 
generic intervals I7 IV7. Manually setting the text would okay -- I'm not 
looking for some kind of automatic translation, although that would be neat. I 
know I can do this with markup, but I do not want to add markup statements to 
noteValues! Do I need to set chordRootNamer somehow? Or is there another 
solution? Thanks for any advice.

\version "2.18.2"

globalDefs = {
  \clef "treble_8" 
  \key c \major
  \time 4/4
}

noteValues = {
  a4 a4 a8[ a8] a4 |
  a4 a4 a2 |
  a4 a8[ a8] a4 a4 |
  a2 a8[ a8] a4 \bar "|."
}

chordValues = \chordmode {
  % \set chordRootNamer = ???
  c1:7 f1:7 c1:7 c1:7 
}

\score { << 
  \new ChordNames {
\chordValues 
  }
  \new RhythmicStaff = "Timing" <<
  \new Voice = "Rhythm" {
\globalDefs
\omit RhythmicStaff.Fingering
\improvisationOn
\noteValues
  } % Rhythm Voice 
  >>
>> 
}

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


Intervalic Chord Names

2018-08-24 Thread Tom Swan

Hello. I need some help figuring out how to change chord names (C, F, G) into intervals such as (I, IV, V). The short example below displays a timing diagram for a melodic line, but I would also like to display the chords C7, F7 as generic intervals I7 IV7. Manually setting the text would okay -- I'm not looking for some kind of automatic translation, although that would be neat. I know I can do this with markup, but I do not want to add markup statements to noteValues! Do I need to set chordRootNamer somehow? Or is there another solution? Thanks for any advice.\version "2.18.2"globalDefs = { \clef "treble_8" \key c \major \time 4/4}noteValues = { a4 a4 a8[ a8] a4 | a4 a4 a2 | a4 a8[ a8] a4 a4 | a2 a8[ a8] a4 \bar "|."}chordValues = \chordmode { % \set chordRootNamer = ??? c1:7 f1:7 c1:7 c1:7 }\score { <<  \new ChordNames { \chordValues } \new RhythmicStaff = "Timing" << \globalDefs \new Voice = "Rhythm" { \globalDefs \omit RhythmicStaff.Fingering \improvisationOn \noteValues } % Rhythm Voice  >>>> }http://www.tomswan.com
 

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


Re: Chord \crossStaff question

2018-07-11 Thread Simon Albrecht

On 11.07.2018 10:05, Menu Jacques wrote:
The cross staff chord can actually be obtained with the code below, in 
which the upper part of the last two chords has been moved to the 
first staff ‘by hand' and rests set up accordingly,


The two actual voices are still independent from each other and no 
visible rests should be added to the LilyPond voice that merely serves 
for faking the cross-staff chords; use s instead. The top staff should 
only contain a \voiceOne R1 in that measure, as well as the four 
noteheads from cross-staff chords.


Best, Simon

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


Re: Chord \crossStaff question

2018-07-11 Thread Simon Albrecht

On 11.07.2018 10:05, Menu Jacques wrote:
Is one among the three scores above clearly preferable for a keyboard 
player?
And what if moving notes to the first staff conflicts with other music 
already present there?


Cross-staff chords are very rarely used in keyboard music and are 
definitely more difficult to read. If anything, it’s an outdated idea. 
(Rossini’s P.te Messe solennelle uses them extensively, for example, at 
least in the Urtext edition I have, which is probably modelled after the 
sources in that respect.)
However, IIUC this is about conversion of MusicXML, so I think it’s 
completely irrelevant what is preferable: if the cross-staff chords are 
explicitly coded as such in the MusicXML, then the task of the 
conversion tool is reproducing that faithfully regardless of typographic 
desirability. For example, there may be situations where it’s relevant 
semantically, e.g. to signify hand distribution. (Rossini is not like 
that, there they merely avoid ledger lines.)


Best, Simon

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


Re: Chord \crossStaff question

2018-07-11 Thread Jacques Menu Muzhic
Hello Rutger,

Fine, your solution is cleaner than the one I had come to.
I’ll make good use of that.

Thanks, and a nice day!

JM

> Le 11 juil. 2018 à 09:35, Rutger Hofman  a écrit :
> 
> Hi Jacques,
> 
> if you follow the instructions on cross-staff stems, you will arrive at 
> something like this:
> 
> \version "2.19.0"
> 
> \score {
>\new PianoStaff \with {
>\consists #Span_stem_engraver
>} <<
>\new Staff = RH <<
>{
>\clef treble
>R1
>}
>\new Voice \relative c'' {
>\autoBeamOff
>\voiceTwo
>\crossStaff {
>s4 c,8  s2 |
>}
>}
>>>
>\new Staff = LH <<
>\relative c {
>\clef bass
>\voiceTwo
>8 \change Staff = RH  \change Staff = LH  e g> g' r2 |
>}
>>>
>>>
> }
> 
> Rutger
> 
> On 10-07-18 23:16, Menu Jacques wrote:
>> Hello Mark,
>> That’s the example I was mentioning.
>> But in the image from Finale 2014, all pitched notes occur in the second 
>> staff, and I tried to achieve the same.
>> JM
>>> Le 10 juil. 2018 à 21:59, Mark Stephen Mrotek >> <mailto:carsonm...@ca.rr.com><mailto:carsonm...@ca.rr.com 
>>> <mailto:carsonm...@ca.rr.com>>> a écrit :
>>> 
>>> Menu Jackues
>>> Perhaps this can direct you
>>> http://lilypond.org/doc/v2.18/Documentation/notation/common-notation-for-keyboards#cross_002dstaff-stems
>>>  
>>> <http://lilypond.org/doc/v2.18/Documentation/notation/common-notation-for-keyboards#cross_002dstaff-stems>
>>> Mark
>>> *From:*lilypond-user 
>>> [mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org 
>>> <mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org>]*On Behalf 
>>> Of*Menu Jacques
>>> *Sent:*Tuesday, July 10, 2018 12:49 PM
>>> *To:*Lilypond-User Mailing List >> <mailto:lilypond-user@gnu.org> <mailto:lilypond-user@gnu.org 
>>> <mailto:lilypond-user@gnu.org>>>
>>> *Cc:*Menu Jacques mailto:imj-...@bluewin.ch> 
>>> <mailto:imj-...@bluewin.ch <mailto:imj-...@bluewin.ch>>>
>>> *Subject:*Chord \crossStaff question
>>> Hello folks,
>>> How can I modify the example below in order to obtain this score, with the 
>>> staff change on the last two chords:
>>> 
>>> instead of that one:
>>> 
>>> The example in the docs didn’t give me the solution.
>>> Thanks for your help!
>>> JM
>>> %%%
>>> 
>>> \version "2.19.82"
>>> 
>>> \version "2.19.58"
>>> % automatically converted by musicxml2ly from CrossStaffChord.xml_inter.xml
>>> 
>>> 
>>> PartPOneVoiceOne =  \relative c' {
>>>   \clef "treble" \key c \major \time 4/4 | % 1
>>>   R1 \bar "|."
>>> }
>>> 
>>> PartPOneVoiceTwo =  \relative c {
>>>   \clef "bass" \key c \major \time 4/4
>>>   8 [
>>>   \change Staff="1"
>>>   8
>>>   \change Staff="2"
>>>   8
>>>   \change Staff="2"
>>>   8
>>>   ]
>>>   \change Staff="2"
>>>   r2 \bar "|."
>>> }
>>> 
>>> 
>>> % The score definition
>>> \score {
>>>   <<
>>> 
>>> \new PianoStaff
>>> <<
>>> 
>>>   \context Staff = "1" <<
>>> \mergeDifferentlyDottedOn\mergeDifferentlyHeadedOn
>>> \context Voice = "PartPOneVoiceOne" {  \PartPOneVoiceOne }
>>>   >> \context Staff = "2" <<
>>> \mergeDifferentlyDottedOn\mergeDifferentlyHeadedOn
>>> \context Voice = "PartPOneVoiceTwo" {  \PartPOneVoiceTwo }
>>>   >>
>>> >>
>>> 
>>>   >>
>>>   \layout {}
>>>   % To create MIDI output, uncomment the following line:
>>>   %  \midi {\tempo 4 = 100 }
>>> }
>>> 
>>> ___
>>> lilypond-user mailing list
>>> lilypond-user@gnu.org <mailto:lilypond-user@gnu.org> 
>>> <mailto:lilypond-user@gnu.org <mailto:lilypond-user@gnu.org>>
>>> https://lists.gnu.org/mailman/listinfo/lilypond-user 
>>> <https://lists.gnu.org/mailman/listinfo/lilypond-user>
> 
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org <mailto:lilypond-user@gnu.org>
> https://lists.gnu.org/mailman/listinfo/lilypond-user 
> <https://lists.gnu.org/mailman/listinfo/lilypond-user>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


<    1   2   3   4   5   6   7   8   9   10   >