Re: Feathered Beam Timing

2024-05-11 Thread David Wright
On Sat 11 May 2024 at 16:06:00 (+0200), N. Andrew Walsh wrote:
> (the stickler in me would complain that tuplets should always indicate a
> shortening of length, and this is technically putting six sixteenths in the
> space of eight, but I guess the feathering overrules that)

I tickles me that I still remember my first encounter with
two in the time of three (Vaughan Williams, Te Deum in G,
Govern them …) even though it was over 60 years ago.

Cheers,
David.



Re: Key signatures in MIDI output

2024-05-11 Thread David Wright
On Sat 11 May 2024 at 15:14:47 (+), Giles Boardman wrote:
> You are, of course, right. Your evidence is clear. The position of the \key 
> command seems a strong candidate but I can't get it into the .MID even in the 
> simplest of snippet.
> 
> As I mentioned I also have other behaviour I can't explain so it could also 
> be version related. I reinstalled the latest version I could find before the 
> release date of Windows 10, but it hasn't changed anything. I prefer to keep 
> my music-related work on a Windows 8.1 machine but that can  change .
> 
> What I am trying to do is this:
> 
> I have a big "library" of small, simple tunes that are variables, named for 
> their name and reference.
> I have "compiled" the library and found errors, which I have corrected.
> Now I can create medleys and audition them much more quickly than otherwise 
> possible by referring to the pieces by their variable name.
> Like this .
> 
> \version "2.18.2"
> % \include "C:\[lilify]\+progress\jukeboxpart1v2.ly"
> % \include "C:\[lilify]\+progress\jukeboxpart2v1.ly"
> 
> "1K002-1a-_WILLIE_SHAW" = { \mark "1K002-1a-" \time 4/4 \key d\major { \time 
> 1/8 \partial 8  g''8 \time 4/4 fis''16 d''8. b'8. d''16 a'4 fis'4 fis'16 a'8. 
> d''8. fis''16 g''16 e''8. e''8. g''16 fis''16 d''8. b'8. d''16 a'4 fis'4 
> \time 7/8 fis'16 a'8. d''8. e''16 fis''16 d''8. d''8 \bar ":|." } }
> \score {
> {
> \key d\major
> \"1K002-1a-_WILLIE_SHAW"
> }
> 
>  \layout { }
> 
>   \midi { }
> }

  [ … ]

Perhaps it's time for you to attach some evidence in the form of a
MIDI file that you have produced.

You might also attach the .ly file that you obtain by "importing"
my attached MIDI file into LilyPond (through whatever process you
habitually use). AFAICT, the other people in this thread are
decoding MIDI files that they themselves generated.

Cheers,
David.


ksigm.midi
Description: audio/sp-midi


Re: Spacing of chords on a chord lead sheet

2024-05-11 Thread Raphael Mankin


On 11/05/24 01:59, Kieren MacMillan wrote:

Hi Raphael,


However, the chord names are mono-spaced; they are not spaced 
according to their durations. So that if, for instance, I  have {ef2 
ef4:maj7 ef4:7} then each symbol occupies the same amount of space on 
the line. The first chord does not occupy double the space of the 
other two.


Are you sure? Are you using ragged-right = ##f to confirm/test?

For example, the code

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

\layout {
  indent = 0
  line-width = 4\in
  ragged-right = ##f
  \context {
    \Score
    \remove "Bar_number_engraver"
  }
  \context {
    \ChordNames
    \consists "Bar_engraver"
    \override BarLine.bar-extent = #'(-2 . 2)
  }
}

theChords = \chordmode {
  ef4 ef2:maj7 ef4:7 \break
  ef2 ef4:maj7 ef4:7
}

\new ChordNames \theChords
%%%  SNIPPET ENDS

gives me the output

and clearly there’s a difference in the spacing.

Cheers,
Kieren.


Thank you for your suggestions.

I am neither setting nor touching ragged-right.

I suspect that part of the difference that we see is that you forced 
lilypond to spread a limited amount of music over two lines. In my case 
it is jamming 49 bars into one page. After sleeping on it, what worked 
for me, in the end, is



\score {
<<*
\set Score.proportionalNotationDuration = #(ly:make-moment 1/8)
\override Score.SpacingSpanner.strict-note-spacing = ##t
*
\new ChordNames \with {
    \override ChordName.font-size = #'+3
    \override BarLine.bar-extent = #'(-2 . 2)
\   consists "Bar_engraver"
} {
    \introChords \bar "||" \break
    \chordNames \bar "|."
}
>>

\layout {
}
}

__

My work day may look different than your work day. Please do not feel 
obligated to read or respond to this email outside of your normal 
working hours.


Re: Key signatures in MIDI output

2024-05-11 Thread David Kastrup
Giles Boardman  writes:

> You are, of course, right. Your evidence is clear. The position of the \key 
> command seems a strong candidate but I can't get it into the .MID even in the 
> simplest of snippet.
>
> As I mentioned I also have other behaviour I can't explain so it could also 
> be version related. I reinstalled the latest version I could find before the 
> release date of Windows 10, but it hasn't changed anything. I prefer to keep 
> my music-related work on a Windows 8.1 machine but that can  change .
>
> What I am trying to do is this:
>
> I have a big "library" of small, simple tunes that are variables, named for 
> their name and reference.
> I have "compiled" the library and found errors, which I have corrected.
> Now I can create medleys and audition them much more quickly than otherwise 
> possible by referring to the pieces by their variable name.
> Like this .
>
> \version "2.18.2"
> % \include "C:\[lilify]\+progress\jukeboxpart1v2.ly"
> % \include "C:\[lilify]\+progress\jukeboxpart2v1.ly"
>
> "1K002-1a-_WILLIE_SHAW" = { \mark "1K002-1a-" \time 4/4 \key d\major { \time 
> 1/8 \partial 8  g''8 \time 4/4 fis''16 d''8. b'8. d''16 a'4 fis'4 fis'16 a'8. 
> d''8. fis''16 g''16 e''8. e''8. g''16 fis''16 d''8. b'8. d''16 a'4 fis'4 
> \time 7/8 fis'16 a'8. d''8. e''16 fis''16 d''8. d''8 \bar ":|." } }
> \score {
> {
> \key d\major
> \"1K002-1a-_WILLIE_SHAW"
> }
>
>  \layout { }
>
>   \midi { }
> }

Filename: /tmp/xxx.midi
MIDI format:  1 (one or more simultaneous tracks)
Divisions:1536 per whole note
#Tracks:  2

Track 1:
Time 0:
Text:   creator: 
Text:   LilyPond 2.25.12  
Time signature: 1/8, metronome 1/8
Marker: 1K002-1a-
Tempo:  100 msec/quarter
Time 192: 
Time signature: 4/4, metronome 1/4
Time 4800: 
Time signature: 7/8, metronome 1/8
Time 6144: 
End of Track

Track 2:
Time 0:
Track name: \new:
Key signature: D major
Note on: Channel 0, G5(79)@90
Time 192: 
Note off: Channel 0, G5(79)
Note on: Channel 0, Fis5(78)@90
Time 288: 
Note off: Channel 0, Fis5(78)
Note on: Channel 0, D5(74)@90
Time 576: 
Note off: Channel 0, D5(74)
Note on: Channel 0, B4(71)@90
Time 864: 
Note off: Channel 0, B4(71)
Note on: Channel 0, D5(74)@90
Time 960: 
Note off: Channel 0, D5(74)
Note on: Channel 0, A4(69)@90
Time 1344: 
Note off: Channel 0, A4(69)
Note on: Channel 0, Fis4(66)@90
Time 1728: 
Note off: Channel 0, Fis4(66)
Note on: Channel 0, Fis4(66)@90
Time 1824: 
Note off: Channel 0, Fis4(66)
Note on: Channel 0, A4(69)@90
Time 2112: 
Note off: Channel 0, A4(69)
Note on: Channel 0, D5(74)@90
Time 2400: 
Note off: Channel 0, D5(74)
Note on: Channel 0, Fis5(78)@90
Time 2496: 
Note off: Channel 0, Fis5(78)
Note on: Channel 0, G5(79)@90
Time 2592: 
Note off: Channel 0, G5(79)
Note on: Channel 0, E5(76)@90
Time 2880: 
Note off: Channel 0, E5(76)
Note on: Channel 0, E5(76)@90
Time 3168: 
Note off: Channel 0, E5(76)
Note on: Channel 0, G5(79)@90
Time 3264: 
Note off: Channel 0, G5(79)
Note on: Channel 0, Fis5(78)@90
Time 3360: 
Note off: Channel 0, Fis5(78)
Note on: Channel 0, D5(74)@90
Time 3648: 
Note off: Channel 0, D5(74)
Note on: Channel 0, B4(71)@90
Time 3936: 
Note off: Channel 0, B4(71)
Note on: Channel 0, D5(74)@90
Time 4032: 
Note off: Channel 0, D5(74)
Note on: Channel 0, A4(69)@90
Time 4416: 
Note off: Channel 0, A4(69)
Note on: Channel 0, Fis4(66)@90
Time 4800: 
Note off: Channel 0, Fis4(66)
Note on: Channel 0, Fis4(66)@90
Time 4896: 
Note off: Channel 0, Fis4(66)
Note on: Channel 0, A4(69)@90
Time 5184: 
Note off: Channel 0, A4(69)
Note on: Channel 0, D5(74)@90
Time 5472: 
Note off: Channel 0, D5(74)
Note on: Channel 0, E5(76)@90
Time 5568: 
Note off: Channel 0, E5(76)
Note on: Channel 0, Fis5(78)@90
Time 5664: 
Note off: Channel 0, Fis5(78)
Note on: Channel 0, D5(74)@90
Time 5952: 
Note off: Channel 0, D5(74)
Note on: Channel 0, D5(74)@90
Time 6144: 
Note off: Channel 0, D5(74)
End of Track

As you can see, the key signature is right with the content track (track
2) and right at the start.

You really need to figure out which part of your processing then loses
it.

-- 
David Kastrup



Re[2]: Feathered Beam Timing

2024-05-11 Thread Steph Phillips
So after a little toying around with the suggestions from this thread, 
I've come up with the following:




\once \override TupletNumber.text = \markup { \note-by-number #1 #0 #UP 
}

\once \override TupletBracket.bracket-visibility = ##t
\once \override TupletBracket.visible-over-note-heads = ##t
\once \override TupletBracket.Y-offset = #-1.5
\tupletUp \tuplet 6/8 {
\once \override Beam.grow-direction = #LEFT
\featherDurations 2/1 { d16[-. d-. d-. d-. d-. d]-. }
}



Pretty happy with how that looks, but now I'm having trouble converting 
it to a function. The following is what I've put together, but I can't 
seem to shake the compiler error.




\version "2.24.2"

customTuplet = #(define-music-function
  (parser location displayed-note y-off beam-left tuplet-up 
feather-ratio tuplet-ratio notes)

  (number? number? boolean? boolean? moment? moment? ly:music?)
   #{
 \once \override TupletNumber.text = \markup { \note-by-number 
#displayed-note #0 #UP }

 \once \override TupletBracket.bracket-visibility = ##t
 \once \override TupletBracket.visible-over-note-heads = ##t
 \once \override TupletBracket.Y-offset = #y-off
 \once \override Beam.grow-direction = #(if beam-left LEFT RIGHT)
 #(if tuplet-up
#{ \tupletUp \tuplet #tuplet-ratio {
 \featherDurations #feather-ratio { $notes }
   } #}
#{ \tupletDown \tuplet #tuplet-ratio {
 \featherDurations #feather-ratio { $notes }
   } #}
 )
   #})

\score {
  \relative c'' {
\time 4/4

\customTuplet #1 #-1.5 ##t ##t #(ly:make-moment 2/1) 
#(ly:make-moment 6/8) {

  d16[-. d-. d-. d-. d-. d]-.
}

\customTuplet #2 #-1.5 ##f ##f #(ly:make-moment 2/1) 
#(ly:make-moment 5/8) {

  e16[-. e-. e-. e-. e-. e]-.
}
  }
}






Re: Getting a function to accept a string or a markup

2024-05-11 Thread Lukas-Fabian Moser

Hi Vaughan,

Am 10.05.24 um 07:44 schrieb Vaughan McAlley:

Hi,

I have a text spanner function that shows a player that they are
playing in simultaneous rhythm with one or more other players. I
adapted it from code I used for indicating colouration in renaissance
music. It works fine, but if it begins on the last note of a line, and
the attached string is long, it can extend right to the edge of the
page (see picture attached).

What would be good is to be able to say

\sim \markup \left-column { "Vln 1," "Vln 2" }

if needed. Otherwise I could have it require a markup and get it to
concatenate within the function, but my Scheme skills are not up to
this...


Strings _are_ markups! So basically, it suffices to change the function
signature to:

#(define-music-function (annotation) (markup?)

This function still accepts strings! But when you call it with an actual
non-string markup, it fails because of

(string-append mySimBeginning annotation)

since such a markup can't be handled by string functions like
string-append. So simply replace this by the corresponding scheme macro
to concatenate markups:

#:concat (mySimBeginning annotation)

Lukas




Re: Solving espressivo problem

2024-05-11 Thread Lukas-Fabian Moser

Here’s one approach:

%%%  SNIPPET BEGINS
\version "2.25.11"

esp = \markup \lower #1 \scale #'(1.375 . 1) \musicglyph #"scripts.espr"

stuff = \relative {
\time 4/4
  r4 b'4 a2-\tweak self-alignment-X #-1.25 _\esp ~
  a2 b4 4(
  c1)-\tweak self-alignment-X #-0.5 _\esp
  b2-\tweak self-alignment-X #-1.125 _\esp d2
  c1-\tweak self-alignment-X #-0.5 _\esp
 \bar "|"
}

\score {
<<
\new Staff
\stuff
>>
}%
%%  SNIPPET ENDS


Or equivalently, saving some keystrokes:

%%%  SNIPPET BEGINS
\version "2.25.9"

esp = _\markup \lower #1 \scale #'(1.375 . 1) \musicglyph #"scripts.espr"

shift = \tweak self-alignment-X \etc

stuff = \relative {
   \time 4/4
 r4 b'4 a2\shift -1.25 \esp ~
 a2 b4 4(
 c1)\shift -0.5 \esp
 b2\shift -1.125 \esp d2
 c1\shift -0.5 \esp
    \bar "|"
}

\score {
   <<
   \new Staff
   \stuff
   >>
}%
%%  SNIPPET ENDS

Lukas


Re: Solving espressivo problem

2024-05-11 Thread Kieren MacMillan
Hi Mats,

> On May 11, 2024, at 11:51 AM, Mats Bengtsson  wrote:
> I would rather do something like the following

I started down that path, but when I saw that the output was

I realized it would take far too much manual tweaking to make it visually 
attractive, whereas my \esp version gives

with only the need to set the self-alignment-X value.

TBH, I also couldn’t remember when \after was added to the code, and since the 
OP had used \version "2.24.3”, I didn’t want to risk it not working for them.  
:)

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.



Re: Solving espressivo problem

2024-05-11 Thread Mats Bengtsson


  
  


On 2024-05-11 15:18, Kieren MacMillan
  wrote:


  Hi Morten,

Here’s one approach:

%%%  SNIPPET BEGINS
\version "2.25.11"

esp = \markup \lower #1 \scale #'(1.375 . 1) \musicglyph #"scripts.espr"

stuff = \relative {
   \time 4/4
 r4 b'4 a2-\tweak self-alignment-X #-1.25 _\esp ~
 a2 b4 4(
 c1)-\tweak self-alignment-X #-0.5 _\esp
 b2-\tweak self-alignment-X #-1.125 _\esp d2
 c1-\tweak self-alignment-X #-0.5 _\esp
\bar "|"
}

\score {
   <<
   \new Staff
   \stuff
   >>
}%
%%  SNIPPET ENDS

This requires some manual effort (read: trial and error), but could probably be fairly easily automated.

Of course there are many other ways to clothe this particular cat — just thought I’d offer one for you to consider!

I would rather do something like the following: 

\version "2.24.3"
  
  stuff = \relative {
      \time 4/4
    r4 b'4 a2~\< |
    \after 4. \! a2\> b4 4( |
    \after 2 \> c1 \< ) |
    b2\< c2\> |
    \after 2 \> c1 \< |
    b4\< c2 \> b4 |
    <>\!
  }
  
  \score {
      <<
      \new Staff
      \stuff
  
      >>
      \layout {
      \context {
      \Staff
  
      }
  
      }
  } 

Let me highlight some of the changes I made to your example, on
  top of using \after to start a diminuendo in the middle of a note:
- Added bar line checks and line breaks at the end of each bar.
  This is a good habit that will help you to navigate and help
  LilyPond assist you in finding rhythmic typos.
- A previous (de-)crescendo is automatically ended when there's a
  new dynamic indication, so there's no need for an explicit \! just
  before a \>, for example. As an extra bonus, a \< or \>
  that's ended at the first note of the next bar is automatically
  ended at the bar line by default (but this can easily be changed
  with to-barline, if you indeed want it to extend at the next note
  instead, see
https://lilypond.org/doc/v2.24/Documentation/notation/expressive-marks-attached-to-notes#dynamics).
  

   /Mats



  




Re: Feathered Beam Timing

2024-05-11 Thread Archer Endrich

Hello,

I have frequently encountered the situation where I want to have 
feathered durations within a specified duration -- e.g., a crotchet, or 
a minim, or a breve.  This is the code I've come up with:


\once \override Beam.grow-direction = #RIGHT
  \featherDurations #(ly:make-moment 1/2)
  \tuplet 6/8 {a'16^\markup{\small{( \note {2} #UP )}}\p\<[( g' a' b' 
c'' d'')]}

  \once \override Beam.grow-direction = #'()
  |

The use of the tuplet helps to indicate the number of notes in the 
figure.  In this case, 6 semiquaver notes are to be played with the time 
of 8 semiquavers (and feathered) to fill out a minim duration.  This 
minim is shown above the figure in parentheses using markup, to confirm 
to the player the duration to be filled.


Here is another example in which 8 notes are played in the time of 8 
semiquavers, but feathered.


 \once \override Beam.grow-direction = #RIGHT
    \featherDurations #(ly:make-moment 1/2)
    \tuplet 8/8 {a'16^\markup{\small{( \note {2} #UP )}}\p[( b' c'' b' 
c'' d'' c'' b')]}

  \once \override Beam.grow-direction = #'() |

And another, in which 8 notes are feathered within a breve (whole note) :

 \once \override Beam.grow-direction = #RIGHT
  \featherDurations #(ly:make-moment 1/2)
  \tuplet 8/16 {e''!16^\markup{\small{( \note {1} #UP )}}\p\<[( e'' 
e'' e''\!) e''\>( e'' e'' e''\!)]}

  \once \override Beam.grow-direction = #'()

The tuplet is 8/16 because it takes 16 normal semiquavers to fill four 
beats and there are only 8 notes.


This score was done with version 2.22.0 and compiles OK.  I hope this 
helps, but if anything is incorrect or could be improved, I trust the 
list to comment.


Archer


On 11/05/2024 15:06, N. Andrew Walsh wrote:

Hi Steph,

I'm not an expert with the \featherDurations interface, but this:

On Sat, May 11, 2024 at 3:53 PM Steph Phillips 
 wrote:



\once \override Beam.grow-direction = #LEFT
\featherDurations 6/4 { d16[-. d-. d-. d-. d-. d]-. } |

seems to disagree with how the tutorial describes it: 
https://lilypond.org/doc/v2.25/Documentation/notation/feathered-beams


There, that ratio (*unlike* with tuplets) describes the ratio in 
duration between the first and last value of the feathered 
group, *not* their relationship to unmodified durations. So if you 
wanted the first note to be a sixteenth and the last to be an eighth, 
you'd use "2/1". I don't know how you'd get six sixteenths to fit 
within the duration of a half note, though, as the feathered interface 
doesn't seem to account for tuplet-like durations. Or, at least, it 
doesn't seem to be documented. Maybe you'd have to nest one inside the 
other? Something like

--
\tuplet 6/8 {
\once \override Beam.grow-direction = #LEFT
\featherDurations 2/1 { d16[-. d-. d-. d-. d-. d]-. }
}
--
(the stickler in me would complain that tuplets should always indicate 
a shortening of length, and this is technically putting six sixteenths 
in the space of eight, but I guess the feathering overrules that)


Anyway, maybe that helps?

Cheers,

A




Re: Key signatures in MIDI output

2024-05-11 Thread Giles Boardman
You are, of course, right. Your evidence is clear. The position of the \key 
command seems a strong candidate but I can't get it into the .MID even in the 
simplest of snippet.

As I mentioned I also have other behaviour I can't explain so it could also be 
version related. I reinstalled the latest version I could find before the 
release date of Windows 10, but it hasn't changed anything. I prefer to keep my 
music-related work on a Windows 8.1 machine but that can  change .

What I am trying to do is this:

I have a big "library" of small, simple tunes that are variables, named for 
their name and reference.
I have "compiled" the library and found errors, which I have corrected.
Now I can create medleys and audition them much more quickly than otherwise 
possible by referring to the pieces by their variable name.
Like this .

\version "2.18.2"
% \include "C:\[lilify]\+progress\jukeboxpart1v2.ly"
% \include "C:\[lilify]\+progress\jukeboxpart2v1.ly"

"1K002-1a-_WILLIE_SHAW" = { \mark "1K002-1a-" \time 4/4 \key d\major { \time 
1/8 \partial 8  g''8 \time 4/4 fis''16 d''8. b'8. d''16 a'4 fis'4 fis'16 a'8. 
d''8. fis''16 g''16 e''8. e''8. g''16 fis''16 d''8. b'8. d''16 a'4 fis'4 \time 
7/8 fis'16 a'8. d''8. e''16 fis''16 d''8. d''8 \bar ":|." } }
\score {
{
\key d\major
\"1K002-1a-_WILLIE_SHAW"
}

 \layout { }

  \midi { }
}

or without the variable, but with the includes activated - the first one 
contains "1K002-1a-_WILLIE_SHAW" and its notes etc.


I have also explicitly pasted the notes into the score:

\version "2.18.2"
% \include "C:\[lilify]\+progress\jukeboxpart1v2.ly"
% \include "C:\[lilify]\+progress\jukeboxpart2v1.ly"

\score {

 { \mark "1K002-1a-" { \time 4/4 \key d\major \time 1/8 \partial 8  g''8 \time 
4/4 fis''16 d''8. b'8. d''16 a'4 fis'4 fis'16 a'8. d''8. fis''16 g''16 e''8. 
e''8. g''16 fis''16 d''8. b'8. d''16 a'4 fis'4 \time 7/8 fis'16 a'8. d''8. 
e''16 fis''16 d''8. d''8 \bar ":|." } }
}

 \layout { }

  \midi { }
}

With and without the braces and with and without my \time to mimic anacrusis 
for the benefit of Cakewalk - ideally, I'd like to hide them but haven't 
figured that out.

Lastly, I've taken all the \key and \time out of the explicit notes

\version "2.18.2"
% \include "C:\[lilify]\+progress\jukeboxpart1v2.ly"
% \include "C:\[lilify]\+progress\jukeboxpart2v1.ly"

\score {
\time 4/4
\key d\major
 { \mark "1K002-1a-" {  \partial 8  g''8  fis''16 d''8. b'8. d''16 a'4 fis'4 
fis'16 a'8. d''8. fis''16 g''16 e''8. e''8. g''16 fis''16 d''8. b'8. d''16 a'4 
fis'4 fis'16 a'8. d''8. e''16 fis''16 d''8. d''8 \bar ":|." } }
}

 \layout { }

  \midi { }
}

I read that SectionLabel and other marks are supported in MIDI output, but I 
can't get Section Label to work at all, and my \mark doesn't come through and 
neither does the default rehearsal mark, which appears in the layout. I've also 
failed in other attempts to get the same effect by other means (not necessarily 
for MIDI) like instrumentName =

Thanks again for your support.


From: msk...@ansuz.sooke.bc.ca 
Sent: 11 May 2024 15:46
To: Giles Boardman 
Cc: Hans Åberg ; lilypond-user@gnu.org 

Subject: Re: Key signatures in MIDI output

On Sat, 11 May 2024, Giles Boardman wrote:

> I have now been more systematic in my approach and conclude that \key is not
> reflected in MIDI output. I tried various positions for events and in each

Well, it definitely is reflected in the output in my own tests.  The
example code I posted, when run through Lilypond 2.24.1, produces a MIDI
file containing key change events.  There may be some relevant
distinctions in terms of which version of Lilypond you're running and
exactly where you put the \key commands in the input.

--
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/


Re: Key signatures in MIDI output

2024-05-11 Thread mskala
On Sat, 11 May 2024, Giles Boardman wrote:

> I have now been more systematic in my approach and conclude that \key is not
> reflected in MIDI output. I tried various positions for events and in each

Well, it definitely is reflected in the output in my own tests.  The
example code I posted, when run through Lilypond 2.24.1, produces a MIDI
file containing key change events.  There may be some relevant
distinctions in terms of which version of Lilypond you're running and
exactly where you put the \key commands in the input.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/



Re: Feathered Beam Timing

2024-05-11 Thread N. Andrew Walsh
Hi Steph,

I'm not an expert with the \featherDurations interface, but this:

On Sat, May 11, 2024 at 3:53 PM Steph Phillips 
wrote:

>
> \once \override Beam.grow-direction = #LEFT
> \featherDurations 6/4 { d16[-. d-. d-. d-. d-. d]-. } |
>
seems to disagree with how the tutorial describes it:
https://lilypond.org/doc/v2.25/Documentation/notation/feathered-beams

There, that ratio (*unlike* with tuplets) describes the ratio in duration
between the first and last value of the feathered group, *not* their
relationship to unmodified durations. So if you wanted the first note to be
a sixteenth and the last to be an eighth, you'd use "2/1". I don't know how
you'd get six sixteenths to fit within the duration of a half note, though,
as the feathered interface doesn't seem to account for tuplet-like
durations. Or, at least, it doesn't seem to be documented. Maybe you'd have
to nest one inside the other? Something like
--
\tuplet 6/8 {
\once \override Beam.grow-direction = #LEFT
\featherDurations 2/1 { d16[-. d-. d-. d-. d-. d]-. }
}
--
(the stickler in me would complain that tuplets should always indicate a
shortening of length, and this is technically putting six sixteenths in the
space of eight, but I guess the feathering overrules that)

Anyway, maybe that helps?

Cheers,

A


Re: Key signatures in MIDI output

2024-05-11 Thread David Kastrup
msk...@ansuz.sooke.bc.ca writes:

> On Sat, 11 May 2024, Giles Boardman wrote:
>
>> When I create MIDI output from Lilypond, if I have imported a MIDI file and
>> then resaved it with changes made in LilyPond, the output is like that, too.
>
> Lilypond as such does not import MIDI files.  I think you must be using
> some piece of software other than Lilypond, and that is relevant to the
> issues you're experiencing.
>
> On the off chance that you might be using midi2ly, I tried round-tripping
> my example code through that, and got suggestive results.

A good viewer of MIDI file content is

lilymidi --pretty

followed by the MIDI file name on the command line.

-- 
David Kastrup



Re: Solving espressivo problem

2024-05-11 Thread Kieren MacMillan
Hi Morten,

Here’s one approach:

%%%  SNIPPET BEGINS
\version "2.25.11"

esp = \markup \lower #1 \scale #'(1.375 . 1) \musicglyph #"scripts.espr"

stuff = \relative {
   \time 4/4
 r4 b'4 a2-\tweak self-alignment-X #-1.25 _\esp ~
 a2 b4 4(
 c1)-\tweak self-alignment-X #-0.5 _\esp
 b2-\tweak self-alignment-X #-1.125 _\esp d2
 c1-\tweak self-alignment-X #-0.5 _\esp
\bar "|"
}

\score {
   <<
   \new Staff
   \stuff
   >>
}%
%%  SNIPPET ENDS

This requires some manual effort (read: trial and error), but could probably be 
fairly easily automated.

Of course there are many other ways to clothe this particular cat — just 
thought I’d offer one for you to consider!

Best,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Key signatures in MIDI output

2024-05-11 Thread Giles Boardman
Thank you for your efforts, Matt, and everyone else who has spent any time 
looking into this.

To answer Matt, I did use Midi2ly by way of Frescobaldi and I must also have 
previously found a way to run a command line batch (if only a repetitive list) 
because I have way to many files to have done it manually and they don't have 
names I would have chosen.

I absolutely understand that LilyPond is not intended as a MIDI editor, but 
it's a pretty good one in a lot of ways. I am more productive on the MIDI side 
as well as the publishing side when using some of its features, hence my 
questions are about what LilyPond can and cannot do, rather than asking for it 
to do things it isn't intended for.

The scope of its intended use is also hard to limit! I just read a script that 
conditionally determines layout based on content, which is pretty advanced for 
a "mere" engraver!

I have now been more systematic in my approach and conclude that \key is not 
reflected in MIDI output. I tried various positions for events and in each case 
I got Time Signature information in my MID file but not Key Signature when 
viewed in Staff View.

But the conclusive evidence  for me is that when I use MIDIDSM to create a TXT 
file the Time Sig event is missing.
I must have been mistaken in thinking I had seen the information in some output 
and not in other.

My apologies.







From: msk...@ansuz.sooke.bc.ca 
Sent: 11 May 2024 13:40
To: Giles Boardman 
Cc: Hans Åberg ; lilypond-user@gnu.org 

Subject: Re: Key signatures in MIDI output

On Sat, 11 May 2024, Giles Boardman wrote:

> When I create MIDI output from Lilypond, if I have imported a MIDI file and
> then resaved it with changes made in LilyPond, the output is like that, too.

Lilypond as such does not import MIDI files.  I think you must be using
some piece of software other than Lilypond, and that is relevant to the
issues you're experiencing.

On the off chance that you might be using midi2ly, I tried round-tripping
my example code through that, and got suggestive results.

I take this code:

\score {
\new Voice {
  \key c \major
  c'4 d'4 e'4 f'4 |
  \key d \minor
  bes4 a4 g4 f4 |
}
\layout { }
\midi { }
}

and run it through Lilypond to get a MIDI file.  Then I take the resulting
MIDI file, which contains key changes at the marked locations, and run it
through midi2ly.  The result is a complicated mess, 74 lines long.  If I
run *that*, the midi2ly output, through Lilypond a second time to get a
PDF file, then the PDF file shows a D-minor key signature at the start of
each of the two bars, no C-major at all.

That seems like it could be relevant to the complaint of Lilypond losing
key changes.  It seems to come about because the control track in the MIDI
file translates into a silent voice in the midi2ly output, and that voice
has a D-minor key signature at the start which overrides the C-major key
signature in the other voice.  But it's an issue on *input*, in that
midi2csv is creating an unusual file structure, nothing to do with MIDI
output or the Lilypond program itself.

I think it's important to understand that Lilypond is not a MIDI file
editor.  MIDI files in Lilypond are treated as final output (much like PDF
files), not as an editable format.

To start with a MIDI file, "import" it with midi2ly, edit the resulting
Lilypond code, and then "resave" it with Lilypond, is not the usual
workflow and is likely to cause problems even if there is some technical
possibility of doing it.  "Importing" and "resaving" are not ordinarily
done with Lilypond.  The intended use of Lilypond is in a one-way flow
from ideas to *.ly source code to PDF or MIDI output, and the midi2ly
utility which creates an exception to that flow is intended only to be
used once, to produce a file parts of which can be cut and pasted into a
new Lilypond source file.  Repeated round-trips between MIDI and Lilypond
source format are asking for trouble.

Of course, you may not actually be using midi2ly at all, in which case the
above is irrelevant.  I'm only guessing based on your description of
"importing" a MIDI file, which stands out as an unusual (indeed,
impossible) thing to do with the main Lilypond program.

--
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/


Re: Key signatures in MIDI output

2024-05-11 Thread mskala
On Sat, 11 May 2024, Giles Boardman wrote:

> When I create MIDI output from Lilypond, if I have imported a MIDI file and
> then resaved it with changes made in LilyPond, the output is like that, too.

Lilypond as such does not import MIDI files.  I think you must be using
some piece of software other than Lilypond, and that is relevant to the
issues you're experiencing.

On the off chance that you might be using midi2ly, I tried round-tripping
my example code through that, and got suggestive results.

I take this code:

\score {
\new Voice {
  \key c \major
  c'4 d'4 e'4 f'4 |
  \key d \minor
  bes4 a4 g4 f4 |
}
\layout { }
\midi { }
}

and run it through Lilypond to get a MIDI file.  Then I take the resulting
MIDI file, which contains key changes at the marked locations, and run it
through midi2ly.  The result is a complicated mess, 74 lines long.  If I
run *that*, the midi2ly output, through Lilypond a second time to get a
PDF file, then the PDF file shows a D-minor key signature at the start of
each of the two bars, no C-major at all.

That seems like it could be relevant to the complaint of Lilypond losing
key changes.  It seems to come about because the control track in the MIDI
file translates into a silent voice in the midi2ly output, and that voice
has a D-minor key signature at the start which overrides the C-major key
signature in the other voice.  But it's an issue on *input*, in that
midi2csv is creating an unusual file structure, nothing to do with MIDI
output or the Lilypond program itself.

I think it's important to understand that Lilypond is not a MIDI file
editor.  MIDI files in Lilypond are treated as final output (much like PDF
files), not as an editable format.

To start with a MIDI file, "import" it with midi2ly, edit the resulting
Lilypond code, and then "resave" it with Lilypond, is not the usual
workflow and is likely to cause problems even if there is some technical
possibility of doing it.  "Importing" and "resaving" are not ordinarily
done with Lilypond.  The intended use of Lilypond is in a one-way flow
from ideas to *.ly source code to PDF or MIDI output, and the midi2ly
utility which creates an exception to that flow is intended only to be
used once, to produce a file parts of which can be cut and pasted into a
new Lilypond source file.  Repeated round-trips between MIDI and Lilypond
source format are asking for trouble.

Of course, you may not actually be using midi2ly at all, in which case the
above is irrelevant.  I'm only guessing based on your description of
"importing" a MIDI file, which stands out as an unusual (indeed,
impossible) thing to do with the main Lilypond program.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/



Re: Key signatures in MIDI output

2024-05-11 Thread Hans Åberg



> On 10 May 2024, at 22:21, msk...@ansuz.sooke.bc.ca wrote:
> 
> On Fri, 10 May 2024, Hans Åberg wrote:
> 
>>> signature.  The MIDI file does not contain that information; it is up to
>>> whatever software reads the MIDI file, to display it appropriately.
>> 
>> So to go back to staff notation from MIDI, one must know what enharmonic
>> equivalences that have been applied.
> 
> Yes - and it's not Lilypond that does that step, so if the translation
> back to staff notation is not as desired, there's little that can be done
> within Lilypond to fix it.

On traditional meantone keyboards with 12 keys per octave, a common way to 
chose the notes are, expressed in iterated fifths:
  E♭ B♭ F C G D A E B F♯ C♯ G♯

One could indicate a note, like A, and from that, get 6 fifths down and 5 
fifths up.





Re: Solving espressivo problem

2024-05-11 Thread morten

mor...@borchorst.eu skrev den 2024-05-11 11:40:

Dear list

 I am trying to solve this  problem about espressivos that stretches 
over four beats. I have tried many versions but not seems to solve it

The c1 and the b4 c2 b4 bars work as I hoped for.
the b2 c2 bar and the a2~ a2 does not give the wished for results.
Can anybody help?

*
\version "2.24.3"

stuff = \relative {
\time 4/4
  r4 b'4 a2~\< <>\! a2\> <>\! b4 4( c1\espressivo) b2\< <>\!\> c2\! 
c1\espressivo b4\< c2\!\> b4\!

 \bar "|"
}

\score {
<<
\new Staff
\stuff

>>
\layout {
\context {
\Staff

}

}
}
*


thanks
Morten

Now with image attached :/

Re: Key signatures in MIDI output

2024-05-11 Thread David Kastrup
Giles Boardman  writes:

> However, when I create new files, I am getting output that is as if I
> have chosen to write everything in C major, with all the flats and
> sharps shown explicitly. Nevertheless, the screen and pdf output are
> written in, for example G, with no sharps on the individual fis notes.

This is when further discussion becomes pointless without an actual
example illustrating the problem.

-- 
David Kastrup



Solving espressivo problem

2024-05-11 Thread morten

Dear list

 I am trying to solve this  problem about espressivos that stretches 
over four beats. I have tried many versions but not seems to solve it

The c1 and the b4 c2 b4 bars work as I hoped for.
the b2 c2 bar and the a2~ a2 does not give the wished for results.
Can anybody help?

*
\version "2.24.3"

stuff = \relative {
\time 4/4
  r4 b'4 a2~\< <>\! a2\> <>\! b4 4( c1\espressivo) b2\< <>\!\> c2\! 
c1\espressivo b4\< c2\!\> b4\!

 \bar "|"
}

\score {
<<
\new Staff
\stuff

>>
\layout {
\context {
\Staff

}

}
}
*


thanks
Morten



Re: Key signatures in MIDI output

2024-05-11 Thread Giles Boardman
The issue is consistency and I'm perhaps not using the terms precisely enough 
to describe what I am seeing.

I understand about MIDI notes  and that they are neither sharpened not 
flattened, but each has their own value.

In my sequencer (Cakewalk ProAudio 9), if my piece has a Key Signature event in 
the .MIDI (I'm not talking about a Cakewalk format file) file of "G", I see a 
staff with an F sharp at the beginning of the staff and no sharp signs on Fs in 
the piece.

When I create MIDI output from Lilypond, if I have imported a MIDI file and 
then resaved it with changes made in LilyPond, the output is like that, too.

However, when I create new files,  I am getting output that is as if I have 
chosen to write everything in C major, with all the flats and sharps shown 
explicitly. Nevertheless, the screen and pdf output are written in, for example 
G, with no sharps on the individual fis notes.

So ,what appears to me to be happening is I have written code that works for 
layout {} but just this aspect of it is ignored by midi {}
But I am new to LilyPond so that deduction may be nonsense. I have much more 
experience of MIDI files and have been using the same software for many years 
and am aware of its idiosyncracies.

In LilyPond,  I have other similar issues which suggest to me I am making a 
bigger, more fundamental mistake in my coding, so I will investigate that 
before asking for any more help and in that case I will bring the necessary 
snippets to the forum.

Thanks for your interest.




From: msk...@ansuz.sooke.bc.ca 
Sent: 10 May 2024 21:21
To: Hans Åberg 
Cc: Giles Boardman ; lilypond-user@gnu.org 

Subject: Re: Key signatures in MIDI output

On Fri, 10 May 2024, Hans Åberg wrote:

> > signature.  The MIDI file does not contain that information; it is up to
> > whatever software reads the MIDI file, to display it appropriately.
>
> So to go back to staff notation from MIDI, one must know what enharmonic
> equivalences that have been applied.

Yes - and it's not Lilypond that does that step, so if the translation
back to staff notation is not as desired, there's little that can be done
within Lilypond to fix it.

--
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/