lilypond-user
[Top][All Lists]
Advanced

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

Re: Staff Tab notation support?


From: Carl Sorensen
Subject: Re: Staff Tab notation support?
Date: Sun, 10 Jan 2010 22:28:25 -0700

On 1/10/10 9:43 PM, "Eric Knapp" <address@hidden> wrote:

> 
> On Sun, Jan 10, 2010 at 9:39 PM, Carl Sorensen <address@hidden> wrote:
>> 
>> 
>> 
>> 
>> Eric,
>> 
>> I don't think that this is hugely difficult to make work.  (Of course, I'm
>> not doing it, so it's easy for me to say that -- talk's cheap).
>> 
> 
> I would be happy to start working on this. I will probably try to get
> others in the Stick community to help or maybe see if one of my
> students would be interested.
> 
>> Let me see if I understand correctly.  The staff lines in Staff Tab have two
>> different purposes.  First of all, they represent normal staff lines for the
>> notes, which show up as real notes but with special heads that indicate the
>> finger to be used.  Secondly, the staff lines represent the strings on which
>> the notes are played, and the rectangles that show up in the note column
>> show which string should be played.
> 
> That's correct. There are some positioning issues that I didn't
> mention. When there is a chord, the string indicator rectangles are
> positioned in the shape that the fingers make on the strings. I can
> give more details later.
> 

Yes, I noticed that, and that the fret numbers were separated by a period,
and that the fret number was over the respective string indicator.

>> 
>> The numbers above or below the staff represent the fret for the strings that
>> are shown on the staff lines below.
>> 
>> Is this right?
>> 
> 
> That's correct. I have been creating lyrics for these numbers. When
> people do StaffTab in Finale or Sibelius they also use the lyric tools
> in those apps.
> 
>> If so, then here are some suggestions:
>> 
>> 1)  The string indications could easily be created by a
>> staff-string-engraver.  (This engraver could be written in Scheme, now that
>> Han-Wen has given us the capability of writing engravers in Scheme).  It
>> would listen to string-number-events, and create the appropriate rectangle
>> stencils (and rectangle stencils are trivial to make).
> 
> With 12 strings and 24 frets there are a lot of places where the same
> note can be played. For example, with the tuning I use there are 9
> fret/string combinations for middle C. It is true that there are
> common spots where middle C is more often played, but we have to be
> able to override any automatic choice that the engraver would pick.
> 

I don't envision the engraver making automatic choices, at least at the
first.  But if you want it to, you'll have to come up with the algorithm.

Right now, for guitar tablature, we have two different algorithms for
determining string number -- one for fret diagrams and one for tab staff.
This is a bug, and I'm currently working on fixing it.

>> 
>> 2) The fret number indications could be created by a fret-number-engraver.
>> It would listen to both note-events and string-number-events, and would
>> calculate the fret numbers based on the note, string number, and string
>> tuning.
> 
> Sounds good with the above comment in mind. We have to be able to
> specify the exact string and fret for any given note sometimes. Also,
> there are many different ways to tune a Stick. There are 8 common ones
> for my type of Stick alone. And there are many people who use custom
> tunings. There are also several different kinds of sticks with
> different numbers of strings and different ranges. I think it would be
> necessary to be able to enter a tuning.

There is already a method for entering string tunings.  A string tuning is a
scheme list that contains the number of semitones away from middle C for
each string.  It should directly apply to the StafTab notation.

One should never have to specify the fret.  By specifying the pitch, the
tuning, and the string, the fret can be calculated.  LilyPond already has
entry notation for pitch and string number, so no new entry syntax is needed
to get the StaffTab information.  This is a bonus, because you don't need to
mess with the parser.

> 
>> 
>> 3) The note-heads could be created by a staff-tab-note-engraver.  It would
>> listen to note-events and fingering-events, and would adjust the note-head
>> shape based on the fingering events.
>> 
> 
> Sounds good.
> 
>> Putting the ChordNames context between the two staffs is no problem.
>> 
>> To get the nicely lined up fret numbers, we may want to make a FretNumbers
>> context, which would contain the fret-number-engraver.
>> 
>> With all this in place, I'd assume that the LilyPond file would look
>> something like this
>> 
>> leftHandMusic = {...} (include the string and finger notations in the music
>> 
>> rightHandMusic = { ...} (again, include the string and finger notations)
>> 
>> chordMusic = \chordmode {...}
>> 
>> \new StaffGroup {
>>  <<
>>    \new FretNumbers { \rightHandMusic }
>>    \new Staff {\rightHandMusic }
>>    \new ChordNames { \chordMusic }
>>    \new Staff { \leftHandMusic }
>>    \new FretNumbers { \leftHandMusic}
>>  >>
>> }
>> 
>> \context Staff {
>>   \consists staff-tab-note-engraver
>> }
>> 
> 
> That looks really nice and is what I was hoping for. My current
> solution is a big hack that doesn't do everything and does some things
> poorly. What you are proposing is has the elegance level that I would
> really love.
> 
>> I think all of the infrastructure to do this easily is currently available
>> in LilyPond.  If you're willing to give it a shot, let's give it a try.
> 
> I'm in! What's first? I assume that I have a lot of reading to do. I
> just downloaded all the 2.13 manuals. I have read most of them for
> 2.12. The links for the "Extend Lilypond" manual are all broken. Is
> this is known issue?

The online version of 2.13 works for Extend if you click on the "read this
manual in the same format as this one" link, rather than the Extend (split
HTML) link.

I don't know if the broken links are a known issue or not.  Please report it
to the bug-lilypond list.

You can get more up-to-date copies of Extending LilyPond on the kainhofer
server:

http://kainhofer.com/~lilypond/Documentation/index.html

But right now that is giving a 404 error.

Hmm -- how to get started?  Well, there are several things that you need to
figure out:

0) How to get the source with git.  It's really easy, especially if you use
the lily-git.tcl script.  See the Contributor's Guide for information.

1) How to write an engraver in Scheme.  Han-Wen just added that
functionality, and david pounder figured out how to use it.

See

http://thread.gmane.org/gmane.comp.gnu.lilypond.general/53740

for an example, and and see

http://thread.gmane.org/gmane.comp.gnu.lilypond.devel/26715

for Han-Wen's original explanation.

3) How to do the Scheme manipulation.  That's a bit harder for me to
explain.  I'd suggest you start with the Contributor's Guide chapter on
Programming.  Follow that up with the Scheme tutorial in Extending LilyPond.
Then try some stuff and see where you get stuck, and ask on the list for
help.  We'll be happy to provide it.

I hope this has been helpful.  I know it's a big chore to figure out how to
get started in LilyPond, but it's worth it!

Thanks,

Carl





reply via email to

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