lilypond-user
[Top][All Lists]
Advanced

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

Re: Is there a Scheme macro(?) to use fretboards to generate a generic g


From: Lukas-Fabian Moser
Subject: Re: Is there a Scheme macro(?) to use fretboards to generate a generic guitar strum?
Date: Sat, 5 Aug 2023 11:40:07 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

Hi Kevin,

But right now,
there's nothing other than constructing it by hand each time, for
every chord. I think something would be better than nothing.
The problem has two parts: 1) Generate a sensible voicing for a given chord; 2) create the arpeggio. (Maybe you intended to do 1) manually anyway?)

Here is a possible approach for 2) using LilyPond's (not ideal) automatic voicings for 1):

\version "2.24.0"

arpeggiateChord = #
(define-music-function (chord) (ly:music?)
  (define (make-tied-note p) #{ $p 32~ #})
  (if (music-is-of-type? chord 'event-chord)
  #{
    \set tieWaitForNote = ##t
    \grace {
      $@(map make-tied-note (drop-right! (music-pitches chord) 1))
    }
    \unset tieWaitForNote
    #chord
  #}
  chord))


\score {
  \musicMap #arpeggiateChord {
    \chordmode { c2:7.9- f4:m bes4:m6 f2:m/c c:7 f1 }
  }
  \layout {}
  \midi {}
}

This is very basic, it doesn't support relative mode etc., but maybe it gives you an idea.

Lukas




reply via email to

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