Re: How can I create from my custom drum note to a pitch? (for fransposing)

2016-04-01 Thread David Kastrup
Thomas Morley  writes:

> P.S.
> The most difficult part for me was how to tell LilyPond to use the new 
> pitches.
> There's a hint in performer-init.ly, but:
>
> git grep "midiDrumPitches"
> ly/drumpitch-init.ly:midiDrumPitches =
> ly/performer-init.ly:  drumPitchTable = #(alist->hash-table midiDrumPitches)
>
> is not what I'd called "well documented"

There is user documentation and programmer documentation.  We are
missing either here.  At the moment, these variables have to be
considered internal constants though exported to user space: were they
considered user-accessible parameters, they would need to be defined
using define-session-public.

So there are several things to be done to make them properly
user-accessible.

-- 
David Kastrup

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


Re: How can I create from my custom drum note to a pitch? (for fransposing)

2016-04-01 Thread Bernard

On 01-04-16 00:31, Thomas Morley wrote:


2016-03-31 22:41 GMT+02:00 Bernard :



Well, let's see whether I understood correctly.

A)
You want to create your own drum-style, with custom-drum-note-names
and a certain appearence when printed.

For the names you did:
   drumPitchNames.dbass  = #'dbass
   etc
Ok, this is fine

Correct.


For the appearence you did
   #(define djembe '(
   (dbassdefault   #f   -2)
   ;; etc
   )
Ok, fine as well

Correct.


Later on you LilyPond to use the above with
   drumStyleTable = #(alist->hash-table djembe)
Also fine, here we're done.

Correct,


B)
Then you want the new stuff to be used in midi.
In general, follow the same route.

Assign pitches to the names:
  midiDrumPitches.dba = ##{ g #}
  etc

Tell Lilypond to use them:
  drumPitchTable = #(alist->hash-table midiDrumPitches
Woh! Thomas, if this would work, it would be really perfect. Simple and 
accurate.

Lilypond is really powerful. Such an important change could make so easy.



In general you're done now. Below a full example.
Because I don't know all your settings I used random ones. For the
drum-pitches I tried to follow yours, but I'm not always sure about
the octave you may need to change it.

\version "2.19.36"

drumPitchNames.dbass = #'dbass
drumPitchNames.dba = #'dbass
drumPitchNames.do  = #'do
drumPitchNames.ds  = #'ds
drumPitchNames.dbm  = #'dbm
drumPitchNames.dom  = #'dom
drumPitchNames.dsm = #'dsm

#(define djembe
   '(
 (dsm   default  #f  -6)
 (dom   default  #f  -5)
 (dbm   default  #f  -4)
 (dsdefault  #f  -3)
 (dodefault  #f  -2)
 (dba   default  #f  -1)
 (dbass default  #f  -1)
))

midiDrumPitches.dba = g
midiDrumPitches.do =  a
midiDrumPitches.ds =  b
midiDrumPitches.dbm = fis
midiDrumPitches.dom = gis
midiDrumPitches.dsm = ais

one = \drummode { r4 dba4 do ds dbm dom dsm }

\score {
   \new DrumStaff
 \with {
   drumStyleTable = #(alist->hash-table djembe)
   drumPitchTable = #(alist->hash-table midiDrumPitches)
 }
 \one
   \layout {}
   \midi {}
}


Looks good. There is only one voice and used in both layout and midi. In 
the midi file I can hear the result except the first note.
I use LMMS to view and edit the imported midi file. I can not see the 
second note, after the rest, at all. Also not an octave higher or lower.

In my test all note's where visible, and could be heard, in the midi file.

You used random settings, so I adjusted it to my custom, good looking 
layout setting. To my surprise this resulted in an empty midi file.
So I made an error somehow, but I could not find out where. I disabled 
the staff instrumentName but this made no difference.



\version "2.18.2"

%{
drumPitchNames.dbass = #'dbass
drumPitchNames.dba = #'dbass
drumPitchNames.do  = #'do
drumPitchNames.ds  = #'ds
drumPitchNames.dbm  = #'dbm
drumPitchNames.dom  = #'dom
drumPitchNames.dsm = #'dsm
%}

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


#(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)))


midiDrumPitches.dba = g
midiDrumPitches.do =  a
midiDrumPitches.ds =  b
midiDrumPitches.dbm = fis
midiDrumPitches.dom = gis
midiDrumPitches.dsm = ais

one = \drummode { r4 dba4 do ds dbm dom dsm }

\score {
   \new DrumStaff
\with {
  \override StaffSymbol.line-count =  #3
  instrumentName = #"Djembe 1"
  drumStyleTable = #(alist->hash-table djembe)
  drumPitchTable = #(alist->hash-table midiDrumPitches)
}
\one
  \layout {}
  \midi {}
}

Where did I go wrong?

Thanks a lot of all your effort. I do appreciate also you try to improve 
documentation so people can solve there problems as much as possible.


With regards,

Bernard






HTH,
   Harm

P.S.
The most difficult part for me was how to tell LilyPond to use the new pitches.
There's a hint in performer-init.ly, but:

git grep "midiD

Re: How can I create from my custom drum note to a pitch? (for fransposing)

2016-04-01 Thread Thomas Morley
2016-04-01 9:33 GMT+02:00 Bernard :
> On 01-04-16 00:31, Thomas Morley wrote:
[...]
> Looks good. There is only one voice and used in both layout and midi. In the
> midi file I can hear the result except the first note.
> I use LMMS to view and edit the imported midi file. I can not see the second
> note, after the rest, at all. Also not an octave higher or lower.
> In my test all note's where visible, and could be heard, in the midi file.

I don't have LMMS, so I use built-in scripts for testing.
The command-line sequence is:

lilypond file-name.ly
midi2ly file-name.midi
gedit file-name-midi.ly

>
> You used random settings, so I adjusted it to my custom, good looking layout
> setting. To my surprise this resulted in an empty midi file.
> So I made an error somehow, but I could not find out where. I disabled the
> staff instrumentName but this made no difference.

> drumPitchNames.dbass  = #'dbass
> drumPitchNames.dba= #'dbass  % db seems to be in use
[...]

It turns out that you need to use the full long name to insert new
settings into midiDrumPitches.
Not:
> midiDrumPitches.dba = g
but
midiDrumPitches.dbass = g

[...]

Complete file attached.


HTH,
  Harm
\version "2.18.2"

%% for testing
%% terminal command-sequence:
%%
%%  lilypond new-drum-pitches-02.ly 
%%  midi2ly new-drum-pitches-02.midi
%%  gedit new-drum-pitches-02-midi.ly


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

#(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)
 ))


midiDrumPitches.dbass = g
midiDrumPitches.dopen =  a
midiDrumPitches.dslap =  b
midiDrumPitches.dbassmute = fis
midiDrumPitches.dopenmute = gis
midiDrumPitches.dslapmute = ais

one = \drummode { r4 dba4 do ds r dbm dom dsm } 

\score {
   \new DrumStaff
\with {
  \override StaffSymbol.line-count =  #3
  instrumentName = #"Djembe 1"
  drumStyleTable = #(alist->hash-table djembe)
  drumPitchTable = #(alist->hash-table midiDrumPitches)
}
\one
  \layout {}
  \midi {}
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: How can I create from my custom drum note to a pitch? (for fransposing)

2016-04-01 Thread Bernard

On 01-04-16 12:47, Thomas Morley wrote:

I don't have LMMS, so I use built-in scripts for testing.
The command-line sequence is:

lilypond file-name.ly
midi2ly file-name.midi
gedit file-name-midi.ly

Powerful statements. Thanks.
It turns out that you need to use the full long name to insert new 
settings into midiDrumPitches. Not:

midiDrumPitches.dba = g

but
midiDrumPitches.dbass = g

[...]

Complete file attached.


HTH,
   Harm

Does work perfect. Thank you very, very much. I am most grateful.

I you would like to create documentation for Lilypond how to create 
notation for a complete new instrument, like this Djembe example, and 
you would need my help

I am more then pleased to help. But I assume you have all info you need.

Thanks again. Lilypond is really a powerful tool. And this newsgroup, 
and especially you are a great help.


With regards,

Bernard

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


time beatStructure isn't printed

2016-04-01 Thread matpen3@gmail
Hi all,

I'm working on a very large score and, after compiling is over, the time 
beatStructure as manually defined isn't printed (e. g. \time #'(2 3) 5/8).
On a very short fragment everything is fine.

Could the size of the score affect the printing?

I'm new to Lilypond, so maybe I'm omitting something obvious…

Thanks for any help or hint.

Matteo

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


How to generate a Tambourine "shake" (or any "trill" sound) in MIDI file ?

2016-04-01 Thread Ziad Gholam
Hello to all


I am using version 2.18.2
I managed to write tambourine percussion music ...

Although I did code tambourine "shake" as trill  ( tamb2^\startTrillSpan
 tamb4\stopTrillSpan )
I do not know how to generate that tambourine "shake" in the MIDI file
(generated at the end of the layout section ...) ?


On a wider scale, how could I generate the sound (in the MIDI file)  of a
trill on ANY instrument or voice ?


__

​Regards
,
Ziad GHOLAM
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: time beatStructure isn't printed

2016-04-01 Thread Thomas Morley
2016-04-01 15:37 GMT+02:00 matpen3@gmail :
> Hi all,
>
> I'm working on a very large score and, after compiling is over, the time
> beatStructure as manually defined isn't printed (e. g. \time #'(2 3) 5/8).
> On a very short fragment everything is fine.
>
> Could the size of the score affect the printing?

_Very_ unlikely.

>
> I'm new to Lilypond, so maybe I'm omitting something obvious…
>
> Thanks for any help or hint.


Without code, nobody can tell.
Try to follow the methods described here:
http://lilypond.org/doc/v2.19/Documentation/usage-big-page.en.html#troubleshooting
to decrease the size of your score.
Maybe you can spot the problem yourself then.
If not try to delete all but the stuff causing the problem.
Maybe you can spot the problem yourself then.
If not post it here.
I would be surprised, if more then ten lines of code remain.

Cheers,
  Harm

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


booleans and conditional compilation?

2016-04-01 Thread Johannes Waldmann
Hi.

Is there a standard way of conditional compilation,
e.g., to turn parts (on any level) of a score on and off?

>From a programmer's standpoint,
I'd want booleans, and branching, something like

let foo = true % or false, somewhere at the top of the file,
   % or even on the command line

% and then (just to show the idea)

...
<<  % (possibly deeply nested)
  { c d
  if foo then   e f  else  c d  endif
  g }
  { e f
  if foo then g a else ... endif
  }
>>

I know I can define variables,
and then (un)comment the use of the variables,
but that does not solve my problem
because then I had to (un)comment all uses of one variable.

I also know I can just use CPP (external preprocessor).
However that seems like a work-around because lilypond
has LISP inside and that sure has booleans and conditionals.

Oh, and I looked up "conditional" in the docs
(D. LilyPond command index) (no results).


... Then I looked it up in the mailing list archive, and found
https://lists.gnu.org/archive/html/lilypond-user/2012-02/msg00786.html

this seems to indicate that I can only switch named parts:
$(if foo thing)  seems to require  \thing?
Then how can I avoid this definition?


- J.

Thanks for answers on the "unfold" question.

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


Re: booleans and conditional compilation?

2016-04-01 Thread Urs Liska


Am 1. April 2016 21:23:17 MESZ, schrieb Johannes Waldmann 
:
>Hi.
>
>Is there a standard way of conditional compilation,
>e.g., to turn parts (on any level) of a score on and off?
>

Yes, look up \tag.

HTH
Urs

>From a programmer's standpoint,
>I'd want booleans, and branching, something like
>
>let foo = true % or false, somewhere at the top of the file,
>   % or even on the command line
>
>% and then (just to show the idea)
>
>...
><<  % (possibly deeply nested)
>  { c d
>  if foo then   e f  else  c d  endif
>  g }
>  { e f
>  if foo then g a else ... endif
>  }
>>>
>
>I know I can define variables,
>and then (un)comment the use of the variables,
>but that does not solve my problem
>because then I had to (un)comment all uses of one variable.
>
>I also know I can just use CPP (external preprocessor).
>However that seems like a work-around because lilypond
>has LISP inside and that sure has booleans and conditionals.
>
>Oh, and I looked up "conditional" in the docs
>(D. LilyPond command index) (no results).
>
>
>... Then I looked it up in the mailing list archive, and found
>https://lists.gnu.org/archive/html/lilypond-user/2012-02/msg00786.html
>
>this seems to indicate that I can only switch named parts:
>$(if foo thing)  seems to require  \thing?
>Then how can I avoid this definition?
>
>
>- J.
>
>Thanks for answers on the "unfold" question.
>
>___
>lilypond-user mailing list
>lilypond-user@gnu.org
>https://lists.gnu.org/mailman/listinfo/lilypond-user

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

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


Re: Variable slur thickness

2016-04-01 Thread Thomas Morley
2016-03-11 21:51 GMT+01:00 Thomas Morley :
> 2016-03-11 14:31 GMT+01:00 Sharon Rosner :
>>> I've managed to bypass using before-line-breaking AND after-line-breaking
>>> by assigning the function to the 'thickness property and having each grob
>>> internally calculate its own control points rather than relying on it
>>> being
>>> calculated elsewhere (also attached):
>>
>> Works great! I improved it further by making it compatible with ties too:
>>
>>
>> #(define (variable-slur-thickness min-l max-l min-t max-t) (lambda (grob)
>>   (let* ((cpf (if (grob::has-interface grob 'tie-interface)
>>   ly:tie::calc-control-points
>>   ly:slur::calc-control-points))
>>  (cpt (cpf grob))
>>  (cp0 (car cpt)) (cp3 (cadddr cpt))
>>  (dx (- (car cp3) (car cp0)))
>>  (dy (- (cdr cp3) (cdr cp0)))
>>  (len (magnitude (make-rectangular dx dy)))
>>  (thickness
>>(cond ((< len min-l) min-t)
>>  ((> len max-l) max-t)
>>  (else (+ min-t (* (- len min-l)
>>  (/ (- max-t min-t) (- max-l min-l
>>
>>  thickness)))
>>
>>
>>> The only thing I'm (slightly) concerned with is
>>> the duplicate control-point calculation in this function and how it might
>>> affect compilation times if this were applied to a large orchestral score,
>>> for example.
>>
>> A preliminary check with a 17-page score shows a pretty negligible effect on
>> compilation time, 0.6s (the total time is about 21s), or about 2.7%
>> additional compilation time. A small price to pay for more beauty!
>>
>> Sharon
>
>
>
> How about below,
> Should work for all bows, hence the name is changed
>
> #(define (variable-bow-thickness min-l max-l min-t max-t)
>   (lambda (grob)
> ;; Get the procedure to calculate the control-points
> ;; If none use `fall-back' to return a default-value for 'thickness
> (let ((cpf (assoc-get 'control-points (ly:grob-basic-properties grob)))
>   (fall-back 1.2))
>   (if (procedure? cpf)
>   (let* ((cpt (cpf grob))
>  (cp0 (car cpt))
>  (cp3 (cadddr cpt))
>  (dx (- (car cp3) (car cp0)))
>  (dy (- (cdr cp3) (cdr cp0)))
>  (len (magnitude (make-rectangular dx dy)))
>  (thickness
>(cond ((< len min-l) min-t)
>  ((> len max-l) max-t)
>  (else (+ min-t (* (- len min-l)
>(/ (- max-t min-t) (- max-l min-l
> thickness)
>   fall-back
>
>
> Cheers,
>  Harm

I made some further editions.
Works now for Slurs, Ties, PhrasingSlurs and theoretical for RepeatTie
and LaissezVibrerTie.
Approved as
Variable bow thickness depending on length
http://lsr.di.unimi.it/LSR/Item?u=1&id=1028

Cheers,
  Harm

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


Placement of dots

2016-04-01 Thread Joseph N. Srednicki
Please see the following example. 

Note: There have been some recent issues of the mail programs lopping thing
off such a final brace when pasting examples. I re-pasted the following
example and recompiled it before sending this message. So, I am hoping that
it comes through without anything missing.

In the middle voice in the second measure of the example below, the two g
notes in the middle voice move the dots to the right of the g. 

Instead, I would like to move the dots next to the notes to which they apply
instead of the position following the intervening g notes.

I looked at Snippet http://lsr.di.unimi.it/LSR/Item?id=674.

According to this snippet, the command \override
Staff.NoteCollision.prefer-dotted-right = ##t is supposed to move the dots
to the position to the immediate right of the notes to which they apply; no
notes are supposed to intervene between a note and the dot to which it
applies. 

Therefore, in my example, the notes should appear to the left of the g notes
in the second measure.

However, I tried placing the \override
Staff.NoteCollision.prefer-dotted-right = ##t in a variety of locations, but
to no avail.

For example, I tried using a \context {\Staff ... statement in a layout
block. I also tried putting the statement in the global variable. In yet
another try, I placed the \override before a particular dotted 

Can someone please tell me how what I am misunderstanding or doing
correctly?

Ideally, I would like to make this change globally for the entire score.

Thanks in advance to anyone who can help with a suggestion or correction.

Joe Srednicki
 
=

\version "2.19.35"
\language "english"

\layout {
  \context {
\Voice
\consists "Melody_engraver"
\override Stem #'neutral-direction = #'()
  }
}

global = {
  \key c \major
  \numericTimeSignature
  \time 3/4
}

rightOne = \relative c'' {
  \global
  \new Voice = "soprano" \voiceOne
  \partial 4 g ( | % pickup
  c4.) b8 [c8. d16] | % 1
}

rightTwo = \relative c' {
  \global
 8._\ff 16 | % pickup
  \stemUp \override NoteColumn.force-hshift = 0.9 g2 g4 \revert
NoteColumn.force-hshift | % 1
}

leftOne = \relative c' {
  \global
   \skip 4 | % pickup
  \change Staff = "right" \stemDown e4. d8 [e8. f16] | % 1
}

leftTwo = \relative c' {
  \global
  % Music follows here.
}

pedal = \relative c {
  \global
 \partial 4 
  c4 | % pickup
  c4 c c | % 1
 }

\score {
  <<
\new PianoStaff \with {
  instrumentName = "Org."
  shortInstrumentName = "Org."
} <<
  \new Staff = "right" << \rightOne \\ \rightTwo >>
  \new Staff = "left" { \clef bass << \leftOne \\ \leftTwo >> }
>>
\new Staff = "pedal" { \clef bass \pedal }
  >>
  \layout { }
}


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


Re: How to join notes in markup?

2016-04-01 Thread Thomas Morley
2016-03-11 22:58 GMT+01:00 Thomas Morley :
> 2016-03-11 11:21 GMT+01:00 tisimst :
>
>> (though further suggestions for improvement
>> are welcome).
>>
>> Thanks,
>> Abraham
>
> Hi Abraham,
>
> just had a more thoroughly look at your snippet at
> http://lsr.di.unimi.it/LSR/Item?id=1029
>
> The biggest issue I see is how to change fontsize. I post my own
> commented suggestion below.
> Best would be that score-markup would respect \fontsize, not sure how
> to do that (if possible at all), though.
>
> #(define-markup-command (ezscore layout props mus) (ly:music?)
> ;; introduce a property to make overriding it possible
>   #:properties ((size 0))
>   (interpret-markup layout props
> #{
>   \markup {
> \score {
> ;; work on a copy of music! Hence $ not #
>   \new RhythmicStaff { $mus }
>   \layout {
> \context {
>   \RhythmicStaff
>   \remove Clef_engraver
>   \remove Time_signature_engraver
> ;; Don't remove Staff_symbol_engraver, omit StaffSymbol.
> ;; (probably set line-count zero, alternatively)
> ;; In order to keep changes for fontSize/staff-space/thickness possible,
> ;; Stem/Beam etc rely on it for thickness, length etc
>
>   \omit StaffSymbol
>   fontSize = #size
>   \override StaffSymbol.staff-space = #(magstep size)
>   \override StaffSymbol.thickness = #(magstep size)
> }
> indent = 0
>   }
> }
>   }
> #}))
>
> %%
>
> \markup {
>   Let's try something simple:
>   \note #"8" #UP + \note #"8" #UP =
>   % BEFORE USING EZNOTES...
>   \combine
> \combine
> %% slightly simplified, here and below
>   \note #"4" #UP
>   \translate #'(1.25 . 2.8) \beam #3 #0 #.5
> \concat {
>   \hspace #3
>   \note #"4" #UP
> }
>   . Yikes! Not so easy by hand.
> }
>
> \markup {
>   Much easier:
>   \note #"8" #UP + \note #"8" #UP =
>   % AFTER USING EZNOTES...
>   \ezscore ##{ { c8[ c] } #}.
>   % LET'S DO SOMETHING HARDER NOW...
>   Now try constructing
> %% size-override applied
>   \override #'(size . -6)
>   \ezscore ##{
> {
> %% spacing-incrementadjusted, according to the size-override.
> \override Score.SpacingSpanner.spacing-increment = #1
> \override TupletNumber.text =
>   #(tuplet-number::append-note-wrapper
>  (tuplet-number::non-default-tuplet-fraction-text 12 7) "8")
> \tuplet 12/7 { c4. c c c }
> }
>   #}
>   manually!
> }
>
> HTH, best
>   Harm


Approved with the tiny amendments as
http://lsr.di.unimi.it/LSR/Item?id=1029

Cheers,
  Harm

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


Re: booleans and conditional compilation?

2016-04-01 Thread Simon Albrecht

On 01.04.2016 21:23, Johannes Waldmann wrote:

Hi.

Is there a standard way of conditional compilation,
e.g., to turn parts (on any level) of a score on and off?


The standard way is using tags, as Urs said.
But of course you can do everything you like via scheme:

\version "2.19.38"
foo = ##f
A = { c' }
B = { d' }
{
  #(if foo A B)
}

or, without music variables,

\version "2.19.38"
foo = ##f
{
  #(if foo
   #{ { c' } #}
   #{ { d' } #})
}




However that seems like a work-around because lilypond
has LISP inside and that sure has booleans and conditionals.

Oh, and I looked up "conditional" in the docs
(D. LilyPond command index) (no results).


There are no conditionals in LilyPond syntax, but you can use Guile 
Scheme. The use of it in LilyPond is explained in the Extending Manual 
.


HTH, Simon

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


Re: booleans and conditional compilation?

2016-04-01 Thread Simon Albrecht

On 01.04.2016 22:43, Simon Albrecht wrote:

you can use Guile Scheme.


LilyPond uses Guile 1.8, whose Reference Manual is here: 
.


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


Re: Placement of dots

2016-04-01 Thread Thomas Morley
2016-04-01 22:22 GMT+02:00 Joseph N. Srednicki :
> Please see the following example.
>
> Note: There have been some recent issues of the mail programs lopping thing
> off such a final brace when pasting examples. I re-pasted the following
> example and recompiled it before sending this message. So, I am hoping that
> it comes through without anything missing.
>
> In the middle voice in the second measure of the example below, the two g
> notes in the middle voice move the dots to the right of the g.
>
> Instead, I would like to move the dots next to the notes to which they apply
> instead of the position following the intervening g notes.
>
> I looked at Snippet http://lsr.di.unimi.it/LSR/Item?id=674.
>
> According to this snippet, the command \override
> Staff.NoteCollision.prefer-dotted-right = ##t is supposed to move the dots
> to the position to the immediate right of the notes to which they apply; no
> notes are supposed to intervene between a note and the dot to which it
> applies.
>
> Therefore, in my example, the notes should appear to the left of the g notes
> in the second measure.
>
> However, I tried placing the \override
> Staff.NoteCollision.prefer-dotted-right = ##t in a variety of locations, but
> to no avail.
>
> For example, I tried using a \context {\Staff ... statement in a layout
> block. I also tried putting the statement in the global variable. In yet
> another try, I placed the \override before a particular dotted
>
> Can someone please tell me how what I am misunderstanding or doing
> correctly?
>
> Ideally, I would like to make this change globally for the entire score.
>
> Thanks in advance to anyone who can help with a suggestion or correction.
>
> Joe Srednicki
>
> =
>
> \version "2.19.35"
> \language "english"
>
> \layout {
>   \context {
> \Voice
> \consists "Melody_engraver"
> \override Stem #'neutral-direction = #'()
>   }
> }
>
> global = {
>   \key c \major
>   \numericTimeSignature
>   \time 3/4
> }
>
> rightOne = \relative c'' {
>   \global
>   \new Voice = "soprano" \voiceOne
>   \partial 4 g ( | % pickup
>   c4.) b8 [c8. d16] | % 1
> }
>
> rightTwo = \relative c' {
>   \global
>  8._\ff 16 | % pickup
>   \stemUp \override NoteColumn.force-hshift = 0.9 g2 g4 \revert
> NoteColumn.force-hshift | % 1
> }
>
> leftOne = \relative c' {
>   \global
>\skip 4 | % pickup
>   \change Staff = "right" \stemDown e4. d8 [e8. f16] | % 1
> }
>
> leftTwo = \relative c' {
>   \global
>   % Music follows here.
> }
>
> pedal = \relative c {
>   \global
>  \partial 4
>   c4 | % pickup
>   c4 c c | % 1
>  }
>
> \score {
>   <<
> \new PianoStaff \with {
>   instrumentName = "Org."
>   shortInstrumentName = "Org."
> } <<
>   \new Staff = "right" << \rightOne \\ \rightTwo >>
>   \new Staff = "left" { \clef bass << \leftOne \\ \leftTwo >> }
> >>
> \new Staff = "pedal" { \clef bass \pedal }
>   >>
>   \layout { }
> }


I don't have a good solution for you.
In the code I used 'extra-offset (last-resort) at first occurence -
needs to be done in every voice.
Second time I used `\i-really-hope-someone-comes-up-with-something-better'.
The name says it all ...

\versio "2.19.38"

i-really-hope-someone-comes-up-with-something-better =
\once \override Staff.DotColumn.positioning-done =
  #(lambda (grob)
 (ly:grob-set-property! grob 'X-offset 1.3)
 (ly:grob-set-property!
   (ly:grob-array-ref (ly:grob-object grob 'dots) 1)
   'Y-offset -0.5))

\layout {
  \context {
\Voice
\consists "Melody_engraver"
\override Stem #'neutral-direction = #'()
  }
}

global = {
  \key c \major
  \numericTimeSignature
  \time 3/4
}

rightOne = \relative c'' {
  \global
  \new Voice = "soprano" \voiceOne
  \partial 4 g ( | % pickup
  \tweak Dots.extra-offset #'(-1.3 . 0)
  c4.) b8[
  \i-really-hope-someone-comes-up-with-something-better
  c8. d16] | % 1
}

rightTwo = \relative c' {
  \global
 8._\ff 16 | % pickup
  \stemUp \override NoteColumn.force-hshift = 0.9 g2 g4
  \revert NoteColumn.force-hshift | % 1
}

leftOne = \relative c' {
  \global
   \skip 4 | % pickup
  \change Staff = "right"
  \stemDown
  \tweak Dots.extra-offset #'(-1.3 . -1) e4. d8[ e8. f16] | % 1
}

leftTwo = \relative c' {
  \global
  % Music follows here.
}

pedal = \relative c {
  \global
 \partial 4
  c4 | % pickup
  c4 c c | % 1
 }

\score {
  <<
\new PianoStaff \with {
  instrumentName = "Org."
  shortInstrumentName = "Org."
} <<
  \new Staff = "right" << \rightOne \\ \rightTwo >>
  \new Staff = "left" { \clef bass << \leftOne \\ \leftTwo >> }
>>
\new Staff = "pedal" { \clef bass \pedal }
  >>
  \layout { }
}


Cheers,
  Harm

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


RE: Placement of dots

2016-04-01 Thread Joseph N. Srednicki
Thomas:

Thanks for taking the time to respond. I appreciate it. 

After I sent the message, I realized that the snippet that I quoted was not the 
right way to approach the problem. 

In my opinion, the solutions that you provided make the dotted notes easier to 
read instead of letting another voice move the dot significantly.

Thanks again.

Joe Srednicki

-Original Message-
From: Thomas Morley [mailto:thomasmorle...@gmail.com] 
Sent: Friday, April 1, 2016 6:32 PM
To: Joseph N. Srednicki 
Cc: lilypond-user 
Subject: Re: Placement of dots

2016-04-01 22:22 GMT+02:00 Joseph N. Srednicki :
> Please see the following example.
>
> Note: There have been some recent issues of the mail programs lopping 
> thing off such a final brace when pasting examples. I re-pasted the 
> following example and recompiled it before sending this message. So, I 
> am hoping that it comes through without anything missing.
>
> In the middle voice in the second measure of the example below, the 
> two g notes in the middle voice move the dots to the right of the g.
>
> Instead, I would like to move the dots next to the notes to which they 
> apply instead of the position following the intervening g notes.
>
> I looked at Snippet http://lsr.di.unimi.it/LSR/Item?id=674.
>
> According to this snippet, the command \override 
> Staff.NoteCollision.prefer-dotted-right = ##t is supposed to move the 
> dots to the position to the immediate right of the notes to which they 
> apply; no notes are supposed to intervene between a note and the dot 
> to which it applies.
>
> Therefore, in my example, the notes should appear to the left of the g 
> notes in the second measure.
>
> However, I tried placing the \override 
> Staff.NoteCollision.prefer-dotted-right = ##t in a variety of 
> locations, but to no avail.
>
> For example, I tried using a \context {\Staff ... statement in a 
> layout block. I also tried putting the statement in the global 
> variable. In yet another try, I placed the \override before a 
> particular dotted
>
> Can someone please tell me how what I am misunderstanding or doing 
> correctly?
>
> Ideally, I would like to make this change globally for the entire score.
>
> Thanks in advance to anyone who can help with a suggestion or correction.
>
> Joe Srednicki
>
> =
>
> \version "2.19.35"
> \language "english"
>
> \layout {
>   \context {
> \Voice
> \consists "Melody_engraver"
> \override Stem #'neutral-direction = #'()
>   }
> }
>
> global = {
>   \key c \major
>   \numericTimeSignature
>   \time 3/4
> }
>
> rightOne = \relative c'' {
>   \global
>   \new Voice = "soprano" \voiceOne
>   \partial 4 g ( | % pickup
>   c4.) b8 [c8. d16] | % 1
> }
>
> rightTwo = \relative c' {
>   \global
>  8._\ff 16 | % pickup
>   \stemUp \override NoteColumn.force-hshift = 0.9 g2 g4 \revert 
> NoteColumn.force-hshift | % 1 }
>
> leftOne = \relative c' {
>   \global
>\skip 4 | % pickup
>   \change Staff = "right" \stemDown e4. d8 [e8. f16] | % 1 }
>
> leftTwo = \relative c' {
>   \global
>   % Music follows here.
> }
>
> pedal = \relative c {
>   \global
>  \partial 4
>   c4 | % pickup
>   c4 c c | % 1
>  }
>
> \score {
>   <<
> \new PianoStaff \with {
>   instrumentName = "Org."
>   shortInstrumentName = "Org."
> } <<
>   \new Staff = "right" << \rightOne \\ \rightTwo >>
>   \new Staff = "left" { \clef bass << \leftOne \\ \leftTwo >> }
> >>
> \new Staff = "pedal" { \clef bass \pedal }
>   >>
>   \layout { }
> }


I don't have a good solution for you.
In the code I used 'extra-offset (last-resort) at first occurence - needs to be 
done in every voice.
Second time I used `\i-really-hope-someone-comes-up-with-something-better'.
The name says it all ...

\versio "2.19.38"

i-really-hope-someone-comes-up-with-something-better = \once \override 
Staff.DotColumn.positioning-done =
  #(lambda (grob)
 (ly:grob-set-property! grob 'X-offset 1.3)
 (ly:grob-set-property!
   (ly:grob-array-ref (ly:grob-object grob 'dots) 1)
   'Y-offset -0.5))

\layout {
  \context {
\Voice
\consists "Melody_engraver"
\override Stem #'neutral-direction = #'()
  }
}

global = {
  \key c \major
  \numericTimeSignature
  \time 3/4
}

rightOne = \relative c'' {
  \global
  \new Voice = "soprano" \voiceOne
  \partial 4 g ( | % pickup
  \tweak Dots.extra-offset #'(-1.3 . 0)
  c4.) b8[
  \i-really-hope-someone-comes-up-with-something-better
  c8. d16] | % 1
}

rightTwo = \relative c' {
  \global
 8._\ff 16 | % pickup
  \stemUp \override NoteColumn.force-hshift = 0.9 g2 g4
  \revert NoteColumn.force-hshift | % 1
}

leftOne = \relative c' {
  \global
   \skip 4 | % pickup
  \change Staff = "right"
  \stemDown
  \tweak Dots.extra-offset #'(-1.3 . -1) e4. d8[ e8. f16] | % 1 }

leftTwo = \relative c' {
  \global
  % Music follows here.
}

pedal = \relative c {
  \global
 \partial 4
  c4 | % pickup
  c4 c c | % 1
 }

\score {
  <<
\new PianoStaff \with {
  instrumentName 

Re: How to join notes in markup?

2016-04-01 Thread tisimst
Thanks, Harm!

On Friday, April 1, 2016, Thomas Morley-2 [via Lilypond] <
ml-node+s1069038n189184...@n5.nabble.com> wrote:

> 2016-03-11 22:58 GMT+01:00 Thomas Morley <[hidden email]
> >:
>
> > 2016-03-11 11:21 GMT+01:00 tisimst <[hidden email]
> >:
> >
> >> (though further suggestions for improvement
> >> are welcome).
> >>
> >> Thanks,
> >> Abraham
> >
> > Hi Abraham,
> >
> > just had a more thoroughly look at your snippet at
> > http://lsr.di.unimi.it/LSR/Item?id=1029
> >
> > The biggest issue I see is how to change fontsize. I post my own
> > commented suggestion below.
> > Best would be that score-markup would respect \fontsize, not sure how
> > to do that (if possible at all), though.
> >
> > #(define-markup-command (ezscore layout props mus) (ly:music?)
> > ;; introduce a property to make overriding it possible
> >   #:properties ((size 0))
> >   (interpret-markup layout props
> > #{
> >   \markup {
> > \score {
> > ;; work on a copy of music! Hence $ not #
> >   \new RhythmicStaff { $mus }
> >   \layout {
> > \context {
> >   \RhythmicStaff
> >   \remove Clef_engraver
> >   \remove Time_signature_engraver
> > ;; Don't remove Staff_symbol_engraver, omit StaffSymbol.
> > ;; (probably set line-count zero, alternatively)
> > ;; In order to keep changes for fontSize/staff-space/thickness possible,
> > ;; Stem/Beam etc rely on it for thickness, length etc
> >
> >   \omit StaffSymbol
> >   fontSize = #size
> >   \override StaffSymbol.staff-space = #(magstep size)
> >   \override StaffSymbol.thickness = #(magstep size)
> > }
> > indent = 0
> >   }
> > }
> >   }
> > #}))
> >
> >
> %%
> >
> > \markup {
> >   Let's try something simple:
> >   \note #"8" #UP + \note #"8" #UP =
> >   % BEFORE USING EZNOTES...
> >   \combine
> > \combine
> > %% slightly simplified, here and below
> >   \note #"4" #UP
> >   \translate #'(1.25 . 2.8) \beam #3 #0 #.5
> > \concat {
> >   \hspace #3
> >   \note #"4" #UP
> > }
> >   . Yikes! Not so easy by hand.
> > }
> >
> > \markup {
> >   Much easier:
> >   \note #"8" #UP + \note #"8" #UP =
> >   % AFTER USING EZNOTES...
> >   \ezscore ##{ { c8[ c] } #}.
> >   % LET'S DO SOMETHING HARDER NOW...
> >   Now try constructing
> > %% size-override applied
> >   \override #'(size . -6)
> >   \ezscore ##{
> > {
> > %% spacing-incrementadjusted, according to the size-override.
> > \override Score.SpacingSpanner.spacing-increment = #1
> > \override TupletNumber.text =
> >   #(tuplet-number::append-note-wrapper
> >  (tuplet-number::non-default-tuplet-fraction-text 12 7) "8")
> > \tuplet 12/7 { c4. c c c }
> > }
> >   #}
> >   manually!
> > }
> >
> > HTH, best
> >   Harm
>
>
> Approved with the tiny amendments as
> http://lsr.di.unimi.it/LSR/Item?id=1029
>
> Cheers,
>   Harm
>
> ___
> lilypond-user mailing list
> [hidden email] 
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://lilypond.1069038.n5.nabble.com/How-to-join-notes-in-markup-tp187711p189184.html
> To start a new topic under User, email ml-node+s1069038n...@n5.nabble.com
> 
> To unsubscribe from Lilypond, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/How-to-join-notes-in-markup-tp187711p189193.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: Variable slur thickness

2016-04-01 Thread tisimst
Thanks, Harm!

On Friday, April 1, 2016, Thomas Morley-2 [via Lilypond] <
ml-node+s1069038n189182...@n5.nabble.com> wrote:

> 2016-03-11 21:51 GMT+01:00 Thomas Morley <[hidden email]
> >:
>
> > 2016-03-11 14:31 GMT+01:00 Sharon Rosner <[hidden email]
> >:
> >>> I've managed to bypass using before-line-breaking AND
> after-line-breaking
> >>> by assigning the function to the 'thickness property and having each
> grob
> >>> internally calculate its own control points rather than relying on it
> >>> being
> >>> calculated elsewhere (also attached):
> >>
> >> Works great! I improved it further by making it compatible with ties
> too:
> >>
> >>
> >> #(define (variable-slur-thickness min-l max-l min-t max-t) (lambda
> (grob)
> >>   (let* ((cpf (if (grob::has-interface grob 'tie-interface)
> >>   ly:tie::calc-control-points
> >>   ly:slur::calc-control-points))
> >>  (cpt (cpf grob))
> >>  (cp0 (car cpt)) (cp3 (cadddr cpt))
> >>  (dx (- (car cp3) (car cp0)))
> >>  (dy (- (cdr cp3) (cdr cp0)))
> >>  (len (magnitude (make-rectangular dx dy)))
> >>  (thickness
> >>(cond ((< len min-l) min-t)
> >>  ((> len max-l) max-t)
> >>  (else (+ min-t (* (- len min-l)
> >>  (/ (- max-t min-t) (- max-l min-l
> >>
> >>  thickness)))
> >>
> >>
> >>> The only thing I'm (slightly) concerned with is
> >>> the duplicate control-point calculation in this function and how it
> might
> >>> affect compilation times if this were applied to a large orchestral
> score,
> >>> for example.
> >>
> >> A preliminary check with a 17-page score shows a pretty negligible
> effect on
> >> compilation time, 0.6s (the total time is about 21s), or about 2.7%
> >> additional compilation time. A small price to pay for more beauty!
> >>
> >> Sharon
> >
> >
> >
> > How about below,
> > Should work for all bows, hence the name is changed
> >
> > #(define (variable-bow-thickness min-l max-l min-t max-t)
> >   (lambda (grob)
> > ;; Get the procedure to calculate the control-points
> > ;; If none use `fall-back' to return a default-value for 'thickness
> > (let ((cpf (assoc-get 'control-points (ly:grob-basic-properties
> grob)))
> >   (fall-back 1.2))
> >   (if (procedure? cpf)
> >   (let* ((cpt (cpf grob))
> >  (cp0 (car cpt))
> >  (cp3 (cadddr cpt))
> >  (dx (- (car cp3) (car cp0)))
> >  (dy (- (cdr cp3) (cdr cp0)))
> >  (len (magnitude (make-rectangular dx dy)))
> >  (thickness
> >(cond ((< len min-l) min-t)
> >  ((> len max-l) max-t)
> >  (else (+ min-t (* (- len min-l)
> >(/ (- max-t min-t) (- max-l min-l
> > thickness)
> >   fall-back
> >
> >
> > Cheers,
> >  Harm
>
> I made some further editions.
> Works now for Slurs, Ties, PhrasingSlurs and theoretical for RepeatTie
> and LaissezVibrerTie.
> Approved as
> Variable bow thickness depending on length
> http://lsr.di.unimi.it/LSR/Item?u=1&id=1028
>
> Cheers,
>   Harm
>
> ___
> lilypond-user mailing list
> [hidden email] 
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://lilypond.1069038.n5.nabble.com/Variable-slur-thickness-tp188374p189182.html
> To start a new topic under User, email ml-node+s1069038n...@n5.nabble.com
> 
> To unsubscribe from Lilypond, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Variable-slur-thickness-tp188374p189194.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


Lilypond server

2016-04-01 Thread Sharon Rosner
Hi all,Here’s something I played around with last night: a lilypond server. I found some old discussions of this idea, and an old bit of code by Han-Wen. Enclosed is a working server script and a client bash script to go with it.The server script starts a telnet server on port 12321. When a client connects, the server forks and compiles the filename sent by the client. The rationale for this is to eliminate the start up time, and thus shave about 0.5-0.6s off the compilation time.So for simple snippets you get compilation time on the order of 0.2-0.3s, which feels almost “real-time”, which is nice!There’s also an open issue for this: https://sourceforge.net/p/testlilyissues/issues/1199/To start the server:lilypond server.lyTo use the client:chmod +x lyc./lyc myfile.lyHappy lilyponding,Sharon

server.ly
Description: Binary data


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