Re: bookparts

2018-03-05 Thread David Kastrup
Flaming Hakama by Elaine  writes:

> This is a bit confusing since it seems that
> you are saying 2 things:
>
>  1) If books have a scope of their own, [scopes of explicit books would
> be]
> separate from the scope in the implicit book.
>
> This makes sense, since we'd expect the scopes of books,
> which are siblings, to be distinct.
>
> But, I don't think that the issue was to use definitions
> from one book in another book.   The issue was:
> how do I define variables within a book, to be used
> within that same book.
>
>
> However, I don't understand:
>
> 2) If books have a scope of their own,
> no "global" definitions would be visible in
> explicit books
>
>
> I'd rather expect that any book scope
> would be within the global scope,
> so anything defined globally
> would be available within each book.

"global scope" belongs to a book of its own.

>> Unfortunately, there does not appear to be a concept readily
>> consistent with scoping the current book/bookpart design.  Because
>> "scope" does not mean "you are defining the variable where you want
>> to use it".  A consequence of well-defined scopes is that you can
>> more often do it in that manner without impacting other code.  But I
>> haven't seen a good "well-definition" with LilyPond.  I am pretty
>> sure that people would protest books not getting to see definitions
>> made "outside" of them.  So normal books would have to be nested in
>> the implicit default book like bookparts of the implicit book are.
>>
>
> This seems backwards from the discussion earlier,
> where the advice was to import your files with variables
> into the global space, not within the bookpart.

Well, it's nice to lead discussions utterly ignoring what LilyPond
actually does.  But they are not likely to lead to a tenable path
forward.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple midi player

2018-03-05 Thread Gianmaria Lari
On 6 March 2018 at 00:32, Hwaen Ch'uqi  wrote:

> Greetings All,
>
> I should like to piggy-back onto Nathan's question, though as an emacs
> user. I have been using timidity, which is directly mentioned in the
> documentation, but I too would like the ability to fast-forward or
> rewind or to start at a particular place.
>
> Hwaen Ch'uqi
>
>
What about windows? Anyone found a way to set the starting point at a
particular place instead of the beginning?

Gianmaria
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple midi player

2018-03-05 Thread Martin Tarenskeen



On Tue, 6 Mar 2018, Martin Tarenskeen wrote:


Thanks for the midish suggestion!


P.S.
midish is not in the Fedora repos, but building from sources is quite 
easy.


MT

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple midi player

2018-03-05 Thread Martin Tarenskeen



On Mon, 5 Mar 2018, Nathan Sprangers wrote:


Thank you, this is a fantastic suggestion!

For the benefit of others following this thread, on Debian at least, midish
comes with a simple command line player, smfplay, which takes a starting
measure number as a command line argument.


Thanks for the midish suggestion!

Frescobaldi is a great tool that I use almost daily. But once in a while 
there are situations where I prefer to use vim or gvim. I am on Linux 
Fedora, and have modified the ftplugin/lilpond.vim file to use another PDF 
viewer (evince instead of gv). Midish could be an alternative for 
Timidity. Jumping to a specified bar is especially useful for our purpose.


I will need to do some reading and studying to set up and configure the 
midishrc file to use fluidsynth as (virtual) MIDI soundmodule. (I 
currently don't own an external hardware GM compatible MIDI module or 
keyboard.)


If someone has already done a working configuration on Linux please share 
your settings and experiences here.


--

MT

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple midi player

2018-03-05 Thread Nathan Sprangers
Hi Ben,

So far I've relied on the vim functionality that comes with lilypond (found
in lilypond's 'vim' directory). I am simply more comfortable and feel more
productive with vim's modal editing, navigation, visual block mode, buffers
and windows, etc. It's also already configured to my preferences. I'm glad
Frescobaldi supports split editors, but it kind of makes my head spin: the
tabs don't line up with the editor panes; I have to think about if clicking
on a tab or link will change focus to a different pane or cause a pane to
switch to a different file, and in either case, the feedback isn't great.
I'm currently working on a band project which I've organized into 9
different files, so multiple windows/buffers is an important feature.
Setting lilypond as the make program enables the use of vim's quickfix
list, which is very handy and lilypond includes multiple macros to support
this. Reading ftplugin/lilypond.vim may give some ideas on further
customization.

Using vim for lilypond comes with its own issues though. The biggest one
I've encountered so far is that syntax highlighting can cause vim to lag,
although this seems to be a general weakness of vim. It's somewhat better
for me using gvim vs a terminal emulator. Automatic indentation is
imperfect (lilypond 2.18.2 - I don't know if this has been touched in the
development version). I don't own a midi keyboard, but if you rely on midi
input I don't think that's going to work in vim. Automatic engraving is
probably also not an option. Frescobaldi's definition linking is very
useful, but I'm guessing this might be feasible in vim with ctags, I
haven't tried yet.

The truth is, I'm very new to lilypond, so I'm still figuring out how
everything works, let alone workflow - although I'm consistently getting
better thanks to practice and a knowledgeable community. Your videos on
lilypond and Frescobaldi have been very helpful, I wish I could return the
favor!

Take care,
Nathan

On Mon, Mar 5, 2018 at 9:28 PM, Ben  wrote:

>
> On 3/5/2018 6:22 PM, Nathan Sprangers wrote:
>
> Yes, Frescobaldi is very nice, but it's not vim. I find myself in
> situations often enough where vim would be faster/more convenient for me. I
> don't know if you're aware, but lilypond comes with vim support
> (highlighting, macros, etc). The beauty of lilypond being text based is you
> can customize your environment. Frescobaldi is a very good option and has
> served me well, but it's not the only option.
>
> Thanks,
> -Nathan
>
>
>>
> >
>> > Can anyone suggest a simple midi player that can begin or cue playback
>> from a specified measure/beat? I would like to be able to work using vim
>> and a pdf reader. I've been using VLC for midi playback, but it only
>> indicates a timestamp, not a measure/beat.
>> >
>> > Thanks,
>> > Nathan
>> > ___
>> > lilypond-user mailing list
>> > lilypond-user@gnu.org
>> > https://lists.gnu.org/mailman/listinfo/lilypond-user
>>
>>
>
>
> Nathan,
>
> I've used Vim for several years now, for text editing and WordPress /
> LaTeX projects, but never really got it working well with LilyPond.
> Instead, I've stuck with Frescobaldi and I have a good workflow now.
>
> But I'm curious: do you have any LilyPond-specific snippets in your .vimrc
> file that help you with inputting music?
>
> Can you share some tips or advice on how you use Vim with LilyPond? I'd be
> interested to hear a brief overview of your workflow - maybe I should give
> Vim another chance ;)
>
> Thanks!
>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple midi player

2018-03-05 Thread Ben


On 3/5/2018 6:22 PM, Nathan Sprangers wrote:
Yes, Frescobaldi is very nice, but it's not vim. I find myself in 
situations often enough where vim would be faster/more convenient for 
me. I don't know if you're aware, but lilypond comes with vim support 
(highlighting, macros, etc). The beauty of lilypond being text based 
is you can customize your environment. Frescobaldi is a very good 
option and has served me well, but it's not the only option.


Thanks,
-Nathan





>
> Can anyone suggest a simple midi player that can begin or cue
playback from a specified measure/beat? I would like to be able to
work using vim and a pdf reader. I've been using VLC for midi
playback, but it only indicates a timestamp, not a measure/beat.
>
> Thanks,
> Nathan
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org 
> https://lists.gnu.org/mailman/listinfo/lilypond-user






Nathan,

I've used Vim for several years now, for text editing and WordPress / 
LaTeX projects, but never really got it working well with LilyPond. 
Instead, I've stuck with Frescobaldi and I have a good workflow now.


But I'm curious: do you have any LilyPond-specific snippets in your 
.vimrc file that help you with inputting music?


Can you share some tips or advice on how you use Vim with LilyPond? I'd 
be interested to hear a brief overview of your workflow - maybe I should 
give Vim another chance ;)


Thanks!

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple midi player

2018-03-05 Thread Nathan Sprangers
Thank you, this is a fantastic suggestion!

For the benefit of others following this thread, on Debian at least, midish
comes with a simple command line player, smfplay, which takes a starting
measure number as a command line argument.

Thanks,
Nathan

On Mon, Mar 5, 2018 at 7:27 PM, Guy Stalnaker  wrote:

> http://www.midish.org
>
> From the manual (if you use *nix operating systems):
>
> 7.1 Moving within the song
>
> The following selects the current position in the song to measure number
> 3:
>
> g 3
>
> This will make ``p '' and ``r
> '' commands start at this
> particular position instead of measure number 0. Furthermore all track
> editing function will process the track starting at this position.]
>
> Sounds like what you were looking for.
>
> Regards.
>
> Guy Stalnaker
> jimmyg...@gmail.com
>
> On Mon, Mar 5, 2018 at 6:16 PM, Guy Stalnaker  wrote:
>
>> There are a lot of tools on this page:
>>
>> http://linux-sound.org/midi.html
>>
>> Neither of you indicated the operating system you use.
>>
>> Regards
>>
>> Guy Stalnaker
>> jimmyg...@gmail.com
>>
>> On Mon, Mar 5, 2018 at 5:32 PM, Hwaen Ch'uqi 
>> wrote:
>>
>>> Greetings All,
>>>
>>> I should like to piggy-back onto Nathan's question, though as an emacs
>>> user. I have been using timidity, which is directly mentioned in the
>>> documentation, but I too would like the ability to fast-forward or
>>> rewind or to start at a particular place.
>>>
>>> Hwaen Ch'uqi
>>>
>>>
>>> On 3/5/18, Nathan Sprangers  wrote:
>>> > Yes, Frescobaldi is very nice, but it's not vim. I find myself in
>>> > situations often enough where vim would be faster/more convenient for
>>> me. I
>>> > don't know if you're aware, but lilypond comes with vim support
>>> > (highlighting, macros, etc). The beauty of lilypond being text based
>>> is you
>>> > can customize your environment. Frescobaldi is a very good option and
>>> has
>>> > served me well, but it's not the only option.
>>> >
>>> > Thanks,
>>> > -Nathan
>>> >
>>> > On Mon, Mar 5, 2018 at 3:11 AM, Jacques Menu Muzhic <
>>> imj-muz...@bluewin.ch>
>>> > wrote:
>>> >
>>> >> Hello Nathan,
>>> >>
>>> >> Frescobaldi/SimpleSynth provides this, what’s the advantage of using
>>> >> vim/a
>>> >> pdf reader?
>>> >>
>>> >> JM
>>> >>
>>> >> > Le 5 mars 2018 à 03:10, Nathan Sprangers <
>>> nathan.r.sprang...@maine.edu>
>>> >> a écrit :
>>> >> >
>>> >> > Hello all,
>>> >> >
>>> >> > Can anyone suggest a simple midi player that can begin or cue
>>> playback
>>> >> from a specified measure/beat? I would like to be able to work using
>>> vim
>>> >> and a pdf reader. I've been using VLC for midi playback, but it only
>>> >> indicates a timestamp, not a measure/beat.
>>> >> >
>>> >> > Thanks,
>>> >> > Nathan
>>> >> > ___
>>> >> > lilypond-user mailing list
>>> >> > lilypond-user@gnu.org
>>> >> > https://lists.gnu.org/mailman/listinfo/lilypond-user
>>> >>
>>> >>
>>> >
>>>
>>> ___
>>> lilypond-user mailing list
>>> lilypond-user@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>>>
>>
>>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple midi player

2018-03-05 Thread Hwaen Ch'uqi
Greetings Guy,

Pretty cool! I am currently on ubuntu-16.04, but I shall have a look
at those links. Thank you.

Hwaen Ch'uqi


On 3/5/18, Guy Stalnaker  wrote:
> http://www.midish.org
>
> From the manual (if you use *nix operating systems):
>
> 7.1 Moving within the song
>
> The following selects the current position in the song to measure number 3:
>
> g 3
>
> This will make ``p '' and ``r
> '' commands start at this
> particular position instead of measure number 0. Furthermore all track
> editing function will process the track starting at this position.]
>
> Sounds like what you were looking for.
>
> Regards.
>
> Guy Stalnaker
> jimmyg...@gmail.com
>
> On Mon, Mar 5, 2018 at 6:16 PM, Guy Stalnaker  wrote:
>
>> There are a lot of tools on this page:
>>
>> http://linux-sound.org/midi.html
>>
>> Neither of you indicated the operating system you use.
>>
>> Regards
>>
>> Guy Stalnaker
>> jimmyg...@gmail.com
>>
>> On Mon, Mar 5, 2018 at 5:32 PM, Hwaen Ch'uqi 
>> wrote:
>>
>>> Greetings All,
>>>
>>> I should like to piggy-back onto Nathan's question, though as an emacs
>>> user. I have been using timidity, which is directly mentioned in the
>>> documentation, but I too would like the ability to fast-forward or
>>> rewind or to start at a particular place.
>>>
>>> Hwaen Ch'uqi
>>>
>>>
>>> On 3/5/18, Nathan Sprangers  wrote:
>>> > Yes, Frescobaldi is very nice, but it's not vim. I find myself in
>>> > situations often enough where vim would be faster/more convenient for
>>> me. I
>>> > don't know if you're aware, but lilypond comes with vim support
>>> > (highlighting, macros, etc). The beauty of lilypond being text based
>>> > is
>>> you
>>> > can customize your environment. Frescobaldi is a very good option and
>>> has
>>> > served me well, but it's not the only option.
>>> >
>>> > Thanks,
>>> > -Nathan
>>> >
>>> > On Mon, Mar 5, 2018 at 3:11 AM, Jacques Menu Muzhic <
>>> imj-muz...@bluewin.ch>
>>> > wrote:
>>> >
>>> >> Hello Nathan,
>>> >>
>>> >> Frescobaldi/SimpleSynth provides this, what’s the advantage of using
>>> >> vim/a
>>> >> pdf reader?
>>> >>
>>> >> JM
>>> >>
>>> >> > Le 5 mars 2018 à 03:10, Nathan Sprangers <
>>> nathan.r.sprang...@maine.edu>
>>> >> a écrit :
>>> >> >
>>> >> > Hello all,
>>> >> >
>>> >> > Can anyone suggest a simple midi player that can begin or cue
>>> playback
>>> >> from a specified measure/beat? I would like to be able to work using
>>> vim
>>> >> and a pdf reader. I've been using VLC for midi playback, but it only
>>> >> indicates a timestamp, not a measure/beat.
>>> >> >
>>> >> > Thanks,
>>> >> > Nathan
>>> >> > ___
>>> >> > lilypond-user mailing list
>>> >> > lilypond-user@gnu.org
>>> >> > https://lists.gnu.org/mailman/listinfo/lilypond-user
>>> >>
>>> >>
>>> >
>>>
>>> ___
>>> lilypond-user mailing list
>>> lilypond-user@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>>>
>>
>>
>

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Flaming Hakama by Elaine
> From: David Kastrup 
> To: Wols Lists 
> Subject: Re: bookparts
> Wols Lists  writes:
>
> > On 05/03/18 17:55, Kieren MacMillan wrote:
> >> Hi Knut,
> >>
> >>> Because the definition of testing is invalid at that point of the main
> >>> source file. If tempTest.ly would contain e.g. a score or a \paper
> block
> >>> no error would occur.
> >>
> >> No, it still throws an error because you can't define a variable
> >> inside a \bookpart (which is what \include-ing it at that point
> >> does).
> >>
> > And as a programmer, I think "scope". You are defining the variable
> > where you want to use it.
>
> That's not what "scope" means.
>

Well, it's kind of what it means:  if you have different scopes,
then you can define variables in whatever scope is appropriate.

As best practice, you generally define variables in the most local
scope that is practicable, to avoid "polluting" the bigger namespaces.
So, "defining the variable where you need it" is, in practice, what
you do when you have different scopes available.

I'd add that, if there is no scoping, then that would mean that
there is only one scope.  In which case, it wouldn't matter where
you defined something, since defining anything anywhere makes
if available everywhere.

Without scopes, you can still usually "define the variable where
you need it" (although that would not be best practice since it is
usually best to define all variables in use at the top of the scope.)



> > It's widely accepted that that is good practice, global variables lead
> > to errors, mistakes and confusion. But here you are forced to declare
> > your variables at the global level :-(
>
> Bookparts at global level are collected into an implicit book.  If books
> have a scope of their own, no "global" definitions would be visible in
> explicit books since they would be separate from the scope in the
> implicit book.
>


This is a bit confusing since it seems that
you are saying 2 things:

 1) If books have a scope of their own, [scopes of explicit books would
be]
separate from the scope in the implicit book.

This makes sense, since we'd expect the scopes of books,
which are siblings, to be distinct.

But, I don't think that the issue was to use definitions
from one book in another book.   The issue was:
how do I define variables within a book, to be used
within that same book.


However, I don't understand:

2) If books have a scope of their own,
no "global" definitions would be visible in
explicit books


I'd rather expect that any book scope
would be within the global scope,
so anything defined globally
would be available within each book.




> Unfortunately, there does not appear to be a concept readily consistent
> with scoping the current book/bookpart design.  Because "scope" does not
> mean "you are defining the variable where you want to use it".  A
> consequence of well-defined scopes is that you can more often do it in
> that manner without impacting other code.  But I haven't seen a good
> "well-definition" with LilyPond.  I am pretty sure that people would
> protest books not getting to see definitions made "outside" of them.  So
> normal books would have to be nested in the implicit default book like
> bookparts of the implicit book are.
>

This seems backwards from the discussion earlier,
where the advice was to import your files with variables
into the global space, not within the bookpart.





David Elaine Alt
415 . 341 .4954   "*Confusion is
highly underrated*"
ela...@flaminghakama.com
skype: flaming_hakama
Producer ~ Composer ~ Instrumentalist
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple midi player

2018-03-05 Thread Guy Stalnaker
http://www.midish.org

>From the manual (if you use *nix operating systems):

7.1 Moving within the song

The following selects the current position in the song to measure number 3:

g 3

This will make ``p '' and ``r
'' commands start at this
particular position instead of measure number 0. Furthermore all track
editing function will process the track starting at this position.]

Sounds like what you were looking for.

Regards.

Guy Stalnaker
jimmyg...@gmail.com

On Mon, Mar 5, 2018 at 6:16 PM, Guy Stalnaker  wrote:

> There are a lot of tools on this page:
>
> http://linux-sound.org/midi.html
>
> Neither of you indicated the operating system you use.
>
> Regards
>
> Guy Stalnaker
> jimmyg...@gmail.com
>
> On Mon, Mar 5, 2018 at 5:32 PM, Hwaen Ch'uqi  wrote:
>
>> Greetings All,
>>
>> I should like to piggy-back onto Nathan's question, though as an emacs
>> user. I have been using timidity, which is directly mentioned in the
>> documentation, but I too would like the ability to fast-forward or
>> rewind or to start at a particular place.
>>
>> Hwaen Ch'uqi
>>
>>
>> On 3/5/18, Nathan Sprangers  wrote:
>> > Yes, Frescobaldi is very nice, but it's not vim. I find myself in
>> > situations often enough where vim would be faster/more convenient for
>> me. I
>> > don't know if you're aware, but lilypond comes with vim support
>> > (highlighting, macros, etc). The beauty of lilypond being text based is
>> you
>> > can customize your environment. Frescobaldi is a very good option and
>> has
>> > served me well, but it's not the only option.
>> >
>> > Thanks,
>> > -Nathan
>> >
>> > On Mon, Mar 5, 2018 at 3:11 AM, Jacques Menu Muzhic <
>> imj-muz...@bluewin.ch>
>> > wrote:
>> >
>> >> Hello Nathan,
>> >>
>> >> Frescobaldi/SimpleSynth provides this, what’s the advantage of using
>> >> vim/a
>> >> pdf reader?
>> >>
>> >> JM
>> >>
>> >> > Le 5 mars 2018 à 03:10, Nathan Sprangers <
>> nathan.r.sprang...@maine.edu>
>> >> a écrit :
>> >> >
>> >> > Hello all,
>> >> >
>> >> > Can anyone suggest a simple midi player that can begin or cue
>> playback
>> >> from a specified measure/beat? I would like to be able to work using
>> vim
>> >> and a pdf reader. I've been using VLC for midi playback, but it only
>> >> indicates a timestamp, not a measure/beat.
>> >> >
>> >> > Thanks,
>> >> > Nathan
>> >> > ___
>> >> > lilypond-user mailing list
>> >> > lilypond-user@gnu.org
>> >> > https://lists.gnu.org/mailman/listinfo/lilypond-user
>> >>
>> >>
>> >
>>
>> ___
>> lilypond-user mailing list
>> lilypond-user@gnu.org
>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>>
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple midi player

2018-03-05 Thread Guy Stalnaker
There are a lot of tools on this page:

http://linux-sound.org/midi.html

Neither of you indicated the operating system you use.

Regards

Guy Stalnaker
jimmyg...@gmail.com

On Mon, Mar 5, 2018 at 5:32 PM, Hwaen Ch'uqi  wrote:

> Greetings All,
>
> I should like to piggy-back onto Nathan's question, though as an emacs
> user. I have been using timidity, which is directly mentioned in the
> documentation, but I too would like the ability to fast-forward or
> rewind or to start at a particular place.
>
> Hwaen Ch'uqi
>
>
> On 3/5/18, Nathan Sprangers  wrote:
> > Yes, Frescobaldi is very nice, but it's not vim. I find myself in
> > situations often enough where vim would be faster/more convenient for
> me. I
> > don't know if you're aware, but lilypond comes with vim support
> > (highlighting, macros, etc). The beauty of lilypond being text based is
> you
> > can customize your environment. Frescobaldi is a very good option and has
> > served me well, but it's not the only option.
> >
> > Thanks,
> > -Nathan
> >
> > On Mon, Mar 5, 2018 at 3:11 AM, Jacques Menu Muzhic <
> imj-muz...@bluewin.ch>
> > wrote:
> >
> >> Hello Nathan,
> >>
> >> Frescobaldi/SimpleSynth provides this, what’s the advantage of using
> >> vim/a
> >> pdf reader?
> >>
> >> JM
> >>
> >> > Le 5 mars 2018 à 03:10, Nathan Sprangers <
> nathan.r.sprang...@maine.edu>
> >> a écrit :
> >> >
> >> > Hello all,
> >> >
> >> > Can anyone suggest a simple midi player that can begin or cue playback
> >> from a specified measure/beat? I would like to be able to work using vim
> >> and a pdf reader. I've been using VLC for midi playback, but it only
> >> indicates a timestamp, not a measure/beat.
> >> >
> >> > Thanks,
> >> > Nathan
> >> > ___
> >> > lilypond-user mailing list
> >> > lilypond-user@gnu.org
> >> > https://lists.gnu.org/mailman/listinfo/lilypond-user
> >>
> >>
> >
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple midi player

2018-03-05 Thread Hwaen Ch'uqi
Greetings All,

I should like to piggy-back onto Nathan's question, though as an emacs
user. I have been using timidity, which is directly mentioned in the
documentation, but I too would like the ability to fast-forward or
rewind or to start at a particular place.

Hwaen Ch'uqi


On 3/5/18, Nathan Sprangers  wrote:
> Yes, Frescobaldi is very nice, but it's not vim. I find myself in
> situations often enough where vim would be faster/more convenient for me. I
> don't know if you're aware, but lilypond comes with vim support
> (highlighting, macros, etc). The beauty of lilypond being text based is you
> can customize your environment. Frescobaldi is a very good option and has
> served me well, but it's not the only option.
>
> Thanks,
> -Nathan
>
> On Mon, Mar 5, 2018 at 3:11 AM, Jacques Menu Muzhic 
> wrote:
>
>> Hello Nathan,
>>
>> Frescobaldi/SimpleSynth provides this, what’s the advantage of using
>> vim/a
>> pdf reader?
>>
>> JM
>>
>> > Le 5 mars 2018 à 03:10, Nathan Sprangers 
>> a écrit :
>> >
>> > Hello all,
>> >
>> > Can anyone suggest a simple midi player that can begin or cue playback
>> from a specified measure/beat? I would like to be able to work using vim
>> and a pdf reader. I've been using VLC for midi playback, but it only
>> indicates a timestamp, not a measure/beat.
>> >
>> > Thanks,
>> > Nathan
>> > ___
>> > lilypond-user mailing list
>> > lilypond-user@gnu.org
>> > https://lists.gnu.org/mailman/listinfo/lilypond-user
>>
>>
>

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple midi player

2018-03-05 Thread Nathan Sprangers
Yes, Frescobaldi is very nice, but it's not vim. I find myself in
situations often enough where vim would be faster/more convenient for me. I
don't know if you're aware, but lilypond comes with vim support
(highlighting, macros, etc). The beauty of lilypond being text based is you
can customize your environment. Frescobaldi is a very good option and has
served me well, but it's not the only option.

Thanks,
-Nathan

On Mon, Mar 5, 2018 at 3:11 AM, Jacques Menu Muzhic 
wrote:

> Hello Nathan,
>
> Frescobaldi/SimpleSynth provides this, what’s the advantage of using vim/a
> pdf reader?
>
> JM
>
> > Le 5 mars 2018 à 03:10, Nathan Sprangers 
> a écrit :
> >
> > Hello all,
> >
> > Can anyone suggest a simple midi player that can begin or cue playback
> from a specified measure/beat? I would like to be able to work using vim
> and a pdf reader. I've been using VLC for midi playback, but it only
> indicates a timestamp, not a measure/beat.
> >
> > Thanks,
> > Nathan
> > ___
> > lilypond-user mailing list
> > lilypond-user@gnu.org
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Thomas Morley
2018-03-05 22:19 GMT+01:00 Kieren MacMillan :
> Hi Harm,
>
>> Nobody ever complained about not working:
>> \score {
>>  mus = { R1 }
>>  \new Staff \mus
>> }
>
> Actually, I've complained several times about not being able to create 
> variables "inline" — the most recent time being 
> , 
> which you responded to.  ;)


I stand corrected lol

Did you ever use that code from the german forum? If so, how did it
work for you?

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread David Kastrup
Thomas Morley  writes:

> 2018-03-05 21:33 GMT+01:00 Wols Lists :
>> On 05/03/18 17:55, Kieren MacMillan wrote:
>>> Hi Knut,
>>>
 Because the definition of testing is invalid at that point of the main
 source file. If tempTest.ly would contain e.g. a score or a \paper block
 no error would occur.
>>>
>>> No, it still throws an error because you can't define a variable
>>> inside a \bookpart (which is what \include-ing it at that point
>>> does).
>>>
>> And as a programmer, I think "scope". You are defining the variable
>> where you want to use it. It's widely accepted that that is good
>> practice, global variables lead to errors, mistakes and confusion. But
>> here you are forced to declare your variables at the global level :-(
>>
>> Cheers,
>> Wol
>
>
>
> Can't agree.
> Nobody ever complained about not working:
> \score {
>   mus = { R1 }
>   \new Staff \mus
> }

I'm pretty sure somebody would have complained about that.  Also I am
pretty sure we got complaints about things like

#{ mus = { R1 } #}

not working.  The difference is that it's easier to make them cease and
desist here.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread David Kastrup
Wols Lists  writes:

> On 05/03/18 17:55, Kieren MacMillan wrote:
>> Hi Knut,
>> 
>>> Because the definition of testing is invalid at that point of the main
>>> source file. If tempTest.ly would contain e.g. a score or a \paper block
>>> no error would occur.
>> 
>> No, it still throws an error because you can't define a variable
>> inside a \bookpart (which is what \include-ing it at that point
>> does).
>> 
> And as a programmer, I think "scope". You are defining the variable
> where you want to use it.

That's not what "scope" means.

> It's widely accepted that that is good practice, global variables lead
> to errors, mistakes and confusion. But here you are forced to declare
> your variables at the global level :-(

Bookparts at global level are collected into an implicit book.  If books
have a scope of their own, no "global" definitions would be visible in
explicit books since they would be separate from the scope in the
implicit book.

Everybody thinks that beating sense into the historical design of
LilyPond should be trivial and that he is entitled to have things
correspond to his handwaving.  So as a programmer, why not try making
stuff actually work as you think they should?  Scopes and closures
actually work seamlessly across #{ #} (as of 2.14 or 2.16).  Scheme has
the tools to do the work once you have your concepts consistent.

Unfortunately, there does not appear to be a concept readily consistent
with scoping the current book/bookpart design.  Because "scope" does not
mean "you are defining the variable where you want to use it".  A
consequence of well-defined scopes is that you can more often do it in
that manner without impacting other code.  But I haven't seen a good
"well-definition" with LilyPond.  I am pretty sure that people would
protest books not getting to see definitions made "outside" of them.  So
normal books would have to be nested in the implicit default book like
bookparts of the implicit book are.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Kieren MacMillan
Hi Harm,

> Nobody ever complained about not working:
> \score {
>  mus = { R1 }
>  \new Staff \mus
> }

Actually, I've complained several times about not being able to create 
variables "inline" — the most recent time being 
, which 
you responded to.  ;)

Cheers,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Thomas Morley
2018-03-05 21:33 GMT+01:00 Wols Lists :
> On 05/03/18 17:55, Kieren MacMillan wrote:
>> Hi Knut,
>>
>>> Because the definition of testing is invalid at that point of the main
>>> source file. If tempTest.ly would contain e.g. a score or a \paper block
>>> no error would occur.
>>
>> No, it still throws an error because you can't define a variable inside a 
>> \bookpart (which is what \include-ing it at that point does).
>>
> And as a programmer, I think "scope". You are defining the variable
> where you want to use it. It's widely accepted that that is good
> practice, global variables lead to errors, mistakes and confusion. But
> here you are forced to declare your variables at the global level :-(
>
> Cheers,
> Wol



Can't agree.
Nobody ever complained about not working:
\score {
  mus = { R1 }
  \new Staff \mus
}
>From the users point of view I see no real difference.

Ofcourse a structure like:

{ cis'1 } stored as music.ly
\score { \new Staff \include "music.ly" } stored as score.ly
\bookpart { \include "score.ly" } stored as bookpart.ly

will work.


Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Wols Lists
On 05/03/18 17:55, Kieren MacMillan wrote:
> Hi Knut,
> 
>> Because the definition of testing is invalid at that point of the main
>> source file. If tempTest.ly would contain e.g. a score or a \paper block
>> no error would occur.
> 
> No, it still throws an error because you can't define a variable inside a 
> \bookpart (which is what \include-ing it at that point does).
> 
And as a programmer, I think "scope". You are defining the variable
where you want to use it. It's widely accepted that that is good
practice, global variables lead to errors, mistakes and confusion. But
here you are forced to declare your variables at the global level :-(

Cheers,
Wol


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Kieren MacMillan
> You can put included files where you want and they behave just as if
> inserted at that position.  The content does not magically become more
> or less valid.

Excellent. We agree!  =)
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread David Kastrup
Kieren MacMillan  writes:

> Hi David,
>
>> Sure.  Included files behave just as if inserted at that position, and
>> at that position no assignments are allowed.
>> 
>> I don't get what is so hard to understand about that.
>
> Nothing. I was simply confused when you said you can include files —
> with no qualification about what the file contains — at anything other
> than top level.

You can put included files where you want and they behave just as if
inserted at that position.  The content does not magically become more
or less valid.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Kieren MacMillan
Hi David,

> Sure.  Included files behave just as if inserted at that position, and
> at that position no assignments are allowed.
> 
> I don't get what is so hard to understand about that.

Nothing. I was simply confused when you said you can include files — with no 
qualification about what the file contains — at anything other than top level.

Thanks,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Kieren MacMillan
Hi Knut,

> Because the definition of testing is invalid at that point of the main
> source file. If tempTest.ly would contain e.g. a score or a \paper block
> no error would occur.

No, it still throws an error because you can't define a variable inside a 
\bookpart (which is what \include-ing it at that point does).

Cheers,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Kieren MacMillan
Hi David,

> Variable definitions must be at top level.

That was my point to Joram.

Thanks,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Knut Petersen

Hi Joram et al!

*What I want to achieve* is to have ~10 independent pieces and
concatenate all of them into one book as well as printing everyone on
its own. The separate pieces should have taglines etc. on the first/last
page as usual. But the book should not repeat them for every piece. Each
piece should start a new page in the book. I dreamed of just including
all the scores into one document. But the output is terrible (errors as
the ones above etc.).



I think the attached file gives some useful examples.

Knut
\version "2.21.0"
\include "deutsch.ly"
\pointAndClickOff

%
% Define all the music first
%

musicA  = {
  \time 4/4 \key c \major
  \repeat unfold 20 {
\relative c' { c4 d e f g a h c c h a g f e d g c1 }
  } \bar "|."
}

musicB = { \transpose c cis { \musicA } }

musicC = { \transpose c d   { \musicA } }

musicD = { \transpose c es  { \musicA } }

musicE = { \transpose c f   { \musicA } }

%
% Global paper definitions
%

\paper {
#(set-paper-size "a4")
top-margin = 20\mm
bottom-margin = 20\mm
line-width = 170\mm
left-margin = 20\mm
ragged-bottom = ##f
ragged-last-bottom = ##t
print-page-number = ##t
page-breaking = #ly:optimal-breaking
}

#(set-global-staff-size 18)

%
% The collection including title page ...
%

\book{
  \bookOutputSuffix "Collection"
  \bookpart {
\markup { 
  \column {
\vspace #5.0 \fill-line { \fontsize #18  "Titelpage" }
\vspace #3.0 \fill-line { \fontsize #4.0 "This is an example." }
  }
}
  }
  \bookpart {
\paper  { print-page-number = ##f }
\markup { \column { \vspace #5.0 \fill-line { \fontsize #4.0 "Page 2: empty, without pagenumber!" } } }
  }
  \bookpart {
 \paper  { system-count = #12 }
 \header { title = "Title A" subtitle = "Subtitle A"  composer = "Fred Foobar"  }
 \score  { \new Staff { \musicA } \layout { indent = 0.0 } }
   }
  \bookpart {
 \paper  { system-count = #14 }
 \header { title = "Title B" subtitle = "Subtitle B"  composer = "Fred Mbogo"  }
 \score  { \new Staff { \musicB } \layout { indent = 5.0 } }
   }
  \bookpart {
 \paper  { system-count = #16 }
 \header { title = "Title C" subtitle = "Subtitle C"  composer = "Fred Feuerstein"  }
 \score  { \new Staff { \musicC } \layout { indent = 10.0 } }
   }
  \bookpart {
 \paper  { system-count = #18 }
 \header { title = "Title D" subtitle = "Subtitle D"  composer = "Fred Foobar"  }
 \score  { \new Staff { \musicD } \layout { indent = 15.0 } }
   }
  \bookpart {
 \paper  { system-count = #20 }
 \header { title = "Title E" subtitle = "Subtitle E"  composer = "Fred Foobar"  }
 \score  { \new Staff { \musicE } \layout { indent = 20.0 } }
   }
  \bookpart {
\paper  { print-page-number = ##f }
\include "otherfile.ly"
\markup { \column { \vspace #5.0 \fill-line { \fontsize #4.0 "Last page" } } }
  }
}

%
% Use scheme if you want to do some postprocessing 
%

#(system "pdfbook --short-edge --landscape  --suffix 'sig4' --quiet --pdftitle 'Collection' \
  --pdfauthor 'Fred Foobar'  --pdfsubject 'My famous collection' \
  --pdfkeywords 'Collection, Fred Foobar' 4Joram-Collection.pdf")

%
% Now produce ndividual pdfs
%

\book {
   \bookOutputSuffix "Piece-A"
   \paper  { system-count = #12 }
   \header { title = "Title A" subtitle = "Subtitle A"  composer = "Fred Foobar"  }
   \score  { \new Staff { \musicA } \layout { indent = 0.0 } }
}
 
\book {
   \bookOutputSuffix "Piece-B"
   \paper  { system-count = #14 }
   \header { title = "Title B" subtitle = "Subtitle B"  composer = "Fred Mbogo"  }
   \score  { \new Staff { \musicB } \layout { indent = 5.0 } }
}
 
\book {
   \bookOutputSuffix "Piece-C"
   \paper  { system-count = #16 }
   \header { title = "Title C" subtitle = "Subtitle C"  composer = "Fred Feuerstein"  }
   \score  { \new Staff { \musicC } \layout { indent = 10.0 } }
}
 
\book {
   \bookOutputSuffix "Piece-D"
   \paper  { system-count = #18 }
   \header { title = "Title D" subtitle = "Subtitle D"  composer = "Fred Foobar"  }
   \score  { \new Staff { \musicD } \layout { indent = 15.0 } }
}
 
\book {
   \bookOutputSuffix "Piece-E"
   \paper  { system-count = #20 }
   \header { title = "Title E" subtitle = "Subtitle E"  composer = "Fred Foobar"  }
   \score  { \new Staff { \musicE } \layout { indent = 20.0 } }
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread David Kastrup
Kieren MacMillan  writes:

> Arg. typo in the comment line… should be:
>
> %%%  tempTest.ly
>
> \version "2.19"
> testing = { c''4 4 4 4 }
>
>
> %%%  file2.ly
>
> \version "2.19"
> \bookpart {
>  \include "tempTest.ly"
>  \score { \testing }
> }
>
> throws several errors.

Sure.  Included files behave just as if inserted at that position, and
at that position no assignments are allowed.

I don't get what is so hard to understand about that.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread David Kastrup
Kieren MacMillan  writes:

> Hi David,
>
 Q: Included files just behave as if the content was inserted at the same
  position?
 Q: Includes must be at top level?
>>> 
>>> Yes x 2.
>> 
>> Second yes is wrong.
>
> Even if the included file has variable definitions?

Variable definitions must be at top level.  Included files just behave
as if the content was inserted at the same position without magically
changing the implications of variable definitions either way.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Knut Petersen

Hi Kieren!


%%%  tempTest.ly

\version "2.19"
testing = { c''4 4 4 4 }


%%%  file2.ly

\version "2.19"
\bookpart {
  \include "tempTest.ly"
  \score { \testing }
}

throws several errors.

Because the definition of testing is invalid at that point of the main
source file. If tempTest.ly would contain e.g. a score or a \paper block
no error would occur.

Knut

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Replace ly:music elements in a Scheme function

2018-03-05 Thread David Kastrup
paolo prete  writes:

> Thanks David,
> one last question: is it possible to _check_  if x is a rest or a note?
>
> (if...  )

Sure.  (if (music-is-of-type? x 'rest-event) ...) and 'note-event,
respectively.  There is also 'event-chord for multiple note events in a
chord.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Kieren MacMillan
e.g.

%%%  file1.ly

\version "2.19.58"
testing = { c''4 4 4 4 }


%%%  file2.ly

\version "2.19"
\bookpart {
  \include "tempTest.ly"
  \score { \testing }
}

throws several errors.

Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Replace ly:music elements in a Scheme function

2018-03-05 Thread paolo prete
Thanks David,
one last question: is it possible to _check_  if x is a rest or a note?

(if...  )

I just made an easier implementation of the function, but I need this
check...

2018-03-05 18:12 GMT+01:00 David Kastrup :

> paolo prete  writes:
>
> > I see.
> > Then I ask if is it possible at least, by placing a simple instruction
> > inside lambda (x y) ( ...) while iterating,  to:
> >
> > 1) replace x with a rest
>
> No.
>
> > 2) add a list of articulations (for example:  "->", "\mp") to x
>
> Yes.
>
> Same reason:
>
> >> No.  x and y are values stored in lists.  The relation to their lists
> >> is not passed into your function, so you cannot change it there.
> >>
> >> You'd need to use something like pair-for-each to modify the first
> >> list in-place, and that gets old fast as music structures change.
> >>
> >> There is an actual reason functions like map-some-music are provided.
>
> --
> David Kastrup
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Kieren MacMillan
Arg. typo in the comment line… should be:

%%%  tempTest.ly

\version "2.19"
testing = { c''4 4 4 4 }


%%%  file2.ly

\version "2.19"
\bookpart {
 \include "tempTest.ly"
 \score { \testing }
}

throws several errors.

Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Kieren MacMillan
Hi David,

>>> Q: Included files just behave as if the content was inserted at the same
>>>  position?
>>> Q: Includes must be at top level?
>> 
>> Yes x 2.
> 
> Second yes is wrong.

Even if the included file has variable definitions?

Thanks,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread David Kastrup
Kieren MacMillan  writes:

>> Q: Included files just behave as if the content was inserted at the same
>>   position?
>> Q: Includes must be at top level?
>
> Yes x 2.

Second yes is wrong.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Replace ly:music elements in a Scheme function

2018-03-05 Thread David Kastrup
paolo prete  writes:

> I see.
> Then I ask if is it possible at least, by placing a simple instruction
> inside lambda (x y) ( ...) while iterating,  to:
>
> 1) replace x with a rest

No.

> 2) add a list of articulations (for example:  "->", "\mp") to x

Yes.

Same reason:

>> No.  x and y are values stored in lists.  The relation to their lists
>> is not passed into your function, so you cannot change it there.
>>
>> You'd need to use something like pair-for-each to modify the first
>> list in-place, and that gets old fast as music structures change.
>>
>> There is an actual reason functions like map-some-music are provided.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Kieren MacMillan
Oof…

> for example, the first three songs of the Piano/Conductor Score of a musical 
> might fit nicely on 8 pages, so I wrap the three \scores in a \bookpart with 
> a \paper { page-count = 3 } instruction.

Obviously, that should be page-count = 8.
Sorry for the typo.

K.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Kieren MacMillan
Hi Joram,

> *What I want to achieve* is to have ~10 independent pieces and
> concatenate all of them into one book as well as printing everyone on
> its own.

I do this all the time: my musicals each have 20+ independent "cues" (songs, 
instrumentals, etc.); the songs are always printed together in big books 
(Piano/Conductor Score, Piano/Vocal Score, Chorus/Vocal Score, etc.); often, 
the more popular songs have their own separate score (to be sold individually).

> I need some further insights in what a bookpart is.

I think of a bookpart as a \paper scope. I generally *use* bookparts as a way 
to lock in certain page breaks easily: for example, the first three songs of 
the Piano/Conductor Score of a musical might fit nicely on 8 pages, so I wrap 
the three \scores in a \bookpart with a \paper { page-count = 3 } instruction.

> \paper blocks inside a \bookpart only affect this bookpart, while \paper
> blocks outside affect everything. So it seems to be a scoping for paper
> blocks.

Exactly.  =)

> Q: Is it correct that the bookpart is a scope for paper blocks?

If you’re asking whether your understanding is correct, then I would say "Yes 
(or at least close enough)".

If you’re asking whether Lily’s \bookpart *should* [only] be a scope for paper 
blocks… then I'd say "No".

> Q: Is it correct that \layout blocks don't belong inside a \bookpart?

Yes; you can bury that in the score if you need it.

> Q: Is it correct that I can't define a variable inside a bookpart?

Yes. This is probably my biggest issue with bookparts currently.

> Q: That means if I have many scores with many voices in my document,
>   I need unique names for all of them and can not reuse \soprano for
>   the next piece with different content?

Yes. I learned that the hard way…

> As my included files contain definitions, I cannot include them inside a
> bookpart as far as I understand. So I need to put them at top level, right?

Correct.

> Q: Included files just behave as if the content was inserted at the same
>   position?
> Q: Includes must be at top level?

Yes x 2.

> Each piece should start a new page in the book.

Sometimes even in that case I use \bookparts.

> Q: Should I use bookparts at all or just \pageBreaks?

I suggest \bookparts… but I've already done the work (e.g., having unique 
variable names) that makes it easier.

Hope this helps!
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Replace ly:music elements in a Scheme function

2018-03-05 Thread paolo prete
I see.
Then I ask if is it possible at least, by placing a simple instruction
inside lambda (x y) ( ...) while iterating,  to:

1) replace x with a rest
2) add a list of articulations (for example:  "->", "\mp") to x



2018-03-05 17:28 GMT+01:00 David Kastrup :

> paolo prete  writes:
>
> > Hello David,
> > thanks for the snippet but I ask if it is possible to modify only the
> body
> > of my function, inside lambda (x y)( ...  ) so to obtain the same result.
> > Something like:
> >
> >
> > 
> >
> > fun = #(define-music-function (parser location music1 music2) (ly:music?
> > ly:music?)
> > (let
> > (
> >   (musicList1 (ly:music-property music1 'elements))
> >   (musicList2 (ly:music-property music2 'elements))
> > )
> > (map
> > (lambda (x y)
> >   ;
> >   ;  place HERE the code for copying the WHOLE y element to the
> > whole x element
> >   ;  (where y and x have the same position in their corresponding
> > lists)
> >   ;
> > )
> >  musicList1 musicList2
> > )
> > )
> > #{ $music1 #})
>
> No.  x and y are values stored in lists.  The relation to their lists is
> not passed into your function, so you cannot change it there.
>
> You'd need to use something like pair-for-each to modify the first list
> in-place, and that gets old fast as music structures change.
>
> There is an actual reason functions like map-some-music are provided.
>
> --
> David Kastrup
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Replace ly:music elements in a Scheme function

2018-03-05 Thread David Kastrup
paolo prete  writes:

> Hello David,
> thanks for the snippet but I ask if it is possible to modify only the body
> of my function, inside lambda (x y)( ...  ) so to obtain the same result.
> Something like:
>
>
> 
>
> fun = #(define-music-function (parser location music1 music2) (ly:music?
> ly:music?)
> (let
> (
>   (musicList1 (ly:music-property music1 'elements))
>   (musicList2 (ly:music-property music2 'elements))
> )
> (map
> (lambda (x y)
>   ;
>   ;  place HERE the code for copying the WHOLE y element to the
> whole x element
>   ;  (where y and x have the same position in their corresponding
> lists)
>   ;
> )
>  musicList1 musicList2
> )
> )
> #{ $music1 #})

No.  x and y are values stored in lists.  The relation to their lists is
not passed into your function, so you cannot change it there.

You'd need to use something like pair-for-each to modify the first list
in-place, and that gets old fast as music structures change.

There is an actual reason functions like map-some-music are provided.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Replace ly:music elements in a Scheme function

2018-03-05 Thread paolo prete
Hello David,
thanks for the snippet but I ask if it is possible to modify only the body
of my function, inside lambda (x y)( ...  ) so to obtain the same result.
Something like:




fun = #(define-music-function (parser location music1 music2) (ly:music?
ly:music?)
(let
(
  (musicList1 (ly:music-property music1 'elements))
  (musicList2 (ly:music-property music2 'elements))
)
(map
(lambda (x y)
  ;
  ;  place HERE the code for copying the WHOLE y element to the
whole x element
  ;  (where y and x have the same position in their corresponding
lists)
  ;
)
 musicList1 musicList2
)
)
#{ $music1 #})

{
\fun {c' r e'} {f' g' a'}
}

2018-03-05 13:42 GMT+01:00 David Kastrup :

> paolo prete  writes:
>
> > in the snippet below I want to replace, while iterating two lists, the
> > elements of music1 with the elements of music2.
> > The code shows how to do that for pitches, but how can I replace the
> whole
> > element? (for example, a rest or a note with its articulation)
> > 
> >
> > fun = #(define-music-function (parser location music1 music2) (ly:music?
> > ly:music?)
> > (let
> > (
> >   (musicList1 (ly:music-property music1 'elements))
> >   (musicList2 (ly:music-property music2 'elements))
> > )
> > (map
> > (lambda (x y)
> >   ;iterate notes
> >   (display "note found\n")
> >   ;(set! (ly:music-property x 'pitch) #{c'#})
> >   ;(ly:music-set-property! x 'pitch #{c' #})
> >   (ly:music-set-property! x 'pitch (ly:music-property y 'pitch))
> > )
> >  musicList1 musicList2
> > )
> > )
> > #{ $music1 #})
> >
> > {
> > \fun {c' d' e'} {f' g' a'}
> > }
>
> Something like
>
>
>
> I'm fuzzy on what music1 is actually good for at all since only a scant
> sketch of its structure is used at all.  Probably you need to vary/copy
> more from the original.  The music-clone function can take additional
> arguments: maybe that allows you to do something more useful.
>
> --
> David Kastrup
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Replace ly:music elements in a Scheme function

2018-03-05 Thread David Kastrup
paolo prete  writes:

> in the snippet below I want to replace, while iterating two lists, the
> elements of music1 with the elements of music2.
> The code shows how to do that for pitches, but how can I replace the whole
> element? (for example, a rest or a note with its articulation)
> 
>
> fun = #(define-music-function (parser location music1 music2) (ly:music?
> ly:music?)
> (let
> (
>   (musicList1 (ly:music-property music1 'elements))
>   (musicList2 (ly:music-property music2 'elements))
> )
> (map
> (lambda (x y)
>   ;iterate notes
>   (display "note found\n")
>   ;(set! (ly:music-property x 'pitch) #{c'#})
>   ;(ly:music-set-property! x 'pitch #{c' #})
>   (ly:music-set-property! x 'pitch (ly:music-property y 'pitch))
> )
>  musicList1 musicList2
> )
> )
> #{ $music1 #})
>
> {
> \fun {c' d' e'} {f' g' a'}
> }

Something like

fun = #(define-music-function (parser location music1 music2) (ly:music?
ly:music?)
	(let*
	 ((pred? (music-type-predicate '(event-chord rhythmic-event)))
	  (musicList2 (apply circular-list (extract-music music2 pred?
	 (define (get-music)
	  (let ((elt (music-clone (car musicList2
	   (set! musicList2 (cdr musicList2))
	   elt))
	 (map-some-music
	  (lambda (m) (and (pred? m) (get-music)))
	  music1)))

{
  \fun {c' d' e'} {f' }
}

I'm fuzzy on what music1 is actually good for at all since only a scant
sketch of its structure is used at all.  Probably you need to vary/copy
more from the original.  The music-clone function can take additional
arguments: maybe that allows you to do something more useful.

-- 
David Kastrup
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Replace ly:music elements in a Scheme function

2018-03-05 Thread paolo prete
Hello,

in the snippet below I want to replace, while iterating two lists, the
elements of music1 with the elements of music2.
The code shows how to do that for pitches, but how can I replace the whole
element? (for example, a rest or a note with its articulation)

Thanks




fun = #(define-music-function (parser location music1 music2) (ly:music?
ly:music?)
(let
(
  (musicList1 (ly:music-property music1 'elements))
  (musicList2 (ly:music-property music2 'elements))
)
(map
(lambda (x y)
  ;iterate notes
  (display "note found\n")
  ;(set! (ly:music-property x 'pitch) #{c'#})
  ;(ly:music-set-property! x 'pitch #{c' #})
  (ly:music-set-property! x 'pitch (ly:music-property y 'pitch))
)
 musicList1 musicList2
)
)
#{ $music1 #})

{
\fun {c' d' e'} {f' g' a'}
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Edition Engraver bug?

2018-03-05 Thread Jan-Peter Voigt

Thank you, David! Sometimes I need a pointer to the obvious ...
* I will refactor the EE to also broadcast overrides.
* Of course I can listen to Overrides (and SetProperty) and check if 
there are editionMods and music colliding - the reason they didn't show 
up when I listened to StreamEvent was that I was looking for 
music-cause, but that isn't set.

* The EE might export overrides and such to another file for use with the EE

There first point should clean up and shorten some code. I will need 
some days but will deliver an update ASAP.


Jan-Peter


Am 05.03.2018 um 12:18 schrieb David Kastrup:

Jan-Peter Voigt  writes:


Hi David,

Am 05.03.2018 um 10:42 schrieb David Kastrup:

This is a failure that can happen whenever there are (implicit)
overrides in the music. I'll try to track/fetch overrides generated
outside the EE to avoid this issue.

Any chance to actually use the equivalent of "\once" here?  It's
protected against reverting the wrong override, but this functionality
is not exposed at the Scheme level.


The EE is written entirely in scheme so I don't see a chance.


It can still send override events rather than setting properties by
itself.


How would it be possible to listen to overrides? They are not caught
when I listen to StreamEvent.


What?  They are definitely sent as events.




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Edition Engraver bug?

2018-03-05 Thread David Kastrup
Jan-Peter Voigt  writes:

> Hi David,
>
> Am 05.03.2018 um 10:42 schrieb David Kastrup:
>>> This is a failure that can happen whenever there are (implicit)
>>> overrides in the music. I'll try to track/fetch overrides generated
>>> outside the EE to avoid this issue.
>> Any chance to actually use the equivalent of "\once" here?  It's
>> protected against reverting the wrong override, but this functionality
>> is not exposed at the Scheme level.
>
> The EE is written entirely in scheme so I don't see a chance.

It can still send override events rather than setting properties by
itself.

> How would it be possible to listen to overrides? They are not caught
> when I listen to StreamEvent.

What?  They are definitely sent as events.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Edition Engraver bug?

2018-03-05 Thread Jan-Peter Voigt

Hi David,

Am 05.03.2018 um 10:42 schrieb David Kastrup:

This is a failure that can happen whenever there are (implicit)
overrides in the music. I'll try to track/fetch overrides generated
outside the EE to avoid this issue.

Any chance to actually use the equivalent of "\once" here?  It's
protected against reverting the wrong override, but this functionality
is not exposed at the Scheme level.


The EE is written entirely in scheme so I don't see a chance. But 
probably I just don't see it right now.


*the following is just a brainstorm*

The overrides given by \editionMod are applied early in the 
start-translation-timestep slot and therefore before overrides inside 
the music are applied (inside process-music ?). If the EE applies 
overrides inside process-music it is to late.
The once-overrides managed by the EE are stored in a list until they are 
reverted inside stop-translation-timestep. Of course it would be better 
to give the once-attribute once and let lilypond revert the right property.
How would it be possible to listen to overrides? They are not caught 
when I listen to StreamEvent. Maybe it is to prevent me from 
implementing bad patterns.


I will later produce a more concise chart on how and when the EE is 
applying overrides.


Jan-Peter


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Edition Engraver bug?

2018-03-05 Thread David Kastrup
Jan-Peter Voigt  writes:

> Hi Stefano,
>
> thanks again for bringing up this issue! Now I identified it an EE-bug
> and I was able to reproduce the failure with:
> --
> \version "2.19.80"
> \include "oll-core/package.ily"
> \loadPackage edition-engraver
> \consistToContexts #edition-engraver Voice
>
> \addEdition test
>
> \editionMod test 1 0/4 Voice.A \once \tieDown
>
> <<
>   \relative { a'4~ a~ a~ a } \\
>   \relative { e'~ e~ e~ e }
>>>
> --
>
> If \tieDown is is set to moment 1/4 it is applied as expected - so the
> affected \editionMod at moment 0/4 is scheduled to happen at the
> moment \voiceOne is applied. This issue produces some kind of a race
> condition where Tie.direction is modified by \voiceOne after
> \editionMod comes into action. The EE does a \revert for all
> \overrides when the timestep is finished, but the top of the override
> stack is the override introduced by \voiceOne, so that is reverted to
> the \tieDown state.
> (Btw. \tieDown is just an equivalent shortcut for \override
> Tie.direction = #DOWN)
> Using ly:grob-property is not affected here, because there are no
> overrides to Tie.after-linebreak inside the music expression and
> ly:grob-property is applied late.
>
> This is a failure that can happen whenever there are (implicit)
> overrides in the music. I'll try to track/fetch overrides generated
> outside the EE to avoid this issue.

Any chance to actually use the equivalent of "\once" here?  It's
protected against reverting the wrong override, but this functionality
is not exposed at the Scheme level.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple midi player

2018-03-05 Thread Jacques Menu Muzhic
Hello Nathan,

Frescobaldi/SimpleSynth provides this, what’s the advantage of using vim/a pdf 
reader?

JM

> Le 5 mars 2018 à 03:10, Nathan Sprangers  a 
> écrit :
> 
> Hello all,
> 
> Can anyone suggest a simple midi player that can begin or cue playback from a 
> specified measure/beat? I would like to be able to work using vim and a pdf 
> reader. I've been using VLC for midi playback, but it only indicates a 
> timestamp, not a measure/beat.
> 
> Thanks,
> Nathan
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Edition Engraver bug?

2018-03-05 Thread Jan-Peter Voigt

Hi Stefano,

thanks again for bringing up this issue! Now I identified it an EE-bug 
and I was able to reproduce the failure with:

--
\version "2.19.80"
\include "oll-core/package.ily"
\loadPackage edition-engraver
\consistToContexts #edition-engraver Voice

\addEdition test

\editionMod test 1 0/4 Voice.A \once \tieDown

<<
  \relative { a'4~ a~ a~ a } \\
  \relative { e'~ e~ e~ e }
>>
--

If \tieDown is is set to moment 1/4 it is applied as expected - so the 
affected \editionMod at moment 0/4 is scheduled to happen at the moment 
\voiceOne is applied. This issue produces some kind of a race condition 
where Tie.direction is modified by \voiceOne after \editionMod comes 
into action. The EE does a \revert for all \overrides when the timestep 
is finished, but the top of the override stack is the override 
introduced by \voiceOne, so that is reverted to the \tieDown state.
(Btw. \tieDown is just an equivalent shortcut for \override 
Tie.direction = #DOWN)
Using ly:grob-property is not affected here, because there are no 
overrides to Tie.after-linebreak inside the music expression and 
ly:grob-property is applied late.


This is a failure that can happen whenever there are (implicit) 
overrides in the music. I'll try to track/fetch overrides generated 
outside the EE to avoid this issue.


Jan-Peter



Am 26.02.2018 um 15:26 schrieb Stefano Troncaro:
Hi everyone! I tried to isolate the issue with Tie directions that I 
posted earlier and I'm fairly confident I've stumbled upon a bug.


Look at the output of this snippet (Sorry for the length, I made it as 
short as I could)


\version  "2.19.80" \language  "english" \include  "oll-core/package.ily" 
\loadPackage  edition-engraver
\addEdition  test
\consistToContexts  #edition-engraver Voice

\layout  { \context  { \Score \time  6/4
 \omit  TimeSignature \omit  Clef } } forceRebelTie =
#(define-music-function  (dir) (ly:dir?)
#{
  \override  Tie.before-line-breaking  =
  #(lambda  (grob)
 (ly:grob-set-property!  grob 'direction dir)) #} )

ovA =\once  \tieDown ovB =\once \override  Tie.direction  = #DOWN ovC =\once  \forceRebelTie  #DOWN formA =\new  Staff  \with  {  instrumentName  ="All V1"  } << \new  Voice  \relative  c''{  \voiceOne  b~  4 4~  4 4~  4} >> formB =\new  Staff  \with  {  instrumentName  ="1V V1"  } << \new  Voice  \relative  c''{  b~  \voiceOne  4  \oneVoice  4~  \voiceOne  4  \oneVoice  4~  \voiceOne  4  } >> controlA =\new  Staff  \with  {  instrumentName  ="No EE"  } << \new  Voice  \relative  c''{  \voiceOne  \ovA  b~  4 4~  4 4~  4  } >> controlB =\new  Staff  \with  {  instrumentName  ="No EE"  } << \new  Voice  \relative  c''{  \voiceOne  \ovB  b~  4 4~  4 4~  4  } >> controlC =\new  Staff  \with  {  instrumentName  ="No EE"  } << \new  Voice  \relative  c''{  \voiceOne  \ovC  b~  4 4~  4 4~  4  } >> \markup  "Results with \\tieDown" \editionMod  test1 0  Voice.A\ovA \editionMod  test1 0  Voice.B\ovA \score  { \new  StaffGroup  << \formA \formB \controlA >> } \markup  "Results with \\override Tie.direction" \editionMod  test1 0  Voice.D\ovB \editionMod  test1 0  Voice.E\ovB \score  { \new  StaffGroup  << \formA \formB \controlB >> } \markup  "Results with ly:grob-set-property!" \editionMod  test1 0  Voice.G\ovC \editionMod  test1 0  Voice.H\ovC \score  { \new  StaffGroup  << \formA \formB \controlC >> } \markup  "No overrides (default behavior for comparison)" \score  { \new  StaffGroup  << \formA \formB >> } 



When \voiceOne is in full effect, both \once \tieDown and\once \override 
Tie.direction seem to have a permanent effect that kicks in after the 
moment they are used, which is exactly the opposite to what they should 
do (take effect only in the moment they are called and revert to the 
previous behavior after). This is very clear when you compare the All V1 
Staff with the No EE Staff: the All V1 behaves in the exact opposite way.


I have absolutely no idea about why this may be happening, but I'm 
certain that one should expect the EE to achieve the same results that 
manually writing the code in the desired place and moment would.


Hopefully Jan-Peter or someone more knowledgeable than I can look into it!

I hope this "research" can be useful!
Stéfano


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Graeme Lee

Hi Noeck.

On 5/03/2018 4:09 AM, Noeck wrote:

Hi,

I need some further insights in what a bookpart is.
I've read the doc but it is very short on the issue:
http://lilypond.org/doc/v2.19/Documentation/notation/multiple-scores-in-a-book
My understanding from try and error is this (and I would be happy if you
could correct me or confirm the statements):


\paper blocks inside a \bookpart only affect this bookpart, while \paper
blocks outside affect everything. So it seems to be a scoping for paper
blocks.

Q: Is it correct that the bookpart is a scope for paper blocks?

It overrides its parent \paper block in \book

If I put a \layout block in a \bookpart, lilypond complains and says:
Für Papier-Block wird \paper benötigt
(\paper needed for paper block) – whatever that means ...

Q: Is it correct that \layout blocks don't belong inside a \bookpart?


Here's a working example.  Full header on :

  \bookpart {
    \header {
  instrument = \markup { \smallCaps "Violin I" }
    }
    \paper {
  oddHeaderMarkup = \markup {
    \column {
  \fill-line {
    \on-the-fly #not-single-page
    \fromproperty #'header:instrument
  }
  " "
    }
  }
  evenHeaderMarkup = \oddHeaderMarkup
    }
    \score {
  \new StaffGroup \keepWithTag #'vnp \Imusic
  \layout {
    \compressFullBarRests
    \context {
  \Score
  \override MultiMeasureRest.expand-limit = #2
  \override MetronomeMark.self-alignment-X = #0.2
  \override MetronomeMark.padding = #2
    }
    \context {
  \Staff \override InstrumentName #'stencil = ##f
    }
  }
    }
  }

I can define variables at top-level and use them in any boobpart. But
defining a variable inside a bookpart fails ("Error: syntax error,
unexpected SYMBOL").

Q: Is it correct that I can't define a variable inside a bookpart?
Q: That means if I have many scores with many voices in my document,
I need unique names for all of them and can not reuse \soprano for
the next piece with different content?

Maybe explore using tags for your voices?


As my included files contain definitions, I cannot include them inside a
bookpart as far as I understand. So I need to put them at top level, right?

Q: Included files just behave as if the content was inserted at the same
position?
Q: Includes must be at top level?


When does a \paper block apply? The order of score and \paper block
doesn't seem to decide upon it. From the example below I am puzzled why
the top-level paper block applies to the second score but not to the
first. It is after all scores but on top-level. Shouldn't it affect
either both or none?


The first score overrides the top level \paper block with its own.

*What I want to achieve* is to have ~10 independent pieces and
concatenate all of them into one book as well as printing everyone on
its own. The separate pieces should have taglines etc. on the first/last
page as usual. But the book should not repeat them for every piece. Each
piece should start a new page in the book. I dreamed of just including
all the scores into one document. But the output is terrible (errors as
the ones above etc.).

Q: Should I use bookparts at all or just \pageBreaks?


Thanks for reading until here! :)

Cheers,
Joram




\bookpart {
   \paper {
 left-margin = 8\cm
   }

   \markup "ASD"
   \score {  { a } }
}

\bookpart {
   { b }
   \header {
 title= "Title"
   }
}

\paper {
   top-margin = 5\cm
}

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user