Typo: \fixed c' should be \fixed $amb1, plus I forgot to remove the flags:

%%%%
\version "2.19.82"

amb = #(define-music-function (parser location arg mus) (integer? ly:music?)
  (let ((amb1 (ly:make-pitch 0 0 0))
        (amb2 (ly:make-pitch 0 (abs arg) 0)))
    #{
      \fixed $amb1
      <<
        \override NoteHead.stem-attachment = #'(0 . 1.2)
        \override Stem.length = #(- (abs arg) 2.5)
        \override Stem.thickness = #2.5
        \override Script.stencil = ##f
        \override Flag.stencil = ##f
        \voiceOne $mus \\
        \override NoteColumn.force-hshift = #0
        \voiceThree \transpose $amb1 $amb2 $mus
      >>
      \revert NoteHead.stem-attachment
      \revert Stem.length
      \revert NoteColumn.force-hshift
      \revert Script.stencil
      \revert Flag.stencil
      \revert Stem.thickness
    #}))

%%% Test:
\relative c' {
  c \amb5 d2-- \amb5 e8 8 \amb6 f1
}
%%%

Cheers,
Pierre

2018-07-10 7:31 GMT+02:00 Pierre Perol-Schneider <
[email protected]>:

> Hi Allen,
>
> Please find hereunder a easyer-to-use function.
> Limitation: work in one way (pitch up), won't work with whole notes and
> slurs.
>
> %%%%
> \version "2.19.82"
>
> amb = #(define-music-function (parser location arg mus) (integer?
> ly:music?)
>   (let ((amb1 (ly:make-pitch 0 0 0))
>         (amb2 (ly:make-pitch  0 (abs arg) 0)))
>     #{
>       \fixed c'
>       <<
>         \override NoteHead.stem-attachment = #'(0 . 1.2)
>         \override Stem.length = #(- (abs arg) 2.5)
>         \override Stem.thickness = #2.5
>         \override Script.transparent = ##t
>         \voiceOne $mus \\
>         \override NoteColumn.force-hshift = #0
>         \voiceThree \transpose $amb1 $amb2 $mus
>       >>
>       \revert NoteHead.stem-attachment
>       \revert Stem.length
>       \revert NoteColumn.force-hshift
>       \revert Script.transparent
>       \revert Stem.thickness
>     #}))
>
> %%% Test:
> \relative c' {
>   c( \amb5 d2-- e4 \amb7 f1)
> }
> %%%%
>
> HTH, Cheers,
> Pierre
>
> 2018-07-09 10:27 GMT+02:00 Pierre Perol-Schneider <
> [email protected]>:
>
>> I cannot think of any simple solution. So here it goes :
>>
>> \version "2.18"
>>
>> \relative c' {
>>
>>   %% Stem defs to be set manually;
>>   \once\override Stem.Y-offset = #-4
>>   \once\override Stem.length = #4.5
>>   \once\stemDown
>>   <c
>>     \tweak NoteHead.stencil #(lambda (grob)
>>        (grob-interpret-markup grob #{
>>          \markup
>>          \center-column {
>>            %% Change to s0 or s2 as appropriated:
>>            \musicglyph #"noteheads.s1"
>>            \path #0.25 #'((moveto 0 2.2)
>>                           ;; Change the Y coordonate as needed:
>>                           (lineto 0 .4))
>>          } #}))
>>   c'>2
>>
>>   %% defaulft stem length:
>>   \once\stemDown c
>>
>>
>>   \once\override Stem.Y-offset = #3.5
>>   \once\override Stem.length = #5.5
>>   <c
>>     \tweak NoteHead.stencil #(lambda (grob)
>>        (grob-interpret-markup grob #{
>>          \markup
>>          \center-column {
>>            %% Change to s0 or s2 as appropriated:
>>            \musicglyph #"noteheads.s1"
>>            \path #0.25 #'((moveto 0 2.2)
>>                           ;; Change the Y coordonate as needed:
>>                           (lineto 0 .4))
>>          } #}))
>>   c'>
>>
>>   %% defaulft stem length:
>>   \once\stemUp c'
>> }
>>
>> Cheers,
>> Pierre
>>
>> 2018-07-09 7:46 GMT+02:00 Allen Wu <[email protected]>:
>>
>>> Hi Pierre,
>>>
>>> Wow, that is cool.  Is there a way to remove the stem in between c' and
>>> c''?
>>>
>>> Thanks,
>>> Allen
>>>
>>> On Sun, Jul 8, 2018 at 6:10 AM, Pierre Perol-Schneider <
>>> [email protected]> wrote:
>>>
>>>> Amitus dimension is not needed in fact :
>>>>
>>>> \version "2.18.2"
>>>>
>>>> \relative c' {
>>>>   <c
>>>>     \tweak NoteHead.stencil #(lambda (grob)
>>>>        (grob-interpret-markup grob #{
>>>>          \markup
>>>>          \center-column {
>>>>            %% Change to s0 or s2 as appropriated:
>>>>            \musicglyph #"noteheads.s1"
>>>>            \path #0.25 #'((moveto 0 2.2)
>>>>                           ; change the Y coordonate as needed:
>>>>                           (lineto 0 .4))
>>>>          } #}))
>>>>   c'>2
>>>> }
>>>>
>>>> Cheers,
>>>> Pierre
>>>>
>>>> 2018-07-08 13:02 GMT+02:00 Pierre Perol-Schneider <
>>>> [email protected]>:
>>>>
>>>>> Hi Allen,
>>>>>
>>>>> It may look a bit complicate -- and it is -- but it's a first draft :
>>>>>
>>>>> %%%
>>>>> \version "2.18.2"
>>>>>
>>>>> {
>>>>>     <c
>>>>>     \tweak NoteHead.stencil #(lambda (grob)
>>>>>        (grob-interpret-markup grob #{
>>>>>          \markup
>>>>>          \center-column {
>>>>>            %% Change to s1 or s2 as appropriated:
>>>>>            \musicglyph #"noteheads.s2"
>>>>>            \with-dimensions #'(0 . 0) #'(0 . 0)
>>>>>            \path #0.25 #'((moveto 0 2.2)
>>>>>                           ; change the Y coordonate as needed:
>>>>>                           (lineto 0 .4))
>>>>>          }
>>>>>          #}))
>>>>>   c'>
>>>>> }
>>>>> %%%
>>>>>
>>>>> Cheers,
>>>>> Pierre
>>>>>
>>>>> 2018-07-08 10:28 GMT+02:00 Allen Wu <[email protected]>:
>>>>>
>>>>>> Hi guys,
>>>>>>
>>>>>> I am thinking about writing a piece with each note offering a range
>>>>>> to choose instead of being specific.   Is there a way to make the note
>>>>>> heads to look like ambitus?  Or I am also open to other suggestions about
>>>>>> how to notate music like this.
>>>>>>
>>>>>> Thanks for advice,
>>>>>> Allen
>>>>>>
>>>>>> _______________________________________________
>>>>>> lilypond-user mailing list
>>>>>> [email protected]
>>>>>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>>>>>> <https://mailtrack.io/trace/link/7cd4d35f62da348e1d66fc4b86e28da5307c0ec1?url=https%3A%2F%2Flists.gnu.org%2Fmailman%2Flistinfo%2Flilypond-user&userId=113304&signature=bbdf9a792463d659>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to