Re: how to add barre indications to automatic fret diagrams?

2015-05-27 Thread pls

On 26.05.2015, at 23:58, Carl Sorensen c_soren...@byu.edu wrote:

 
 Let's try again.  I have checked this version; it has the warning code.

Yes, it does.  Looks very good to me!

Thanks a lot,

patrick


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


Re: how to add barre indications to automatic fret diagrams?

2015-05-26 Thread pls

On 26.05.2015, at 04:34, Carl Sorensen c_soren...@byu.edu wrote:

 On 5/25/15 5:25 AM, pls p.l.schm...@gmx.de wrote:
 
 Works great!  Thanks a million!
 
 Thanks for your feedback.
 
 
 Should/Could LilyPond issue a warning message in the case of open strings
 whenever wrong fingers (not 0) are ignored?  Or is it better to
 silently set the fingers to 0?
 Example: d-1 a d' f¹ (Perhaps the user simply forgot to set the minimum
 fret to 5)
 
 Here's a new patch that has the warning implemented.  Give it a try.
 You'll need to rename it, I think.

It doesn’t seem to have any effect.  I used these test cases:

\new FretBoards {
  f,-1 c-3 f-4 a-2 c'-1 f'-11 % this works
  d-1 a d' f’ % finger is set to zero, no warning!
}

I’m sorry to ask but I checked the translation-function files several times: 
Did you inadvertently send me an unchanged file? diff did not show any 
difference between this file and the last file.

Thanks for your help!

patrick


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


Re: how to add barre indications to automatic fret diagrams?

2015-05-26 Thread Carl Sorensen


On 5/26/15 2:44 AM, pls p.l.schm...@gmx.de wrote:


I¹m sorry to ask but I checked the translation-function files several
times: Did you inadvertently send me an unchanged file? diff did not show
any difference between this file and the last file.

If diff didn't how the difference, then there must not have been one.

Let's try again.  I have checked this version; it has the warning code.

Thanks,

Carl





translation-functions[2].scm
Description: translation-functions[2].scm
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: how to add barre indications to automatic fret diagrams?

2015-05-25 Thread pls

On 25.05.2015, at 01:16, Carl Sorensen c_soren...@byu.edu wrote:

 On 5/23/15 11:59 PM, pls p.l.schm...@gmx.de wrote:
 
 \transpose f g { f,-1 c-3 f-4 a-2 c'-1 f'-11 }
 
 Here's a revised version of translation-functions.scm.  It will generate
 barres only if fingers are indicated, and multiple strings use the same
 finger.  It does work properly on the chord you listed above.
 
 It does not generate barres on transposed open chords.
 
 Please review and let me know what you think.

Works great!  Thanks a million!

Should/Could LilyPond issue a warning message in the case of open strings 
whenever wrong fingers (not 0) are ignored?  Or is it better to silently set 
the fingers to 0? 
Example: d-1 a d' f’ (Perhaps the user simply forgot to set the minimum fret 
to 5)

Thanks again,

patrick


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


Re: how to add barre indications to automatic fret diagrams?

2015-05-25 Thread Carl Sorensen
On 5/25/15 5:25 AM, pls p.l.schm...@gmx.de wrote:

Works great!  Thanks a million!

Thanks for your feedback.


Should/Could LilyPond issue a warning message in the case of open strings
whenever wrong fingers (not 0) are ignored?  Or is it better to
silently set the fingers to 0?
Example: d-1 a d' f¹ (Perhaps the user simply forgot to set the minimum
fret to 5)

Here's a new patch that has the warning implemented.  Give it a try.
You'll need to rename it, I think.

Thanks,

Carl



translation-functions[1].scm
Description: translation-functions[1].scm
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: how to add barre indications to automatic fret diagrams?

2015-05-24 Thread Carl Sorensen
On 5/23/15 11:59 PM, pls p.l.schm...@gmx.de wrote:



 
 Maybe I should back the code back to where a barre will be indicated
only
 if the fingers are specified in the chord, and no barre will be
generated
 when an open chord is transposed.  That would be a straightforward fix.
 It would never generate any surprising results, because it would only
 generate barres that the user had entered by indicating that multiple
 notes should be played with the same finger.
 
 What do you think?

Sounds reasonable.  Would something like this work?

\transpose f g { f,-1 c-3 f-4 a-2 c'-1 f'-11 }

Here's a revised version of translation-functions.scm.  It will generate
barres only if fingers are indicated, and multiple strings use the same
finger.  It does work properly on the chord you listed above.

It does not generate barres on transposed open chords.

Please review and let me know what you think.

Thanks,

Carl



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


Re: how to add barre indications to automatic fret diagrams?

2015-05-24 Thread pls

On 23.05.2015, at 22:06, Carl Sorensen c_soren...@byu.edu wrote:

 
 
 On 5/23/15 6:34 AM, pls p.l.schm...@gmx.de wrote:
 
 
 Here is another test case for your patch:
 
 \version 2.19.20
 
 
 \new FretBoards {
   d-1 a c'-1 fis' a'-11
   g,-1 d f-1 b d'-1 g'-11
   \transpose g a { g,-1 d f-1 b d'-1 g'-11 }
 }
 
 
 These chords can be played with one finger! ;)
 
 So what do you recommend be done?
 
 I can make it so no fingerings are added, and then diagrams that are not
 completely fingered will show dots that have a finger of 0 (that's the way
 I started).  It seemed to me that having a finger of 0 is confusing.

Agreed.

 Also, by far the most common barre is with the first finger.  So allowing
 an open chord to be transposed to a barre chord with a first finger barre
 seemed useful.

Agreed.

 
 I don't have an algorithm to figure out fingering.  The .ly file explains
 exactly how the implemented fingering algorithm works.  It assumes that
 multiple notes played on the same fret with no fingering should be
 represented as a barre with the first finger.  That's all it does.

Yes, again no lack of clarity in your .ly file and still I fell into the trap 
when I tried to quickly cook up a minimal example for a bug report.  Sorry for 
my useless test case.

 
 If the user specifies fingerings that don't work right with the algorithm,
 they won't work right.

Sounds fair to me because I consider your algorithm to be very useful but it 
would most certainly lead to a lot of complaints/bug reports (see above!)...

 
 Maybe I should back the code back to where a barre will be indicated only
 if the fingers are specified in the chord, and no barre will be generated
 when an open chord is transposed.  That would be a straightforward fix.
 It would never generate any surprising results, because it would only
 generate barres that the user had entered by indicating that multiple
 notes should be played with the same finger.
 
 What do you think?

Sounds reasonable.  Would something like this work?

\transpose f g { f,-1 c-3 f-4 a-2 c'-1 f'-11 }

(At the moment it generates a false additional barre indicator.)

If yes, I’d say it’s a very good compromise.

Thanks for your work  patience!

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


Re: how to add barre indications to automatic fret diagrams?

2015-05-23 Thread Carl Sorensen


On 5/23/15 6:34 AM, pls p.l.schm...@gmx.de wrote:


Here is another test case for your patch:

\version 2.19.20


  \new FretBoards {
d-1 a c'-1 fis' a'-11
g,-1 d f-1 b d'-1 g'-11
\transpose g a { g,-1 d f-1 b d'-1 g'-11 }
  }


These chords can be played with one finger! ;)

So what do you recommend be done?

I can make it so no fingerings are added, and then diagrams that are not
completely fingered will show dots that have a finger of 0 (that's the way
I started).  It seemed to me that having a finger of 0 is confusing.
Also, by far the most common barre is with the first finger.  So allowing
an open chord to be transposed to a barre chord with a first finger barre
seemed useful.

I don't have an algorithm to figure out fingering.  The .ly file explains
exactly how the implemented fingering algorithm works.  It assumes that
multiple notes played on the same fret with no fingering should be
represented as a barre with the first finger.  That's all it does.

If the user specifies fingerings that don't work right with the algorithm,
they won't work right.

Maybe I should back the code back to where a barre will be indicated only
if the fingers are specified in the chord, and no barre will be generated
when an open chord is transposed.  That would be a straightforward fix.
It would never generate any surprising results, because it would only
generate barres that the user had entered by indicating that multiple
notes should be played with the same finger.

What do you think?

Carl





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


Re: how to add barre indications to automatic fret diagrams?

2015-05-23 Thread pls

On 23.05.2015, at 06:22, Carl Sorensen c_soren...@byu.edu wrote:

 
 + some frequently used chords are missing, such as m7.5- and suspended
 chords. (I know of course from my own experience that predefined fret
 diagram tables unfortunately are never complete.)
 
 m7.5- is not commonly used in  US consumer-grade pop charts, but I'd be
 happy to add them.  

Hm, m7.5- probably isn't used very often in pop music.  But in jazz music it 
definitely is a very common chord. 

 Suspended chords are also not commonly used in US
 consumer-grade pop charts.

Hm, being a guitar teacher quite a few more or less popular songs containing 
suspended chords pop into my mind:

+ All Of Me (John Legend)
+ Fireflies (Owl City)
+ Wonderwall (Oasis)
+ Stairway To Heaven (Led Zeppelin)
+ Brothers In Arms (Dire Straits)
+ You Take My Breath Away (Eva Cassidy)
+ Dreamer (Ozzy Osbourne)
+ How You Remind Me (Nickelback)
+ Underneath Your Clothes (Shakira)
+ To Be With You (Mr. Big)
+ Come As You Are (Nirvana)
+ Behind Blue Eyes (The Who/Limp Biskit)
+ Bubbly (Colbie Caillat)
+ Dear Mr. President (Pink)
+ Sweet Home Alabama (Lynyrd Skynyrd)
+ Viva la Vida (Coldplay)
+ Wake Me Up When September Ends (Green Day)
+ When You Say Nothing At All (Garth Brooks/Ronan Keating/Allison Krauss)
+ You’re Beautiful (James Blunt)
+ Your Body Is A Wonderland (John Mayer)
+ Born To Run (Bruce Springsteen)

I’d suspect that this list is not exhaustive and that these examples are not 
rare exceptions. ;)

 
 + some rare ³unacceptable² diagrams which can be easily fixed by
 assigning note(s) to a string.
 + problems arising from trying to transpose/shift diagrams potentially
 containing fingerings and or string numbers (as discussed here)
 
 String numbers should be consistent as you transpose diagrams within a
 given shape, I think.  Have you found any case where they don't work?

No, actually I haven’t.  I thought string numbers would interfere with 
predefined diagrams.  They don’t.  LilyPond simply ignores them.  

In the case of transposing automatically-generated diagrams LilyPond might 
throw some warnings ‘Ignoring string request and recalculating’  but the 
resulting diagram is fine, e.g.:

stringedA = a,\5 e\4 a\3 cis'\2 e'\11
\new FretBoards {
  \stringedA
  \transpose a e { \stringedA }
}

 
 Fingers should be OK as well, as long as you finger for the barre chord.

Yes, they basically are.  I alluded to the problem we already discussed: 
LilyPond can’t guess which fingers should be used in a chord, e.g.:

fingeredA = a, e-3 a-3 cis'-3 e'1
\new FretBoards {
  \fingeredA
  \transpose a e { \fingeredA } %wrong fingering
}

 
 These are basically the reasons why I started to make my own predefined
 fret diagram tables a few years ago (see
 https://github.com/Philomelos/lilypond-predefined-fretboards).  I haven¹t
 found the time to document it yet and there are only just a few test
 files currently available.  The definitions are spread over 6 files:
 + c-shape.ly http://c-shape.ly
 + a-shape.ly http://a-shape.ly
 + g-shape.ly http://g-shape.ly
 + e-shape.ly http://e-shape.ly
 + d-shape.ly http://d-shape.ly
 + alt-shape.ly http://alt-shape.ly (contains alternative chord shapes
 that cannot be included in the five basic shape files for technical
 reasons or due to their ambiguity)
 
 You can include these files as usual and then use 6 new commands
 (\cShape, \aShape, \gShape, \eShape, \dShape, and \altShape) to choose a
 diagram derived from one of the five basic chord shapes, so e.g.
 + \chordmode { \aShape c,:1.5.8.10 } or \notemode { c g c¹ e¹ }
 returns a c major barre chord across the 3rd fret
 + \chordmode { \eShape c,:1.5.8.10 } or \notemode { c g c¹ e¹ }
 returns a c major chord at the 8th fret (on the strings 6, 5, 4, and 3)
 + \chordmode { \dShape c:1.5.8.10 } or \notemode { c¹ g¹ c¹¹ e¹¹ }
 returns a c major chord at the 10th fret (on the strings 4, 3, 2, and 1)
 
 You need to enter all the pitches you want to include in your diagram.
 If there is a definition for the chord you should get the expected
 diagram including fingerings and a barre indicator (if necessary).  You
 don¹t need to manually add fingerings or string numbers.  So there are no
 problems with shape shifting and transpositions.  If you don¹t like a
 detail: don¹t use this definition or override it!
 You can use other definition files in combination. You can switch the
 definition files on and off by using \predefinedFretboardsOn and
 \predefinedFretboardsOff (as usual).  If the tables don¹t contain a
 definition for a certain chord structure (or if the chord structure or
 the octave is impossible in standard tuning) LilyPond jumps in and tries
 to automatically generate a diagram.
 
 The tables already contain a couple of hundred transposable definitions
 (even some inversions) but of course the library is far from being
 complete.  The reason why I started this thread here was to check whether
 it makes sense to continue the work on this library or maybe just use
 

Re: how to add barre indications to automatic fret diagrams?

2015-05-23 Thread pls

On 23.05.2015, at 06:22, Carl Sorensen c_soren...@byu.edu wrote:

 
 + some chords lead to unwanted barre indicators, e.g.:
 + d-1 a d¹ f¹ or
 + e, b,-3 e-3 gis-3 b e¹ (wrong fingers!)
 
 I will look into those.  Thanks.

Here is another test case for your patch:

\version 2.19.20


  \new FretBoards {
d-1 a c'-1 fis' a'-11
g,-1 d f-1 b d'-1 g'-11
\transpose g a { g,-1 d f-1 b d'-1 g'-11 }
  }


These chords can be played with one finger! ;)

hth
patrick


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


Re: how to add barre indications to automatic fret diagrams?

2015-05-22 Thread Carl Sorensen


On 5/22/15 9:30 AM, pls p.l.schm...@gmx.de wrote:


Yes, I have some issues with the predefined fretboards shipped with
LilyPond, e.g.:
+ the resulting diagrams are not always predictable:
  + the number of notes in the diagrams varies from 4 to 6 even when you
enter a three-note chord modifier like \chordmode { e:m e,:m e:1.3-.5
e,:1.3-.5 }  or e g b e' g' b' .  I know it¹s meant to make chord
entries as easy as possible but it¹s not exactly WYGIWYM and it leads to
a different interpretation of these examples in different contexts.  In a
FretBoards context and (therefore) a TabStaff context all six examples
are interpreted as the same six-note chord e, b, e g b e¹ even though
neither the chord structure nor the absolute octaves are in line with
this interpretation whereas in a Staff context the chord structures, the
number of notes, and the octaves are displayed correctly/as defined.
This means that in this case it would be necessary to define two
different chord variables, one for the Staff context and one for the
FretBoards/TabStaff context which seems a bit cumbersome to me.

Yes, this is true.  The chord shapes were chosen to be the most common
shapes for those chords in U.S. pop music books.  The number of notes in
the fret diagram is unrelated to the number of notes in the chord.  It's
absolutely and definitely incorrect as an exact representation of the
notes in the chord.  For such usage, either a custom fretboard or an
automatic fretboard is the way to go.

  + the chord shapes vary depending on the octaves (I know, they were
chosen to be simple in form and easy to play but more often than not the
changing shapes really surprise me.)

The reason they change depending on the octaves is to allow alternate
patterns.  This is consistent with the separation of the fretboards from
the notes in the chords.  Again, it is chosen to be consistent with common
pop music  use in the U.S.

  + quite a lot of chords are displayed in their first inversion instead
of their root position as suggested by their modifiers (Again, I know /
can see the reasons: avoiding barre chords, preference for the upper four
strings, playability/³strummability² ;) but the output is nevertheless
unexpected.)

Agreed.

 
  + some chord shapes/structures are wrong, e.g. (I haven¹t checked all
of them yet and I haven¹t found time to post a bug report.):
+ dis:m (fis ais dis¹ eis¹ instead of fis ais dis¹ fis') and es:m
(es bes es¹ f' instead of es bes es¹ ges¹).
+ f+ (dis aisis dis¹ fisis¹ instead of cisis ais cisis¹ fis¹ or
even better (root position) fis ais cisis¹ fis¹)

Thank you for pointing this out.  I'm happy to fix them.  dis:m and es:m
will both be wrong, because they are both defined from the same base
shape.  I'll fix the base shape.

+ some frequently used chords are missing, such as m7.5- and suspended
chords. (I know of course from my own experience that predefined fret
diagram tables unfortunately are never complete.)

m7.5- is not commonly used in  US consumer-grade pop charts, but I'd be
happy to add them.  Suspended chords are also not commonly used in US
consumer-grade pop charts.

+ inversions are missing (Slash chords)
+ as discussed: the lack of being able to shift the same chord shape up
and down the fretboard.

When defining your own predefined diagrams, shifting a chord shape up and
down the fretboard is easy.



LilyPond¹s automatically-generated fret diagrams solve almost all of the
above issues. The only drawbacks I can see are:
+ the missing barre indications (which you fixed in the meantime! Thank
you very much!)

You're welcome.

+ some rare ³unacceptable² diagrams which can be easily fixed by
assigning note(s) to a string.
+ problems arising from trying to transpose/shift diagrams potentially
containing fingerings and or string numbers (as discussed here)

String numbers should be consistent as you transpose diagrams within a
given shape, I think.  Have you found any case where they don't work?

Fingers should be OK as well, as long as you finger for the barre chord.

+ the need to customize the fret diagrams over and over again (for each
new score)

Yes.  You could use an include file, though, I think.  An include file
could define every chord you wanted to use in terms of a chord with
strings and fingering that are demonstrated create good automatic
fretboards.


These are basically the reasons why I started to make my own predefined
fret diagram tables a few years ago (see
https://github.com/Philomelos/lilypond-predefined-fretboards).  I haven¹t
found the time to document it yet and there are only just a few test
files currently available.  The definitions are spread over 6 files:
+ c-shape.ly http://c-shape.ly
+ a-shape.ly http://a-shape.ly
+ g-shape.ly http://g-shape.ly
+ e-shape.ly http://e-shape.ly
+ d-shape.ly http://d-shape.ly
+ alt-shape.ly http://alt-shape.ly (contains alternative chord shapes
that cannot be included in the five basic shape files for technical
reasons or due to 

Re: how to add barre indications to automatic fret diagrams?

2015-05-22 Thread pls

On 22.05.2015, at 01:43, Carl Sorensen c_soren...@byu.edu wrote:

 I am now speaking solely in LilyPond internals terms.  When \transpose is
 applied to a chord, it changes the pitches of the chord, but does not
 change the fingerings.  And there is no reasonable system I can imagine
 that would allow \transpose to do the right thing on both chords and
 single notes, relative to fingerings.  So \transpose is almost guaranteed
 *not* to work effectively on automatically-generated fret diagrams.

Understood!

 
 That is *why* there is a predefined fretboard capability defined in
 LilyPond.  You are free to define the set of chords you want to work with,
 complete with fingerings.  And if you do that, the predefined fretboards
 will work *exactly* the way you want them to work when you transpose.
 
 As part of the predefined fretboard code, to make it easy to define
 fretboards, we have the concept of a chord shape (e.g. E-shape, A-shape,
 D-shape).  And we can define other chords as these shapes shifted by a
 certain number of frets.  That is what I meant by shape shifting.  Not
 changing shapes, but moving a shape along the fretboard by a given number
 of frets.  I apologize for my lack of clarity.

I can’t see any lack of clarity on your side.  The concept of shape shifting is 
very familiar to me (both instrument- and notation-wise).
It’s actually me who wasn’t clear here.  I’m sorry for lumping together several 
problems.

 
 In the current usage of predefined-guitar-fretboards, we actually don't
 use E-shape, because it is missing the barre.  So we use F-shape (which
 has the barre) and then slide it along the fretboard wherever we want to
 go, to get F#, G, G#, etc.  Same with A-shape.  We use bes-shape (because
 it has the barre) and then slide it along the fretboard.

Understood.

 
 The predefined fretboards are really quite robust to LilyPond
 transposition, meaning you can apply \transpose to a music expression
 going to a FretBoards context, and it will give you what you want.  The
 only problem is if you don't like the predefined fretboards, you'll have
 to make your own predefined fret diagram table, but that is a one-time
 thing.

Yes, I have some issues with the predefined fretboards shipped with LilyPond, 
e.g.:
+ the resulting diagrams are not always predictable:
  + the number of notes in the diagrams varies from 4 to 6 even when you enter 
a three-note chord modifier like \chordmode { e:m e,:m e:1.3-.5 e,:1.3-.5 }  or 
e g b e' g' b' .  I know it’s meant to make chord entries as easy as 
possible but it’s not exactly WYGIWYM and it leads to a different 
interpretation of these examples in different contexts.  In a FretBoards 
context and (therefore) a TabStaff context all six examples are interpreted as 
the same six-note chord e, b, e g b e’ even though neither the chord 
structure nor the absolute octaves are in line with this interpretation whereas 
in a Staff context the chord structures, the number of notes, and the octaves 
are displayed correctly/as defined.  This means that in this case it would be 
necessary to define two different chord variables, one for the Staff context 
and one for the FretBoards/TabStaff context which seems a bit cumbersome to me.
  + the chord shapes vary depending on the octaves (I know, they were chosen to 
be simple in form and easy to play but more often than not the changing shapes 
really surprise me.)
  + quite a lot of chords are displayed in their first inversion instead of 
their root position as suggested by their modifiers (Again, I know / can see 
the reasons: avoiding barre chords, preference for the upper four strings, 
playability/“strummability” ;) but the output is nevertheless unexpected.) 
  + some chord shapes/structures are wrong, e.g. (I haven’t checked all of them 
yet and I haven’t found time to post a bug report.):
+ dis:m (fis ais dis’ eis’ instead of fis ais dis’ fis') and es:m (es 
bes es’ f' instead of es bes es’ ges’). 
+ f+ (dis aisis dis’ fisis’ instead of cisis ais cisis’ fis’ or even 
better (root position) fis ais cisis’ fis’)
+ some frequently used chords are missing, such as m7.5- and suspended chords. 
(I know of course from my own experience that predefined fret diagram tables 
unfortunately are never complete.)
+ inversions are missing (Slash chords)
+ as discussed: the lack of being able to shift the same chord shape up and 
down the fretboard.

LilyPond’s automatically-generated fret diagrams solve almost all of the above 
issues. The only drawbacks I can see are:
+ the missing barre indications (which you fixed in the meantime! Thank you 
very much!)
+ some rare “unacceptable” diagrams which can be easily fixed by assigning 
note(s) to a string. 
+ problems arising from trying to transpose/shift diagrams potentially 
containing fingerings and or string numbers (as discussed here)
+ the need to customize the fret diagrams over and over again (for each new 
score)

These are basically the reasons why I 

Re: how to add barre indications to automatic fret diagrams?

2015-05-21 Thread pls

On 21.05.2015, at 02:44, Thomas Morley thomasmorle...@gmail.com wrote:

 2015-05-20 13:16 GMT+02:00 pls p.l.schm...@gmx.de:
 
 
 Begin forwarded message:
 
 From: pls p.l.schm...@gmx.de
 Subject: Re: how to add barre indications to automatic fret diagrams?
 Date: 20. Mai 2015 13:12:30 MESZ
 To: Stephen MacNeil classicalja...@gmail.com
 
 Hi Stephen,
 On 20.05.2015, at 13:02, Stephen MacNeil classicalja...@gmail.com wrote:
 
 sorry forgot one
 
 \version 2.18.2
 barre = #(define-music-function (barre location str ) (number?)
 #{
 \once \override FretBoard.before-line-breaking =
 #(lambda (grob)
 ;(display (ly:grob-property grob 'dot-placement-list))
 (ly:grob-set-property! grob 'dot-placement-list
 (cons `(barre 6 1 ,str) (ly:grob-property grob 'dot-placement-list
 
 #})
 fMajorEShape = { f,-1 c-3 f-4 a-2 c'-1 f'-1 }
 gMajorEShape = { \transpose f g { \fMajorEShape } }
 
 \new FretBoards {
 \barre #3
 \transpose f g { \fMajorEShape }
 \barre #4
 \gMajorEShape
 \barre #3
 g,-1 d-3 g-4 b-2 d'-1 g'-1
 \set FretBoards.minimumFret = #3
 \barre #4
 \gMajorEShape
 }
 
 
 Yes, that’s what I was looking for! Thank you very much! I cleaned it up a
 little bit to get rid of some unnecessary bits and pieces (and to make it
 easier to understand what it does):
 
 \version 2.19.15
 
 barre = #(define-music-function (bend location str ) (number?)
  #{
\once \override FretBoard.before-line-breaking =
#(lambda (grob)
   ;(display (ly:grob-property grob 'dot-placement-list))
   (ly:grob-set-property! grob 'dot-placement-list
 (cons `(barre 6 1 ,str) (ly:grob-property grob
 'dot-placement-list
  #})
 
 fMajorEShape = { f,-1 c-3 f-4 a-2 c'-1 f'-1 }
 
 \new FretBoards {
 \barre #1
 \fMajorEShape
 \barre #3
 \transpose f g { \fMajorEShape }
 \barre #5
 \transpose f a { \fMajorEShape }
 \barre #7
 \transpose f b { \fMajorEShape }
 }
 
 Thanks again!
 patrick
 
 
 More automated:
 
 \version 2.19.15
 
 \new FretBoards
 \transpose c d
 {
 
 \override FretBoard.before-line-breaking =
 #(lambda (grob)
   (let* ((dots-list (ly:grob-property grob 'dot-placement-list))
  (fingered-frets
(filter
  (lambda (d)
(and (eq? 'place-fret (car d)) (= (length d) 4)))
dots-list))
  ;; TODO do better mapping, loop or the like!
  (finger-1
(filter
  (lambda (f) (and (number? (last f)) (= (last f) 1)))
  fingered-frets))
  (finger-2
(filter
  (lambda (f) (and (number? (last f)) (= (last f) 2)))
  fingered-frets))
  (finger-3
(filter
  (lambda (f) (and (number? (last f)) (= (last f) 3)))
  fingered-frets))
  (finger-4
(filter
  (lambda (f) (and (number? (last f)) (= (last f) 4)))
  fingered-frets))
  (barre-1
(if ( (length finger-1) 1)
(let* ((strgs
 (sort (map cadr finger-1) ))
 )
  (list 'barre (car strgs) (last strgs) (third (car 
 finger-1
'()))
  (barre-2
(if ( (length finger-2) 1)
(let* ((strgs
 (sort (map cadr finger-2) ))
 )
  (list 'barre (car strgs) (last strgs) (third (car 
 finger-2
'()))
  (barre-3
(if ( (length finger-3) 1)
(let* ((strgs
 (sort (map cadr finger-3) ))
 )
  (list 'barre (car strgs) (last strgs) (third (car 
 finger-3
'()))
  (barre-4
(if ( (length finger-4) 1)
(let* ((strgs
 (sort (map cadr finger-4) ))
 )
  (list 'barre (car strgs) (last strgs) (third (car 
 finger-4
'()))
  (barres
(filter
  (lambda (l)
(not (null? l)))
  (list barre-1 barre-2 barre-3 barre-4
 
 (ly:grob-set-property! grob 'dot-placement-list
(append
  barres
  dots-list
 
  f,-1 c-3 f-4 a-2 c'-1 f'-1
 
  \override Score.RehearsalMark.self-alignment-X = #LEFT
  \mark
  \markup
\fontsize #-6 \column { transposing this one, will be strange ofc }
  a, e-1 a-1 cis'-2 e'
 
  bes,-1 f-2 bes-3 d'-4 f'-1
 
  a,-2 d-2 fis-1 c'-3 e'-3 a'-3
 }
 

Nice! Thanks a lot.

Yes, transposing chords with open strings probably poses a problem.  Fingering 
information would have to be included automatically in order to decide whether 
they should be part of a barre.  I’d think it’s safe to assume that transposed 
open strings in chords will always be played with the first finger.

Carl has already added a feature request 
(https://code.google.com/p/lilypond/issues/detail?id

Re: how to add barre indications to automatic fret diagrams?

2015-05-21 Thread Carl Sorensen
On 5/21/15 1:30 AM, pls p.l.schm...@gmx.de wrote:


Nice! Thanks a lot.

Yes, transposing chords with open strings probably poses a problem.
Fingering information would have to be included automatically in order to
decide whether they should be part of a barre.  I¹d think it¹s safe to
assume that transposed open strings in chords will always be played with
the first finger.

For right now, transposing chords with open strings will leave the strings
open.  Transposing doesn't affect fingering, only pitches.

I'm actually OK with that.  An E chord (with open 6, 2, and 1) is a
different shape from an F chord (with barred 6, 2, and 1) in my opinion.
Yes, the pattern on strings 3, 4, and 5 is the same.  But the hand pattern
on the chord is different.

I thought about this issue quite a bit when I was creating predefined fret
diagrams.  There, we introduced the idea of a chord shape.  There is a
function that shifts a chord shape by N frets (offset-fret).  At present,
it adds N to the fret number for every dot.  I thought about setting the
fret number to N for every open string, but elected not to do it because I
wouldn't know what to do with the finger.  I guess it's possible to set it
to 1.

The fundamental issue that causes the problem is that a fingering of 0 not
only sets a finger, but also a fret.

However, you can easily fix this yourself in your chords that request
automatic fret diagrams.  Set the finger to 1, and if the automatic
diagram asks for a fret of 0, it will automatically change it to zero.

\new FretBoards {
  e,-1 b,-3 e-4 gis-2 b-1  e'-11
  \transpose e f e,-1 b,-3 e-4 gis-2 b-1  e'-11
  f,-1 c-3 f-4 a-2 c'-1 f'-11
  \transpose f e  f,-1 c-3 f-4 a-2 c'-1 f'-11
   
  }

Thanks,

Carl



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


Re: how to add barre indications to automatic fret diagrams?

2015-05-21 Thread pls

On 21.05.2015, at 15:10, Carl Sorensen c_soren...@byu.edu wrote:

 On 5/21/15 1:30 AM, pls p.l.schm...@gmx.de wrote:
 
 
 Nice! Thanks a lot.
 
 Yes, transposing chords with open strings probably poses a problem.
 Fingering information would have to be included automatically in order to
 decide whether they should be part of a barre.  I¹d think it¹s safe to
 assume that transposed open strings in chords will always be played with
 the first finger.
 
 For right now, transposing chords with open strings will leave the strings
 open.  Transposing doesn't affect fingering, only pitches.
 
 I'm actually OK with that.  An E chord (with open 6, 2, and 1) is a
 different shape from an F chord (with barred 6, 2, and 1) in my opinion.
 Yes, the pattern on strings 3, 4, and 5 is the same.  But the hand pattern
 on the chord is different.

Yes, the hand pattern is slightly different but nevertheless F is an E chord 
shape moved up by one fret.  The very popular CAGED system claims that there 
are only five basic open chord shapes: C, A, G, E, and D.  All other chords 
shapes can be derived from these five basic shapes.

 
 I thought about this issue quite a bit when I was creating predefined fret
 diagrams.  There, we introduced the idea of a chord shape.  There is a
 function that shifts a chord shape by N frets (offset-fret).  At present,
 it adds N to the fret number for every dot.  I thought about setting the
 fret number to N for every open string, but elected not to do it because I
 wouldn't know what to do with the finger.  I guess it's possible to set it
 to 1.

I would argue that it would make a lot of sense to set the fret number to N 
for every open string” and to automatically add a barre indication when 
transposing open chord shapes.  Otherwise these resulting diagrams look really 
daunting and unplayable.

 
 The fundamental issue that causes the problem is that a fingering of 0 not
 only sets a finger, but also a fret.
 
 However, you can easily fix this yourself in your chords that request
 automatic fret diagrams.  Set the finger to 1, and if the automatic
 diagram asks for a fret of 0, it will automatically change it to zero.
 
 \new FretBoards {
  e,-1 b,-3 e-4 gis-2 b-1  e'-11
  \transpose e f e,-1 b,-3 e-4 gis-2 b-1  e'-11
  f,-1 c-3 f-4 a-2 c'-1 f'-11
  \transpose f e  f,-1 c-3 f-4 a-2 c'-1 f'-11
 
  }

Ah, thank you, I didn’t know that. It’s a clever trick but I don’t think I 
would really like to use it in practice because it messes with the fingerings 
of open chord shapes.  In this case I’d rather prefer to use a “manual” \barre 
function when transposing fretboards with correct fingerings.

Thanks for your help!
patrick


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


Re: how to add barre indications to automatic fret diagrams?

2015-05-21 Thread pls

On 21.05.2015, at 21:06, Carl Sorensen c_soren...@byu.edu wrote:

 
 
 On 5/21/15 8:39 AM, pls p.l.schm...@gmx.de wrote:
 
 
 I thought about this issue quite a bit when I was creating predefined
 fret
 diagrams.  There, we introduced the idea of a chord shape.  There is a
 function that shifts a chord shape by N frets (offset-fret).  At
 present,
 it adds N to the fret number for every dot.  I thought about setting the
 fret number to N for every open string, but elected not to do it
 because I
 wouldn't know what to do with the finger.  I guess it's possible to set
 it
 to 1.
 
 I would argue that it would make a lot of sense to set the fret number
 to N for every open string² and to automatically add a barre indication
 when transposing open chord shapes.  Otherwise these resulting diagrams
 look really daunting and unplayable.
 
 There is a difference between transposing and shape shifting.
 
 Shape shifting is done on chord shapes, rather than music.  It would be
 trivial to set the fret to N and the finger to 1 when shifting a chord
 shape.  I think that probably makes sense to do.
 
 Transposing doesn't work on chord shapes.  Transposing works on notes.
 The automatic fretboard creator looks at the notes and creates a
 fretboard.  At that point, it has no knowledge of a chord shape, so we
 can't do the shape shifting algorithm there.

Ah, ok, now I’m beginning to understand the problem.  The line between 
transposing and shape shifting is sometimes very thin, though.  (The notes of) 
Some chord structures like e.g. 1.3.5.8.10.15 (G shape) or 1.5.8.10.12.15 (E 
shape) cannot be transposed without also shifting and thus keeping their 
shapes.  Transposing the notes of other chord structures like 1.5.8.10 could 
mean using either the same shape (shape shifting) or switching to at least one 
(sometimes two) alternative shape(s) (A shape, D shape, E shape)

 
 Do you represent an E chord as
 
 e, b,-3 e-4 gis-2 b e'
 or
 e,-0 b,-3 e-4 gis-2 b-0 e'-c ?
 
 If the latter, you will get a warning when you try to transpose the chord,
 because you're asking for open strings, and the transposed notes don't
 work on open strings.  It makes for an incorrect diagram, with the finger
 listed as 0 and a dot on the fret corresponding to the transposition.
 
 \new FretBoards {
 e,-0 b,-3 e-4 gis-2 b-0 e'-01
 \transpose e f e,-0 b,-3 e-4 gis-2 b-0 e'-01
 }
 
 
 
 If you use the former notation, you get an incomplete fretboard when you
 transpose the code,
 because you:
 
 1) Don't have the barre indicator
 2) Don't have the finger listed for the barred notes
 
 However, you don't get the warning, and you don't have the inconsistency
 of asking for an open string and showing a dot simultaneously.
 
 \new FretBoards {
 e, b,-3 e-4 gis-2 b  e'1
 \transpose e f e, b,-3 e-4 gis-2 b  e'1
 
  }

Hm, I’d either use e,-0 b,-3 e-4 gis-2 b-0 e’-0 or (even more likely) e,-0 
b,-2 e-3 gis-1 b-0 e’-0, the latter making it even more complicated! When 
transposing this open chord to a barred chord all fingers would have to be 
raised by 1.

 
 It would be possible to employ some code like the following:
 
 If (some notes have fingers given) and
   (there is more than one dot on the lowest fret in the diagram)
 then
   make a barre on the lowest fret and set the fingering of all the dots
 on the lowest fret to 1
 
 Or alternatively 
 
 If (some notes have fingers given) and
   (a note has a finger of 0 and a fret = 1)
 then
   give that note a finger of 1
 
 If (we have more than one note with the same finger)
 then
   make a barre from the lowest note to the highest note on that finger
 
 
 
 Do you think either of these algorithms would do what you want?

They both sound fine to me!  Are they mutually exclusive? I’d suggest another 
condition:

if we make a barre on the lowest fret and set the fingering of all the dots on 
the lowest fret to 1, the other fingers should be automatically raised by one.

Does that make sense? I will probably need some more time to think about it 
myself...

Thanks for your help and your detailed explanations!
patrick
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: how to add barre indications to automatic fret diagrams?

2015-05-21 Thread Carl Sorensen
On 5/21/15 4:42 PM, pls p.l.schm...@gmx.de wrote:


On 21.05.2015, at 21:06, Carl Sorensen c_soren...@byu.edu wrote:

 
 Transposing doesn't work on chord shapes.  Transposing works on notes.
 The automatic fretboard creator looks at the notes and creates a
 fretboard.  At that point, it has no knowledge of a chord shape, so we
 can't do the shape shifting algorithm there.

Ah, ok, now I¹m beginning to understand the problem.  The line between
transposing and shape shifting is sometimes very thin, though.  (The
notes of) Some chord structures like e.g. 1.3.5.8.10.15 (G shape) or
1.5.8.10.12.15 (E shape) cannot be transposed without also shifting and
thus keeping their shapes.  Transposing the notes of other chord
structures like 1.5.8.10 could mean using either the same shape (shape
shifting) or switching to at least one (sometimes two) alternative
shape(s) (A shape, D shape, E shape)

Actually, this is not what I meant.

I am now speaking solely in LilyPond internals terms.  When \transpose is
applied to a chord, it changes the pitches of the chord, but does not
change the fingerings.  And there is no reasonable system I can imagine
that would allow \transpose to do the right thing on both chords and
single notes, relative to fingerings.  So \transpose is almost guaranteed
*not* to work effectively on automatically-generated fret diagrams.

That is *why* there is a predefined fretboard capability defined in
LilyPond.  You are free to define the set of chords you want to work with,
complete with fingerings.  And if you do that, the predefined fretboards
will work *exactly* the way you want them to work when you transpose.

As part of the predefined fretboard code, to make it easy to define
fretboards, we have the concept of a chord shape (e.g. E-shape, A-shape,
D-shape).  And we can define other chords as these shapes shifted by a
certain number of frets.  That is what I meant by shape shifting.  Not
changing shapes, but moving a shape along the fretboard by a given number
of frets.  I apologize for my lack of clarity.

In the current usage of predefined-guitar-fretboards, we actually don't
use E-shape, because it is missing the barre.  So we use F-shape (which
has the barre) and then slide it along the fretboard wherever we want to
go, to get F#, G, G#, etc.  Same with A-shape.  We use bes-shape (because
it has the barre) and then slide it along the fretboard.

The predefined fretboards are really quite robust to LilyPond
transposition, meaning you can apply \transpose to a music expression
going to a FretBoards context, and it will give you what you want.  The
only problem is if you don't like the predefined fretboards, you'll have
to make your own predefined fret diagram table, but that is a one-time
thing.


Hm, I¹d either use e,-0 b,-3 e-4 gis-2 b-0 e¹-0

Yes, that is what I meant to type -- the other was a typo.

or (even more likely) e,-0 b,-2 e-3 gis-1 b-0 e¹-0,

This is my most often played E-chord.  But if this is used with automatic
(not predefined) fretboards, it will not be transposable.

the latter making it even more complicated! When transposing this open
chord to a barred chord all fingers would have to be raised by 1.

Yes, and this rule would apply in the case of E, but would not apply in
the case of A if you are playing the A as a barre on fret 2.  And I can
imagine no straightforward means of configuring the transposition if you
don't like the default output.  That's why we have predefined fret
diagrams.

They both sound fine to me!  Are they mutually exclusive? I¹d suggest
another condition:

if we make a barre on the lowest fret and set the fingering of all the
dots on the lowest fret to 1, the other fingers should be automatically
raised by one.

It does make sense, but I can find some counterexamples, so I don't think
that rule should be implemented.

I've made some changes to the automatic fret diagram generator code that
will add barres, as long as you have fingerings listed in the diagram.
I've attached it to this email.

If you would like to try it out, copy translation-functions.scm to the
scm/ subdirectory of your lilypond installation.  Make a copy of the
original, of course.

Thanks,

Carl




translation-functions.scm
Description: translation-functions.scm


automatic-fretboards-barre.ly
Description: automatic-fretboards-barre.ly
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: how to add barre indications to automatic fret diagrams?

2015-05-21 Thread Carl Sorensen


On 5/21/15 8:39 AM, pls p.l.schm...@gmx.de wrote:

 
 I thought about this issue quite a bit when I was creating predefined
fret
 diagrams.  There, we introduced the idea of a chord shape.  There is a
 function that shifts a chord shape by N frets (offset-fret).  At
present,
 it adds N to the fret number for every dot.  I thought about setting the
 fret number to N for every open string, but elected not to do it
because I
 wouldn't know what to do with the finger.  I guess it's possible to set
it
 to 1.

I would argue that it would make a lot of sense to set the fret number
to N for every open string² and to automatically add a barre indication
when transposing open chord shapes.  Otherwise these resulting diagrams
look really daunting and unplayable.

There is a difference between transposing and shape shifting.

Shape shifting is done on chord shapes, rather than music.  It would be
trivial to set the fret to N and the finger to 1 when shifting a chord
shape.  I think that probably makes sense to do.

Transposing doesn't work on chord shapes.  Transposing works on notes.
The automatic fretboard creator looks at the notes and creates a
fretboard.  At that point, it has no knowledge of a chord shape, so we
can't do the shape shifting algorithm there.

Do you represent an E chord as

e, b,-3 e-4 gis-2 b e'
or
e,-0 b,-3 e-4 gis-2 b-0 e'-c ?

If the latter, you will get a warning when you try to transpose the chord,
because you're asking for open strings, and the transposed notes don't
work on open strings.  It makes for an incorrect diagram, with the finger
listed as 0 and a dot on the fret corresponding to the transposition.

\new FretBoards {
 e,-0 b,-3 e-4 gis-2 b-0 e'-01
 \transpose e f e,-0 b,-3 e-4 gis-2 b-0 e'-01
}



If you use the former notation, you get an incomplete fretboard when you
transpose the code,
because you:

1) Don't have the barre indicator
2) Don't have the finger listed for the barred notes

However, you don't get the warning, and you don't have the inconsistency
of asking for an open string and showing a dot simultaneously.

\new FretBoards {
 e, b,-3 e-4 gis-2 b  e'1
 \transpose e f e, b,-3 e-4 gis-2 b  e'1
   
  }

It would be possible to employ some code like the following:

If (some notes have fingers given) and
   (there is more than one dot on the lowest fret in the diagram)
then
   make a barre on the lowest fret and set the fingering of all the dots
on the lowest fret to 1

Or alternatively 

If (some notes have fingers given) and
   (a note has a finger of 0 and a fret = 1)
then
   give that note a finger of 1

If (we have more than one note with the same finger)
then
   make a barre from the lowest note to the highest note on that finger



Do you think either of these algorithms would do what you want?

Thanks,

Carl



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


Re: how to add barre indications to automatic fret diagrams?

2015-05-20 Thread Stephen MacNeil
sorry forgot one


\version 2.18.2

barre = #(define-music-function (barre location str ) (number?)

#{

\once \override FretBoard.before-line-breaking =

#(lambda (grob)

;(display (ly:grob-property grob 'dot-placement-list))

(ly:grob-set-property! grob 'dot-placement-list

(cons `(barre 6 1 ,str) (ly:grob-property grob 'dot-placement-list


 #})

fMajorEShape = { f,-1 c-3 f-4 a-2 c'-1 f'-1 }

gMajorEShape = { \transpose f g { \fMajorEShape } }


 \new FretBoards {

\barre #3

\transpose f g { \fMajorEShape }

\barre #4

On Wed, May 20, 2015 at 7:02 AM, Stephen MacNeil classicalja...@gmail.com
wrote:

 sorry forgot one


 \version 2.18.2

 barre = #(define-music-function (barre location str ) (number?)

 #{

 \once \override FretBoard.before-line-breaking =

 #(lambda (grob)

 ;(display (ly:grob-property grob 'dot-placement-list))

 (ly:grob-set-property! grob 'dot-placement-list

 (cons `(barre 6 1 ,str) (ly:grob-property grob 'dot-placement-list


  #})

 fMajorEShape = { f,-1 c-3 f-4 a-2 c'-1 f'-1 }

 gMajorEShape = { \transpose f g { \fMajorEShape } }


  \new FretBoards {

 \barre #3

 \transpose f g { \fMajorEShape }

 \barre #4

 \gMajorEShape

 \barre #3

 g,-1 d-3 g-4 b-2 d'-1 g'-1

 \set FretBoards.minimumFret = #3

 \barre #4

 \gMajorEShape

 }


 HTH

 Stephen

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


Re: how to add barre indications to automatic fret diagrams?

2015-05-20 Thread pls

On 20.05.2015, at 01:58, Thomas Morley thomasmorle...@gmail.com wrote:

 Hi Patrick,
 
 maybe this will get you started:
 
 \version 2.19.15
 
 \new FretBoards {
 
  \override FretBoard.before-line-breaking =
  #(lambda (grob)
 ;(display (ly:grob-property grob 'dot-placement-list))
 (ly:grob-set-property! grob 'dot-placement-list
(cons '(barre 6 1 1) (ly:grob-property grob 'dot-placement-list
 
  f,-1 c-3 f-4 a-2 c'-1 f'-1
 }

Hi Harm,

thanks a million!  It certainly does get me started.  I think this should be 
added to the snippet repository.  I could prepare a snippet illustrating your 
code and some other overrides of details of automatically generated fret 
diagrams.  Something like that:

\version 2.19.15

barre = {
  \once \override FretBoard.before-line-breaking =
 #(lambda (grob)
;(display (ly:grob-property grob 'dot-placement-list))
(ly:grob-set-property! grob 'dot-placement-list
   (cons '(barre 6 1 1) (ly:grob-property grob 'dot-placement-list
}

fMajorEShape = { f,-1 c-3 f-4 a-2 c'-1 f'-1 }

\new FretBoards {  
  \override FretBoards.FretBoard.size = #'2
  \override FretBoard.fret-diagram-details.barre-type = #'straight
  \override FretBoard.fret-diagram-details.finger-code = #'in-dot
%  \override FretBoard.fret-diagram-details.dot-color = #'white
%  \override FretBoard.fret-diagram-details.finger-code = #'below-string
  \override FretBoard.fret-diagram-details.number-type = #'roman-upper
%\override FretBoard.fret-diagram-details.orientation = #'opposing-landscape
\override FretBoard.fret-diagram-details.mute-string = #M
%\override FretBoard.fret-diagram-details.label-dir = #DOWN
\override FretBoard.fret-diagram-details.open-string = #0
%   \override FretBoard.fret-diagram-details.string-count = #4 % doesn’t work
%\override FretBoard.fret-diagram-details.fret-count = #3
   \barre
  f,-1 c-3 f-4 a-2 c'-1 f'-1
}

What do you think?

Oh wait, I just tried to transpose the chord but the barre indication is always 
printed at the first fret:

\version 2.19.15

barre = {
  \once \override FretBoard.before-line-breaking =
 #(lambda (grob)
;(display (ly:grob-property grob 'dot-placement-list))
(ly:grob-set-property! grob 'dot-placement-list
   (cons '(barre 6 1 1) (ly:grob-property grob 'dot-placement-list
}

fMajorEShape = { f,-1 c-3 f-4 a-2 c'-1 f'-1 }
gMajorEShape = { \transpose f g { \fMajorEShape } }

\new FretBoards {
  \barre
  \transpose f g { \fMajorEShape }
  \barre
  \gMajorEShape
  \barre
  g,-1 d-3 g-4 b-2 d'-1 g'-1
  \set FretBoards.minimumFret = #3
  \barre
  \gMajorEShape
}

Is there any way to move it up the fretboard?

Thanks again!
patrick 





On 19.05.2015, at 20:45, pls p.l.schm...@gmx.de wrote:

 Hi all,
 
 LilyPond’s automatic fret diagrams really are a very helpful feature! More 
 often than not it helps to not having to predefine and store a diagram in a 
 lookup table.  But it has one little drawback: it doesn’t automatically 
 include a barre indication when several strings are to be covered by one 
 finger.  The default diagram actually looks a bit as if six fingers were 
 needed to play this chord (see example).  
 
 \version 2.19.15
 {
  \new FretBoards {
f,-1 c-3 f-4 a-2 c'-1 f'-1
  }
 }
 
 I have had a look at the \override options of the FretBoard and many details 
 are customizable but of course it’s not possible to override a barre 
 indication that isn’t there.  Now, is there a known way to (manually) add 
 barre indications to automatic fret diagrams or do I have to use predefined 
 fret diagrams for barre chords in general?
 
 tia
 patrick

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


Re: how to add barre indications to automatic fret diagrams?

2015-05-20 Thread Stephen MacNeil
how about

 barre = #(define-music-function (bend location str ) (number?)

#{

\once \override FretBoard.before-line-breaking =

#(lambda (grob)

;(display (ly:grob-property grob 'dot-placement-list))

(ly:grob-set-property! grob 'dot-placement-list

(cons `(barre 6 1 ,str) (ly:grob-property grob 'dot-placement-list

#})

fMajorEShape = { f,-1 c-3 f-4 a-2 c'-1 f'-1 }

gMajorEShape = { \transpose f g { \fMajorEShape } }


 \new FretBoards {

\barre #1

\transpose f g { \fMajorEShape }

\barre

\gMajorEShape

\barre #3

g,-1 d-3 g-4 b-2 d'-1 g'-1

\set FretBoards.minimumFret = #3

\barre #4

\gMajorEShape

}


HTH

stephen


On Wed, May 20, 2015 at 4:52 AM, pls p.l.schm...@gmx.de wrote:


 On 20.05.2015, at 01:58, Thomas Morley thomasmorle...@gmail.com wrote:

 Hi Patrick,

 maybe this will get you started:

 \version 2.19.15

 \new FretBoards {

  \override FretBoard.before-line-breaking =
  #(lambda (grob)
 ;(display (ly:grob-property grob 'dot-placement-list))
 (ly:grob-set-property! grob 'dot-placement-list
(cons '(barre 6 1 1) (ly:grob-property grob 'dot-placement-list

  f,-1 c-3 f-4 a-2 c'-1 f'-1
 }


 Hi Harm,

 thanks a million!  It certainly does get me started.  I think this should
 be added to the snippet repository.  I could prepare a snippet illustrating
 your code and some other overrides of details of automatically generated
 fret diagrams.  Something like that:

 \version 2.19.15

 barre = {
   \once \override FretBoard.before-line-breaking =
  #(lambda (grob)
 ;(display (ly:grob-property grob 'dot-placement-list))
 (ly:grob-set-property! grob 'dot-placement-list
(cons '(barre 6 1 1) (ly:grob-property grob 'dot-placement-list
 }

 fMajorEShape = { f,-1 c-3 f-4 a-2 c'-1 f'-1 }

 \new FretBoards {
   \override FretBoards.FretBoard.size = #'2
   \override FretBoard.fret-diagram-details.barre-type = #'straight
   \override FretBoard.fret-diagram-details.finger-code = #'in-dot
 %  \override FretBoard.fret-diagram-details.dot-color = #'white
 %  \override FretBoard.fret-diagram-details.finger-code = #'below-string
   \override FretBoard.fret-diagram-details.number-type = #'roman-upper
 %\override FretBoard.fret-diagram-details.orientation =
 #'opposing-landscape
 \override FretBoard.fret-diagram-details.mute-string = #M
 %\override FretBoard.fret-diagram-details.label-dir = #DOWN
 \override FretBoard.fret-diagram-details.open-string = #0
 %   \override FretBoard.fret-diagram-details.string-count = #4 % doesn’t
 work
 %\override FretBoard.fret-diagram-details.fret-count = #3
\barre
   f,-1 c-3 f-4 a-2 c'-1 f'-1
 }


 What do you think?

 Oh wait, I just tried to transpose the chord but the barre indication is
 always printed at the first fret:

 \version 2.19.15

 barre = {
   \once \override FretBoard.before-line-breaking =
  #(lambda (grob)
 ;(display (ly:grob-property grob 'dot-placement-list))
 (ly:grob-set-property! grob 'dot-placement-list
(cons '(barre 6 1 1) (ly:grob-property grob 'dot-placement-list
 }

 fMajorEShape = { f,-1 c-3 f-4 a-2 c'-1 f'-1 }
 gMajorEShape = { \transpose f g { \fMajorEShape } }

 \new FretBoards {
   \barre
   \transpose f g { \fMajorEShape }
   \barre
   \gMajorEShape
   \barre
   g,-1 d-3 g-4 b-2 d'-1 g'-1
   \set FretBoards.minimumFret = #3
   \barre
   \gMajorEShape
 }


 Is there any way to move it up the fretboard?

 Thanks again!
 patrick





 On 19.05.2015, at 20:45, pls p.l.schm...@gmx.de wrote:

 Hi all,

 LilyPond’s automatic fret diagrams really are a very helpful feature! More
 often than not it helps to not having to predefine and store a diagram in a
 lookup table.  But it has one little drawback: it doesn’t automatically
 include a barre indication when several strings are to be covered by one
 finger.  The default diagram actually looks a bit as if six fingers were
 needed to play this chord (see example).

 \version 2.19.15
 {
  \new FretBoards {
f,-1 c-3 f-4 a-2 c'-1 f'-1
  }
 }

 I have had a look at the \override options of the FretBoard and many
 details are customizable but of course it’s not possible to override a
 barre indication that isn’t there.  Now, is there a known way to (manually)
 add barre indications to automatic fret diagrams or do I have to use
 predefined fret diagrams for barre chords in general?

 tia
 patrick



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


Re: how to add barre indications to automatic fret diagrams?

2015-05-20 Thread Carl Sorensen


On 5/19/15 12:45 PM, pls p.l.schm...@gmx.de wrote:

Hi all,

LilyPond¹s automatic fret diagrams really are a very helpful feature!
More often than not it helps to not having to predefine and store a
diagram in a lookup table.  But it has one little drawback: it doesn¹t
automatically include a barre indication when several strings are to be
covered by one finger.  The default diagram actually looks a bit as if
six fingers were needed to play this chord (see example).

\version 2.19.15
{
  \new FretBoards {
f,-1 c-3 f-4 a-2 c'-1 f'-1
  }
}

I have had a look at the \override options of the FretBoard and many
details are customizable but of course it¹s not possible to override a
barre indication that isn¹t there.  Now, is there a known way to
(manually) add barre indications to automatic fret diagrams or do I have
to use predefined fret diagrams for barre chords in general?

Actually, this should be a feature request for automatic fret diagrams.
Any time two strings have the same finger, they could be part of a barre.
And it would be relatively straightforward to keep a list of minimum and
maximum strings for each finger, and add the necessary barre indications.

LilyPond should be smart enough to do this on its own (speaking as the
original author of the fret diagram code.

Thanks,

Carl


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


Re: how to add barre indications to automatic fret diagrams?

2015-05-19 Thread Thomas Morley
2015-05-19 21:59 GMT+02:00 pls p.l.schm...@gmx.de:

 On 19.05.2015, at 21:47, Stephen MacNeil classicalja...@gmail.com wrote:

 you can check here see if that's what you want.

 http://lsr.di.unimi.it/LSR/Search?q=fret-diagram


 Thanks, but unfortunately these snippets are all about customizing
 predefined fret diagrams and not about adding barre indications to
 automatically generated fret diagrams.

 patrick


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


Hi Patrick,

maybe this will get you started:

\version 2.19.15

\new FretBoards {

  \override FretBoard.before-line-breaking =
  #(lambda (grob)
 ;(display (ly:grob-property grob 'dot-placement-list))
 (ly:grob-set-property! grob 'dot-placement-list
(cons '(barre 6 1 1) (ly:grob-property grob 'dot-placement-list

  f,-1 c-3 f-4 a-2 c'-1 f'-1
}

HTH,
  Harm

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


Re: how to add barre indications to automatic fret diagrams?

2015-05-19 Thread pls

On 19.05.2015, at 21:47, Stephen MacNeil classicalja...@gmail.com wrote:

 you can check here see if that's what you want.
 
 http://lsr.di.unimi.it/LSR/Search?q=fret-diagram

Thanks, but unfortunately these snippets are all about customizing predefined 
fret diagrams and not about adding barre indications to automatically generated 
fret diagrams.

patrick

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