Re: Change a string in to a identical list

2020-06-04 Thread Carl Sorensen
What do you want A to be?  Do you want it to be the symbol A?

Carl


On 6/4/20, 8:13 AM, "Freeman Gilmore"  wrote:

Carl:
I know about that section but i do not know how to make any thing
there work for this
Do you have an example?
Thank you,ƒg

On Thu, Jun 4, 2020 at 9:52 AM Carl Sorensen  wrote:
>
>
>
> On 6/4/20, 7:00 AM, "Freeman Gilmore"  wrote:
>
> On Thu, Jun 4, 2020 at 7:23 AM David Kastrup  wrote:
> >
> > Freeman Gilmore  writes:
> >
> > > How to change a string in to a identical list.
> > > From  "-3 31 A -6 B -8"  to  (-3 31 A -6 B -8).(Or from  ("-3"
> > > "31" "A" "-6" "B" "-8")  to  (-3 31 A -6 B -8)  if it is simpler.)
> >
>
> https://www.gnu.org/software/guile/manual/html_node/List_002fString-Conversion.html
>
> Carl
>
>



Re: Change a string in to a identical list

2020-06-04 Thread Jean Abou Samra

Hello,


https://www.gnu.org/software/guile/manual/html_node/List_002fString-Conversion.html

Carl

Carl:
I know about that section but i do not know how to make any thing
there work for this
Do you have an example?
Thank you,ƒg


This is:

(string->list "abcd")

returning (#\a #\b #\c #\d).

This procedure converts a string into a list of
characters.

You may want a list of single-character strings instead.
Then here you go:

(map string (string->list "abcd"))

Thas gives ("a" "b" "c" "d").

The other one on the same page is for splitting a string
following certain criteria. For example, if you want to split
by spaces, then that would be

(string-split "Hello world!" #\space)

resulting in ("Hello" "world!").

And, if you want symbols,

(map string->symbol(map string (string->list "-3 31 A -6 B -8")))

That said, I don't really understand why you are mixing
numbers and letters in your strings. As David suggested,
it would be more natural to start with a list. And if
you provide context about what you're trying to achieve,
we likely can give more helpful answers.

Best,

Jean Abou Samra



Re: two lv ties on merged notehead

2020-06-04 Thread Michael Winter via LilyPond user discussion
Thanks all, 

Seems like there are many solutions. Also know I understand the problem so will 
be able to look for such things in the future.

Best,

Michael

Jun 4, 2020, 04:20 by r...@dabble.ch:

> Michael Winter wrote:
>
> It seems that when a notehead is merged in two voices no matter what you do 
> you, lilypond only adds on lv tie. 
> There are indeed two lv ties.  But in your example they are using the same 
> (default) settings and so end up exactly superimposed.
>
> Try giving the one of them a difference:
>
>  d,4-\tweak direction #UP \laissezVibrer
>
>
> Cheers,
> Robin
>



Re: Change a string in to a identical list

2020-06-04 Thread Freeman Gilmore
Carl:
I know about that section but i do not know how to make any thing
there work for this
Do you have an example?
Thank you,ƒg

On Thu, Jun 4, 2020 at 9:52 AM Carl Sorensen  wrote:
>
>
>
> On 6/4/20, 7:00 AM, "Freeman Gilmore"  wrote:
>
> On Thu, Jun 4, 2020 at 7:23 AM David Kastrup  wrote:
> >
> > Freeman Gilmore  writes:
> >
> > > How to change a string in to a identical list.
> > > From  "-3 31 A -6 B -8"  to  (-3 31 A -6 B -8).(Or from  ("-3"
> > > "31" "A" "-6" "B" "-8")  to  (-3 31 A -6 B -8)  if it is simpler.)
> >
>
> https://www.gnu.org/software/guile/manual/html_node/List_002fString-Conversion.html
>
> Carl
>
>



Re: Change a string in to a identical list

2020-06-04 Thread Carl Sorensen


On 6/4/20, 7:00 AM, "Freeman Gilmore"  wrote:

On Thu, Jun 4, 2020 at 7:23 AM David Kastrup  wrote:
>
> Freeman Gilmore  writes:
>
> > How to change a string in to a identical list.
> > From  "-3 31 A -6 B -8"  to  (-3 31 A -6 B -8).(Or from  ("-3"
> > "31" "A" "-6" "B" "-8")  to  (-3 31 A -6 B -8)  if it is simpler.)
>

https://www.gnu.org/software/guile/manual/html_node/List_002fString-Conversion.html

Carl




Re: Change a string in to a identical list

2020-06-04 Thread Freeman Gilmore
On Thu, Jun 4, 2020 at 7:23 AM David Kastrup  wrote:
>
> Freeman Gilmore  writes:
>
> > How to change a string in to a identical list.
> > From  "-3 31 A -6 B -8"  to  (-3 31 A -6 B -8).(Or from  ("-3"
> > "31" "A" "-6" "B" "-8")  to  (-3 31 A -6 B -8)  if it is simpler.)
>
> Why would you even start with a string then instead of reading a list in
> the first place?
>
> You can use something like
>
> (with-input-from-string (string-append "( " "-3 31 A -6 B -8" " )") read)
Thank you that works. ƒg
>
> but it looks like you are doing something fundamentally backwards if you
> don't read what is supposed to be a list in as a list in the first
> place.
Starting with \j “-3+31   A -6+B -8”  , two less key stroke for entry, simple.
True I could start with \j #’(-3+31   A -6+B -8) .
With all the list help and the guile manual I now have:
(“-3” “31” “A” “-6” “B” “-8”) , and
(-3 31 A -6 B -8) .
I want to try something with these, need both.


>
> --
> David Kastrup



Re: Change a string in to a identical list

2020-06-04 Thread David Kastrup
Freeman Gilmore  writes:

> How to change a string in to a identical list.
> From  "-3 31 A -6 B -8"  to  (-3 31 A -6 B -8).(Or from  ("-3"
> "31" "A" "-6" "B" "-8")  to  (-3 31 A -6 B -8)  if it is simpler.)

Why would you even start with a string then instead of reading a list in
the first place?

You can use something like

(with-input-from-string (string-append "( " "-3 31 A -6 B -8" " )") read)

but it looks like you are doing something fundamentally backwards if you
don't read what is supposed to be a list in as a list in the first
place.

-- 
David Kastrup



Change a string in to a identical list

2020-06-04 Thread Freeman Gilmore
How to change a string in to a identical list.
>From  "-3 31 A -6 B -8"  to  (-3 31 A -6 B -8).(Or from  ("-3"
"31" "A" "-6" "B" "-8")  to  (-3 31 A -6 B -8)  if it is simpler.)

Thank you, ƒg



Re: two lv ties on merged notehead

2020-06-04 Thread Robin Bannister

Michael Winter wrote:

It seems that when a notehead is merged in two voices no matter what you do you, lilypond only adds on lv tie. 


There are indeed two lv ties.  But in your example they are using the 
same (default) settings and so end up exactly superimposed.


Try giving the one of them a difference:

  d,4-\tweak direction #UP \laissezVibrer


Cheers,
Robin



Re: bach chorales

2020-06-04 Thread Urs Liska
Hi Phil,

Am Donnerstag, den 04.06.2020, 11:52 +0200 schrieb Ph. Hezaine:
> On 6/1/20, Rudi Guggt  wrote:
> 
> > > > There are some mistakes in the titles of the Bach-Chorales. Are
> > > > you
> > > > curious, what I have found?
> > > > 
> > > > #9, #102, #343 and #361: Ermuntre dich, mein schwa_ch_er Geist
> > > > #45 and #370: Kommt her zu mir, spricht Gottes S_o_hn
> > > > #50: old: In allen meine_n_ Taten
> > > > #101: Herr Christ, der einge Gottes-S_o_hn
> > > >  or: Herr Christ, der ein'ge Gott's Sohn
> > > > #148: Danket dem Herrn, heu_t_ und allzeit
> > > > #150: Welt, ade! ich bin dein m_ü_de
> > > > 
> > > > cheers
> > > > Rudi
> 
> Hello Rudi
> 
> I take due note of your proofreading. Really relevant. Thanks.
> I don't know when I will upgrade the sources to 2.21 exactly but
> it's 
> all right!

If you are planning to update this repository I would be happy if you
could coordinate this work with what we have started on Gitlab
recently. We did not set up this repository simply because we wanted to
make your great work more accessible but to actually *build* upon it.

Concretely I want to restructure the code so the voices are
independently available and then build an infrastructure around it to
allow more flexible typesetting, e.g. 

 * choosing between modern and old clefs
 * choose between real score or piano score
 * select voices to be engraved/hidden
 * allow additional analysis layers (harmonic analysis, figured bass,
   others) to be added

This will make it a terrific resource for pedagogical/academic work. I
have been lobbying for LilyPond in the musicological and music theory
communities for quite some time, and one of the main obstacles
(particularly in the latter) is the need to give them something that
can be used immediately (because the horizon of the average music
theory teacher is typically "I do have to provide material to my four
courses tomorrow"). Having a corpus like the Bach chorales readily
available seems like a really great incentive to dangle in front of
their noses. I hope to find the time to write a Frescobaldi extension
for this repertoire, maybe even with an interface for letting students
write their own solutions right into the material.

So far I have not touched the files uploaded in the Gitlab repository
because you had indicated there are some updates available or pending.
But it would be nice to know when it will be suitable to start with
substantial modifications of the input files. Maybe you could apply
your updates directly to that repository?

Best
Urs

> Phil.
> 
> 




Re: bach chorales

2020-06-04 Thread Ph. Hezaine

On 6/1/20, Rudi Guggt  wrote:


There are some mistakes in the titles of the Bach-Chorales. Are you
curious, what I have found?

#9, #102, #343 and #361: Ermuntre dich, mein schwa_ch_er Geist
#45 and #370: Kommt her zu mir, spricht Gottes S_o_hn
#50: old: In allen meine_n_ Taten
#101: Herr Christ, der einge Gottes-S_o_hn
 or: Herr Christ, der ein'ge Gott's Sohn
#148: Danket dem Herrn, heu_t_ und allzeit
#150: Welt, ade! ich bin dein m_ü_de

cheers
Rudi


Hello Rudi

I take due note of your proofreading. Really relevant. Thanks.
I don't know when I will upgrade the sources to 2.21 exactly but it's 
all right!

Phil.




Re: Adding metronome click track to MIDI

2020-06-04 Thread Matt Wallis

On 03/06/2020 15:55, Francesco Petrogalli wrote:

Hi all,

I need to add  a metronome click sound to the MIDI generated with
lilypond, to allow people sync up a record-from-home session. A quick
web search didn't bring up anything that I could have used. Is there a
special midi instrument I could use for that?


Hi Francesco,

The solution I use for click tracks uses this:

https://lists.gnu.org/archive/html/lilypond-user/2019-12/msg00346.html

That will give you a definition of clickTrackForMusic. All you need to 
do then is to provide the time signature and the music.


When I use it I do this:

-

clickPart = \clickTrackForMusic \timeSignature \music

% Click track:
clickStaff = \new DrumStaff = "click" {
  \set DrumStaff.instrumentName = #"Click "
  \clickPart
}

-

It automatically adjusts the length of the click track to the length of 
the music, but does not handle changes of time signature or tempo.


Matt





Re: When (in seconds) does each page begin?

2020-06-04 Thread Matt Wallis

On 02/06/2020 11:30, Thomas Morley wrote:

Am Di., 2. Juni 2020 um 10:19 Uhr schrieb Valentin Villenave
:

On 5/30/20, Matt Wallis  wrote:

But I'd still like to know how to find out when a page of a score begins

Well, there is something to be done with the 'page-number and
'rank-on-page properties, as demonstrated in this regtest:
https://git.savannah.gnu.org/cgit/lilypond.git/plain/input/regression/multi-measure-rest-reminder.ly

The problem is that the page-breaking algorithm runs fairly late in
the process, so whenever I try adding that to the aforementioned
Grob_metadata_engraver, either ly:grob-system doesn’t return anything
or it remains stuck on 0.  (The regtest I mentioned works around that
in a pretty convoluted way, by creating a new grob and then suiciding
it.)

You might want to have a look; maybe your guess’s gonna be better than mine.

Cheers,
-- V.


I think best bet would be to post-process the final file.
We already have a post-process-hook (see Application Usage). Below I
use it to print the first BarNumber of each page. If you know the used
\tempo it should be straight forward to calculate the passed seconds.
Ofcourse any calculation of passed time fails if multiple scores are
in the file. The provided procedure is not able to distinguish.

Here the code (example_has_  multiple scores)
Output is done in terminal, output to a .log-file is possible as well,
see comment.

\version "2.19.32"

#(define* (print-pages-first-bar-numbers layout pages #:optional print-to-file)
;; If `print-to-file' is set #t the output is written to a file
;; otherwise usually displayed in Terminal
   (let* ((lines (map (lambda (page) (ly:prob-property page 'lines)) pages))
  ;; list of systems of each pages


Thomas - thank you very much for this. I will look at it in depth some 
time soon. Right now, I'm modifying the code I've cloned from


https://gitlab.com/sigmate/lilypond-html-live-score

This has 'distracted' me from my original plan, and the pressing need to 
identify "when (in seconds) does each page begin". :-)


At some point, I'll make available a fork of the repo, to show what I've 
been doing.


All the best, Matt.



Re: Adding metronome click track to MIDI

2020-06-04 Thread Valentin Villenave
On 6/4/20, Francesco Petrogalli  wrote:
> thank you both for your help. I have created a solution based on your
> examples. I hope you don't mind the copy and paste + tweak exercise,

Hey, that’s what the list is for!  Also, I’ve uploaded a copy of my
own function onto http://lsr.di.unimi.it/LSR/Item?id=1114 which makes
it Public Domain.

> The code that works for me is the following, I will merge it when I
> get an "OK go" from both of you:
> https://github.com/fpetrogalli/trr/pull/1/files

Note that if you’re using a \score block specially for MIDI output,
then you don’t need a Devnull, you could simply use a \new Staff or
\new DrumStaff and therefore you’d no longer need all the \consists
lines.

Or even shorter, instead of \new whatever, you can just type
  \drums \repeat unfold 83 {wbh4. trim4. trim4. trim4.}
which also removes the need for midiInstrument and \drummode.

> The `unfold 83` is a bit ugly, but it allows me to obtain what I need
> without having to dig into lilypond internals and scheme syntax.

I can understand that!  Also note that the <>\ff is just for dynamics
(to make the clicks louder) so whether you want to keep it or not, is
up to you.

Cheers,
-- V.