lilypond-user
[Top][All Lists]
Advanced

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

Re: Single bass notes in chordmode


From: Henning Hraban Ramm
Subject: Re: Single bass notes in chordmode
Date: Thu, 25 Jun 2020 10:37:00 +0200

> Am 24.06.2020 um 16:07 schrieb Henning Hraban Ramm <lilypondml@fiee.net>:
> 
> 
>> Am 24.06.2020 um 15:01 schrieb David Kastrup <dak@gnu.org>:
>> 
>> Henning Hraban Ramm <lilypondml@fiee.net> writes:
>> 
>>> In some of my songbooks, the chord line (for guitar) is interrupted by
>>> single bass notes, i.e. you are supposed to play only these strings.
>>> 
>>> The notation is mostly a smallcaps letter with a bar above (or a small
>>> x below), but a simple /G would be enough if it isn’t possible
>>> otherwise.
>>> 
>>> And I’d like to have that bass note also in MIDI output.
>>> 
>>> Is this possible, and how?
>>> 
>>> Preferred syntax: r/g or s/g
>> 
>> Try <g> .  You'll still need to fiddle with the chord naming function.
> 
> Ah, thanks for the hint.
> 
> I found a snippet to add brackets to a chord:
> ...
> 
> Now, how can I use markup like \tiny or \circle within that (markup ...) ?

Ok, I found
http://lilypond.org/doc/v2.20/Documentation/extending/markup-construction-in-scheme

That lead me to:

#(define (bassNote grob)
   "mark chord as single bass note"
   (let* (
          ; Get current text
          (currentText (ly:grob-property grob 'text))
          (markedText (markup #:small #:fraction "" currentText )))
     ; Store the marked text back
     (ly:grob-set-property! grob 'text markedText)
     )
   ; and print it
   (ly:text-interface::print grob))

% bnC = bass note "chord"
bnC = \once \override ChordNames.ChordName.stencil = #bassNote

Now my syntax is: \bnC <g>4 \bnC <f>

A bit verbose, but since I need it only for a few songs, it’s good enough.


Hraban


reply via email to

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