[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: disabling point-and-click for displayed chords?
From: |
Adam Spiers |
Subject: |
Re: disabling point-and-click for displayed chords? |
Date: |
Thu, 7 Feb 2013 02:21:24 +0000 |
On Sat, Jan 26, 2013 at 10:04 PM, Adam Spiers
<address@hidden> wrote:
> On Tue, Jan 15, 2013 at 3:05 PM, Adam Spiers
> <address@hidden> wrote:
>> On Tue, Jan 15, 2013 at 9:41 AM, David Kastrup <address@hidden> wrote:
>>> You could use an engraver in ChordNames for wiping out the (event) cause
>>> of the last involved grob. Then the point-and-click location would no
>>> longer be available...
>>
>> That makes sense. Do you mean an existing engraver though, or a new
>> one? The only existing one which looks promising is
>> Output_property_engraver (which I had never heard of before). Does
>> that mean I do this via \applyOutput?
>
> I got this to work for a single note via:
>
> #(define (delete-grob-cause grob origctx curctx)
> (let* ((cause (ly:grob-property grob 'cause))
> (music-origin (if (ly:stream-event? cause)
> (ly:event-property cause 'origin))))
> (ly:debug "removing grob origin '~a'" music-origin)))
> (ly:grob-set-property! grob 'cause #f))
>
> and then:
>
> \applyOutput #'ChordNames #delete-grob-cause
>
> However, this only worked for the single note following the command.
> I searched hard for a way to apply it to all notes, but this was the
> best advice I could find:
>
> http://thread.gmane.org/gmane.comp.gnu.lilypond.general/18699/focus=18700
>
> and both options presented were behind my expertise.
I eventually found a solution to this:
(music-map
(lambda (x)
(let ((type (ly:music-property x 'name)))
(if (eq? type 'NoteEvent)
#{ \applyOutput #'Score #delete-grob-cause $x #}
#{ $x #}))
) music))
This is possibly worth an LSR entry, although in the end, Jan helped
me come up with a fundamentally superior approach to the whole
problem, documented here:
https://github.com/aspiers/ly2video/issues/16
> I think it would be worth either extending \pointAndClickTypes to
> support filtering by context, or adding a new command such as
> \pointAndClickContexts. If there is agreement with this idea I am
> happy to submit an issue and drum up a patch, but I'd appreciate
> guidance on the best interface syntax. For instance, I'm not sure
> whether it's better to treat the argument as a list of contexts to
> include:
>
> \pointAndClickExcludedContexts #'(Voice DrumVoice)
>
> or contexts to exclude:
>
> \pointAndClickContexts #'(ChordNames)
>
> or should both inclusion and exclusion be supported, either via
> separate commands or a single command, e.g.
>
> \pointAndClickContexts #'(Voice DrumVoice -ChordNames)
>
> And how would any of these commands interact with the existing
> \pointAndClickTypes command? Presumably they'd have to be treated as
> an additional level of filtering.
I still think this line of development is still worthwhile, but I'm
unlikely to have time to drive it.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: disabling point-and-click for displayed chords?,
Adam Spiers <=