[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: functions with multiple arguments
From: |
Knute Snortum |
Subject: |
Re: functions with multiple arguments |
Date: |
Sun, 3 Jan 2021 16:46:22 -0800 |
I think this is the correct syntax:
rpt =
#(define-music-function
(parser location note1 note2)
(ly:pitch? ly:pitch?)
#{
$note1 1 $note2 1
#})
\rpt a bes
--
Knute Snortum
On Sun, Jan 3, 2021 at 4:04 PM Tom Sgouros <tomfool@as220.org> wrote:
>
> Hello all:
>
> This works:
>
> rpt =
> #(define-music-function
> (parser location note1)
> (ly:pitch?)
> #{
> $note1 1
> #})
> \rpt a
>
> Why doesn't this? ("Wrong number of arguments to #<procedure #f (parser
> location note1 note2)>") What am I missing?
>
> rpt =
> #(define-music-function
> (parser location note1 note2)
> (ly:pitch?) (ly:pitch?)
> #{
> $note1 1 note2 1
> #})
> \rpt a bes
>
> I was imagining I could use a function like this to generate groups of
> sextets efficiently, with four notes input to make the groups of six and
> making the arpeggio automatically. Perhaps barking up the wrong tree?
>
> Thank you,
>
> -Tom