snippet to properly align dynamics with expressive text

2017-07-07 Thread Shevek
Dynamics with expressive text, like "p espressivo" are meant to have the
dynamic aligned on the notehead the same as ordinary dynamics, with the
expressive text following. Here is a snippet I've written to align custom
dynamics correctly.

\version "2.18.2"

\paper {
  ragged-right = ##f
  indent = 0\cm
}

dynText = #(define-event-function (parser location dyn expr) (markup?
markup?)
 (let* (
 (mark #{ \markup { \dynamic $dyn \normal-text\italic
$expr } #})
 (offset (lambda (grob)
   (let* (
   (layout (ly:grob-layout grob))
   (props (ly:grob-alist-chain grob
(ly:output-def-lookup layout
'text-font-defaults)))
   (target-X-extent
(ly:stencil-extent

(ly:text-interface::interpret-markup layout props dyn)
 X))
   (width (abs
   (- (cdr target-X-extent) (car
target-X-extent
   )
 (display target-X-extent)
 (- 1 (/ width 2))
 )
   )
   )
 )
   #{
 \tweak DynamicText.X-offset #offset
 #(make-dynamic-script mark) 
   #}
   )
 )

%% Example

\new Staff \with {
  \omit TimeSignature
} \relative c' {
  c1\dynText "p" "sub."
  c1\dynText "fff" "espressivo"
  c1\dynText "p" "espressivo"
  c1\dynText "f" "sub."
  \break
  c1\p
  c1\fff
  c1\p
  c1\f
}



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/snippet-to-properly-align-dynamics-with-expressive-text-tp204305.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: snippet to properly align dynamics with expressive text

2017-07-07 Thread Shevek
Agreed about the optical spacing. My goal was to get the alignment to be
identical between the bare dynamics and the dynamics + text. To my eye, the
fff and fff espressivo are aligned the same, so it seems more like something
that could be improved in Lilypond's dynamic alignment in general.

I would be pleased to contribute this to openlilylib, but I have no idea
how! I've never contributed to a collaborative project like that before. How
would I go about this?

Thanks,

Saul



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/snippet-to-properly-align-dynamics-with-expressive-text-tp204305p204307.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: snippet to properly align dynamics with expressive text

2017-07-07 Thread Kieren MacMillan
Hi Shevek,

> Here is a snippet I've written to align custom dynamics correctly.

This is a nice start — thanks!

Two thoughts:

1. To my eye, the f's don't seem centred (the fff shows the "error" more 
prominently than the f". I realise this is an optical illusion based on the 
actual X-extent… but like optical spacing (see 
),
 it would be nice if the function adjusted accordingly (or at least the user 
had the ability to set an adjustment by dynamic).

2. Regardless, you should consider merging it with the analogous function in 
openlilylib (see 
).

Thanks and all the best,
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: [ANN] LilyQuick 0.94beta - Quick note Lilypond entry using MIDI for Linux

2017-07-07 Thread Martin Tarenskeen



Hi,

I just re-read the code and comments, and it seems configuring lilyquick 
works a little different. It looks to me that this is done from the 
function InitSetNoteLengths(). I'd rather enter my own list of 
valuemappings in a simple table. I only have to do that once, and 
LilyQuick wouldn't need an "intelligent" function to automatically 
calculate the keyboardmapping. Denemo is just one of many possible 
possible special preferences. A user-editable keyboard mapping table would 
be more flexible. (for example how do I configure a mapping in the 
style of Sibelius ?)



MT



On Fri, 7 Jul 2017, Martin Tarenskeen wrote:


On Fri, 7 Jul 2017, Vaughan McAlley wrote:


 I developed the layout myself using the Finale Speedy Note Entry as
 a base, which was:

 8 - \breve
 7 - 1
 6 - 2
 5 - 4
 4 - 8
 3 - 16
 2 - 32
 1 - 64


This also corresponds with the keyboard shortcuts for note durations 
when entering notes in MuseScore.


https://musescore.org/en/handbook/note-input#keyboard

I guess the MuseScore developers also where inspired by Finale.

In Sibelius it's more like this

1 - 32
2 - 16
3 - 8
4 - 4
5 - 2
6 - 1

And Denemo uses

0 - 1
1 - 2
2 - 4
3 - 8
4 - 16
5 - 32
6 - 64

Correct me if I am wrong, most of this info I just quickly Googled 
while writing this comment.


Personally I quite like the Sibelius mapping where 4=4

Good to be able to adjust the LilyQuick lua code to fit my personal 
preferences. Maybe the different mappings known from Finale, MuseScore, 
Sibelius and Denemo can be added [[-- in a comment block --]] in 
LQkeyboardEvents.lua to make it easy to select. Or maybe even a special 
configuration variable could be created in LQconfig.lua

Something like

NumericInputStyle = "denemo"
[[--
or "finale", "sibelius", "musescore", "custom"
--]]


Just a suggestion

--

MT



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


Re: [ANN] LilyQuick 0.94beta - Quick note Lilypond entry using MIDI for Linux

2017-07-07 Thread Johan Vromans
On Fri, 7 Jul 2017 11:23:49 +1000, Vaughan McAlley 
wrote:

> I’ve put version 0.941beta up which fixes the issue of custom layouts not
> working and adds a Denemo layout option.

Thanks.

One thing: When I run lq, I still have to (manually) connnect its 'Virtual
RawMIDI ' port to 'Synth input port (10726:0)' although I understand from
the code this should be handled by lq itself.

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


Re: [ANN] LilyQuick 0.94beta - Quick note Lilypond entry using MIDI for Linux

2017-07-07 Thread Martin Tarenskeen



On Fri, 7 Jul 2017, Vaughan McAlley wrote:


I developed the layout myself using the Finale Speedy Note Entry as a base, 
which was:

8 - \breve
7 - 1
6 - 2
5 - 4
4 - 8
3 - 16
2 - 32
1 - 64


This also corresponds with the keyboard shortcuts for note durations when 
entering notes in MuseScore.


https://musescore.org/en/handbook/note-input#keyboard

I guess the MuseScore developers also where inspired by Finale.

In Sibelius it's more like this

1 - 32
2 - 16
3 - 8
4 - 4
5 - 2
6 - 1

And Denemo uses

0 - 1
1 - 2
2 - 4
3 - 8
4 - 16
5 - 32
6 - 64

Correct me if I am wrong, most of this info I just quickly Googled while 
writing this comment.


Personally I quite like the Sibelius mapping where 4=4

Good to be able to adjust the LilyQuick lua code to fit my personal 
preferences. Maybe the different mappings known from Finale, 
MuseScore, Sibelius and Denemo can be added [[-- in a comment 
block --]] in LQkeyboardEvents.lua to make it easy to select. Or maybe 
even a special configuration variable could be created in LQconfig.lua

Something like

NumericInputStyle = "denemo"
[[--
or "finale", "sibelius", "musescore", 
"custom"

--]]


Just a suggestion

--

MT

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