Re: Scheme question

2020-01-14 Thread Urs Liska
Am Dienstag, den 14.01.2020, 17:20 -0800 schrieb Aaron Hill: > On 2020-01-14 5:11 pm, Arle Lommel wrote: > > Is that feature explained anywhere in the documentation? I don’t > > recall seeing anything like that anywhere and searching for > > “quasi-quote scheme Lilypond” doesn’t return anything

Re: Scheme question

2020-01-14 Thread Aaron Hill
On 2020-01-14 5:11 pm, Arle Lommel wrote: Is that feature explained anywhere in the documentation? I don’t recall seeing anything like that anywhere and searching for “quasi-quote scheme Lilypond” doesn’t return anything relevant. If it isn’t there, this seems like rather a nice thing to have

Re: Scheme question

2020-01-14 Thread Arle Lommel
> Since you have a variable, you would need the quasi-quote feature if you > wanted the shorthand: `(,padding . 0) But, (cons padding 0) should > work. > > > -- Aaron Hill Thank you, Aaron. The quasi-quote version did it. Is that feature explained anywhere in the documentation? I don’t

Re: Scheme question

2020-01-14 Thread Aaron Hill
On 2020-01-14 5:01 pm, Arle Lommel wrote: I am a total neophyte to Scheme, but not to coding. I’ve written a simple function, but it does not work (I’ve reduced it to just the problematic lines. Can anyone tell me how to write the line indicated below? shifter = #(define-music-function

Scheme question

2020-01-14 Thread Arle Lommel
I am a total neophyte to Scheme, but not to coding. I’ve written a simple function, but it does not work (I’ve reduced it to just the problematic lines. Can anyone tell me how to write the line indicated below? shifter = #(define-music-function (parser location padding) (number?) #{

Re: scheme-question: matrix-operation

2019-11-04 Thread Thomas Morley
Am Mo., 4. Nov. 2019 um 01:05 Uhr schrieb David Kastrup : > > Thomas Morley writes: > > > Hi, > > > > lets say I've a list of sublists like '((1 2 3)(4 5 6)) > > I want to modify it, the result should be '((1 3 5)(2 4 6)) > > > > This is a matrix-operation (not sure whether matrix is the correct

Re: scheme-question: matrix-operation

2019-11-03 Thread David Kastrup
Thomas Morley writes: > Hi, > > lets say I've a list of sublists like '((1 2 3)(4 5 6)) > I want to modify it, the result should be '((1 3 5)(2 4 6)) > > This is a matrix-operation (not sure whether matrix is the correct > english term), on could write it graphically: > 1 2 3 > 4 5 6 > -> > 1 3

scheme-question: matrix-operation

2019-11-03 Thread Thomas Morley
Hi, lets say I've a list of sublists like '((1 2 3)(4 5 6)) I want to modify it, the result should be '((1 3 5)(2 4 6)) This is a matrix-operation (not sure whether matrix is the correct english term), on could write it graphically: 1 2 3 4 5 6 -> 1 3 5 2 4 6 What's the best scheme-way to get

Re: Scheme question

2019-09-20 Thread Jay Vara
Stefano, That works perfectly. The Cond conditional is even better. Thank you, Jay -- Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html ___ lilypond-user mailing list lilypond-user@gnu.org

Re: Scheme question

2019-09-20 Thread Stefano Troncaro
Hi Jay, your 'if' statements are not nested properly. See: #(define nameold (if (equal? pitch "C") nameCpitch (if (equal? pitch "E") nameEpitch (if (equal? pitch "G") nameGpitch (if (equal? pitch "A")

Scheme question

2019-09-20 Thread Jay Vara
I have defined three pair lists nameCpitch, nameEpitch, nameGpitch and nameApitch. I want to assign nameold to one of the four depending on the value of pitch. I set pitch to G and have a set of if statements to define nameold. However it is not working. When I print one of the lists I

Re: scheme-question about accumulating lists of lists

2019-04-23 Thread Thomas Morley
Hi David, Am Di., 23. Apr. 2019 um 04:12 Uhr schrieb David Pirotte : > ... > > Now `core-guile-condition´ feels like a case for `match´, but I > > couldn't make it work. > > Is this a bad use case and alist searching is always preferable? > > I would do this: [...] regarding your code, it's all

Re: scheme-question about accumulating lists of lists

2019-04-22 Thread David Pirotte
Hello THomas, > ... > Now `core-guile-condition´ feels like a case for `match´, but I > couldn't make it work. > Is this a bad use case and alist searching is always preferable? I would do this: (define (is-spanner? grob) (match grob ((g-key . g-vals) (let ((meta (assq-ref g-vals

Re: scheme-question about accumulating lists of lists

2019-04-22 Thread Thomas Morley
Am So., 21. Apr. 2019 um 23:51 Uhr schrieb David Pirotte : > > Whether 'pattern matching' will be useful to hide complexity to make > > life easier for our users or whether it adds an abstraction layer, > > which would make it even harder for users to write their own > > guile-code, I can't judge

Re: scheme-question about accumulating lists of lists

2019-04-21 Thread David Pirotte
Hi Thomas, > ... > Thanks again! You're welcome. I used 'funny' (weird) procedure and variable names, but if the procedure is to be exposed to your users, and with the objective of making it simple to use, read and maintain, as you described later in your answer, you could write it as - using

Re: scheme-question about accumulating lists of lists

2019-04-21 Thread Thomas Morley
Am So., 21. Apr. 2019 um 02:34 Uhr schrieb David Pirotte : > > Hi Thomas, > > > ... > > Thanks pointing me to this possibility, in my use-case I then could do: > > (define (p) (cons '(1 2 3) '(4 5 6))) > > (define l1 '(a b c)) > > (define l2 '(x y z)) > > (cons* l1 l2 (car (p)) (cdr (p)) '()) > >

Re: scheme-question about accumulating lists of lists

2019-04-20 Thread David Pirotte
Hi Thomas, > ... > Thanks pointing me to this possibility, in my use-case I then could do: > (define (p) (cons '(1 2 3) '(4 5 6))) > (define l1 '(a b c)) > (define l2 '(x y z)) > (cons* l1 l2 (car (p)) (cdr (p)) '()) > => > ((a b c) (x y z) (1 2 3) (4 5 6)) Yes, if you can (you mentioned the

Re: scheme-question about accumulating lists of lists

2019-04-20 Thread Thomas Morley
Hi David, Am Sa., 20. Apr. 2019 um 03:52 Uhr schrieb David Pirotte : > > Hi again, > > Replying twice to myself in a row, how is that :) > A little tired I guess ... > > > > Note that the above will only work if the last 'blue item' has 3 > > > elements, you'd > > > need to adapt

Re: scheme-question about accumulating lists of lists

2019-04-19 Thread David Pirotte
Hi again, Replying twice to myself in a row, how is that :) A little tired I guess ... > > Note that the above will only work if the last 'blue item' has 3 elements, > > you'd > > need to adapt for other use case (which also 'speak' in favor of the cleaner > > approach. >

Re: scheme-question about accumulating lists of lists

2019-04-19 Thread David Pirotte
Hi again, > Note that the above will only work if the last 'blue item' has 3 elements, > you'd > need to adapt for other use case (which also 'speak' in favor of the cleaner > approach. Actually, I didn't like what I wrote, here is a slightly better code: (use-modules (ice-9 match)) (define

Re: scheme-question about accumulating lists of lists

2019-04-19 Thread David Pirotte
Hi Thomas, > Failing example: > (map > car > (cons '(a b c) (cons '(1 2 3) '(x y z > One way to make it work is to convert the initial pair (cons '(1 2 3) > '(x y z)) to a list of lists, i.e (cons '(1 2 3) (list '(x y z))) > The question is: is it the only and/or best way? It sounds a

Re: scheme-question about accumulating lists of lists

2019-04-19 Thread Thomas Morley
Am Fr., 19. Apr. 2019 um 17:09 Uhr schrieb Malte Meyn : > > > > Am 19.04.19 um 16:35 schrieb Thomas Morley: > > I could do > > (cons '(a b c) (list (car (list-pair)) (cdr (list-pair > > and to get the last list: (last ...) > > Looksy clumsy, though. > > > > Any better method? > > I’m not sure

Re: scheme-question about accumulating lists of lists

2019-04-19 Thread Malte Meyn
Am 19.04.19 um 16:35 schrieb Thomas Morley: I could do (cons '(a b c) (list (car (list-pair)) (cdr (list-pair and to get the last list: (last ...) Looksy clumsy, though. Any better method? I’m not sure what you want to do here. But maybe it would be easier to convert the pair of lists

scheme-question about accumulating lists of lists

2019-04-19 Thread Thomas Morley
Hi all, let's say I've a procedure building a pair of lists. Actually it's a built-in procedure, so I can't change it. For the sake of simplicity let's take: (define (list-pair) (cons '(1 2 3) '(x y z))) (list-pair) returns ((1 2 3) x y z) (cdr (list-pair)) returns the second list, i.e. (x y z)

Re: Scheme question

2018-12-26 Thread Muzhic
Thanks a lot, Harm, and a happy musical year to everybody! Envoyé de mon iPhone > Le 26 déc. 2018 à 00:13, Thomas Morley a écrit : > >> Am Di., 25. Dez. 2018 um 21:19 Uhr schrieb Jacques Menu >> : >> >> Hello folks, >> >> I don’t succeed in using ‘#:concat’ to compute the second argument to

Re: Scheme question

2018-12-25 Thread Thomas Morley
Am Di., 25. Dez. 2018 um 21:19 Uhr schrieb Jacques Menu : > > Hello folks, > > I don’t succeed in using ‘#:concat’ to compute the second argument to > ‘#(:note’ in the following Scheme code, where HERE occurs. > > What should I use instead? The aim is to use half the value of ‘den’ instead > of

Scheme question

2018-12-25 Thread Jacques Menu
Hello folks, I don’t succeed in using ‘#:concat’ to compute the second argument to ‘#(:note’ in the following Scheme code, where HERE occurs. What should I use instead? The aim is to use half the value of ‘den’ instead of 4 in the previous line. Thanks for your help! JM -- #(define-public

Re: scheme-question: restricted list inserting

2017-09-16 Thread Thomas Morley
2017-09-17 0:29 GMT+02:00 David Kastrup : > Thomas Morley writes: > >> 2017-09-16 22:20 GMT+02:00 David Kastrup : >>> Thomas Morley writes: >>> Hi all, what's the best (less expensive) method to insert

Re: scheme-question: restricted list inserting

2017-09-16 Thread David Kastrup
Thomas Morley writes: > 2017-09-16 22:20 GMT+02:00 David Kastrup : >> Thomas Morley writes: >> >>> Hi all, >>> >>> what's the best (less expensive) method to insert elements only at the >>> head of a list and between first and

Re: scheme-question: restricted list inserting

2017-09-16 Thread Thomas Morley
2017-09-16 22:20 GMT+02:00 David Kastrup : > Thomas Morley writes: > >> Hi all, >> >> what's the best (less expensive) method to insert elements only at the >> head of a list and between first and second element of said list. >> But don't insert an element

Re: scheme-question: restricted list inserting

2017-09-16 Thread David Kastrup
Thomas Morley writes: > Hi all, > > what's the best (less expensive) method to insert elements only at the > head of a list and between first and second element of said list. > But don't insert an element at list-end if the list is of length 1. > > I do have: > >

scheme-question: restricted list inserting

2017-09-16 Thread Thomas Morley
Hi all, what's the best (less expensive) method to insert elements only at the head of a list and between first and second element of said list. But don't insert an element at list-end if the list is of length 1. I do have: (define (list-insert-first-and-third lst arg1 arg2) (if (pair? lst)

Re: Scheme question: context from grob?

2016-05-19 Thread David Nalesnik
Hi Steven, On Thu, May 19, 2016 at 4:01 PM, Steven Weber wrote: > Is there any way to get the context from a grob? Not that I know of. > Or is there another way to > get the current bar number from a grob? Yes, you can do this using the function grob::rhythmic-location

Scheme question: context from grob?

2016-05-19 Thread Steven Weber
Is there any way to get the context from a grob?  Or is there another way to get the current bar number from a grob? I’m writing an after-line-break function and would like to know what bar number the grob is in: #(define (after-break-function grob) (newline)(display “whatever code gets

Re: Scheme question: convert a range

2015-11-17 Thread Jacques Menu
Hello folks, I’ve tried to integrate such a pure Scheme function: guile> (define (function arg) (if (and (integer? (car arg)) (integer? (cdr arg))) (iota (1+ (interval-length arg)) (car arg) 1) ) ) guile> (function '(3 . 7)) (3 4 5 6 7) as part of a markup, but to no

Re: Scheme question: convert a range

2015-11-17 Thread Jacques Menu
Hello David N. and Andrew, Great, all your suggestions are of some use to me. Thanks! JM > Le 17 nov. 2015 à 14:19, Andrew Bernard a écrit : > > Hi Jacques, > > You could base a solution on this approach: > > c'1 -\markup { > \column { >

Re: Scheme question: convert a range

2015-11-17 Thread Jacques Menu
Message says that #(string-append… is not a markup. > Le 17 nov. 2015 à 13:31, Jacques Menu a écrit : > > Hello folks, > > I’ve tried to integrate such a pure Scheme function: > > > guile> (define (function arg) > (if (and (integer? (car arg)) (integer? (cdr arg))) >

Re: Scheme question: convert a range

2015-11-17 Thread David Nalesnik
Jacques, On Tue, Nov 17, 2015 at 6:32 AM, Jacques Menu wrote: > Message says that #(string-append… is not a markup. > > > Le 17 nov. 2015 à 13:31, Jacques Menu a écrit : > > > > Hello folks, > > > > I’ve tried to integrate such a pure Scheme

Re: Scheme question: convert a range

2015-11-17 Thread Andrew Bernard
Hi Jacques, You could base a solution on this approach: c'1 -\markup { \column { \column { #(string-append "commllen = " (string-concatenate (map number->string '(1 2 } }

Scheme question: convert a range

2015-11-16 Thread Simon Albrecht
Hello, The subject certainly seems cryptic – it’s difficult to summarize, but an example will make it clear immediately. I want to write a scheme procedure, which takes a pair like #'(3 . 7) and returns a list with all the numbers in the range: #'(3 4 5 6 7) How is this done most easily?

Re: Scheme question: convert a range

2015-11-16 Thread Urs Liska
(iota 7 3) Am 15.11.2015 um 19:53 schrieb Simon Albrecht: > Hello, > > The subject certainly seems cryptic – it’s difficult to summarize, but > an example will make it clear immediately. > I want to write a scheme procedure, which takes a pair like #'(3 . 7) > and returns a list with all the

Re: Scheme question: convert a range

2015-11-16 Thread David Kastrup
Simon Albrecht writes: > Hello, > > The subject certainly seems cryptic – it’s difficult to summarize, but > an example will make it clear immediately. > I want to write a scheme procedure, which takes a pair like #'(3 . 7) > and returns a list with all the numbers in the

Re: Scheme question: convert a range

2015-11-16 Thread pls
Simon Albrecht writes: > The subject certainly seems cryptic – it’s difficult to summarize, but > an example will make it clear immediately. > I want to write a scheme procedure, which takes a pair like #'(3 . 7) > and returns a list with all the numbers in the range: #'(3

Re: Scheme question: convert a range

2015-11-16 Thread Simon Albrecht
On 16.11.2015 22:20, Thomas Morley wrote: (define (foo pair) (if (and (integer? (car pair)) (integer? (cdr pair))) (iota (1+ (interval-length pair)) (car pair) 1)) #f) (foo '(3 . 7)) --> (3 4 5 6 7) An equally good solution. Thank you, Simon

Re: Scheme question: convert a range

2015-11-16 Thread Thomas Morley
2015-11-15 19:53 GMT+01:00 Simon Albrecht : > Hello, > > The subject certainly seems cryptic – it’s difficult to summarize, but an > example will make it clear immediately. > I want to write a scheme procedure, which takes a pair like #'(3 . 7) and > returns a list with all

Re: Scheme question: convert a range

2015-11-16 Thread David Nalesnik
On Mon, Nov 16, 2015 at 5:24 PM, David Nalesnik wrote: > Hi Simon, > > On Sun, Nov 15, 2015 at 12:53 PM, Simon Albrecht > wrote: > >> Hello, >> >> The subject certainly seems cryptic – it’s difficult to summarize, but an >> example will make it

Re: Scheme question: convert a range

2015-11-16 Thread David Nalesnik
Hi Simon, On Sun, Nov 15, 2015 at 12:53 PM, Simon Albrecht wrote: > Hello, > > The subject certainly seems cryptic – it’s difficult to summarize, but an > example will make it clear immediately. > I want to write a scheme procedure, which takes a pair like #'(3 . 7) and

Re: Scheme question: convert a range

2015-11-16 Thread Simon Albrecht
On 16.11.2015 21:59, David Kastrup wrote: Simon Albrecht writes: Hello, The subject certainly seems cryptic – it’s difficult to summarize, but an example will make it clear immediately. I want to write a scheme procedure, which takes a pair like #'(3 . 7) and returns

Re: Scheme question: convert a range

2015-11-16 Thread Simon Albrecht
On 16.11.2015 23:30, pls wrote: Simon Albrecht writes: The subject certainly seems cryptic – it’s difficult to summarize, but an example will make it clear immediately. I want to write a scheme procedure, which takes a pair like #'(3 . 7) and returns a list with all the

Re: Scheme question: convert a range

2015-11-16 Thread David Nalesnik
On Mon, Nov 16, 2015 at 5:33 PM, David Nalesnik wrote: > >> If not, something like this would work: >> > (for all cases) ___ lilypond-user mailing list lilypond-user@gnu.org

Re: Scheme question: convert a range

2015-11-16 Thread Andrew Bernard
Hi Simon, Fellow listers have posted many answers while I was cooking up this one. All good! (use-modules (srfi srfi-1)) (define (range r) (let ((start (car r)) (end (cdr r))) (iota (+ (- end start) 1) start 1))) That’s pure Scheme of course. Thomas Morley’s answer is

Re: Scheme question: convert a range

2015-11-16 Thread David Nalesnik
On Mon, Nov 16, 2015 at 3:22 PM, Simon Albrecht wrote: > On 16.11.2015 22:20, Thomas Morley wrote: > >> (define (foo pair) >>(if (and (integer? (car pair)) (integer? (cdr pair))) >>(iota (1+ (interval-length pair)) (car pair) 1)) >>#f) >> >> (foo '(3 .

Re: Arrastres: function scheme question - Built from ideas of Simon and David -- Dynamic mark at the end of a bar

2015-05-31 Thread Jacques Menu
Hello Stephen, Changing : \once \override NoteHead.extra-spacing-width = #`(,len . 1) to : \once \override NoteHead.extra-spacing-width = #`(,(- len) . 1) allows a positive number instead. JM Le 31 mai 2015 à 02:47, Stephen MacNeil classicalja...@gmail.com a écrit : the

Re: Arrastres: function scheme question - Built from ideas of Simon and David -- Dynamic mark at the end of a bar

2015-05-31 Thread Stephen MacNeil
Thank you for that Stephen ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user

Arrastres: function scheme question - Built from ideas of Simon and David -- Dynamic mark at the end of a bar

2015-05-30 Thread Stephen MacNeil
I used the first snippet posted by Simon for an Arrastres function. Then I noticed Davids post for afterGrace so I tried my hand at that. Both work but I have a few questions. In the first posted by simon I did it my typical way. And it works like all my other functions. Typically I use modified

RE:Arrastres: function scheme question - Built from ideas of Simon and David -- Dynamic mark at the end of a bar

2015-05-30 Thread Stephen MacNeil
the second didn't work correctly so i changed it \version 2.18.2 Fraction = #(cons 6 8) Arrastres = #(define-music-function (parser location len main grace) (number? ly:music? ly:music?) (_i Create @var{grace} note(s) after a @var{main} music _expression_.) (let ((main-length

Re: Scheme question

2011-03-10 Thread TaoCG
. is it possible to store the value in another variable? Also, is there some info about the Timing context because I couldn't find it in the Internals. Regards, Tao -- View this message in context: http://old.nabble.com/Scheme-question-tp31109572p31113015.html Sent from the Gnu - Lilypond - User mailing

Re: Scheme question

2011-03-10 Thread TaoCG
additional information available on contexts like 'Timing or 'ContextSpeccedMusic? Regards, Tao -- View this message in context: http://old.nabble.com/Scheme-question-tp31109572p31122831.html Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com

Scheme question

2011-03-09 Thread TaoCG
this message in context: http://old.nabble.com/Scheme-question-tp31109572p31109572.html Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com. ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo

Re: Scheme question

2011-03-09 Thread Carl Sorensen
On 3/9/11 12:22 PM, TaoCG tao_lilypondu...@gmx.net wrote: Hi, is it possible to determine the current time signature with scheme? I would like to alter the functions from this snippet so that the length of the produced rest equals the denominator and that $count equals the nominator.

Scheme question regarding hiding accidentals

2009-12-04 Thread Aaron Dalton
I'm typesetting a book of Italian madrigals and have used the accidental-style 'forget' for the project as it deals correctly with 99% of my accidentals. The issue is when I have a chromatically inflected note repeated. It quite naturally wants to reprint the accidental for each note. For

Re: Scheme question regarding hiding accidentals

2009-12-04 Thread Robin Bannister
Aaron Dalton wrote: I want to be able to hide the accidental. There is Mark Polesky's suppress-accidental http://lists.gnu.org/archive/html/lilypond-devel/2009-07/msg00384.html but that is probably overkill in your case. You can do it by switching the style in a music function

Re: Scheme question regarding hiding accidentals

2009-12-04 Thread Reinhold Kainhofer
Am Samstag, 5. Dezember 2009 01:42:16 schrieb Robin Bannister: Aaron Dalton wrote: I want to be able to hide the accidental. There is Mark Polesky's suppress-accidental http://lists.gnu.org/archive/html/lilypond-devel/2009-07/msg00384.html but that is probably overkill in your case. You

Translating tempo marks -- scheme question

2008-12-19 Thread Dmytro O. Redchuk
Hi, i asked some question about tempo marks translation some time ago. So, i've tried to find a solution, and now i need help (and suggestion?). Please, take a look. A question is below :-) % here is a dictionary: #(define tempi (list (cons Adagio Повільно) (cons Allegro

Re: Translating tempo marks -- scheme question

2008-12-19 Thread Mark Polesky
Dmytro, This isn't stupid. What's happening (I think) is: Metronome_mark_engraver sees the exact same tempo command twice in a row, so it doesn't print the second one, since it's redundant. As if to say, the tempo already *is* Allegretto, no need to reprint it. Off the top of my head, I don't

Re: Translating tempo marks -- scheme question

2008-12-19 Thread Neil Puttock
2008/12/19 Mark Polesky markpole...@yahoo.com: 2) use (null? items) instead of (equal? '() items) 3) use (caar items) instead of (car (car items)) 4) use (cdar items) instead of (cdr (car items)) More streamlining, since the dictionary is an alist: #(define (getLocalized items word)

Re: Translating tempo marks -- scheme question

2008-12-19 Thread Mark Polesky
Neil Puttock wrote: More streamlining, since the dictionary is an alist: #(define (getLocalized items word) (assoc-get word items word)) While we're at it, we might as well replace (list '(a . b) '(c . d)) with '((a . b) (c . d)): #(define tempi '((Adagio . Повільно) (Allegro .

Re: Translating tempo marks -- scheme question

2008-12-19 Thread Dmytro O. Redchuk
Thank you, Mark and Neil. I forget to notice once again that i am not a programmer, and my scripting experience if way far from programming scheme :-) However (therefore) you responses are very helpful, i will study them :-) 2008/12/19 Mark Polesky markpole...@yahoo.com: What's happening (I

Re: Scheme question: symbol to music

2008-11-13 Thread Johan Vromans
Graham Percival [EMAIL PROTECTED] writes: Hmm. I guess I don't quite understand what you were asking; I can't see why \tag wouldn't work. Using \tag requires that all the variables are defined, and the variables that need (not) to be processed must get a tag. leadWords = \lyricmode { Some

Re: Scheme question: symbol to music

2008-11-13 Thread Johan Vromans
Roman Stawski [EMAIL PROTECTED] writes: Take a look at http://lsr.dsi.unimi.it/LSR/Item?u=1id=493 Nice! Is there a way to get rid of the warning: no such internal option: target? This lets you have constructs such as \ifTargetIn #'(foo) { ... } A limitation is that it works on

e: Scheme question: symbol to music

2008-11-13 Thread Roman Stawski
[EMAIL PROTECTED] wrote: Roman Stawski [EMAIL PROTECTED] writes: Take a look at http://lsr.dsi.unimi.it/LSR/Item?u=1id=493 Nice! Is there a way to get rid of the warning: no such internal option: target? I asked Nicolas Sceaux the same question when he helped me set this up. Apparently,

Re: Scheme question: symbol to music

2008-11-12 Thread Johan Vromans
Carl Sorensen [EMAIL PROTECTED] writes: You need to use the procedure primitive-eval to evaluate a symbol YES! That's the trick. Thanks! -- Johan ___ lilypond-user mailing list lilypond-user@gnu.org

Re: Scheme question: symbol to music

2008-11-12 Thread Johan Vromans
Mark Polesky [EMAIL PROTECTED] writes: Wow! Someone should add this to the LSR! Stay tuned, it'll get even better... -- Johan ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user

Re: Scheme question: symbol to music

2008-11-12 Thread Johan Vromans
Johan Vromans [EMAIL PROTECTED] writes: Stay tuned, it'll get even better... If it would only work... What I'm trying to achieve is to have input lines processed selectively based on whether certain symbols are defined. For example, I have a file highstaff.ly: \new Staff = High

Re: Scheme question: symbol to music

2008-11-12 Thread Graham Percival
On Wed, Nov 12, 2008 at 05:28:37PM +0100, Johan Vromans wrote: What I'm trying to achieve is to have input lines processed selectively based on whether certain symbols are defined. Umm, use \tag? See different editions from one source in NR 3. Cheers, - Graham

Re: Scheme question: symbol to music

2008-11-12 Thread Mark Polesky
Wow! Someone should add this to the LSR! - Mark ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user

Re: Scheme question: symbol to music

2008-11-12 Thread Nicolas Sceaux
Le 12 nov. 08 à 05:48, Carl Sorensen a écrit : Johan Vromans jvromans at squirrel.nl writes: Stupic question, I assume... In a scheme function I have a symbol that is the name of a lilypond expression. How can I get its music value? E.g. ifDefined = #(define-music-function (parser

Re: Scheme question: symbol to music

2008-11-12 Thread Johan Vromans
Nicolas Sceaux [EMAIL PROTECTED] writes: A more idiomatic way to do it: Nice. This gives me the following snippet: % \ifDefined #'symbol % Returns the music expression defined by symbol, % or a void expression if symbol has not been defined. ifDefined = #(define-music-function

Re: Scheme question: symbol to music

2008-11-12 Thread Johan Vromans
Graham Percival [EMAIL PROTECTED] writes: On Wed, Nov 12, 2008 at 05:28:37PM +0100, Johan Vromans wrote: What I'm trying to achieve is to have input lines processed selectively based on whether certain symbols are defined. Umm, use \tag? I use this for other purposes: allMusic = {

Re: Scheme question: symbol to music

2008-11-12 Thread Graham Percival
On Wed, Nov 12, 2008 at 11:47:04PM +0100, Johan Vromans wrote: Graham Percival [EMAIL PROTECTED] writes: On Wed, Nov 12, 2008 at 05:28:37PM +0100, Johan Vromans wrote: What I'm trying to achieve is to have input lines processed selectively based on whether certain symbols are defined.

Re: Scheme question: symbol to music

2008-11-12 Thread Roman Stawski
Johan This is the sort of thing I was playing with earlier on this year. Take a look at http://lsr.dsi.unimi.it/LSR/Item?u=1id=493 This lets you have constructs such as \ifTargetIn #'(foo) { ... } In this case the symbols are switched on/off on the command-line but you could always change

Scheme question: symbol to music

2008-11-11 Thread Johan Vromans
Stupic question, I assume... In a scheme function I have a symbol that is the name of a lilypond expression. How can I get its music value? E.g. ifDefined = #(define-music-function (parser location sym) (symbol?) (if (defined? sym) ??? return the value of the expression ???

Re: Scheme question: symbol to music

2008-11-11 Thread Carl Sorensen
Johan Vromans jvromans at squirrel.nl writes: Stupic question, I assume... In a scheme function I have a symbol that is the name of a lilypond expression. How can I get its music value? E.g. ifDefined = #(define-music-function (parser location sym) (symbol?) (if

scheme question

2008-07-24 Thread Matthieu Jacquot
! command, but maybe it's not at all the good approach... Can anyone help me? Do you know how I can find exemples from the source code? with best regards Matthieu PS : sorry to have post this thread in the dev mailing list yesterday. -- View this message in context: http://www.nabble.com/scheme-question

Re: scheme question

2008-07-24 Thread Matthieu Jacquot
/scheme-question-tp18628816p18640520.html Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com. ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user

Re: Scheme question

2007-11-03 Thread Nicolas Sceaux
Le 3 nov. 07 à 00:00, Steven Weber a écrit : I need a function that takes 7 parameters. My function works fine as long as there are only 3 parameters – as soon as I add the fourth, everything blows up, with the following error: programming error: no parser tag defined for this markup

Scheme question

2007-11-02 Thread Steven Weber
Hey everyone! I'm hoping one of the Scheme gods on the list can tell me what I'm doing wrong here. I'm trying to create a markup function that will draw harp pedal diagrams. To do that, I need a function that takes 7 parameters. My function works fine as long as there are only 3 parameters

Re: Little scheme question

2006-12-08 Thread Sébastien Gross
On Wed, Dec 06, 2006 at 09:05:53PM +0100, [EMAIL PROTECTED] wrote: [...] The first thing to do is to observe what the input music looks like, and what the output of your function should look like, using \displayMusic. The purpose of your function will then be to transform one into the other.

Re: Little scheme question

2006-12-08 Thread Sébastien Gross
On Fri, Dec 08, 2006 at 05:46:03PM +0100, [EMAIL PROTECTED] wrote: Maybe the code is ugly (my first scheme routine) and may be enhenced. I thing about: - use relative music whitout being messed u by octave shifts - abbility to change tags - put all in a scm file instead of

Little scheme question

2006-12-06 Thread Sebastien Gross
Hi all I do use lilypond for a while and I have a recurent problem when splitting notes to feat to a beat. Let's see a simple example: [1]: relative c { c4. ees bes' d4 c8 ees bes' ees4 } This produce a nice output but: [2]: \relative c { c4 ~ c8 ees bes' d8 ~ ees bes' d c8 ees bes' ees4 } I

Re: Little scheme question

2006-12-06 Thread Nicolas Sceaux
Sebastien Gross [EMAIL PROTECTED] writes: The question is how to factorise an expression like: \tag #'tab {ees bes' d4} tag #'score {ees bes' d8 ~ ees bes' d} to something like: \tabRhythme {ees bes' d} #'(4) #'(8 8) I thought to write a function like: tabRhythme =

Re: Scheme question on strict substitution

2006-12-03 Thread Erik Sandberg
On Thursday 30 November 2006 21:32, [EMAIL PROTECTED] wrote: Hello, . . . one problem is that this [giving the syntax of each keyword] would still just tell a small part of the full syntax. I think it would give a big part of the full syntax, even if not the whole picture. It would

Re: Scheme question on strict substitution

2006-12-03 Thread stk
Hello, As regards the issue of context-free equivalence -- I can say foo = \markup { \bold Zanzibar } bar = \markup { Stand on \foo } but I can't say bar = \markup { Stand on \markup { \bold Zanzibar } } [so] \foo is not equivalent to \markup { \bold

Re: Scheme question on strict substitution

2006-12-01 Thread Nicolas Sceaux
Han-Wen Nienhuys [EMAIL PROTECTED] writes: Mats Bengtsson escreveu: As already said, this is not available in the current manual and one problem is that this would still just tell a small part of the full syntax. Another This should be rather easy to add to the manual. I believe some of

Re: Scheme question on strict substitution

2006-11-30 Thread stk
Hello, It may help your understanding to know that \tweak itself is implemented as a music function taking 3 arguments. The syntax of \tweak is \tweak symbol value music_expression OK, thank you, that's very clear. That fact, for any given keyword, would tell a user immediately whether

Re: Scheme question on strict substitution

2006-11-30 Thread Mats Bengtsson
[EMAIL PROTECTED] wrote: Hello, It may help your understanding to know that \tweak itself is implemented as a music function taking 3 arguments. The syntax of \tweak is \tweak symbol value music_expression OK, thank you, that's very clear. That fact, for any given

Re: Scheme question on strict substitution

2006-11-30 Thread stk
Hello, . . . one problem is that this [giving the syntax of each keyword] would still just tell a small part of the full syntax. I think it would give a big part of the full syntax, even if not the whole picture. It would enable a user to know (1) what type of arguments have to follow the

Re: Scheme question on strict substitution

2006-11-30 Thread Han-Wen Nienhuys
Mats Bengtsson escreveu: OK, thank you, that's very clear. That fact, for any given keyword, would tell a user immediately whether (s)he could just write a macro or would be forced to define a function for some expression involving the keyword. Is the information (1) number of

Re: Scheme question on strict substitution

2006-11-29 Thread Trevor Bača
On 11/29/06, Mats Bengtsson [EMAIL PROTECTED] wrote: No, this doesn't work. What does work is \version 2.10.0 fraction = #(define-music-function (parser location music) (ly:music?) #{ \tweak #'text #tuplet-number::calc-fraction-text $music #}) This is exactly what I was

Re: Scheme question on strict substitution

2006-11-29 Thread stk
Hello, Does it work just to define this macro at the top level fraction = \tweak #'text #tuplet-number::calc-fraction-text No, this doesn't work. OK, but I have a question. It is common to write such things as push = \once \override NoteColumn #'extra-X-extent = #'(0 .

  1   2   >