tremolos in tablature

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

tremolos in tablature

Patrick Schmidt-3
Hi all,

in the following example misplaced tremolos appear in tablature  
without \tabFullNotation. With \tabFullNotation the symbols are  
placed correctly but IMO in both cases the tremolo symbols are too  
massive in tablature (see attached pngs).

\version "2.13.30"

music = {
   <c e g c' e'>4:16
   \stemUp
   \repeat tremolo 4 c'16
   \repeat tremolo 2 { c16 d }
   \repeat tremolo 4 { <c d>16 }
}

\score {
   <<
     \new Staff {
       \clef "treble_8"
       \music
     }
     \new TabStaff {
       %\tabFullNotation
       \music
     }
   >>
}

This seems to be a bug.

Workaround(s):
1) Use

\override TabVoice.StemTremolo #'transparent = ##t

within a TabStaff.

2) Insert

\layout {
     \context {
       \TabVoice
       \remove Stem_engraver
     }
   }
at the end of the score block. This also removes the unwanted tremolo  
symbols in normal tablature but – as a side effect – shortens the  
tremolo symbol between two notes in standard notation (in this  
example between c and d). Why does this happen?

HTH
patrick





tremolo-in-tabstaff.png (48K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Marc Hohl
Patrick Schmidt schrieb:

> Hi all,
>
> in the following example misplaced tremolos appear in tablature
> without \tabFullNotation. With \tabFullNotation the symbols are placed
> correctly but IMO in both cases the tremolo symbols are too massive in
> tablature (see attached pngs).
>
> \version "2.13.30"
>
> music = {
>   <c e g c' e'>4:16
>   \stemUp
>   \repeat tremolo 4 c'16
>   \repeat tremolo 2 { c16 d }
>   \repeat tremolo 4 { <c d>16 }
> }
>
> \score {
>   <<
>     \new Staff {
>       \clef "treble_8"
>       \music
>     }
>     \new TabStaff {
>       %\tabFullNotation
>       \music
>     }
>   >>
> }
>
> This seems to be a bug.
>
Hi Patrick,

yes, of course. I didn't use tremolos very often while playing around with
the new tablature appearance which yielded to scm/tablature.scm, so
I overlooked this.
> Workaround(s):
> 1) Use
>
> \override TabVoice.StemTremolo #'transparent = ##t
That's great, I'll provide a patch within the next days.

The #'beam-thickness of the tremolo beams is defined in
scm/define-grobs.scm as .48 * staff space.
In ly/engraver-init.ly we have the staff space spread to 1.5 * staff
space, so it would be optimal to
define the #'beam-thickness in TabStaff being 0.48/1.5=0.32 to ensure
the tremolo beams are equal
in size for normal and tab staves.

What do you think?

Greetings

Marc




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Patrick Schmidt-3

Am 23.08.2010 um 21:26 schrieb Marc Hohl:

> Patrick Schmidt schrieb:
>> Hi all,
>>
>> in the following example misplaced tremolos appear in tablature  
>> without \tabFullNotation. With \tabFullNotation the symbols are  
>> placed correctly but IMO in both cases the tremolo symbols are too  
>> massive in tablature (see attached pngs).
>>
>> \version "2.13.30"
>>
>> music = {
>>   <c e g c' e'>4:16
>>   \stemUp
>>   \repeat tremolo 4 c'16
>>   \repeat tremolo 2 { c16 d }
>>   \repeat tremolo 4 { <c d>16 }
>> }
>>
>> \score {
>>   <<
>>     \new Staff {
>>       \clef "treble_8"
>>       \music
>>     }
>>     \new TabStaff {
>>       %\tabFullNotation
>>       \music
>>     }
>>   >>
>> }
>>
>> This seems to be a bug.
>>
> Hi Patrick,
>
> yes, of course. I didn't use tremolos very often while playing  
> around with
> the new tablature appearance which yielded to scm/tablature.scm, so
> I overlooked this.
>> Workaround(s):
>> 1) Use
>>
>> \override TabVoice.StemTremolo #'transparent = ##t
> That's great, I'll provide a patch within the next days.
>
> The #'beam-thickness of the tremolo beams is defined in scm/define-
> grobs.scm as .48 * staff space.
> In ly/engraver-init.ly we have the staff space spread to 1.5 *  
> staff space, so it would be optimal to
> define the #'beam-thickness in TabStaff being 0.48/1.5=0.32 to  
> ensure the tremolo beams are equal
> in size for normal and tab staves.
>
> What do you think?
Sounds great!

Thanks,
patrick
>
> Greetings
>
> Marc
>
>
>
>



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Carl Sorensen
In reply to this post by Marc Hohl



On 8/23/10 1:26 PM, "Marc Hohl" <[hidden email]> wrote:

> Patrick Schmidt schrieb:
>> Hi all,
 

> Hi Patrick,
>
> yes, of course. I didn't use tremolos very often while playing around with
> the new tablature appearance which yielded to scm/tablature.scm, so
> I overlooked this.
>> Workaround(s):
>> 1) Use
>>
>> \override TabVoice.StemTremolo #'transparent = ##t
> That's great, I'll provide a patch within the next days.
>
> The #'beam-thickness of the tremolo beams is defined in
> scm/define-grobs.scm as .48 * staff space.
> In ly/engraver-init.ly we have the staff space spread to 1.5 * staff
> space, so it would be optimal to
> define the #'beam-thickness in TabStaff being 0.48/1.5=0.32 to ensure
> the tremolo beams are equal
> in size for normal and tab staves.
>
It seems that we should use 0.48 times the *actual* staff space, rather than
the default staff space.  That way, if someone overrides the space, the
tremolo bars will be the right size.

Thanks,

Carl



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Marc Hohl
Carl Sorensen schrieb:

>
> On 8/23/10 1:26 PM, "Marc Hohl" <[hidden email]> wrote:
>
>  
>> Patrick Schmidt schrieb:
>>    
>>> Hi all,
>>>      
>  
>  
>> Hi Patrick,
>>
>> yes, of course. I didn't use tremolos very often while playing around with
>> the new tablature appearance which yielded to scm/tablature.scm, so
>> I overlooked this.
>>    
>>> Workaround(s):
>>> 1) Use
>>>
>>> \override TabVoice.StemTremolo #'transparent = ##t
>>>      
>> That's great, I'll provide a patch within the next days.
>>
>> The #'beam-thickness of the tremolo beams is defined in
>> scm/define-grobs.scm as .48 * staff space.
>> In ly/engraver-init.ly we have the staff space spread to 1.5 * staff
>> space, so it would be optimal to
>> define the #'beam-thickness in TabStaff being 0.48/1.5=0.32 to ensure
>> the tremolo beams are equal
>> in size for normal and tab staves.
>>
>>    
> It seems that we should use 0.48 times the *actual* staff space, rather than
> the default staff space.  That way, if someone overrides the space, the
> tremolo bars will be the right size.
>  
Sounds reasonable. I wasn't aware of the distinction between default and
actual
staff space, to be honest.

I'll try to create a patch, give me some days and give me a ping if you
don't hear
from me within a week or so. I have ubuntu studio 8.04 on my machine
(which I bought
"as is" from a friend) with too little disk space for upgrading (he
didn't use the standard
installation defaults and cloned the image from a small netbook instead
:-(, so I have to
install 10.04 from scratch and hope to get this done within a couple of
days.

Marc

> Thanks,
>
> Carl
>
>
>
>
>  



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Marc Hohl
In reply to this post by Carl Sorensen
Carl Sorensen schrieb:
> [...]
>>    
> It seems that we should use 0.48 times the *actual* staff space, rather than
> the default staff space.
Um, after reading your answer twice - it should be the other way round,
isn't it?

The *actual* staff space within a TabStaff is 1.5 * default staff space,
and the
tremolo beams are 1.5 times thicker than those in a normal staff, which
uses the
default value.

Marc

>   That way, if someone overrides the space, the
> tremolo bars will be the right size.
>
> Thanks,
>
> Carl
>
>
>
>
>  



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Marc Hohl
In reply to this post by Carl Sorensen
Carl Sorensen schrieb:

> [...]
>> The #'beam-thickness of the tremolo beams is defined in
>> scm/define-grobs.scm as .48 * staff space.
>> In ly/engraver-init.ly we have the staff space spread to 1.5 * staff
>> space, so it would be optimal to
>> define the #'beam-thickness in TabStaff being 0.48/1.5=0.32 to ensure
>> the tremolo beams are equal
>> in size for normal and tab staves.
>>
>> [...]
Me again ;-)

In ly/engraver-init.ly, I found

%% TabStaff increase the staff-space, which in turn
%% increases beam thickness and spacing; beams are
%% too big. We have to adjust the beam settings:
\override Beam #'beam-thickness = #0.32

So I just have to add
\override StemTremolo #'beam-thickness = #0.32

as well. (Perhaps I create a patch *before* cleaning up my machine ...)

Marc




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Carl Sorensen
In reply to this post by Marc Hohl



On 8/23/10 3:28 PM, "Marc Hohl" <[hidden email]> wrote:

> Carl Sorensen schrieb:
>> [...]
>>>    
>> It seems that we should use 0.48 times the *actual* staff space, rather than
>> the default staff space.
> Um, after reading your answer twice - it should be the other way round,
> isn't it?

Oops, yes, of course.  But this makes the problem a bit harder.  I guess
using the 0.32 instead o 0.48 is probably as good an idea as I can come up
with.....

Thanks,

Carl



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Marc Hohl
Carl Sorensen schrieb:

>
> On 8/23/10 3:28 PM, "Marc Hohl" <[hidden email]> wrote:
>
>  
>> Carl Sorensen schrieb:
>>    
>>> [...]
>>>      
>>>>    
>>>>        
>>> It seems that we should use 0.48 times the *actual* staff space, rather than
>>> the default staff space.
>>>      
>> Um, after reading your answer twice - it should be the other way round,
>> isn't it?
>>    
>
> Oops, yes, of course.  But this makes the problem a bit harder.  I guess
> using the 0.32 instead o 0.48 is probably as good an idea as I can come up
> with.....
>  
Ok, so here is a patch. I had to adjust length-fraction as well, and
it is strange that this is somewhat hard-coded in lily/stem-tremolo.cc,
but since the default is 1, it probably doesn't matter.

Marc
> Thanks,
>
> Carl
>
>
>  


From 7aa51698d5030faffc04d0024e722650119c5e2f Mon Sep 17 00:00:00 2001
From: Marc Hohl <[hidden email]>
Date: Tue, 24 Aug 2010 14:46:45 +0200
Subject: [PATCH] Tablature: support StemTremolo correctly

---
 ly/engraver-init.ly |    6 ++++++
 ly/property-init.ly |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly
index 6ecba2d..a27e4d6 100644
--- a/ly/engraver-init.ly
+++ b/ly/engraver-init.ly
@@ -725,6 +725,11 @@ context."
   %% too big. We have to adjust the beam settings:
   \override Beam #'beam-thickness = #0.32
   \override Beam #'length-fraction = #0.62
+  %% the same goes for tremolo beams
+  \override StemTremolo #'beam-thickness = #0.32
+  \override StemTremolo #'length-fraction = #0.67
+  %% NOTE: in lily/stem-tremolo.cc, we have length-fraction = 1,
+  %% and the tablature staff space is scaled by 1.5, so we use 1/1.5=0.67
 
   %% No accidental in tablature !
   \remove "Accidental_engraver"
@@ -744,6 +749,7 @@ context."
   autoBeaming = ##f
   %% remove beams, dots and rests ...
   \override Beam #'stencil = ##f
+  \override StemTremolo #'stencil = ##f
   \override Dots #'stencil = ##f
   \override Rest #'stencil = ##f
   \override MultiMeasureRest #'stencil = ##f
diff --git a/ly/property-init.ly b/ly/property-init.ly
index 0b1f2a2..5a60e0e 100644
--- a/ly/property-init.ly
+++ b/ly/property-init.ly
@@ -415,6 +415,7 @@ tabFullNotation = {
   \revert NoteColumn #'ignore-collision
   % beams, dots
   \revert TabVoice.Beam #'stencil
+  \revert TabVoice.StemTremolo #'stencil
   \revert TabVoice.Dots #'stencil
   \revert TabVoice.Tie #'stencil
   \revert TabVoice.Tie #'after-line-breaking
--
1.5.4.3

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Marc Hohl
Marc Hohl schrieb:
> [...]
>>  
> Ok, so here is a patch. I had to adjust length-fraction as well, and
> it is strange that this is somewhat hard-coded in lily/stem-tremolo.cc,
> but since the default is 1, it probably doesn't matter.
>
> Marc
Just a little ping - is the patch ok, or should I load it to Rietveld? I
think such small
corrections could be handled more easily via patches and email.

Marc


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Neil Puttock
On 28 August 2010 14:46, Marc Hohl <[hidden email]> wrote:

> Just a little ping - is the patch ok, or should I load it to Rietveld?

Looks OK apart from this:

+  %% NOTE: in lily/stem-tremolo.cc, we have length-fraction = 1,
+  %% and the tablature staff space is scaled by 1.5, so we use 1/1.5=0.67

These comments should be above the \override, and will be incorrect if
a user decides to change staff-space (though it's debatable whether
it's worth complicating all the overrides to account for staff-space
changes).

Are you happy with the width of the tremolos?  It looks like
'beam-width should also be tweaked.

Cheers,
Neil


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Carl Sorensen



On 8/28/10 9:11 AM, "Neil Puttock" <[hidden email]> wrote:

> On 28 August 2010 14:46, Marc Hohl <[hidden email]> wrote:
>
>> Just a little ping - is the patch ok, or should I load it to Rietveld?
>
> Looks OK apart from this:
>
> +  %% NOTE: in lily/stem-tremolo.cc, we have length-fraction = 1,
> +  %% and the tablature staff space is scaled by 1.5, so we use 1/1.5=0.67
>
> These comments should be above the \override, and will be incorrect if
> a user decides to change staff-space (though it's debatable whether
> it's worth complicating all the overrides to account for staff-space
> changes).

Why not use 1/staff-space?  This would adjust things regardless of how
staff-space was tweaked, wouldn't it?

Carl



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Neil Puttock
On 28 August 2010 16:17, Carl Sorensen <[hidden email]> wrote:

> Why not use 1/staff-space?  This would adjust things regardless of how
> staff-space was tweaked, wouldn't it?

Yes.  A simple helper function using ly:staff-symbol-staff-space would
suffice (apart from 'beam-width, which needs a wrapper around
ly:stem-tremolo::calc-width).

Cheers,
Neil


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Marc Hohl
Neil Puttock schrieb:

> On 28 August 2010 16:17, Carl Sorensen <[hidden email]> wrote:
>
>  
>> Why not use 1/staff-space?  This would adjust things regardless of how
>> staff-space was tweaked, wouldn't it?
>>    
>
> Yes.  A simple helper function using ly:staff-symbol-staff-space would
> suffice (apart from 'beam-width, which needs a wrapper around
> ly:stem-tremolo::calc-width).
>  
Thanks you both for your answers, I'll try to include all your proposals.
I think uploading to Rietveld does now make more sense, what do you think?

Marc
> Cheers,
> Neil
>
>
>
>  



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Marc Hohl
Marc Hohl schrieb:

> Neil Puttock schrieb:
>> On 28 August 2010 16:17, Carl Sorensen <[hidden email]> wrote:
>>
>>  
>>> Why not use 1/staff-space?  This would adjust things regardless of how
>>> staff-space was tweaked, wouldn't it?
>>>    
>>
>> Yes.  A simple helper function using ly:staff-symbol-staff-space would
>> suffice (apart from 'beam-width, which needs a wrapper around
>> ly:stem-tremolo::calc-width).
>>  
> Thanks you both for your answers, I'll try to include all your proposals.
> I think uploading to Rietveld does now make more sense, what do you
> think?
Adding just <10 lines to the code, I just send you another patch directly.

Marc


From 5bff0c603dae1c8984a6e9837dbae9ab71cbae5c Mon Sep 17 00:00:00 2001
From: Marc Hohl <[hidden email]>
Date: Tue, 24 Aug 2010 14:46:45 +0200
Subject: [PATCH] Tablature: support StemTremolo correctly

---
 ly/engraver-init.ly |    9 +++++++++
 ly/property-init.ly |    1 +
 scm/tablature.scm   |    8 ++++++++
 3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly
index 6ecba2d..22e588c 100644
--- a/ly/engraver-init.ly
+++ b/ly/engraver-init.ly
@@ -725,6 +725,14 @@ context."
   %% too big. We have to adjust the beam settings:
   \override Beam #'beam-thickness = #0.32
   \override Beam #'length-fraction = #0.62
+  %% the same goes for tremolo beams
+  \override StemTremolo #'beam-thickness = #0.32
+  %% NOTE: in lily/stem-tremolo.cc, we have length-fraction = 1,
+  %% and the tablature staff space is scaled (1.5 by default),
+  %% so we use the inversion of the scale factor:
+  \override StemTremolo #'length-fraction = #(lambda (grob)
+                                               (/ 1 (ly:staff-symbol-staff-space grob)))
+  \override StemTremolo #'beam-width = #stem-tremolo::calc-tab-width
 
   %% No accidental in tablature !
   \remove "Accidental_engraver"
@@ -744,6 +752,7 @@ context."
   autoBeaming = ##f
   %% remove beams, dots and rests ...
   \override Beam #'stencil = ##f
+  \override StemTremolo #'stencil = ##f
   \override Dots #'stencil = ##f
   \override Rest #'stencil = ##f
   \override MultiMeasureRest #'stencil = ##f
diff --git a/ly/property-init.ly b/ly/property-init.ly
index 0b1f2a2..5a60e0e 100644
--- a/ly/property-init.ly
+++ b/ly/property-init.ly
@@ -415,6 +415,7 @@ tabFullNotation = {
   \revert NoteColumn #'ignore-collision
   % beams, dots
   \revert TabVoice.Beam #'stencil
+  \revert TabVoice.StemTremolo #'stencil
   \revert TabVoice.Dots #'stencil
   \revert TabVoice.Tie #'stencil
   \revert TabVoice.Tie #'after-line-breaking
diff --git a/scm/tablature.scm b/scm/tablature.scm
index 71b453c..2c33528 100644
--- a/scm/tablature.scm
+++ b/scm/tablature.scm
@@ -248,3 +248,11 @@
 
     (ly:grob-set-property! grob 'control-points new-control-points)
     (ly:slur::print grob)))
+
+;; for \tabFullNotation, the stem tremolo beams are too big in comparison to
+;; normal staves; this wrapper function scales accordingly:
+(define-public (stem-tremolo::calc-tab-width grob)
+  (let* ((width (ly:stem-tremolo::calc-width grob))
+         (staff-space (ly:staff-symbol-staff-space grob)))
+        (/ width staff-space)))
+
--
1.5.4.3

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Neil Puttock
On 30 August 2010 15:17, Marc Hohl <[hidden email]> wrote:

> Marc Hohl schrieb:
>>
>> Neil Puttock schrieb:
>>>
>>> On 28 August 2010 16:17, Carl Sorensen <[hidden email]> wrote:
>>>
>>>
>>>>
>>>> Why not use 1/staff-space?  This would adjust things regardless of how
>>>> staff-space was tweaked, wouldn't it?
>>>>
>>>
>>> Yes.  A simple helper function using ly:staff-symbol-staff-space would
>>> suffice (apart from 'beam-width, which needs a wrapper around
>>> ly:stem-tremolo::calc-width).
>>>
>>
>> Thanks you both for your answers, I'll try to include all your proposals.
>> I think uploading to Rietveld does now make more sense, what do you think?
>
> Adding just <10 lines to the code, I just send you another patch directly.

LGTM; will push soon.

Cheers,
Neil

> +;; normal staves; this wrapper function scales accordingly:
> +(define-public (stem-tremolo::calc-tab-width grob)
> +  (let* ((width (ly:stem-tremolo::calc-width grob))

let

> +         (staff-space (ly:staff-symbol-staff-space grob)))
> +        (/ width staff-space)))

indent

> +

rogue newline


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tremolos in tablature

Marc Hohl
Neil Puttock schrieb:

> On 30 August 2010 15:17, Marc Hohl <[hidden email]> wrote:
>  
>> Marc Hohl schrieb:
>>    
>>> Neil Puttock schrieb:
>>>      
>>>> On 28 August 2010 16:17, Carl Sorensen <[hidden email]> wrote:
>>>>
>>>>
>>>>        
>>>>> Why not use 1/staff-space?  This would adjust things regardless of how
>>>>> staff-space was tweaked, wouldn't it?
>>>>>
>>>>>          
>>>> Yes.  A simple helper function using ly:staff-symbol-staff-space would
>>>> suffice (apart from 'beam-width, which needs a wrapper around
>>>> ly:stem-tremolo::calc-width).
>>>>
>>>>        
>>> Thanks you both for your answers, I'll try to include all your proposals.
>>> I think uploading to Rietveld does now make more sense, what do you think?
>>>      
>> Adding just <10 lines to the code, I just send you another patch directly.
>>    
>
> LGTM; will push soon.
>
> Cheers,
> Neil
>
>  
>> +;; normal staves; this wrapper function scales accordingly:
>> +(define-public (stem-tremolo::calc-tab-width grob)
>> +  (let* ((width (ly:stem-tremolo::calc-width grob))
>>    
>
> let
>  
Thanks for correcting there errors - I first calculated  the correction
within the let*-Block and decided not to use a superfluous variable.
Then I forgot to remove the *.
>  
>> +         (staff-space (ly:staff-symbol-staff-space grob)))
>> +        (/ width staff-space)))
>>    
>
> indent
>
>  
Oops, I used the position of the first ( after the let for indentation.
>> +
>>    
>
> rogue newline
>
>
>
>  
Thanks for pushing!

Marc



Loading...