[tablatures] Re: Problems with chord glissandos with articulations and tablature

[ Thread Index | Date Index | More lilynet.net/tablatures Archives ]




On 4/23/10 1:48 AM, "Marc Hohl" <marc@xxxxxxxxxx> wrote:

> Carl Sorensen schrieb:
>> 
>> On 4/16/10 8:30 AM, "Bernardo Barros" <bernardobarros2@xxxxxxxxx> wrote:
>> 
>>  
>>> [...]
>>>    
>> 
>> Check out the attached files for one possibility.  Note that I've moved the
>> chordGlissando function to its own .ly file so it can be included in any .ly
>> file you desire to write, without having to copy it in an editor.
>>  
> Hello Carl,
> 
> thanks for your work - this extension is great! However, in combination
> with tab staves, the explicit declaration of "\new Voice" in
> add-glissando-line
> creates spurious staves below the tablature. Is there a way to switch
> to TabVoice automatically, i.e. to get the current context, and if it is a
> Staff, then use Voice, if it is TabStaff, use TabVoice?

There is a way to accomplish this, but AFAICS it will require fundamental
changes in the format of the code.

The problem is that the context is not available during parsing, which is
when the music functions are evaluated.  In order to make it work, the \new
Voice has to be replaced with some kind of (make-music 'contextSpeccedMusic
....) that will apply during the translation stage, when grobs are evaluated..

The way to do that is demonstrated in the revert-beam-setting function of
scm/beam-settings.scm.  It uses ly:export, and context-spec-music, and
make-apply-context.

Now, in this case, we probably don't need to use ly:export, since we aren't
trying to change property settings.  But I think we will need to use
make-apply-context, which will eventually be called with a context as an
argument.

Unfortunately, I don't have time to pursue this right now.  But I'd be happy
to provide any support to you that I can.

It may be possible to create a hack that works with parser variables.  That
is, we might be able to use something like the following

parserSetVoiceSymbol =
#(define-music-funtion (parser location voice-symbol) (symbol?)
  (ly:parser-define! parser 'voiceSymbol voice-symbol))


then put a check in chord-glissando.ly  using (ly:parser-lookup parser
'voiceSymbol)

and in your music do

<<
\new Staff {
  \new Voice {
     \parserSetVoiceSymbol #'Voice
     \myMusicIncludingChordGlissando
  }
} 
\new TabStaff {
  \new TabVoice {
     \parserSetVoiceSymbol #'TabVoice
     \myMusicIncludingChordGlissando
  }
} 
>>

Note: I haven't tested any of the above code, it's just an idea I had.

HTH,

Carl




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/