Re: Scheme function help

2014-06-15 Thread Phil Holmes
- Original Message - From: "David Kastrup" To: "Phil Holmes" Cc: Sent: Sunday, June 15, 2014 4:34 PM Subject: Re: Scheme function help Phil Holmes writes: I'm not top posting I'm typesetting quite a bit of mensural music, and using the same musi

Re: Scheme function help

2014-06-15 Thread David Kastrup
Phil Holmes writes: >> I'm not top posting > > I'm typesetting quite a bit of mensural music, and using the same music > source for both mensural and modern. The mensural rests tend to be > pitched and the modern ones aren't. So I often have to use the following > as input: > > \tag #'mens {

Scheme function help

2014-06-15 Thread Phil Holmes
> I'm not top posting I'm typesetting quite a bit of mensural music, and using the same music source for both mensural and modern. The mensural rests tend to be pitched and the modern ones aren't. So I often have to use the following as input: \tag #'mens { f2 \rest } \tag #'mod { r2 } and

Re: scheme function help

2013-05-08 Thread Urs Liska
Am 08.05.2013 11:23, schrieb Peter Gentry: ... David Kastrup > writes: Well, I definitely proud myself on facilitating one of the fastest PTF times for active projects (PTF = posting to flamewar). Peter writes: David you have not been flamed your work is highly respected. I don't think th

Re: scheme function help

2013-05-07 Thread David Kastrup
Stjepan Horvat writes: > I did not mean to criticize anyone but to learn how to use the > software completely. And that was my fault as I did not watch which > documentation I read, ie the version. I'm sorry. I was no annoyed at you making a mistake, but rather that Peter used that in order to p

Re: scheme function help

2013-05-07 Thread Stjepan Horvat
I did not mean to criticize anyone but to learn how to use the software completely. And that was my fault as I did not watch which documentation I read, ie the version. I'm sorry. I think lilypond has a great community and i did't have to wait more that 12h to get at least a response. This is very

Re: scheme function help

2013-05-07 Thread David Kastrup
"Peter Gentry" writes: > This conversation is throwing much light on the difficulty that even > the computer literate face when trying to learn the Lilypond > Scheme interface. By using documentation from 5 years ago with a current version of LilyPond. Preceding my work on usability. I don't c

Re: scheme function help

2013-05-06 Thread Stjepan Horvat
Madoka..you are right..i'm trying to learn Scheme by writing simple functions..i have many ideas about what i would want to achieve..for example..\mark \default is a cool feature because it is never in wrong order..but when it is inside a bar i would want it to have a "," under it..so now i'm tryin

Re: scheme function help

2013-05-06 Thread David Kastrup
Madoka Machitani writes: > On Mon, May 6, 2013 at 10:59 PM, David Kastrup wrote: > [...] > > In general, your approach is fundamentally flawed: it is very bad > idea > to write code relying on user-specified music to be of a > particular type > (in this case, SequentialMusic)

Re: scheme function help

2013-05-06 Thread Madoka Machitani
On Mon, May 6, 2013 at 10:59 PM, David Kastrup wrote: [...] > In general, your approach is fundamentally flawed: it is very bad idea > to write code relying on user-specified music to be of a particular type > (in this case, SequentialMusic) without verifying it. [...] > I think he is just stru

Re: scheme function help

2013-05-06 Thread David Kastrup
Stjepan Horvat writes: > When i do this [...] > and David yours makes > > (make-music > 'SequentialMusic > 'elements > (list (make-music > 'SequentialMusic > 'elements > (list (make-music (quote MarkEvent) (quote label) "A") > (make-music >

Re: scheme function help

2013-05-06 Thread David Kastrup
Stjepan Horvat writes: > after insMark =* was a strange invisible character with code 160, Hex > 00a0, Octal 240 and becouse of that it wouldn't want to pass.. Could you tell your mail program _not_ to include HTML versions of the mail? HTML works particularly bad for rendering (indented) code

Re: scheme function help

2013-05-06 Thread Stjepan Horvat
And this concept with including lilypond code block in function is 100% easyer..:) On Mon, May 6, 2013 at 12:40 PM, Stjepan Horvat wrote: > When i do this > insMark = > #(define-music-function (parser location mark mus) > (markup? ly:music?) > (set! (ly:music-property mus 'elements) >(con

Re: scheme function help

2013-05-06 Thread Stjepan Horvat
When i do this insMark = #(define-music-function (parser location mark mus) (markup? ly:music?) (set! (ly:music-property mus 'elements) (cons (make-music 'MarkEvent 'label mark) (ly:music-property mus 'elements))) mus) \displayMusic { \insMark "A" c'4 } (make-music 'SequentialMusic

Re: scheme function help

2013-05-06 Thread Madoka Machitani
Hi, David! On Mon, May 6, 2013 at 6:40 PM, David Kastrup wrote: > Madoka Machitani writes: > > > Now, is it correct to assume you are trying to achieve something like > > this? \insMark "a" musical-sequence > > > > If so, the function would be: > > > > insMark = > > #(define-music-function (pa

Re: scheme function help

2013-05-06 Thread Stjepan Horvat
I'm using GNU LilyPond 2.16.2 and Guile 1.8.8 I found out the error insMark = #(define-music-function (parser location mark mus) (markup? ly:music?) (set! (ly:music-property mus 'elements) (cons (make-music 'MarkEvent 'label mark) (ly:music-property mus 'elements))) mus) \

Re: scheme function help

2013-05-06 Thread David Kastrup
Madoka Machitani writes: > Now, is it correct to assume you are trying to achieve something like > this? \insMark "a" musical-sequence > > If so, the function would be: > > insMark = > #(define-music-function (parser location mark mus) >(markup? ly:music?) >(set! (ly:music-property mus '

Re: scheme function help

2013-05-06 Thread David Kastrup
Stjepan Horvat writes: > I'm trying to figure out how and learn to create a function based on a > \displayMusic function. > for example: > \displayMusic { \mark "A" c'4 } > gives me > (make-music > 'SequentialMusic > 'elements > (list (make-music (quote MarkEvent) (quote label) "A") > (make-music

Re: scheme function help

2013-05-06 Thread Madoka Machitani
Hi, Stjepan On Mon, May 6, 2013 at 4:57 PM, Stjepan Horvat wrote: > Ok..thanks Madoka.. > It wasn't to me clear where i have to use the display-scheme-music > function => in lilypond scheme-sandbox..and that it had to be > music..ok..that is now clear.. > > but your function does not work for me

Re: scheme function help

2013-05-06 Thread Stjepan Horvat
Ok..thanks Madoka.. It wasn't to me clear where i have to use the display-scheme-music function => in lilypond scheme-sandbox..and that it had to be music..ok..that is now clear.. but your function does not work for me: i get this (make-music 'SequentialMusic 'elements (list (make-music (quo

Re: scheme function help

2013-05-05 Thread Madoka Machitani
Hi, Let me first point out that you have to remember object type matters. ly:music-property expects music object, not pitch object or anything else, so you have to give a music object to it, like this: (display-scheme-music (car (ly:music-property #{ \mark "A" c'4 #} 'el

RE: scheme function help

2013-05-05 Thread Peter Gentry
I don't have any answers for you but only sympathy for a fellow struggler. I have many years of experience with several languages but Scheme seems so idiosyncratic that it is difficult to learn. Each particle of knowledge seems to be standalone and not transferable to a new situation nothing is

scheme function help

2013-05-05 Thread Stjepan Horvat
I'm trying to figure out how and learn to create a function based on a \displayMusic function. for example: \displayMusic { \mark "A" c'4 } gives me (make-music 'SequentialMusic 'elements (list (make-music (quote MarkEvent) (quote label) "A") (make-music 'NoteEvent

Re: Scheme function help - modifying note durations

2012-10-06 Thread David Kastrup
Shashank Raja writes: > I want to write a scheme function that doubles a note such that the > pitch (let's call it 'x') is retained, but the respective durations > are such that {x8.. x32} is displayed. > Since \displayMusic{ c'8.. c'32 } outputs this: > https://raw.github.com/gist/3843324/f7779

Scheme function help - modifying note durations

2012-10-06 Thread Shashank Raja
I want to write a scheme function that doubles a note such that the pitch (let's call it 'x') is retained, but the respective durations are such that {x8.. x32} is displayed. Since \displayMusic{ c'8.. c'32 } outputs this: https://raw.github.com/gist/3843324/f77790c4917337539936584ae65bb886f804edec