Re: Simple scheme function

2020-04-01 Thread Павел Буданов
Amazing, thank you! чт, 2 апр. 2020 г. в 01:12, Aaron Hill : > On 2020-04-01 3:04 pm, Павел Буданов wrote: > > Hello, I'm newbie in scheme. I want to write simple function to > > octavize > > melody, but something doesn't works... > > > > > > \version "2.20.0" > > octavize = #(define-music-functi

Re: Simple scheme function

2020-04-01 Thread Aaron Hill
On 2020-04-01 3:04 pm, Павел Буданов wrote: Hello, I'm newbie in scheme. I want to write simple function to octavize melody, but something doesn't works... \version "2.20.0" octavize = #(define-music-function (parser location music) (ly:music?) #{ << #music \transpose c c' #music >> #}

Simple scheme function

2020-04-01 Thread Павел Буданов
Hello, I'm newbie in scheme. I want to write simple function to octavize melody, but something doesn't works... \version "2.20.0" octavize = #(define-music-function (parser location music) (ly:music?) #{ << #music \transpose c c' #music >> #}) music = { c' d' e' f' } \markup "Need:" \ne

Re: simple scheme function #{ $note #}

2018-05-12 Thread David Kastrup
Aaron Hill writes: > On 2018-05-11 23:01, David Kastrup wrote: >>> The reason why #{ $p #} does not work as the body of a music function >>> is that it will only evaluate to a pitch not a note, and that pitch by >>> itself is not enough to create a music expression. >> >> Wrong again. There is n

Re: simple scheme function #{ $note #}

2018-05-12 Thread Aaron Hill
On 2018-05-11 23:01, David Kastrup wrote: The reason why #{ $p #} does not work as the body of a music function is that it will only evaluate to a pitch not a note, and that pitch by itself is not enough to create a music expression. Wrong again. There is no such thing as a "pitch by itself" i

Re: simple scheme function #{ $note #}

2018-05-11 Thread David Kastrup
Aaron Hill writes: > On 2018-05-11 14:17, David Kastrup wrote: >> Aaron Hill writes: >>> The error message reads pretty clearly, though. The result of a music >>> function cannot be a single NOTENAME_PITCH. >> >> The result of a music function cannot be a pitch, period. It has to be >> a music

Re: simple scheme function #{ $note #}

2018-05-11 Thread Aaron Hill
On 2018-05-11 14:17, David Kastrup wrote: Aaron Hill writes: The error message reads pretty clearly, though. The result of a music function cannot be a single NOTENAME_PITCH. The result of a music function cannot be a pitch, period. It has to be a music expression. A pitch is not a music e

Re: simple scheme function #{ $note #}

2018-05-11 Thread David Kastrup
Aaron Hill writes: > On 2018-05-11 09:34, David Kastrup wrote: >> There is no "incomplete music expression". #{ ... #} is used for >> converting a whole slew of different expression types from LilyPond >> syntax to Scheme: pitches, durations, markups, music, numbers with >> dimension and other s

Re: simple scheme function #{ $note #}

2018-05-11 Thread Aaron Hill
On 2018-05-11 09:34, David Kastrup wrote: There is no "incomplete music expression". #{ ... #} is used for converting a whole slew of different expression types from LilyPond syntax to Scheme: pitches, durations, markups, music, numbers with dimension and other stuff. A pitch is not an "incompl

Re: simple scheme function #{ $note #}

2018-05-11 Thread David Kastrup
Aaron Hill writes: > On 2018-05-11 08:46, David Kastrup wrote: >> Aaron Hill writes: >> >>> On 2018-05-11 06:53, Gianmaria Lari wrote: Sorry to bother with a simple question. Why this does not work? \version "2.19.81" pit = #(define-music-function (p) (ly:pitch?)

Re: simple scheme function #{ $note #}

2018-05-11 Thread Gianmaria Lari
On 11 May 2018 at 17:58, Aaron Hill wrote: > On 2018-05-11 08:46, David Kastrup wrote: > >> Aaron Hill writes: >> >> On 2018-05-11 06:53, Gianmaria Lari wrote: >>> Sorry to bother with a simple question. Why this does not work? \version "2.19.81" pit = #(define-music-function

Re: simple scheme function #{ $note #}

2018-05-11 Thread Aaron Hill
On 2018-05-11 08:46, David Kastrup wrote: Aaron Hill writes: On 2018-05-11 06:53, Gianmaria Lari wrote: Sorry to bother with a simple question. Why this does not work? \version "2.19.81" pit = #(define-music-function (p) (ly:pitch?) #{ $p #} ) { \pit c' } The result

Re: simple scheme function #{ $note #}

2018-05-11 Thread David Kastrup
Aaron Hill writes: > On 2018-05-11 06:53, Gianmaria Lari wrote: >> Sorry to bother with a simple question. Why this does not work? >> >> \version "2.19.81" >> pit = #(define-music-function >> (p) (ly:pitch?) >> #{ $p #} >> ) >> { \pit c' } > > The result is "error: music f

Re: simple scheme function #{ $note #}

2018-05-11 Thread Aaron Hill
On 2018-05-11 06:53, Gianmaria Lari wrote: Sorry to bother with a simple question. Why this does not work? \version "2.19.81" pit = #(define-music-function (p) (ly:pitch?) #{ $p #} ) { \pit c' } The result is "error: music function cannot return c'". It appears that a

simple scheme function #{ $note #}

2018-05-11 Thread Gianmaria Lari
Sorry to bother with a simple question. Why this does not work? \version "2.19.81" pit = #(define-music-function (p) (ly:pitch?) #{ $p #} ) { \pit c' } Changing the body to #{ $p $p #} or #{ $pit 4 #} or #{ $p a' #} it works g. __