Re: Programming question

2014-11-26 Thread David Nalesnik
Jay, On Wed, Nov 26, 2014 at 4:10 AM, Jay Vara wrote: > Yay! That works. Not sure why the other way did not work. > > I tried various ways of getting it to output to a string instead of to a > file, something like: > > #(set! (jv (with-output-to-string > > (lambda () #{ \displayMusic \music #}))

Re: Programming question

2014-11-26 Thread Jay Vara
Yay! That works. Not sure why the other way did not work. I tried various ways of getting it to output to a string instead of to a file, something like: #(set! (jv (with-output-to-string (lambda () #{ \displayMusic \music #} so that we could add the # to the string jv. No luck here as I co

Re: Programming question

2014-11-25 Thread David Nalesnik
Harm, On Tue, Nov 25, 2014 at 11:54 AM, Thomas Morley wrote: attached my own attempt using Davids work and some recyceled > own codings. > Very nice! ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond

Re: Programming question

2014-11-25 Thread David Nalesnik
On Tue, Nov 25, 2014 at 8:49 AM, Jay Vara wrote: > Trying to force the lyric in David's program to associate with the > Staff/Voice, I added a name "jun" to the voice and see if that worked. > [...] In this case, the lyrics, that is the pitch numbers, did not show up at > all! Wonder why? > I

Re: Programming question

2014-11-25 Thread David Nalesnik
On Tue, Nov 25, 2014 at 12:42 PM, Jay Vara wrote: > This version seems to work. You are creating a list of lyric-events to be > fed to the parser rather than a string - is that the difference? Hopefully > I can understand your code within a few days. > > Interestingly, b-flat is coming out as b r

Re: Programming question

2014-11-25 Thread Jay Vara
This version seems to work. You are creating a list of lyric-events to be fed to the parser rather than a string - is that the difference? Hopefully I can understand your code within a few days. Interestingly, b-flat is coming out as b rather than bes. Or rather b is shown as b-flat on the staff.

Re: Programming question

2014-11-25 Thread Thomas Morley
2014-11-25 15:49 GMT+01:00 Jay Vara : > Trying to force the lyric in David's program to associate with the > Staff/Voice, I added a name "jun" to the voice and see if that worked. > > noteNameToLyric = > > #(define-void-function (parser location lst) (list?) > > (let* ((str (t lst)) > > (str (strin

Re: Programming question

2014-11-25 Thread Thomas Morley
2014-11-25 15:49 GMT+01:00 Jay Vara : > Trying to force the lyric in David's program to associate with the > Staff/Voice, I added a name "jun" to the voice and see if that worked. > > noteNameToLyric = > > #(define-void-function (parser location lst) (list?) > > (let* ((str (t lst)) > > (str (strin

Re: Programming question

2014-11-25 Thread Jay Vara
Trying to force the lyric in David's program to associate with the Staff/Voice, I added a name "jun" to the voice and see if that worked. noteNameToLyric = #(define-void-function (parser location lst) (list?) (let* ((str (t lst)) (str (string-append "{ " str "}"))) (display str) (newline) (ly

Re: Programming question

2014-11-23 Thread David Nalesnik
Hi, On Sun, Nov 23, 2014 at 3:31 PM, Mike Solomon wrote: > > > On Nov 23, 2014, at 10:21 PM, Jay Vara wrote: > > > > Given that NoteNames are really a type of lyrics, is it possible to have > a function that just takes music and returns a text string that is a lyric. > > > > For example: > > >

Re: Programming question

2014-11-23 Thread Mike Solomon
> On Nov 23, 2014, at 10:21 PM, Jay Vara wrote: > > Given that NoteNames are really a type of lyrics, is it possible to have a > function that just takes music and returns a text string that is a lyric. > > For example: > > music = \relative c' { c4 d e f g a b c } > > notenameLyric = \Note

Programming question

2014-11-23 Thread Jay Vara
Given that NoteNames are really a type of lyrics, is it possible to have a function that just takes music and returns a text string that is a lyric. For example: music = \relative c' { c4 d e f g a b c } notenameLyric = \NoteNameToLyric \music would make notenameLyric = "c d e f g a b c" so

Re: Engraver Programming Question

2014-09-24 Thread Jay Vara
Jan > > > Hi Jay, > to output something, you have to display it. The format function > returns the formatted string. If you insert #t (true) prior the > format string, it will output the result to stdout: > (format #t "length ~a position ~a note-names ~a ~%" measure

Re: Engraver Programming Question

2014-09-24 Thread Jan-Peter Voigt
Hi Jay, to output something, you have to display it. The format function returns the formatted string. If you insert #t (true) prior the format string, it will output the result to stdout: (format #t "length ~a position ~a note-names ~a ~%" measure-len measure-pos note-names) HTH Jan-Pet

Engraver Programming Question

2014-09-24 Thread Jay Vara
>I am not top-posting I tried to build in a way to get the measurePosition and measureLength in a user defined engraver (lines 13 and 14). The idea was to change them as needed. As a first step, I wanted to print the values - I tried putting in a format statement (line 23). The program runs w

Re: Programming Question

2014-09-19 Thread Jay Vara
David Definitely consider trying out the Scheme "sandbox."  It's much more convenient for learning Scheme than embedding Scheme in ly files. I will try out the sandbox. Yes, it's a lifesaver.  I use format more often, because it makes constructing meaningful

Re: Programming Question

2014-09-19 Thread David Nalesnik
Hi Jay, On Fri, Sep 19, 2014 at 4:53 AM, Jay Vara wrote: > Paul, > > >can read up on them in the Guile manual). > >Here's the section on equality (eq? eqv? and equal?): >https://www.gnu.org/software/guile/manual/guile.html#Equality > >I've found the guile manual t

Re: Programming Question

2014-09-19 Thread Jay Vara
Paul, can read up on them in the Guile manual). Here's the section on equality (eq? eqv? and equal?): https://www.gnu.org/software/guile/manual/guile.html#Equality I've found the guile manual to be a helpful resource for learning to use Scheme. Yes, I usua

Re: Programming Question

2014-09-19 Thread Jay Vara
David, Right. Thanks. I know my mistake now - from reading the guile page, I thought eqv? should work for characters. However I should have used string=? since the variable is a string. The display function is a real life saver. Not only is it easy to spot mistakes, it also makes it a good way

Re: Programming Question

2014-09-18 Thread Paul Morris
em in the Guile manual). Here's the section on equality (eq? eqv? and equal?): https://www.gnu.org/software/guile/manual/guile.html#Equality I've found the guile manual to be a helpful resource for learning to use Scheme. Cheers, -Paul -- View this message in context: http://lilypond.1

Re: Programming Question

2014-09-18 Thread David Nalesnik
Hi Jay, On Thu, Sep 18, 2014 at 6:28 PM, Jay Vara wrote: > > I am not top-posting > > David, > > I defined a second variable nsiz which is 1, 2 or 3 > > Tried > > (case duration-log > ((nsiz) "a" ) > (else ""))) > > This condition was never succeeding although I printed out nsiz and > duratio

Re: Programming Question

2014-09-18 Thread Jay Vara
> I am not top-posting David, I defined a second variable nsiz which is 1, 2 or 3 Tried (case duration-log ((nsiz) "a" ) (else ""))) This condition was never succeeding although I printed out nsiz and duration-log and they were the same. Then I changed it into an if statement - that work

Re: Programming Question

2014-09-18 Thread David Nalesnik
On Thu, Sep 18, 2014 at 9:57 AM, Jay Vara wrote: > David: > > Friscobaldi says: > > Starting lilypond-windows.exe 2.18.2 [Alam-Ata.ly]... > Processing `c:/users/arjuna/appdata/local/temp/frescobaldi- > pvt8zv/tmptpz4so/Alam-Ata.ly' > Parsing... > Interpreting music...[8][16][24][32][40][48][56][6

Re: Programming Question

2014-09-18 Thread Jay Vara
David Fantastic! I can not claim to understand what you have done. The display command is helping - I can see that text has what I need, and why I need to replace the new-name with text in the set property line. Thanks, Jay ___ lilypond-user mailin

Re: Programming Question

2014-09-18 Thread David Nalesnik
Hi Jay, On Thu, Sep 18, 2014 at 10:54 AM, Jay Vara wrote: > > Is this the way I enter it? For some reason, does not seem to be working > - it seems to be ignoring the suffix. > > By the time you set the 'text property, new-name doesn't hold the "newest" name, rather the variable text does. You

Re: Programming Question

2014-09-18 Thread Jay Vara
>I am not top-posting David, You are way too good! Is this the way I enter it? For some reason, does not seem to be working - it seems to be ignoring the suffix. If I wanted to display new-name as the program runs, is there a command for that? Thanks Jay \version "2.18.2" music = \relativ

Re: Programming Question

2014-09-18 Thread Jay Vara
David: Friscobaldi says: Starting lilypond-windows.exe 2.18.2 [Alam-Ata.ly]... Processing `c:/users/arjuna/appdata/local/temp/frescobaldi- pvt8zv/tmptpz4so/Alam-Ata.ly' Parsing... Interpreting music...[8][16][24][32][40][48][56][64] Preprocessing graphical objects... Interpreting music... warning

Re: Programming Question

2014-09-18 Thread David Nalesnik
Hi Jay, On Thu, Sep 18, 2014 at 9:54 AM, Jay Vara wrote: > > On the other hand, what would be nice is if the NoteName could be changed > based on duration. In particular, if the note is a half note, I would like > to add a character (say a "-" or a "a") to the note name. This could be > more in

Re: Programming Question

2014-09-18 Thread Jay Vara
David, Wow! The power of programming knowledge! Yeah, size can be set based on duration. In my particular case, this is giving some unwanted effects since the duration of all my notes are not the same (unlike in the small example I made up for this post). So I will be using your earlier sugges

Re: Programming Question

2014-09-18 Thread David Nalesnik
On Thu, Sep 18, 2014 at 7:42 AM, Jay Vara wrote: > Yay! I tried the "cryptic" version you suggested, and it works nicely. The > syntax does take some time to get used to. > > When lilypond displays an error, is it possible to know which line of code > the error is in? I am using Friscobaldi. > Y

Re: Programming Question

2014-09-18 Thread David Nalesnik
Hi Jay, On Thu, Sep 18, 2014 at 7:28 AM, David Nalesnik wrote: > > > On Thu, Sep 18, 2014 at 7:01 AM, David Nalesnik > wrote: > > >> >> > >> >> Now, if you want to have LilyPond detect the note durations and make the >> fontsize decisions for you, I don't believe you'll be able to use the >> N

Re: Programming Question

2014-09-18 Thread Jay Vara
Yay! I tried the "cryptic" version you suggested, and it works nicely. The syntax does take some time to get used to. When lilypond displays an error, is it possible to know which line of code the error is in? I am using Friscobaldi. ___ lilypond-u

Re: Programming Question

2014-09-18 Thread David Nalesnik
On Thu, Sep 18, 2014 at 7:01 AM, David Nalesnik wrote: > myNoteNames = > #(lambda (size) >(lambda (grob) > > > > #(define (myNoteNames size) >(lambda (grob) > > Or even the cryptic #(define ((myNoteNames size) grob) > > Now, if you want to have LilyPond detect the note durations an

Re: Programming Question

2014-09-18 Thread David Nalesnik
Hi Jay, On Thu, Sep 18, 2014 at 4:43 AM, Jay Vara wrote: > > I'm not top posting. > > I am using NoteNames context to print the note names automatically for > scales of half notes, quarter notes and eighth notes. I have redefined > the NoteNames using override NoteName.Stencil. > > I need differ

Programming Question

2014-09-18 Thread Jay Vara
> I'm not top posting. I am using NoteNames context to print the note names automatically for scales of half notes, quarter notes and eighth notes. I have redefined the NoteNames using override NoteName.Stencil. I need different font sizes for the note names of half, quarter and eighth notes.