lilypond-user
[Top][All Lists]
Advanced

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

Re: Passing pitch to function


From: Pierre-Luc Gauthier
Subject: Re: Passing pitch to function
Date: Thu, 15 Jun 2023 12:45:43 -0400

I've attached my notquite-MWE.

Le jeu. 15 juin 2023, à 12 h 35, Pierre-Luc Gauthier
<p.luc.gauthier@gmail.com> a écrit :
>
> So sorry, you have to remove the c''% at the end… 'should have made that 
> clear.
>
> Le jeu. 15 juin 2023, à 12 h 33, Valentin Petzel <valentin@petzel.at> a écrit 
> :
> >
> > Hello Pierre-Luc,
> >
> > It works for me if I copy and paste your code. Can you maybe attach a ly 
> > file
> > that does not work for you?
> >
> > Cheers,
> > Valentin
> >
> >
> > Am Donnerstag, 15. Juni 2023, 18:25:37 CEST schrieb Pierre-Luc Gauthier:
> > > 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



-- 
Pierre-Luc Gauthier

Attachment: test.ly
Description: Text Data


reply via email to

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