Re: Constant Hairpin on line break

2018-03-21 Thread Thomas Morley
2018-03-21 3:28 GMT+01:00 Karim Haddad :
> Hi,
>
> Does somebody know how to avoid having the vertical hook on a line break and 
> just to have it on the end of a constant hairpin ?
> Here is a minimal example code :
>
> \relative c'' {
>  \override Hairpin.stencil = #constante-hairpin
>   c1 \p \< |
>   \break
>   c1 | %%here the hook should not appear if possible.
>   c1 \! |
>   }
>
> Best regards
> --
> Karim Haddad



How about:

\version "2.19.65"

#(define breaking-constante-hairpin
  (lambda (grob)
(let* ((orig (ly:grob-original grob))
   (siblings (if (ly:grob? orig)
 (ly:spanner-broken-into orig) '()))
   (grow-dir (ly:grob-property grob 'grow-direction))
 )
  (if (and (pair? siblings)
   (or (and (eqv? grow-dir RIGHT) (equal? grob (last siblings)))
   (and (eqv? grow-dir LEFT) (equal? grob (car siblings)
  constante-hairpin
  (elbowed-hairpin '((0 . 0) (1.0 . 0.0)) #f)


\relative c'' {
 \override Hairpin.stencil = #breaking-constante-hairpin
  c1 \p \< |
  \break
  c1 | %%here the hook should not appear if possible.
  c1 \! |
  }

Cheers,
  Harm

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


Re: Constant Hairpin on line break

2018-03-21 Thread Karim Haddad
Thanx a lot,

This works marvelously well !
Wondering, if this should not be by default?

Best
K

On Wed, Mar 21, 2018 at 11:16:13AM +0100, Thomas Morley wrote:
> 2018-03-21 3:28 GMT+01:00 Karim Haddad :
> > Hi,
> >
> > Does somebody know how to avoid having the vertical hook on a line break 
> > and just to have it on the end of a constant hairpin ?
> > Here is a minimal example code :
> >
> > \relative c'' {
> >  \override Hairpin.stencil = #constante-hairpin
> >   c1 \p \< |
> >   \break
> >   c1 | %%here the hook should not appear if possible.
> >   c1 \! |
> >   }
> >
> > Best regards
> > --
> > Karim Haddad
> 
> 
> 
> How about:
> 
> \version "2.19.65"
> 
> #(define breaking-constante-hairpin
>   (lambda (grob)
> (let* ((orig (ly:grob-original grob))
>(siblings (if (ly:grob? orig)
>  (ly:spanner-broken-into orig) '()))
>(grow-dir (ly:grob-property grob 'grow-direction))
>  )
>   (if (and (pair? siblings)
>(or (and (eqv? grow-dir RIGHT) (equal? grob (last siblings)))
>(and (eqv? grow-dir LEFT) (equal? grob (car siblings)
>   constante-hairpin
>   (elbowed-hairpin '((0 . 0) (1.0 . 0.0)) #f)
> 
> 
> \relative c'' {
>  \override Hairpin.stencil = #breaking-constante-hairpin
>   c1 \p \< |
>   \break
>   c1 | %%here the hook should not appear if possible.
>   c1 \! |
>   }
> 
> Cheers,
>   Harm

-- 
Karim Haddad

email   : karim.had...@ircam.fr
webpage : http://karim.haddad.free.fr

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


Re: MIDI tick resolution

2018-03-21 Thread karl
Gilberto:
...
> Also keep in mind that tick resolution is given in pulses per quarter note
> (PPQ), not seconds. This means that a slow piece will have a lower
> resolution /in true time/, i.e. ticks per second.

I don't think resolution /in true time/ matters, since each tick is 
"exact" in some sense.

What matters is the smallest subdivision of a quarter note used
(unless you use the smpte time format).

> Finally note that the
> reference is a quarter note, so if you have 384 PPQ, you then have 192 ticks
> per eighth note, 96 per sixteenth note, 48 per thirty-second-notes. Given
> that contemporary music can very much look like the image below, I think
> there is a strong case for higher PPQ in order to have decent
> representations of tuplets of very short note values:
> 
>  

(My wild guess is that music would need a tick value of 64*9*5*7.)

The technical limitation of midi file format is that the tick is a 
15bit quantity, i.e. the maximum value is 2^15-1 = 32767.
(Instead of "ticks" you could use a time code based time, guess that 
that is more for film making, don't know much about that.)

So you can't get 128*9*5*7 = 40320, but 64*9*5*7 = 20160 is possible, 
and if you really need 128*9*5*7*11 or whatever, then you either need 
 to choose a format other than midi,
 accept (smallish) time errors or
 you have to scale the notes, say make a quarter a whole note or longa
  (that would gain you a factor of 4 or 16).

All note times in the file is delta times, and they are of variable 
length; the largest number allowed is 0x0FFF = 268435455, so if your
tick is 2^15 (finest subdivision), the longest time is slightly less 
than 8192 quarter notes, which should be sufficient for most (all?)
music.

In effect, there is no need to choose a small tick value unless you 
want smaller midi files (a consern which should be irrelevant today)
or perhaps due to some misbehaving midi equipment.

Regards,
/Karl Hammar

---
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57



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


Re: Tie/Accidental Collision

2018-03-21 Thread Kieren MacMillan
Hi Sam,

> In the attached MWE, I'm having difficulties correcting the collision between 
> the tie and the accidental.
> The documentation has ample support for slur/accidental collisions, but I'm 
> having trouble fixing the collision with ties.
> I'd appreciate any help you can offer!

Don’t forget you can use whiteout (see snippet, below).
That’s how I would probably handle this case, to avoide distortions.

Hope this helps!
Kieren.

%%%  SNIPPET BEGINS
\version "2.19.81"
\language "english"

\layout {
  \context {
\Score
  \override Tie.layer = #-2
  \override Accidental.layer = #-1
  \override Accidental.whiteout-style = #'outline
  \override Accidental.whiteout = #2
  }
}

left = \relative c {
  \time 2/2
  <<
{
  s4 2 q4~ |
  q q2 4 |
}
\\
{
  2-> -> |
  -> -> |
}
  >>
}

\score {
\new Staff = "left" { \clef bass \left }
}
%%%  SNIPPET ENDS


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: MIDI tick resolution

2018-03-21 Thread karl
David:
> Malte Meyn  writes:
> 
> > Am 19.03.2018 um 14:47 schrieb k...@aspodata.se:
> >> You could try the attached rudimentary patch and recompile your
> >> lilypond source, see if that solves your problem, and report back.
> > Would it be possible to make a patch that reads this from a context
> > property so that the user could input something like
> >
> > \set Score.midiTickResolution = 960

(The word resolution is not suitable since the resolution of the
midi tick is 1, it is a 15 bit int.)

Yes, if someone points to directions to go from \set to variable.

The second question is in what namespace or class to have the variable.
One possibility is to have it globally, another is to have it in the
Midi_header class.

> I think it belongs in the \midi block since you cannot change it in
> mid-file.  Well, you probably can, but LilyPond is even less prepared to
> do that.

The tick value can only be set once in the midi file, in the
last 16bits of the header chunk (the first so called "chunk"
of the file). See e.g. lily/midi-chunk.cc:Midi_header::Midi_header()

My current awful patch looks like in the attachment.

BTW, it is called "division" in the midi docs, and the word tick is
about the duration of one delta-time, or to cite the std:

 If bit 15 of  is zero, the bits 14 thru 0 represent the number
 of delta time "ticks" which make up a quarter-note. For instance, if
 division is 96, then a time interval of an eighth-note between two
 events in the file would be 48.

Perhaps we should call the value Midi_division or something similar.

Regards,
/Karl Hammar

---
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57

diff --git a/lily/audio-item.cc b/lily/audio-item.cc
index a8a78199c7..57c1fa025c 100644
--- a/lily/audio-item.cc
+++ b/lily/audio-item.cc
@@ -129,7 +129,7 @@ moment_to_real (Moment m)
 int
 moment_to_ticks (Moment m)
 {
-  return int (moment_to_real (m) * 384 * 4);
+  return int (moment_to_real (m) * Midi_ticks * 4);
 }
 
 void Audio_span_dynamic::set_end_moment (Moment mom)
diff --git a/lily/include/midi-item.hh b/lily/include/midi-item.hh
index 57bb2d4da2..22de679cda 100644
--- a/lily/include/midi-item.hh
+++ b/lily/include/midi-item.hh
@@ -23,6 +23,8 @@
 #include "audio-item.hh"
 #include "std-vector.hh"
 
+int16_t Midi_ticks;
+
 string int2midi_varint_string (int i);
 
 /**
diff --git a/lily/midi-item.cc b/lily/midi-item.cc
index ba29ba0ba5..4af3f16d6c 100644
--- a/lily/midi-item.cc
+++ b/lily/midi-item.cc
@@ -34,6 +34,8 @@
 #define PITCH_WHEEL_CENTER 0x2000
 #define PITCH_WHEEL_SEMITONE 0X1000
 
+int16_t Midi_ticks = 960; /* negative value is SMPTE time format */
+
 Midi_item *
 Midi_item::get_midi (Audio_item *a)
 {
diff --git a/lily/midi-walker.cc b/lily/midi-walker.cc
index d9765c6814..4411206c2d 100644
--- a/lily/midi-walker.cc
+++ b/lily/midi-walker.cc
@@ -86,7 +86,7 @@ Midi_walker::do_start_note (Midi_note *note)
   assert (note->audio_ == ptr);
   int now_ticks = ptr->audio_column_->ticks ();
   int stop_ticks = int (moment_to_real (note->audio_->length_mom_) *
-Real (384 * 4)) + now_ticks;
+Real (Midi_ticks * 4)) + now_ticks;
   for (vsize i = 0; i < stop_note_queue.size (); i++)
 {
   /* if this pitch already in queue, and is not already ignored */
diff --git a/lily/performance.cc b/lily/performance.cc
index 9f840efd25..bd6a91d9cb 100644
--- a/lily/performance.cc
+++ b/lily/performance.cc
@@ -72,7 +72,7 @@ Performance::output (Midi_stream &midi_stream,
 {
   int tracks_ = audio_staffs_.size ();
 
-  midi_stream.write (Midi_header (1, tracks_, 384));
+  midi_stream.write (Midi_header (1, tracks_, Midi_ticks));
   debug_output (_ ("Track...") + " ", false);
 
   //Find the first Audio_item in the performance, so all staves start___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


How to write a ly:pitch? as element of a pair?

2018-03-21 Thread Urs Liska

Hi all,

I have a with block where I would like to let the user enter a pair as a 
value, and one of the elements of the pair should be a pitch.


Something like:

\with {
  transposition = #'( d' . "D")
}

But this doesn't work, just like

  transposition = #'( #{ d' #} . "D")

What I currently do is have them write

  transposition = d'
  transposition-label = D

and cons them together within the function. This works but is inconsistent.

So is there a convenient way to write a pitch within a Scheme expression?

TIA
Urs


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


Re: How to write a ly:pitch? as element of a pair?

2018-03-21 Thread Malte Meyn



Am 21.03.2018 um 15:28 schrieb Urs Liska:

Hi all,

I have a with block where I would like to let the user enter a pair as a 
value, and one of the elements of the pair should be a pitch.


Something like:

\with {
   transposition = #'( d' . "D")
}

But this doesn't work, just like

   transposition = #'( #{ d' #} . "D")


How about #`( ,#{ d' #} . "D") ?

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


Re: MIDI tick resolution

2018-03-21 Thread Gilberto Agostinho
Hi Karl, thanks for your reply!


Karl Hammar wrote
> The technical limitation of midi file format is that the tick is a
> 15bit quantity, i.e. the maximum value is 2^15-1 = 32767.
> 
> [...]
> 
> So you can't get 128*9*5*7 = 40320, but 64*9*5*7 = 20160 is possible,
> and if you really need 128*9*5*7*11 or whatever, then you either need
> to choose a format other than midi

The only issue of going overboard with that value is that some DAWs might
then complain when opening these files (I never tried importing a .mid file
with larger PPQ than REAPER's default to see what happens though). REAPER's
default of 960 is a quite reasonable value: 3 × 5 × 64. This way, triplets
and quintuplets and all note down to a 64th-note can be exactly represented,
and everything else has a quite fine grid to be adjusted to. I've also read
here that Cubase handles anything from 24 to 960 (source:
https://steinberg.help/cubase_elements_le_ai/v9.5/en/cubase_nuendo/topics/track_handling/track_handling_export_options_for_midi_files_r.html
)
 

Karl Hammar wrote
> Perhaps we should call the value Midi_division or something similar. 

The terminology I find the most is Pulses Per Quarter Note (PPQN),Pulses Per
Quarter (PPQ) and Ticks Per Quarter Note (TPQN). I am surprised this is not
on the official specifications as it's what most DAWs use. 

Cheers,
Gilberto



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

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


Re: How to write a ly:pitch? as element of a pair?

2018-03-21 Thread David Kastrup
Urs Liska  writes:

> Hi all,
>
> I have a with block where I would like to let the user enter a pair as
> a value, and one of the elements of the pair should be a pitch.
>
> Something like:
>
> \with {
>   transposition = #'( d' . "D")
> }
>
> But this doesn't work, just like
>
>   transposition = #'( #{ d' #} . "D")
>
> What I currently do is have them write
>
>   transposition = d'
>   transposition-label = D
>
> and cons them together within the function. This works but is inconsistent.
>
> So is there a convenient way to write a pitch within a Scheme expression?

Like usual with quoting.

transposition = #`( ,#{ d' #} . "D")

Or even without quoting:

transposition = #(cons #{ d' #} "D")

But frankly: I'd use separate variables instead.

-- 
David Kastrup

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


Re: How to write a ly:pitch? as element of a pair?

2018-03-21 Thread Urs Liska

Hi Malte, David,

thank you for your suggestions.


Am 21.03.2018 um 15:43 schrieb David Kastrup:

Urs Liska  writes:


Hi all,

...


So is there a convenient way to write a pitch within a Scheme expression?

Like usual with quoting.

transposition = #`( ,#{ d' #} . "D")

Or even without quoting:

transposition = #(cons #{ d' #} "D")

But frankly: I'd use separate variables instead.



Indeed, now that I see it this really isn't an option. Probably I'll 
rather change the other end of the rope and don't treat the data as a 
pair internally at all.


Thanks again
Urs

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


Re: How to write a ly:pitch? as element of a pair?

2018-03-21 Thread David Kastrup
Urs Liska  writes:

> Hi Malte, David,
>
> thank you for your suggestions.
>
>
> Am 21.03.2018 um 15:43 schrieb David Kastrup:
>> Urs Liska  writes:
>>
>>> Hi all,
>>>
>>> ...
>>>
>>>
>>> So is there a convenient way to write a pitch within a Scheme expression?
>> Like usual with quoting.
>>
>> transposition = #`( ,#{ d' #} . "D")
>>
>> Or even without quoting:
>>
>> transposition = #(cons #{ d' #} "D")
>>
>> But frankly: I'd use separate variables instead.
>>
>
> Indeed, now that I see it this really isn't an option. Probably I'll
> rather change the other end of the rope and don't treat the data as a
> pair internally at all.

Or

transposed =
#(define-scheme-function (p m) (ly:pitch? markup?) (cons p m))

transposition = \transposed d' "D"

-- 
David Kastrup

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


Re: Tie/Accidental Collision

2018-03-21 Thread Stefano Troncaro
Hi Sam,

How about using TieColum.tie-configuration? Together with
Tie.details.height-limit you can avoid the collision.

I don't know how to shorten the Ties, but I used Kieren's whiteout idea to
make them finish them in the Stem. If someone knows how to actually shorten
them I'd be happy to know!

Snippet below, hope you find it useful,
Stéfano

\version "2.19.81"
\language "english"

left = \relative c {
  \time 2/2
  <<
{
  s4 2
  \override Tie.details.height-limit = 0.6
  \override Tie.layer = -1
  q4~ |
  \override TieColumn.tie-configuration = #`((4 . ,UP) (6 . ,UP))
  q q2 4 |
}
\\
{
  2-> -> |
  \once \override Stem.layer = 0
  \once \override Stem.whiteout = 2
  -> -> |
}
  >>
}


2018-03-21 9:58 GMT-03:00 Kieren MacMillan :

> Hi Sam,
>
> > In the attached MWE, I'm having difficulties correcting the collision
> between the tie and the accidental.
> > The documentation has ample support for slur/accidental collisions, but
> I'm having trouble fixing the collision with ties.
> > I'd appreciate any help you can offer!
>
> Don’t forget you can use whiteout (see snippet, below).
> That’s how I would probably handle this case, to avoide distortions.
>
> Hope this helps!
> Kieren.
>
> %%%  SNIPPET BEGINS
> \version "2.19.81"
> \language "english"
>
> \layout {
>   \context {
> \Score
>   \override Tie.layer = #-2
>   \override Accidental.layer = #-1
>   \override Accidental.whiteout-style = #'outline
>   \override Accidental.whiteout = #2
>   }
> }
>
> left = \relative c {
>   \time 2/2
>   <<
> {
>   s4 2 q4~ |
>   q q2 4 |
> }
> \\
> {
>   2-> -> |
>   -> -> |
> }
>   >>
> }
>
> \score {
> \new Staff = "left" { \clef bass \left }
> }
> %%%  SNIPPET ENDS
> 
>
> 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
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: MIDI tick resolution

2018-03-21 Thread karl
Gilberto:
> Karl Hammar wrote
> > The technical limitation of midi file format is that the tick is a
> > 15bit quantity, i.e. the maximum value is 2^15-1 = 32767.
...
> The only issue of going overboard with that value is that some DAWs might
> then complain when opening these files (I never tried importing a .mid file
...

If lilypond defaults to 384, and user sets it to something that a device cannot 
handle, that is a user problem I guess.

> Karl Hammar wrote
> > Perhaps we should call the value Midi_division or something similar. 
> 
> The terminology I find the most is Pulses Per Quarter Note (PPQN),Pulses Per
> Quarter (PPQ) and Ticks Per Quarter Note (TPQN). I am surprised this is not
> on the official specifications as it's what most DAWs use. 

I don't know about thoose, one just have to choose a name and
possible mention other names used. Usually I tend to use names from
standard papers because then I can point to paper X page n. I don't
know what the regular developers think about this, but if you
know your stuff, I wouldn't mind if you choose the name.

What we are missing now is some info of how to do handle

\midi {
 \divisions = 960 % or
 \ppq = 960
}

in the source.

Regards,
/Karl Hammar

---
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57



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


Re: Tie/Accidental Collision

2018-03-21 Thread Kieren MacMillan
Hi Stéfano,

> How about using TieColum.tie-configuration? Together with 
> Tie.details.height-limit you can avoid the collision.

This is nice!

But I would suggest not having the Stem whiteout affect the StaffSymbol… It's 
probably enough just to write

  \override Tie.layer = -2

and

  \once \override Stem.layer = -1

> I don't know how to shorten the Ties

Maybe use the \shape function?

Cheers,
Kieren.


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


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


Re: Build error. MergeFonts: Can't find font: feta11.pfb

2018-03-21 Thread Lucas Werkmeister
On 18.03.2018 12:17, Malte Meyn wrote:
> Am 17.03.2018 um 20:01 schrieb Lucas Werkmeister:
>> Can confirm, coredumpctl shows loads of t1asm core dumps (no idea why
>> there’s no error message in the terminal), and downgrading to t1utils
>> 1.39 fixed the problem (1.40 seems buggy as well). Thanks for the info!
>
> I’m back from Lisbon and can confirm that downgrading to 1.39 works :)

It turns out this is a known bug [1] and a fix is already available in
the source code repository, there just hasn’t been a release with that
fix yet. Arch users can install t1utils-git from AUR [2] instead of
downgrading t1utils.

Cheers,
Lucas

[1]: https://github.com/kohler/t1utils/issues/8
[2]: https://aur.archlinux.org/packages/t1utils-git/
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Tie/Accidental Collision

2018-03-21 Thread Sam Bivens

Hi Kieren and Stéfano,

Thanks so much for both of your help; your ideas were both different 
(but much simpler) approaches than I was considering, and I was able to 
combine them into the best solution for my full example.


Take care,

Sam


On 03/21/2018 04:15 PM, Kieren MacMillan wrote:

Hi Stéfano,


How about using TieColum.tie-configuration? Together with 
Tie.details.height-limit you can avoid the collision.

This is nice!

But I would suggest not having the Stem whiteout affect the StaffSymbol… It's 
probably enough just to write

   \override Tie.layer = -2

and

   \once \override Stem.layer = -1


I don't know how to shorten the Ties

Maybe use the \shape function?

Cheers,
Kieren.


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



--
Sam Bivens
Music Theory Faculty | Cleveland Institute of Music
Ph.D. Candidate | Eastman School of Music

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