Re: Scheme function to force any noteEvent to a skipEvent

2016-04-04 Thread David Wright
On Mon 04 Apr 2016 at 17:47:03 (+), Joseph Chrestien wrote:
> Thanks David and Simon for your kind help. I used David's solution and it 
> works brilliantly. Very nice. I didn't know of this NullVoice context, I'll 
> take a look at it.

My view would be to use David's solution where you have a preexisting
part already coded, but to use Simon's where you're writing a score
from scratch. It clarifies the structure of the score, and the
"aux" part is likely to be much less bulky to include in each and
every midi score than, say, a silenced florid soprano part.

I don't know if you write homophonic music with shared words (like in
a US-style hymn book) but NullVoice is almost unavoidable for setting
lyrics unless the rhythms are identical in every voice.

Cheers,
David.

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread David Wright
On Tue 05 Apr 2016 at 01:04:40 (+0200), Thomas Morley wrote:
> 2016-04-04 23:58 GMT+02:00 David Sumbler :
> >
> > Just a thought - perhaps one day somebody who understands Lilypond well
> > might write a section for the docs, starting with the basic
> 
> Well, the full quote:
> 
> LilyPond treats input like this:
> 
> \relative {
>   c''4 a d c
> }
> 
> as shorthand for this:
> > \book {
> >   \score {
> > \new Staff {
> >   \new Voice {
> > \relative {
> >   c''4 a b c
> > }
> >   }
> > }
> > \layout { }
> >   }
> > }
> > structure shown in LM3.1.1 (what happened to \bookpart I wonder)

... and StaffGroup.

It's interesting to compare this structure with NM5.1.1 where \score
is the topmost context and StaffGroups are "top-level" contexts.

And why book, score and not Book, Score? And why not \new Score?

And, if you actually *do* write \new Score, why does the parser object
to its \layout command; but if you now delete the \layout command,
why does the parser not object to \new Score any more?

> The example shows how LilyPond treats the input.
> 
> If you do:
> 
> bk =
> \book {
>   \score {
> \new Staff {
>   \new Voice {
> \relative {
>   c''4 a b c
> }
>   }
> }
> \layout { }
>   }
> }

If LilyPond had an IDE, it might well start off with something looking
rather like that. Pressing, say, F1 at any point might give you
suggestions as to what could appear there.
Kind of syntax highlighting on steroids.

> #(write-me "book? " (ly:book? bk))
> #(write-me "book-parts present: " (ly:book-book-parts bk))
> 
> You'll se that _no_ bookparts are created. So the example _is_ complete.
> Why mention bookpart if not present, same for other stuff like
> ChoirStaff, ChordNames, DrumVoice, etc, etc
> 
> Btw, bookparts _are_ books. See:
> bkprt =
> \bookpart { \score { \new Staff { cisis'1 } } }
> 
> #(write-me "book? " (ly:book? bkprt))
> 
> They are differently treated, though...
> 
> 
> In general I think we would do our users a favor to emphasize the
> recommendation to use the various display-functions more prominently.
> 
> I do it all the time, sometimes writing special ones, like earlier in
> this thread.
> If I don't understand things, I first display them, always, sometimes
> every little detail...
> Works great form me.

Does LP have any display functions? (I mean like \the in TeX.)
For example, if mus = { a b c d }, I can render it and read the
music from the score, but how would I type\mus
and get
=> { a b c d }
displayed in the LP output stream? Or how about
 LyricText.font-size
=> -3
 LyricText
font-size => -3 font-shape => 'italic ... etc.

I'm almost reluctant to ask a question like this,
having recently reread the thread starting at
http://lists.gnu.org/archive/html/lilypond-user/2016-02/msg00700.html

Cheers,
David.

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


Re: Weird error when using skipTypesetting

2016-04-04 Thread David Wright
On Mon 04 Apr 2016 at 23:30:00 (+0200), Sharon Rosner wrote:
> Hi all,
> 
> I’m getting a bunch of "programming error: insane spring distance requested, 
> ignoring it” etc errors when compiling the following:
> 
> \version "2.19.37"
> 
> music = \relative c' { 
>   c1 d e f \bar "||"
>   \set Score.skipTypesetting = ##t
>   g a b c
> }
> 
> { \music }
> 
> In addition, the music is cut immediately after the last note, and does not 
> show the bar line that I’m explicitly asking for:
> 
> 
> Does somebody have an idea what I’m doing wrong?

If you add \set Score.skipTypesetting = ##f at the end of the music to
be omitted, you will get a bit more sense.

Crumblies among us may remember line editors where you finished
editing a file with W(indup). If instead you finished with Q(uit) you
lost everything that was still in memory rather than in the file on
disk. Maybe LP wants type-setting ON when it encounters the } at the
end of the music.

Cheers,
David.

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


Re: Weird error when using skipTypesetting

2016-04-04 Thread Colin Campbell

On 16-04-04 05:12 PM, Sharon Rosner wrote:

Sharon Rosner wrote

In addition, the music is cut immediately after the last note, and does
not show the bar line that I’m explicitly asking for:

For anyone who's interested, I've found a workaround technique based on code
in music-functions.scm. The code is here:

   https://gist.github.com/ciconia/a6e1cf9c9af84d39fe6ad25fff9ab502




Another possibility is simply putting a spacer rest after the \bar function:
**
\version "2.19.37"

music = \relative c' {
  c1 d e f \bar "||" s
  \set Score.skipTypesetting = ##t
  g a b c
}

{ \music }

*
It does seem odd that skipTypesetting seems to begin on a bar line 
rather than in the instant after it, though.


Cheers,
Colin
--
1.79 * 10^12 furlongs/fortnight: 'Tis not just a good idea, it be the law!
- Unattributed
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Weird error when using skipTypesetting

2016-04-04 Thread Sharon Rosner
Sharon Rosner wrote
> In addition, the music is cut immediately after the last note, and does
> not show the bar line that I’m explicitly asking for:

For anyone who's interested, I've found a workaround technique based on code
in music-functions.scm. The code is here:

  https://gist.github.com/ciconia/a6e1cf9c9af84d39fe6ad25fff9ab502

Sharon





--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Weird-error-when-using-skipTypesetting-tp189298p189306.html
Sent from the User mailing list archive at Nabble.com.

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Thomas Morley
2016-04-04 23:58 GMT+02:00 David Sumbler :
>
> Just a thought - perhaps one day somebody who understands Lilypond well
> might write a section for the docs, starting with the basic

Well, the full quote:

LilyPond treats input like this:

\relative {
  c''4 a d c
}

as shorthand for this:
> \book {
>   \score {
> \new Staff {
>   \new Voice {
> \relative {
>   c''4 a b c
> }
>   }
> }
> \layout { }
>   }
> }
> structure shown in LM3.1.1 (what happened to \bookpart I wonder)

The example shows how LilyPond treats the input.

If you do:

bk =
\book {
  \score {
\new Staff {
  \new Voice {
\relative {
  c''4 a b c
}
  }
}
\layout { }
  }
}

#(write-me "book? " (ly:book? bk))
#(write-me "book-parts present: " (ly:book-book-parts bk))

You'll se that _no_ bookparts are created. So the example _is_ complete.
Why mention bookpart if not present, same for other stuff like
ChoirStaff, ChordNames, DrumVoice, etc, etc

Btw, bookparts _are_ books. See:
bkprt =
\bookpart { \score { \new Staff { cisis'1 } } }

#(write-me "book? " (ly:book? bkprt))

They are differently treated, though...


In general I think we would do our users a favor to emphasize the
recommendation to use the various display-functions more prominently.

I do it all the time, sometimes writing special ones, like earlier in
this thread.
If I don't understand things, I first display them, always, sometimes
every little detail...
Works great form me.

Cheers,
  Harm

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread David Wright
On Mon 04 Apr 2016 at 12:46:37 (+0200), Bernard wrote:
> On 03-04-16 22:56, David Kastrup wrote:
> >Bernard  writes:
> >>That does help. I found out \with is a very special statement.
> >Not really.  \with can be part of other constructs, just like "else" can
> >be part of other constructs in many programming languages (including
> >Scheme).  It is not a "statement" at all.
> That does help a lot. Now I understand why there can not be anything
> before /with.
> >
> >>It influence what happens before the statement, it must be executed
> >>just after \new . That is the reason why my examples 4 and 5 did not
> >>work.
> >>And it influence what happens after the statement. If within the Staff
> >>not a additional Staff property can be set.
> >>
> >>No wonder it confuses me.
> >\with introduces "context modifications".  They are basic expressions in
> >that they can be stored in variables and passed to functions, but to
> >take effect, they need to be applied to an actually created context, and
> >there are various syntactic constructs for doing that.
> >
> >They "influence what happens after the statement" like any modification
> >to anything.  Their influence is restricted to contexts they are applied
> >to (possibly via layout or context definitions or wrapped into other
> >context modifications).
> >
> I still do not get it all. By the way, I am my self a Python
> programmer and object orientation in known to me.

[...]

Your example is incomprehensible to me as I've never used drum mode.
It's also large enough to obfuscate the problem.

Simplifying the code:

%%

mus = { e' f' g' a' }

\markup { with section }
\score { \new Staff \with { \override NoteHead.color = #red } \mus }

\markup { with section }
\score { \new Staff \with { \override NoteHead.color = #red } { e' f' g' a' } }

%% That worked. The \with { xxx } modified the music.
%% Then you took out the \with so the { xxx } now becomes the music.
%% (Music expressions can include context modifications as well as notes.)

%% Think of python's positional parameters and keyword parameters.
%% You start with ( keyword=argument, parm ) but you remove "keyword="
%% so you're left with ( argument, parm ) and "argument" becomes a
%% positional parameter instead.

%% In LilyPond, the "first positional parameter" is the music.
%% Most LilyPond elements consist of either   \element SINGLE-value
%% or   \element { SINGLE arbitrarily complicated expression }
%% and not   \element { argument } { parm }
%% So LilyPond does not allow a "second positional parameter".

\markup { without the use of the with section }
%% generate error
\score { \new Staff { \override NoteHead.color = #red } \mus }

\markup { without the use of the with section }
%% generate error
\score { \new Staff { \override NoteHead.color = #red } { e' f' g' a' } }

%% Your music now becomes treated as illegal source code because
%% it's syntactically a "second positional parameter".
%% However, if you move the music in with the "first positional parameter":

\markup { without the use of the with section }
\score { \new Staff { \override NoteHead.color = #red \mus } }

\markup { without the use of the with section }
\score { \new Staff { \override NoteHead.color = #red e' f' g' a' } }

\markup { without the use of the with section }
\score { \new Staff { e' f' \override NoteHead.color = #red g' a' } }

%%

If you really want a python example; when you
"skipped the   with   section" by deleting "\with"
what you did was like changing:

with fileinput.input(args, mode='rb') as theinput:
  for bytestring in theinput:
nbytesscanned += len(bytestring)
linenum += 1
for k in bytestring:
  maxchar = max(maxchar, k)
  if k not in firsts: firsts[k] = linenum
  counts[k] = counts.setdefault(k,0) + 1

into:

fileinput.input(args, mode='rb') as theinput:
  for bytestring in theinput:
nbytesscanned += len(bytestring)
linenum += 1
for k in bytestring:
  maxchar = max(maxchar, k)
  if k not in firsts: firsts[k] = linenum
  counts[k] = counts.setdefault(k,0) + 1

Python now has no idea what to do with the word "as".

Cheers,
David.

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Simon Albrecht

On 04.04.2016 22:19, Johannes Waldmann wrote:

The docs do make considerable effort to explain, e.g.,
http://lilypond.org/doc/v2.18/Documentation/learning/contexts-and-engravers
  .
If at all, I might criticize this for being in the wrong order:
2. Common Notation, 3. Fundamental Concepts - but how can we
use or learn a language (syntax, notation) without knowing
its underlying semantical model first?


That is because many people who get a go at LilyPond (such as me) are 
not programmers, but musicians with little background knowledge about or 
experience with programming.
It seems that a majority of LilyPond users are either music 
professionals with a knack for logics and programming, or (active or 
retired) programmers who are hobby musicians. It’s hard to satisfy both 
at once.


Yours, Simon

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread David Sumbler
On Mon, 2016-04-04 at 16:12 -0400, lilypond-user-requ...@gnu.org wrote:
> > From: Noeck 
> > To: lilypond-user@gnu.org
> > Subject: Re: Lilypond structure / implicit - explicit / with
> > statement
> > Date: Mon, 4 Apr 2016 22:11:51 +0200
> > 
> > Would the table in the previous mail be helpful for the docs here?
> > http://lilypond.org/doc/v2.19/Documentation/notation/overview-of-modifying-properties
> > 
> > I could write it and some text around it if there is a general feeling
> > that it would help.
> > 
> > Cheers,
> > Joram

I think it would help.

I have followed this thread with great interest: I have a lot of
sympathy with Bernard.

I have been using Lilypond for a few years now (but admittedly there are
always periods of weeks or months at a time when I haven't touched it,
which of course makes things much more difficult to retain).

I still find the whole thing rather cryptic, and I do think that
Bernard's remark about Godolvsky errors is perceptive and relevant.  A
few of the replies that have been given imply that things are pretty
obvious when, for some, they simply are not.  When one is very familiar
with and well-immersed in a subject, it is often hard or impossible to
understand what another intelligent person finds so obscure or difficult
about it.

I myself have even had thoughts lately of cutting my losses, installing
a DOS emulator and going back to using Score!  I can't remember much
about how Score is used, but I do remember that I published quite a
number of arrangements and compositions in the late '90s using Score,
and that getting to grips with it was a fraction of the effort I have
needed (and still need) to understand how to do things in Lilypond.  Yet
Score's output is commonly regarded still as pretty much first-rate.

Of course, different people have different learning styles, and for me I
think that part of the problem with Lilypond is that there is no very
clear, organized "bottom-up" description of how it works and how to use
it.  Like Bernard, I suspect, I would probably have had more success in
getting to grips with Lilypond if I had had a more thorough grounding in
the fundamentals at the very start.  I'm the sort of person who finds
that modern (human)-language-teaching methods leave me stranded very
quickly: I need to learn the present tense of the verb "to be" and the
principles of the orthography of a language at the very beginning.

Just a thought - perhaps one day somebody who understands Lilypond well
might write a section for the docs, starting with the basic
\book {
  \score {
\new Staff {
  \new Voice {
\relative {
  c''4 a b c
}
  }
}
\layout { }
  }
}
structure shown in LM3.1.1 (what happened to \bookpart I wonder) and
gradually expanding that, as well as showing how and when some elements
can be omitted.  The different ways of changing context and object
properties could be detailed as well.

David


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


Re: Weird error when using skipTypesetting

2016-04-04 Thread Urs Liska


Am 04.04.2016 um 23:30 schrieb Sharon Rosner:
> Hi all,
>
> I’m getting a bunch of "programming error: insane spring distance
> requested, ignoring it” etc errors when compiling the following:
>
> \version "2.19.37"
>
> music = \relative c' { 
>   c1 d e f \bar "||"
>   \set Score.skipTypesetting = ##t
>   g a b c
> }
>
> { \music }
>
> In addition, the music is cut immediately after the last note, and
> does not show the bar line that I’m explicitly asking for:
>
>
>
> Does somebody have an idea what I’m doing wrong?

No, but I can confirm that I'm always seeing this issue when setting
skipTypesetting to ##t.

Somehow I have the impression that the two issues are related. When
compiling I see two sets of warnings, complaining (in that order) about
- insane spring distance requested
- insane spring min_distance requested
- insane spring constant

If you repeat the first line, say, eight times (so the music spans three
systems) all copies are correct except the last, and there is exactly
the same amount of six error/warnings in the end.

The spring is the metaphor for the code that is responsible for
stretching out the music horizontally to fill the line. My impression is
that the skipTypesetting prevents the spring on the last item to be
properly "attached" to the "wall to the right".

I think you don't do anything wrong but that is suboptimal behaviour,
therefore this is CC'd to bug-lilypond.

Urs

>
> Thanks
> Sharon
>
>
>
>
>
>
>
> ___
> 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: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread David Kastrup
Colin Campbell  writes:

> On 16-04-04 02:57 PM, David Kastrup wrote:
>> Noeck  writes:
>>
>>> … and enjoy your climbing! I hope I don't produce much more
>>> misinformation until you are safely back ;)
>> Uh, I'm already back.  I'm only enjoying the open spots on my fingertips
>> now.  They'll close up in the next few days, and in 10 days or so the
>> fingers (mostly) will start peeling.
>>
>
> You certainly seem to carry your scale exercises to new heights,
> although I would have thought you more interested in the classical
> repertoire than rock.

The Classics actually don't do much for me, particularly not the
Symphonic Classics.  I'm mostly uninterested in stuff later than Baroque
until something like mid-20th century.  I'm currently working on
Piazzolla, but if you look closely, that's actually counterpoint.

-- 
David Kastrup

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


Weird error when using skipTypesetting

2016-04-04 Thread Sharon Rosner
Hi all,I’m getting a bunch of "programming error: insane spring distance requested, ignoring it” etc errors when compiling the following:\version "2.19.37"music = \relative c' {   c1 d e f \bar "||"  \set Score.skipTypesetting = ##t  g a b c}{ \music }In addition, the music is cut immediately after the last note, and does not show the bar line that I’m explicitly asking for:Does somebody have an idea what I’m doing wrong?ThanksSharon

skip4.ly
Description: Binary data
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Colin Campbell

On 16-04-04 02:57 PM, David Kastrup wrote:

Noeck  writes:


… and enjoy your climbing! I hope I don't produce much more
misinformation until you are safely back ;)

Uh, I'm already back.  I'm only enjoying the open spots on my fingertips
now.  They'll close up in the next few days, and in 10 days or so the
fingers (mostly) will start peeling.



You certainly seem to carry your scale exercises to new heights, 
although I would have thought you more interested in the classical 
repertoire than rock.


Cheers,
Colin

--
One of the advantages of being disorderly is that one is constantly 
making exciting discoveries.

 - A. A. Milne, From the Daryl R. Gibson collection

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread David Kastrup
Noeck  writes:

> … and enjoy your climbing! I hope I don't produce much more
> misinformation until you are safely back ;)

Uh, I'm already back.  I'm only enjoying the open spots on my fingertips
now.  They'll close up in the next few days, and in 10 days or so the
fingers (mostly) will start peeling.

-- 
David Kastrup

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Noeck
… and enjoy your climbing! I hope I don't produce much more
misinformation until you are safely back ;)

Cheers,
Joram

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Noeck
Hi David,

On 04.04.2016 22:22, David Kastrup wrote:
> Noeck  writes:
> 
>> Alternatively, you can put this into a layout block:
>>
>> \layout {
>>   \context {
>> \Staff
>> clefPosition = 2
>>   }
>> }
>> %or
>> \layout {
>>   \set Staff.clefPosition = 2
>> }
> 
> This is not the same.  

I know. I wanted to keep it as short as possible, but you are right, it
is worth mentioning.


>> in layout block (variant 1):
>> \layout { \context { \Ctx   | \layout { \context { \Ctx
>>   prop = val }  |   \override obj.prop = val }

btw: } missing here

>> in layout block (variant 2):
>> \layout { \set Ctx.prop = val } | \layout{\override Ctx.obj.prop = val }
> 
> That's not a variant but something quite more encompassing.

Well, obviously, the docs did not help to find the most important
answers first in this particular case/thread. That's why I tried to
summarize what I consider minimal knowledge for property tweaking. Not
providing the full picture but only the "most important" parts, is
always dangerous. But my aim was not to replacate several chapters of
the manual but rather a practical concise form which is not found in the
manual. I still think that conciseness is a value in itself (it is a
fine line, though).

Back to the table, I probably should have omitted 'variant 2' as it is
indeed a bit dangerous until one knows what happens.

Cheers,
Joram

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread David Kastrup
Noeck  writes:

> Alternatively, you can put this into a layout block:
>
> \layout {
>   \context {
> \Staff
> clefPosition = 2
>   }
> }
> %or
> \layout {
>   \set Staff.clefPosition = 2
> }

This is not the same.  The first affects only the "Staff" context
definition.  The second also affects _all_ contexts aliased to "Staff",
namely "TabStaff" and "DrumStaff" and "RhythmicStaff" and "FretBoards"
and "ChordNames" and "Devnull" and "NullVoice" (!) and "VaticanaStaff"
and "GregorianTranscriptionStaff" and "MensuralStaff" and
"PetrucciStaff" and "KievanStaff".

For most of those, you would _not_ want to change their default
clefPosition.

Putting \set/\override straight into a \layout definition has more
thorough effects than in a particular context definition.  Sometimes,
that's what you want.

Often, it's not.

> in with block:
> \with { prop = val }| \with { \override Ctx.obj.prop = val }
>
> in layout block (variant 1):
> \layout { \context { \Ctx   | \layout { \context { \Ctx
>   prop = val }  |   \override obj.prop = val }
>
> in layout block (variant 2):
> \layout { \set Ctx.prop = val } | \layout{\override Ctx.obj.prop = val }

That's not a variant but something quite more encompassing.  Note that
"Ctx." can be left off in which case "Bottom." is implied as usual.
Since "Bottom." is only ever an alias, addressing only the named context
would confuse people if they use something like "\omit Accidental" in
the expectation that it would omit accidentals.

-- 
David Kastrup

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


Re: Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Johannes Waldmann
interesting discussion!

> My ultimate question boils down to how to assign
> a value to a property. That should not even be a question.

That ("should not be a question") depends on the mental model.
Why do you assume that a property is assignable, or in fact
that a (sub)program should consist of (state-changing) statements?
I guess because of your OO programming background (you mentioned it).
But in (pure) functional programming, there are no assignments
(no state) at all, and that happens to be my preferred mental model.

This is not a question of right or wrong -
history shows that both models are useful.
The question is to convey to the user
the model that was used in the design of the language/system.
You described this as "making implicit knowledge explicit".

The docs do make considerable effort to explain, e.g.,
http://lilypond.org/doc/v2.18/Documentation/learning/contexts-and-engravers
 .
If at all, I might criticize this for being in the wrong order:
2. Common Notation, 3. Fundamental Concepts - but how can we
use or learn a language (syntax, notation) without knowing
its underlying semantical model first?

E.g., my lilypond learning problem (I think)
is to find out how much of lilypond is pure data
(music as an expressions, nested by sequential and parallel composition)
and how much is procedural (music as execution of events,
that is, of statements)
and when and how to switch between these models (if at all).

- J.

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Noeck
Would the table in the previous mail be helpful for the docs here?
http://lilypond.org/doc/v2.19/Documentation/notation/overview-of-modifying-properties

I could write it and some text around it if there is a general feeling
that it would help.

Cheers,
Joram

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Noeck
Hi Bernard,

I would like to try and explain it in other words as the manual:

music with implicit voice and staff:
{ c' }

music with explicit staff and implicit voice:
\new Staff { c' }

adding a with statement:
\new Staff \with { clefPosition = 2 } { c' }

Please note here: There must be no { after Staff, because that would
start a music expression. The braces are not just for grouping things
but they start a music expression and \with must come before the music
starts. Think of it as a function, if the first argument starts with {
it is music and not a \with block:

\new Staff   \with { clefPosition = 2 } { c' }
^^   ^^ ^^
function optional argument (not music)  music

Alternatively, you can put this into a layout block:

\layout {
  \context {
\Staff
clefPosition = 2
  }
}
%or
\layout {
  \set Staff.clefPosition = 2
}



## Contexts and objects

Contexts are different from graphical objects and their properties
(prop) are changed differently (explained in the docs). Just a summary
here (val means value):

contexts (Staff, Voice, …) Ctx  |  graphical objects (Clef, …) obj
---
in music:
{ \set Ctx.prop = val } | { \override Ctx.obj.prop = val }

in with block:
\with { prop = val }| \with { \override Ctx.obj.prop = val }

in layout block (variant 1):
\layout { \context { \Ctx   | \layout { \context { \Ctx
  prop = val }  |   \override obj.prop = val }

in layout block (variant 2):
\layout { \set Ctx.prop = val } | \layout{\override Ctx.obj.prop = val }


td;dr: (1) be careful with {}
   (2) read the input as functions with some optional arguments
   (3) context properties and object properties are different

HTH,
Joram


PS: I know you said you won't try any longer, but perhaps this will help
someone.

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Simon Albrecht

On 04.04.2016 21:54, David Kastrup wrote:

The only "inconsistency" I am able to see is that context modifications
(like context definitions) omit a context name for their sets/overrides,
and that they use assignment syntax without \set unlike to how context
properties are set inside of actual music.  The first is rather obvious
(how could a context modification apply to anything but the respective
context itself?).  The second is kind of a wart due to a mixture of
historical and technical reasons.


Why a wart? It’s neither ugly nor a nuisance, quite the opposite.

Yours, Simon

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread David Kastrup
Bernard  writes:

> On 04-04-16 18:35, David Kastrup wrote:
>> Bernard  writes:
>>
>>>
>>> I think I am getting quite close now. Thanks,
>> I have no idea what you think you are doing but I have severe doubts
>> that you are getting close to anything useful.  It looks to me like you
>> are just randomly putting syntactic entities into a bag and shake.
>>
>> Have you read through the Learning Manual?  It should tell you how
>> LilyPond organizes its input.
>
> Thanks David and others, but I give up.
> For your info I did read the manual, much more then I wanted to.
> My ultimate question boils down to how to assign a value to a
> property. That should not even be a question.

With \set / \override, and you actually had working code doing just
that.  For some properties, it might make sense to set them right at the
creation of a context rather than afterwards (like instrument names or
number of staff lines).  For those you use context modifications spelled
with \with which may contain assignments or \override inside.

If you just had followed the code examples given for setting properties
in the manual, all would have worked fine.

> Lilypond advertise itself being easy, and it is.
> {c'} does create output.
> Even a bit more complex examples are made.
> This because code is generated implicit. But at the same time it hides
> what is behind, creating confusing.

> You have implicit knowledge and explicit knowledge. Using implicit
> knowledge creates confusing.
> As being new to Lilypond I might see inconsistencies, which are, for
> those with many experience not noticeable any more.
> I might learn those inconsistencies but first I have to comprehend them.
>
> For me, when someone come new to work for a company, the first two
> weeks are most valuable. He can see things  nobody else can see, who
> do work their many years. Use those info or it be lost.
>
> Sorry but just assigning a value to a property, when then property is
> known and the value is known, should not be such a hassle.

It isn't.  Nobody except yourself knows why you chose _not_ to stick
with the working code for that but rather walk through arbitrary
permutations of syntactic elements.

> I thought I was close. But you are right, I am not. And I am not
> spending more time to just assign a value to a property.

I have no idea why you did not just stick with the code that worked.
Instead you invented and listed a number of variations that didn't, for
a number of reasons that are not actual inconsistencies.

The only "inconsistency" I am able to see is that context modifications
(like context definitions) omit a context name for their sets/overrides,
and that they use assignment syntax without \set unlike to how context
properties are set inside of actual music.  The first is rather obvious
(how could a context modification apply to anything but the respective
context itself?).  The second is kind of a wart due to a mixture of
historical and technical reasons.

But that's pretty much it.

-- 
David Kastrup

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Kieren MacMillan
Hi Bernard,

I’m sorry you’ve had such difficulty learning Lilypond.

On Apr 4, 2016, at 3:20 PM, Bernard  wrote:
> My ultimate question boils down to how to assign a value to a property. That 
> should not even be a question.

The main problem you’re having, I think, is that there are different ways of 
setting a property, depending on exactly where the setting is being done. With 
flexibility comes complexity, unfortunately — that’s an almost universal 
tradeoff in machine design.

Best regards,
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: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Bernard

On 04-04-16 18:35, David Kastrup wrote:

Bernard  writes:



I think I am getting quite close now. Thanks,

I have no idea what you think you are doing but I have severe doubts
that you are getting close to anything useful.  It looks to me like you
are just randomly putting syntactic entities into a bag and shake.

Have you read through the Learning Manual?  It should tell you how
LilyPond organizes its input.


Thanks David and others, but I give up.
For your info I did read the manual, much more then I wanted to.
My ultimate question boils down to how to assign a value to a property. 
That should not even be a question.


Lilypond advertise itself being easy, and it is.
{c'} does create output.
Even a bit more complex examples are made.
This because code is generated implicit. But at the same time it hides 
what is behind, creating confusing.


You have implicit knowledge and explicit knowledge. Using implicit 
knowledge creates confusing.
As being new to Lilypond I might see inconsistencies, which are, for 
those with many experience not noticeable any more.

I might learn those inconsistencies but first I have to comprehend them.

For me, when someone come new to work for a company, the first two weeks 
are most valuable. He can see things  nobody else can see, who do work 
their many years. Use those info or it be lost.


Sorry but just assigning a value to a property, when then property is 
known and the value is known, should not be such a hassle.


It has similarities to a Goldovsky-error 
http://www.joshuakennon.com/mental-model-goldovsky-errors . Similarities 
but not equal.
You all spend a lot of time to help me. I spend a lot of time believing 
Lilypond is easy to use and to customize.


I thought I was close. But you are right, I am not. And I am not 
spending more time to just assign a value to a property.


But still, thank you all for your efforts.

Greetings,

Bernard





At any rate, \new DrumStaff is optionally followed by a context
modification before the single music expression it typesets in the
DrumStaff context.  In the above case, that music expression is {
\override ... djembe) }, so \djEen has nothing whatsoever to do with the
DrumStaff and is just a spurious expression in the \score.




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


RE: How to generate a Tambourine "shake" (or any "trill" sound)

2016-04-04 Thread Peter Gentry

>Message: 1
>Date: Fri, 1 Apr 2016 15:56:03 +0200
>From: Ziad Gholam 
>To: lilypond-user@gnu.org
>Subject: How to generate a Tambourine "shake" (or any "trill" sound)
>   in MIDI file ?
>Message-ID:
>   

Re: Scheme function to force any noteEvent to a skipEvent

2016-04-04 Thread Joseph Chrestien
Thanks David and Simon for your kind help. I used David's solution and it works 
brilliantly. Very nice. I didn't know of this NullVoice context, I'll take a 
look at it.

Nice day to all of you
Joseph



On Mon, Apr 4, 2016 at 7:57 AM -0700, "Simon Albrecht" 
> wrote:

Hi Joseph,

a more common approach to the situation is using a separate music
variable containing information common to all parts. E.g.

%
aux = {
   \tempo 4 = 100
   s1
   \bar "|."
}

musicOne = { e'1 }
musicTwo = { c'1 }

\score {
   <<
 \new Staff <<
   \new NullVoice \aux
   \new Voice \musicOne
 >>
 \new Staff \new Voice \musicTwo
   >>
   \layout {}
}

\score {
   \new Staff <<
 \new NullVoice \aux
 \new Voice \musicOne
   >>
   \midi {}
}
%%

HTH, Simon

On 04.04.2016 13:43, Joseph Chrestien wrote:
>
> Hi all,
>
> is it possible to change all notes in a voice to skips through a
> function ?
>
> E.g. ` \silence c4 \tempo 4=100 f8\p g8 ` would be compiled as ` s4 \tempo
> 4=100 s8\p s8 `. Note all other events would stay the same.
>
> Below are the context and minimal code.
>
> Thanks!
> Jo Chrestien
>
>
>
>
> -
>
> PS. Context : I am editing a choral score with multiple MIDI
> outputs (4 voice-by-voice MIDI outputs and 1 polyphonic output). My
> goal is
> to tweak the tempo in all MIDI outputs with only one hand entry.
>
> So far I indicated (invisible) tempo changes in only one of the
> voices. This
> works like a charm for the polyphonic output, but when individual
> voices are
> printed to MIDI it logically does not affect their tempo.
>
> So I want to generate a silent clone of that "tempo-adapted" voice and
> include
>
> it in the split MIDI output, as a new voice.
>
> Is there some kind of \silence function I could call to change tempo in
> split MIDI? This function would force all note events of \sopranoMusic to
> become skip events (e.g. c4 --> s4).
>
> --
> PPS. Minimal code:
>
> ```
> \version "2.18.2"
>
> sopranoMusic = \relative c'' {
>   \cadenzaOn
>   % here are the invisible tempo marks that I don't want to copy
> manually in
> other voices
>   \set Score.tempoHideNote = ##t
>   \tempo 4=200
>   c\breve g\breve
>   \tempo 4=60
>   a8 b8 c4
> }
>
> altoMusic = \relative c' {
>   \cadenzaOn
>   e\breve e\breve
>   f8 g8 e2
> }
>
> silence = #(define-music-function (parser location my-music)
>(ly:music?)
>   ;change everything to silence
>   ;...
>my-music)
>
>
> % alto-only MIDI output
> \score {
>   \new Staff <<
> \new Voice = "1" { \silence \sopranoMusic }
>
> % just to get the tempo modifications : no music should be played
> \new Voice = "2" { \altoMusic } %
>   >>
>   \midi{}
> }
>
> ```
>
>
>
> ___
> 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: I'm not smart enough to figure out the math for this.

2016-04-04 Thread Paul Morris
> On Mar 9, 2016, at 6:27 PM, David Kastrup  wrote:
> 
> \version "2.19.28"
> 
> show =
> #(define-music-function (mup item) (markup? symbol-list-or-music?)
>  (propertyTweak 'stencil
>   (lambda (grob)
>(grob-interpret-markup grob mup))
>   item))
> 
> \relative c' \new Staff {
>  \show \markup \compound-meter #'(4 . 3)
>  \time 3/4
>  c4 c c | c c c
> }
> 
> Maybe we should have \show (possibly with a different name) as a nice
> supplement to \omit/\hide.

This seems like a good idea to me.  Previously when this was discussed, I 
argued that the function should take a stencil as well as a markup and maybe a 
procedure too…  but I now see the sense in just providing a simple and 
high-level shortcut that takes a markup.  (And “ \markup \stencil sss “ still 
allows use of stencils.)

Cheers,
-Paul___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Paul Morris
> On Apr 4, 2016, at 6:46 AM, Bernard  wrote:
> 
> I have attached some more real live code using /with and and example I tried 
> to skip the /with section and assign properties directly, which fails.

Here’s how to fix your example (without \with) that was not working:

\score {
  \new DrumStaff {
\override DrumStaff.StaffSymbol.line-count =  #3
\set DrumStaff.instrumentName = #"Djembe 2"
\set DrumStaff.drumStyleTable = #(alist->hash-table djembe)
\djEen
  }
}

As others have mentioned, reading the Learning Manual is a good idea, and 
should answer many of your questions.

http://lilypond.org/doc/v2.18/Documentation/learning/index.html

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread David Kastrup
Bernard  writes:

> On 04-04-16 16:51, Simon Albrecht wrote:
>> On 04.04.2016 12:46, Bernard wrote:
>>> I have attached some more real live code using /with and and
>>> example I tried to skip the /with section and assign properties
>>> directly, which fails.
>>
>> instrumentName, drumStyleTable  are context properties. Inside
>> music, these are set with the \set command, e.g.
>> \set DrumStaff.instrumentName = "foo"
>> Note that a string doesn’t need the # before.
>>
>> HTH, Simon
>>
> Hi Simon,
>
> Thanks, I could do set the properties.
> But when the voice is called I get a Error : unexpected MUSIC_IDENTIFIER
>
> when using "\with" I did not get this error.
>
> \score {
> \new DrumStaff {
> \override DrumStaff.StaffSymbol.line-count = #3
> \set DrumStaff.instrumentName = "Djembe 2"
> \set DrumStaff.drumStyleTable = #(alist->hash-table djembe)
> }
> \djEen
> }
>
> I think I am getting quite close now. Thanks,

I have no idea what you think you are doing but I have severe doubts
that you are getting close to anything useful.  It looks to me like you
are just randomly putting syntactic entities into a bag and shake.

Have you read through the Learning Manual?  It should tell you how
LilyPond organizes its input.

At any rate, \new DrumStaff is optionally followed by a context
modification before the single music expression it typesets in the
DrumStaff context.  In the above case, that music expression is {
\override ... djembe) }, so \djEen has nothing whatsoever to do with the
DrumStaff and is just a spurious expression in the \score.

-- 
David Kastrup

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Kieren MacMillan
Hi Bernard,

> \score {
> \new DrumStaff {
> \override DrumStaff.StaffSymbol.line-count = #3
> \set DrumStaff.instrumentName = "Djembe 2"
> \set DrumStaff.drumStyleTable = #(alist->hash-table djembe)
> }
> \djEen
> }

If, like me, you prefer separating musical content from presentation as much as 
possible, maybe modify the context instead:

\layout {
  \context {
\DrumStaff
\override StaffSymbol.line-count = #3
instrumentName = "Djembe 2"
drumStyleTable = #(alist->hash-table djembe)
  }
}

\score {
  \new DrumStaff \djEen
}

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: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Simon Albrecht

On 04.04.2016 17:36, Bernard wrote:

On 04-04-16 16:51, Simon Albrecht wrote:

On 04.04.2016 12:46, Bernard wrote:
I have attached some more real live code using /with and and example 
I tried to skip the /with section and assign properties directly, 
which fails.


instrumentName, drumStyleTable  are context properties. Inside 
music, these are set with the \set command, e.g.

\set DrumStaff.instrumentName = "foo"
Note that a string doesn’t need the # before.

HTH, Simon


Hi Simon,

Thanks, I could do set the properties.
But when the voice is called I get a Error : unexpected MUSIC_IDENTIFIER

when using "\with" I did not get this error.

\score {
\new DrumStaff {
\override DrumStaff.StaffSymbol.line-count = #3
\set DrumStaff.instrumentName = "Djembe 2"
\set DrumStaff.drumStyleTable = #(alist->hash-table djembe)
}
\djEen
}


Are you familiar with the whole of the Learning Manual? If not, you 
should read it thoroughly.
\score {} can only contain /one/ music expression. Your example has two 
music expressions, the second without any link to the first. You need to 
either bind them together as sequential {} or simultaneous <<>> music – 
in this case it doesn’t really matter which.


HTH, Simon

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


how to send raw MIDI?

2016-04-04 Thread Johannes Waldmann
Hi.

Is there a way to send raw MIDI messages
(that is, sequences of bytes) from a description
inside a lilypond text? (possibly embedded LISP)

my application: to an external synthesizer device
that accepts a lot of control messages.

Base case: I want to send "program changes" where the argument
is an actual number, and not a general MIDI instrument name.
Then, there are a lot more messages like
(hex) [ B , 4A ,  ] for "filter cutoff"

yes I understand it's probably not the right thing to do
(e.g., how should these messages appear in the printed score?)
but I think it'd be convenient.

Thanks - J.

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Bernard

On 04-04-16 16:51, Simon Albrecht wrote:

On 04.04.2016 12:46, Bernard wrote:
I have attached some more real live code using /with and and example 
I tried to skip the /with section and assign properties directly, 
which fails.


instrumentName, drumStyleTable  are context properties. Inside 
music, these are set with the \set command, e.g.

\set DrumStaff.instrumentName = "foo"
Note that a string doesn’t need the # before.

HTH, Simon


Hi Simon,

Thanks, I could do set the properties.
But when the voice is called I get a Error : unexpected MUSIC_IDENTIFIER

when using "\with" I did not get this error.

\score {
\new DrumStaff {
\override DrumStaff.StaffSymbol.line-count = #3
\set DrumStaff.instrumentName = "Djembe 2"
\set DrumStaff.drumStyleTable = #(alist->hash-table djembe)
}
\djEen
}

I think I am getting quite close now. Thanks,

Greetings

Bernard



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


Re: Fwd: Problem with one staff

2016-04-04 Thread Simon Albrecht

On 04.04.2016 15:19, Maria Jesus Marin wrote:

Good afternoon,

I have one problem with one composition. My problem is that I have writted
the composition in Musescore, but when I export to xml and I import the xml
file in to Frescobaldi the staff duplicate lines.
I attach the musescore file, xml file, and pdf file for your information.
Can you help me? Can you tell me why the process is not working well?


Hello Maria,

as Martin already worked, you can’t expect that such a conversion 
process works without manual intervention. In fact, the LilyPond file 
generated seems – sorry to say that – to be a total mess, with all the 
duplicate dynamics, markup instead of DynamicTextSpanners, wrong use of 
voices, etc.
You should definitely not ask on the bug list in such a case; the bug 
list is only for concise bug reports, using minimal examples. Instead, 
try the user list. But even there it’s nice to follow the guide lines 
from .
 
may also help, as well as upgrading LilyPond at least to v2.18.2.

Are you familiar with LilyPond basics?

Best, Simon

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


Re: unfold: volta for typesetting, unfold for MIDI generation?

2016-04-04 Thread Johannes Waldmann
Hi.

turns out my previous question already is answered in the docs:
http://lilypond.org/doc/v2.18/Documentation/notation/repeats-in-midi
and it handles \alternative correctly as well.

- J.

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


Re: Scheme function to force any noteEvent to a skipEvent

2016-04-04 Thread Simon Albrecht

Hi Joseph,

a more common approach to the situation is using a separate music 
variable containing information common to all parts. E.g.


%
aux = {
  \tempo 4 = 100
  s1
  \bar "|."
}

musicOne = { e'1 }
musicTwo = { c'1 }

\score {
  <<
\new Staff <<
  \new NullVoice \aux
  \new Voice \musicOne
>>
\new Staff \new Voice \musicTwo
  >>
  \layout {}
}

\score {
  \new Staff <<
\new NullVoice \aux
\new Voice \musicOne
  >>
  \midi {}
}
%%

HTH, Simon

On 04.04.2016 13:43, Joseph Chrestien wrote:


Hi all,

is it possible to change all notes in a voice to skips through a 
function ?


E.g. ` \silence c4 \tempo 4=100 f8\p g8 ` would be compiled as ` s4 \tempo
4=100 s8\p s8 `. Note all other events would stay the same.

Below are the context and minimal code.

Thanks!
Jo Chrestien




-

PS. Context : I am editing a choral score with multiple MIDI
outputs (4 voice-by-voice MIDI outputs and 1 polyphonic output). My 
goal is

to tweak the tempo in all MIDI outputs with only one hand entry.

So far I indicated (invisible) tempo changes in only one of the 
voices. This
works like a charm for the polyphonic output, but when individual 
voices are

printed to MIDI it logically does not affect their tempo.

So I want to generate a silent clone of that "tempo-adapted" voice and 
include


it in the split MIDI output, as a new voice.

Is there some kind of \silence function I could call to change tempo in
split MIDI? This function would force all note events of \sopranoMusic to
become skip events (e.g. c4 --> s4).

--
PPS. Minimal code:

```
\version "2.18.2"

sopranoMusic = \relative c'' {
  \cadenzaOn
  % here are the invisible tempo marks that I don't want to copy 
manually in

other voices
  \set Score.tempoHideNote = ##t
  \tempo 4=200
  c\breve g\breve
  \tempo 4=60
  a8 b8 c4
}

altoMusic = \relative c' {
  \cadenzaOn
  e\breve e\breve
  f8 g8 e2
}

silence = #(define-music-function (parser location my-music)
   (ly:music?)
  ;change everything to silence
  ;...
   my-music)


% alto-only MIDI output
\score {
  \new Staff <<
\new Voice = "1" { \silence \sopranoMusic }

% just to get the tempo modifications : no music should be played
\new Voice = "2" { \altoMusic } %
  >>
  \midi{}
}

```



___
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: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Simon Albrecht

On 04.04.2016 12:46, Bernard wrote:
I have attached some more real live code using /with and and example I 
tried to skip the /with section and assign properties directly, which 
fails.


instrumentName, drumStyleTable  are context properties. Inside music, 
these are set with the \set command, e.g.

\set DrumStaff.instrumentName = "foo"
Note that a string doesn’t need the # before.

HTH, Simon

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


Re: Fwd: Problem with one staff

2016-04-04 Thread Martin Tarenskeen



On Mon, 4 Apr 2016, Maria Jesus Marin wrote:


Good afternoon,

I have one problem with one composition. My problem is that I have writted
the composition in Musescore, but when I export to xml and I import the xml
file in to Frescobaldi the staff duplicate lines.
I attach the musescore file, xml file, and pdf file for your information.
Can you help me? Can you tell me why the process is not working well?
Best regards,


MusicXML export from MuseScore isn't perfect, MusicXML import from 
Frescobaldi (musicxml2ly) isn't perfect either. Double imperfection.


--

MT



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


Re: Scheme function to force any noteEvent to a skipEvent

2016-04-04 Thread David Kastrup
Joseph Chrestien <_...@live.com> writes:

> Hi all,
>
> is it possible to change all notes in a voice to skips through a function ?
>
> E.g. ` \silence c4 \tempo 4=100 f8\p g8 ` would be compiled as ` s4 \tempo
> 4=100 s8\p s8 `. Note all other events would stay the same.

\version "2.19.32"

silence =
#(define-music-function (arg) (ly:music?)
   (map-some-music
 (lambda (m)
(and (music-is-of-type? m 'note-event)
 (make-music 'SkipEvent m)))
 arg))

\displayLilyMusic
\silence { c4 \tempo 4=100 f8\p g8 }

For version 2.18 you'll likely have to write (parser location arg)
instead of just (arg) but I think the rest would work fine.

-- 
David Kastrup

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


Scheme function to force any noteEvent to a skipEvent

2016-04-04 Thread Joseph Chrestien
Hi all,

is it possible to change all notes in a voice to skips through a function ?

E.g. ` \silence c4 \tempo 4=100 f8\p g8 ` would be compiled as ` s4 \tempo
4=100 s8\p s8 `. Note all other events would stay the same.

Below are the context and minimal code.

Thanks!
Jo Chrestien



-

PS. Context : I am editing a choral score with multiple MIDI
outputs (4 voice-by-voice MIDI outputs and 1 polyphonic output). My goal is
to tweak the tempo in all MIDI outputs with only one hand entry.

So far I indicated (invisible) tempo changes in only one of the voices. This
works like a charm for the polyphonic output, but when individual voices are
printed to MIDI it logically does not affect their tempo.

So I want to generate a silent clone of that "tempo-adapted" voice and include

it in the split MIDI output, as a new voice.

Is there some kind of \silence function I could call to change tempo in
split MIDI? This function would force all note events of \sopranoMusic to
become skip events (e.g. c4 --> s4).

--
PPS. Minimal code:

```
\version "2.18.2"

sopranoMusic = \relative c'' {
  \cadenzaOn
  % here are the invisible tempo marks that I don't want to copy manually in
other voices
  \set Score.tempoHideNote = ##t
  \tempo 4=200
  c\breve g\breve
  \tempo 4=60
  a8 b8 c4
}

altoMusic = \relative c' {
  \cadenzaOn
  e\breve e\breve
  f8 g8 e2
}

silence = #(define-music-function (parser location my-music)
   (ly:music?)
  ;change everything to silence
  ;...
   my-music)


% alto-only MIDI output
\score {
  \new Staff <<
\new Voice = "1" { \silence \sopranoMusic }

% just to get the tempo modifications : no music should be played
\new Voice = "2" { \altoMusic } %
  >>
  \midi{}
}

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


Re: midi2ly dll error

2016-04-04 Thread Anders Eriksson


On 2016-04-04 11:03, Gianmaria Lari wrote:

Ciao Federico,

regarding [configure Frescobaldi to reference a specific phyton 
compiler] you wrote:



You must add it to the path in system preferences, as explained here:
http://lilypond.org/windows.html


Yes, I can change the system path but this is something I wanted to 
avoid. I have other software that refer to "c:\Python27" and changing 
the system path will make them stop to working. I thought it was 
possible to specify the python compiler to use only for Frescobaldi.




Do you have PYTHONPATH environment variable defined?
If you do, remove it (you may want to save the value).

Do Lilypond work?
Do the other python27 programs work?

It works for me!

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Bernard

On 03-04-16 22:56, David Kastrup wrote:

Bernard  writes:



Hi Paul,

That does help. I found out \with is a very special statement.

Not really.  \with can be part of other constructs, just like "else" can
be part of other constructs in many programming languages (including
Scheme).  It is not a "statement" at all.
That does help a lot. Now I understand why there can not be anything 
before /with.



It influence what happens before the statement, it must be executed
just after \new . That is the reason why my examples 4 and 5 did not
work.
And it influence what happens after the statement. If within the Staff
not a additional Staff property can be set.

No wonder it confuses me.

\with introduces "context modifications".  They are basic expressions in
that they can be stored in variables and passed to functions, but to
take effect, they need to be applied to an actually created context, and
there are various syntactic constructs for doing that.

They "influence what happens after the statement" like any modification
to anything.  Their influence is restricted to contexts they are applied
to (possibly via layout or context definitions or wrapped into other
context modifications).



I still do not get it all. By the way, I am my self a Python programmer 
and object orientation in known to me.


The example of Thomas Morly with his house with rooms is all in line 
with object orientation and setting values of properties.


But still I am missing something.

I have attached some more real live code using /with and and example I 
tried to skip the /with section and assign properties directly, which fails.


Thanks very much for all your good work.

With regards,

Bernard


\version "2.18.2"

#(define djembe '(
 (dbassdefault   #f   -2)
 (dbassmutedefault   "stopped"-2)
 (dbassopendefault   "open"   -2)
 (dopendefault   #f   0)
 (dopenmutedefault   "stopped"0)  
 (dopenopendefault   "open"   0)  
 (dslapdefault   #f   2)
 (dslapmutedefault   "stopped"2)
 (dslapopendefault   "open"   2)
 (sidestick	   cross #f   -4)))

% no abbrevation for the open variant, it is hardly used
drumPitchNames.dbass  = #'dbass 
drumPitchNames.dba= #'dbass  % db seems to be in use
drumPitchNames.dbassmute  = #'dbassmute
drumPitchNames.dbm= #'dbassmute  
drumPitchNames.dbassopen  = #'dbassopen
drumPitchNames.dopen  = #'dopen   
drumPitchNames.do = #'dopen  
drumPitchNames.dopenmute  = #'dopenmute 
drumPitchNames.dom= #'dopenmute  
drumPitchNames.dopenopen  = #'dopenopen  
drumPitchNames.dslap  = #'dslap   
drumPitchNames.ds = #'dslap 
drumPitchNames.dslapmute  = #'dslapmute
drumPitchNames.dsm= #'dslapmute
drumPitchNames.dslapopen  = #'dslapopen 

% assign to full name, assign to abbrevation does not work.
midiDrumPitches.dbass = g
midiDrumPitches.dopen =  a
midiDrumPitches.dslap =  b
midiDrumPitches.dbassmute = fis
midiDrumPitches.dopenmute = gis
midiDrumPitches.dslapmute = ais  

djEen =  \drummode { dba4 do }

% with with section of context
% Line count and instrumentname correct processed
\markup { with section }
\score {  
   \new DrumStaff
\with {
  \override StaffSymbol.line-count =  #3
  instrumentName = #"Djembe 1" 
  drumStyleTable = #(alist->hash-table djembe) 
} 
\djEen  
}

\markup { without the use of the with section }
% generate error
\score {  
   \new DrumStaff  {  
  \override DrumStaff.StaffSymbol.line-count =  #3
  DrumStaff.instrumentName = #"Djembe 2" 
  DrumStaff.drumStyleTable = #(alist->hash-table djembe) 
   } 
   \djEen 
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: midi2ly dll error

2016-04-04 Thread Gianmaria Lari
Ciao Federico,

regarding [configure Frescobaldi to reference a specific phyton compiler]
you wrote:


You must add it to the path in system preferences, as explained here:
> http://lilypond.org/windows.html


Yes, I can change the system path but this is something I wanted to avoid.
I have other software that refer to "c:\Python27" and changing the system
path will make them stop to working. I thought it was possible to specify
the python compiler to use only for Frescobaldi.

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


Re: midi2ly dll error

2016-04-04 Thread Federico Bruni
Il giorno lun 4 apr 2016 alle 8:19, Gianmaria Lari 
 ha scritto:
> You set it on the Frecobaldi Preferences page 
(Edit/Preferences/Helper

> Applications).

In the Frescobaldi Preferences page (Edit/Preferences/Helper 
Applications) I can set the path for the following applications: Pdf, 
Midi, SVG, Image, Browser, email, FileManager, Shell, Git. I don't 
see anything related to phyton compiler.


You must add it to the path in system preferences, as explained here:
http://lilypond.org/windows.html




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


Re: 4 slashes in percent repeat

2016-04-04 Thread Marc Hohl

Hi Daniel,

Am 04.04.2016 um 07:07 schrieb Daniel E. Moctezuma:

Thanks for your reply.

The samples from http://lsr.di.unimi.it/LSR/Item?id=954 look nice for solo 
pieces, but my use case is for multiple instruments.
Imagine a rock band where the bass has 4 bars that will be repeated, but the 
rest of the instruments don't have repetitive bars. I've have seen this usage 
in rock songs for instance.


I see.


I understand the issue of having 2 empty bars and it seems like having a number 
above the percent repeat helps.
Example: https://musescore.org/sites/musescore.org/files/finale%20four-bar.jpg


I like the last one! With help of the thicker lines trough the otherwise 
empty bars, it is visually clear which bars belong together.


I am sure that this is doable in lilypond, but this scheme wizardry is 
way over my head ...


Marc


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


Re: midi2ly dll error

2016-04-04 Thread Gianmaria Lari
Ciao Carl,

[configure Frescobaldi to reference a specific phyton compiler]

> You set it on the Frecobaldi Preferences page (Edit/Preferences/Helper
> Applications).

In the Frescobaldi Preferences page (Edit/Preferences/Helper Applications)
I can set the path for the following applications: Pdf, Midi, SVG, Image,
Browser, email, FileManager, Shell, Git. I don't see anything related to
phyton compiler.

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