lilypond-user
[Top][All Lists]
Advanced

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

Passing pitch to function


From: Pierre-Luc Gauthier
Subject: Passing pitch to function
Date: Thu, 15 Jun 2023 12:25:37 -0400

What am-I doing wrong here… ☹

\version "2.25.6"

\language "english"

#(define instrumentsInfo
   '(
      (piccolo . ((fullName "Piccolo") (transposition #{bf'#})))
      ))

instrumentInfoLookup =
#(define-scheme-function
  (instrument info)
  (symbol? symbol?)
  (car (cdr (assq info (cdr (assq instrument instrumentsInfo))))))

#(display (instrumentInfoLookup 'piccolo 'fullName))
#(display (instrumentInfoLookup 'piccolo 'transposition))

part =
#(define-music-function
  (music fullName transposition)
  (ly:music? markup? ly:pitch?)
  #{
    \new Staff \with {
      shortInstrumentName = fullName
    } <<
      \transpose $transposition c'
      $music
  >>#} )

%\part c' "test" bf
\part c'' #(instrumentInfoLookup 'piccolo 'fullName)
c''%#(instrumentInfoLookup 'piccolo 'transposition)

The ly:pitch? predicate fails. Is there a way for that pitch to be
sent as a correct ly:pitch? ¿

Thanks for any pointers.
-- 
Pierre-Luc Gauthier



reply via email to

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