Re: Persian music package

2021-07-31 Thread Jean Abou Samra

Le 01/08/2021 à 00:54, Thomas Morley a écrit :

No idea why "glyph-name-alist" was not converted to
"alteration-glyph-name-alist" (an oversight?), had to do it manually.


Runnning convert-ly from 2.23.3 on this file, I
get the conversion correctly… Not sure why it didn't
work for you?

Cheers,
Jean



Re: Custom note names, or meta-score?

2021-07-31 Thread Craig Comstock
Wow. That is a bunch of code generated quick! Nice!

FWIW, I am using the osx version from here: 
https://gitlab.com/marnen/lilypond-mac-builder/-/releases 
 as this one 
https://lilypond.org/download/binaries/darwin-x86/lilypond-2.22.1-1.darwin-x86.tar.bz2
 

 didn’t work I’m pretty sure. So I have v2.20.0.

Both work quite well but Jean’s doesn’t seem to respond to rhythmic values?

{ astaccato16 astaccato astaccato8 aaccent bstaccato }
 



Aaron’s seems to work with rhythmic values

{ qw4 qw8 qw qw qw er2 er16 er ty qw ty }




Maybe I am not quite doing things right?

Regardless I have something that I think will work for me. Thanks!!! I am very 
impressed with this community.

Excited to get to work composing instead of programming. I am easily distracted 
by programming because it is so interesting and fun.

Cheers,
Craig

Re: incomplete tuplets

2021-07-31 Thread David Zelinsky
Aaron Hill  writes:

> On 2021-07-31 2:44 pm, David Zelinsky wrote:
>> The suggested notation for this was to use a quintuplet bracket that
>> was
>> open on the right, and extended slightly beyond the second notehead, or
>> beyond the beam.  See attached.
>>
>> Is there a sensible way to do that in Lilypond?  I've searched
>> around in
>> the documentation but haven't found anything.
>
> Not a perfect replica, but hopefully a start:
>
> 
> \version "2.22.0"
>
> \fixed c'' {
>   \time 2/20
>   #(ly:expect-warning "strange time signature")
>   \once \override TupletBracket.bracket-visibility = ##t
>   \once \override TupletBracket.edge-height = #'(0.7 . 0)
>   \once \override TupletBracket.shorten-pair = #'(0 . -1)
>   \once \override TupletBracket.padding = 3
>   \tuplet 5/4 { a16[ bes16] }
>   \time 4/8
>   r8
> }
> 
>
> -- Aaron Hill


Thanks!  I knew there had to be some magic like that!

-David



Re: incomplete tuplets

2021-07-31 Thread Aaron Hill

On 2021-07-31 2:44 pm, David Zelinsky wrote:
The suggested notation for this was to use a quintuplet bracket that 
was

open on the right, and extended slightly beyond the second notehead, or
beyond the beam.  See attached.

Is there a sensible way to do that in Lilypond?  I've searched around 
in

the documentation but haven't found anything.


Not a perfect replica, but hopefully a start:


\version "2.22.0"

\fixed c'' {
  \time 2/20
  #(ly:expect-warning "strange time signature")
  \once \override TupletBracket.bracket-visibility = ##t
  \once \override TupletBracket.edge-height = #'(0.7 . 0)
  \once \override TupletBracket.shorten-pair = #'(0 . -1)
  \once \override TupletBracket.padding = 3
  \tuplet 5/4 { a16[ bes16] }
  \time 4/8
  r8
}


-- Aaron Hill

incomplete tuplets

2021-07-31 Thread David Zelinsky
Recently there was a discussion on the Music Engraving Tips facebook
group involving a non-dyadic time signature, that required notating a
*pair* of quintuplet 16th notes, without the rest of the quintuplet.
It's not that there were rests for the other three.  The measure just
ended after the first two.

The suggested notation for this was to use a quintuplet bracket that was
open on the right, and extended slightly beyond the second notehead, or
beyond the beam.  See attached.

Is there a sensible way to do that in Lilypond?  I've searched around in
the documentation but haven't found anything.

I don't want to debate the merits of this notation--I have my own doubts
about it.  I'm just curious how to do such a thing in Lilypond.

-David




Re: \shiftDurations

2021-07-31 Thread Jean Abou Samra

Le 29/07/2021 à 05:23, Kees van den Doel a écrit :

Is there a way to do a \shiftDurations of 2/3?
I have a voice with almost all dotted minims and semibreves {c2. c1. } 
in 6/2 and want to change to 2/2 and use \scaleDurations to make it fit.


I would not be surprised by "no" as there are a few "minim semiminim" 
 like {e2 d4 c2.} occurrences which would have to be changed to triplets.


Thanks,
Kees



Hello,

\shiftDurations happily accepts a negative second argument,
like: \shiftDurations 0 -1 { c1. }  If there are not enough
dots, it just brings the number of dots to zero.

It is unclear to me how one could do better given that

\tuplet 3/2 { c8 d e c d e }

and

{ \tuplet 3/2 { c8 d e } \tuplet 3/2 { c d e } }

are different things in spite of all notes having the
same played durations.

So perhaps use tags to convert the non-dotted to
triplets manually?

Regards,
Jean




Re: Custom note names, or meta-score?

2021-07-31 Thread Karlin High

On 7/31/2021 3:47 PM, Aaron Hill wrote:

It is funny how similar our approaches were.


Great minds, y'know... :APPLAUSE:
--
Karlin High
Missouri, USA



Re: Custom note names, or meta-score?

2021-07-31 Thread Aaron Hill

On 2021-07-31 1:32 pm, Jean Abou Samra wrote:

This is perfectly doable, but not as simple as defining a
custom language for pitches, because the languages map note
names to mere pitches, and not full-fledged notes that can
contain articulations. Therefore, the code below arrives at
the end result via two steps, first mapping the note names
to dummy pitches chosen to be unique, then replacing those
with the real pitches, adding the articulations at the
same time.


Sigh... you got there before me.  :)

It is funny how similar our approaches were.


-- Aaron Hill



Re: Custom note names, or meta-score?

2021-07-31 Thread Aaron Hill

On 2021-07-31 10:43 am, Craig Comstock wrote:

So said another way, I’d like to write a meta-score like { aa4 aa2 aa
aa ab ab ab ac ac ca ca } and those note names relate to a set of
pitches determined maybe in another file (not code hopefully) so that
as the pitches are chosen/changed it is easy to regenerate the
score/parts.


The following (minimally-tested) proof-of-concept should get you pretty 
close to your goal:



\version "2.22.0"

#(define generic-notes '())

defineGenericNote =
#(begin
  (define (note-event? arg)
   (and (ly:music? arg)
(music-is-of-type? arg 'note-event)))
  (define-void-function (name music) (symbol? note-event?)
   (if (ly:assoc-get name generic-notes #f)
(ly:input-warning (*location*)
 "note name ~s is already defined" name)
(set! generic-notes (cons (cons name music) generic-notes)

registerGenericLanguage =
#(define-void-function () ()
  (define pitch-names
   (let ((len (length generic-notes)))
(cons 'generic
 (map (lambda (n idx)
   ;; Encode index within alteration.
   (cons (car n) (ly:make-pitch 0 0 (/ idx len
  generic-notes (iota len)
  (set! language-pitch-names (cons pitch-names language-pitch-names)))

fixupGenericMusic =
#(define-music-function (music) (ly:music?)
  (define (fixup! m)
   (let* ((pitch (ly:music-property m 'pitch))
  (oct (ly:pitch-octave pitch))
  (alt (ly:pitch-alteration pitch))
  (idx (numerator alt))
  (note (cdr (list-ref generic-notes idx
;; Adjust pitch, applying octave transposition.
(ly:music-set-property! m 'pitch
 (ly:pitch-transpose
  (ly:music-property note 'pitch)
  (ly:make-pitch oct 0 0)))
;; Merge articulations.
(ly:music-set-property! m 'articulations
 (append (ly:music-property note 'articulations '())
 (ly:music-property m 'articulations '(
;; Merge tweaks.
(ly:music-set-property! m 'tweaks
 (append (ly:music-property note 'tweaks '())
 (ly:music-property m 'tweaks '())
  (map fixup! (extract-typed-music music 'note-event))
  music)

toplevel-music-functions =
#(cons fixupGenericMusic toplevel-music-functions)

% NOTE: Pitches here use the current \language setting.
\defineGenericNote qw d'
\defineGenericNote er d'-.
\defineGenericNote ty \tweak font-size -3 fis'

\registerGenericLanguage
\language "generic"

{ qw4 er2 ty8->  }


Each generic note name is mapped to a note event that specifies the 
desired pitch along with tweaks and articulations.  Target pitches need 
not be unique.


As an implementation detail, a generic note is associated with a 
placeholder pitch with a special alteration value for looking up the 
reference note event.  A top-level handler is installed that processes 
music to convert these temporary pitches into the correct ones while 
merging tweaks and articulations.  As shown above with qw', the 
reference pitch can be shifted by octave as needed.


Chords mostly work, however certain articulations need to be applied to 
the chord-event rather than individual notes.  Additional logic is 
needed to support chords fully, and it might be useful for generic note 
names to be chords as well.


Key signatures do not support the generic note names as they are 
processed before the top-level handler.  For now, you would have to 
manually specify the pitch:



\key #(ly:make-pitch 0 1 0) \major   %{ equiv. to \key d \major %}


-- Aaron Hill

Re: Problem

2021-07-31 Thread Jean Abou Samra




Le 30/07/2021 à 16:28, ole a écrit :

I'am a little confused- some years ago topposting was not much appreciated  in 
this mailing-list, has that changed?
Just installed an old version of Lilypond (2.19.83) and everything works fine 
again!
Could it be that the latest version is not working properly on Mac OS X.14.6 
(aka 'Mojave')?
Are there other Mac users who can confirm this?

thanks!


It was reported some time ago, with a workaround:

https://gitlab.com/lilypond/lilypond/-/issues/6143

The problem with such issues is that very few developers are running Mac 
OS, making debugging hard.


Best,
Jean



Re: Custom note names, or meta-score?

2021-07-31 Thread Jean Abou Samra

Le 31/07/2021 à 19:43, Craig Comstock a écrit :

Hello,

I am writing a piece for a 9 piece ensemble in which I want the 
players to choose 9 different pitches along with articulations and/or 
other additional symbols to indicate extended techniques and such. I 
want to take those 81 different “glyphs” if you will and generate a 
score and parts. The part I specify as the composer is only rhythm and 
which glyph to use.


I would like to bring along the pitch level and say stocatto, accent, 
things like that but keep them separated from rhythm.


So say ‘aa’ is middle C stocatto I could write { aa4 aa2 aa aa } which 
would be the same as { c’4-. c2-. c-. c-. }


At first I thought I might just use variables like

aa = { ‘c }
{ \aa4 \aa2 \aa \aa }

But that didn’t parse and is also an extra backslash and such I’d 
rather not have in there if possible.


So said another way, I’d like to write a meta-score like { aa4 aa2 aa 
aa ab ab ab ac ac ca ca } and those note names relate to a set of 
pitches determined maybe in another file (not code hopefully) so that 
as the pitches are chosen/changed it is easy to regenerate the 
score/parts.


So maybe something near 
https://gitlab.com/lilypond/lilypond/-/blob/master/scm/define-note-names.scm 
 I 
could add in a list of pitch names from another file included in the 
score somehow?


Thanks!
Craig



Hello,

This is perfectly doable, but not as simple as defining a
custom language for pitches, because the languages map note
names to mere pitches, and not full-fledged notes that can
contain articulations. Therefore, the code below arrives at
the end result via two steps, first mapping the note names
to dummy pitches chosen to be unique, then replacing those
with the real pitches, adding the articulations at the
same time.


\version "2.22.1"

%% Code

#(define note-name-to-dummy-pitch-alist '())
#(define dummy-pitch-to-note-table (make-hash-table))
#(define dummy-pitch-counter 0)

defineName =
#(define-void-function (name note) (symbol? ly:music?)
   (set! note-name-to-dummy-pitch-alist
 (acons name
    (ly:make-pitch dummy-pitch-counter 0 0)
    note-name-to-dummy-pitch-alist))
   (hashv-set! dummy-pitch-to-note-table dummy-pitch-counter note)
   (set! dummy-pitch-counter (1+ dummy-pitch-counter)))

endDefinitions =
#(define-void-function () ()
   (ly:parser-set-note-names note-name-to-dummy-pitch-alist))

replaceDummyPitches =
#(define-music-function (music) (ly:music?)
   (music-map
 (lambda (m)
   (if (music-is-of-type? m 'note-event)
   (let* ((pitch (ly:music-property m 'pitch))
  (octave (ly:pitch-octave pitch)))
 (hashv-ref dummy-pitch-to-note-table octave))
   m))
 music))

% Not pretty, but effective
#(set! toplevel-music-functions
   (cons replaceDummyPitches toplevel-music-functions))


%% Note definitions

\defineName astaccato a-.
\defineName aaccent a->
\defineName bstaccato b-.
% etc.

\endDefinitions



%% Usage

{ astaccato aaccent bstaccato }


Best regards,
Jean





Re: Persian music package

2021-07-31 Thread Hans Åberg


> On 31 Jul 2021, at 21:03, Kees van den Doel  wrote:
> 
> Hi Hans,
> Thanks but I don't see how this helps.
> I don't see the Koron or Sori anywhere in those files you sent.

Change the names for the double arrowed accidentals to the ones you want to 
use. They are in smufldata.ily.

> Tuning is defined correctly in persian.ly already so there is no problem to 
> solve there.  

I recall you used E60. E72 might be a better choice. It is your choice though.




Re: Persian music package

2021-07-31 Thread Knute Snortum
On Sat, Jul 31, 2021 at 10:42 AM Kees van den Doel  wrote:
>
> A decade ago I wrote the attached header persian.ly which supports Persian 
> music notation + microtuning.
> A hack with a downloaded font is necessary as the Persian microtonal symbols, 
> the koron and sori are not available in Lilypond,
> Strange, as these have been standard for over a century and there is a 
> substantial body of music written requiring it.
> I'm still getting occasional requests for the package and I've used it to 
> transcribe and compose many hours of Persian traditional music.
>
> At the time it was version 2.12.2 and I took a snapshot of that version with 
> the additional fonts already installed and an "example" directory to 
> illustrate usage of persian.ly.
>
> Available at https://persianney.com/misc/LilyPond.zip
>
> It does not work anymore with current Lilypond version: when compiling 
> provided  example (after copying font files as documented in persian.ly) it 
> trips over
>
> "(ly:parser-set-note-names parser pitchnames)"
>
> but that may not be all. I noticed there is no type1 directory anymore in the 
> current Lilypond version.
>
> Anyone have an idea on how I can get it to work with current version?  It 
> works perfectly fine with the old version, but it is a bit annoying to be 
> forced to use 2.12.

What about running it thru convert-ly in LilyPond's bin directory?



Re: Persian music package

2021-07-31 Thread Kees van den Doel
Hi Hans,
Thanks but I don't see how this helps.
I don't see the Koron or Sori anywhere in those files you sent. Tuning is
defined correctly in persian.ly already so there is no problem to solve
there.  Problem is it does not compile anymore persian.ly v > 2.12.
Cheers,
Kees

On Sat, Jul 31, 2021 at 11:49 AM Hans Åberg  wrote:

>
> > On 31 Jul 2021, at 19:41, Kees van den Doel  wrote:
> >
> > A decade ago I wrote the attached header persian.ly which supports
> Persian music notation + microtuning.
> > A hack with a downloaded font is necessary as the Persian microtonal
> symbols, the koron and sori are not available in Lilypond,
> > Strange, as these have been standard for over a century and there is a
> substantial body of music written requiring it.
> > I'm still getting occasional requests for the package and I've used it
> to transcribe and compose many hours of Persian traditional music.
> …
> > Anyone have an idea on how I can get it to work with current version?
>
> You might switch to using SmuFl and E53/E72; the accidentals are available
> in the Bravura font. E53 can now be used with Graham Breed's file
> regular.ly. For ETs multiples of 12, it is not needed.
>
> I send you files for E53 and E72 with Helmholtz-Ellis notation. For
> Persian music, the double comma accidental would be suitable.
>
> I recommend using E72 because relative E53/Pythagorean tuning, E72 adjusts
> the diatonic scale to E12, but the neutral seconds change only a few cents.
>
> Adam Good reworked the Turkish makam file, and expressed interest in
> Arabic and Persian music, too. He also felt the the E53/E72 combination was
> good.
>
>
>


Re: Persian music package

2021-07-31 Thread Hans Åberg


> On 31 Jul 2021, at 19:41, Kees van den Doel  wrote:
> 
> A decade ago I wrote the attached header persian.ly which supports Persian 
> music notation + microtuning.
> A hack with a downloaded font is necessary as the Persian microtonal symbols, 
> the koron and sori are not available in Lilypond,
> Strange, as these have been standard for over a century and there is a 
> substantial body of music written requiring it.
> I'm still getting occasional requests for the package and I've used it to 
> transcribe and compose many hours of Persian traditional music.
…
> Anyone have an idea on how I can get it to work with current version?

You might switch to using SmuFl and E53/E72; the accidentals are available in 
the Bravura font. E53 can now be used with Graham Breed's file regular.ly. For 
ETs multiples of 12, it is not needed.

I send you files for E53 and E72 with Helmholtz-Ellis notation. For Persian 
music, the double comma accidental would be suitable.

I recommend using E72 because relative E53/Pythagorean tuning, E72 adjusts the 
diatonic scale to E12, but the neutral seconds change only a few cents.

Adam Good reworked the Turkish makam file, and expressed interest in Arabic and 
Persian music, too. He also felt the the E53/E72 combination was good.





Re: Question about Lilypond and meterless/free time music

2021-07-31 Thread Kees van den Doel
Attached is a demo of meterless typesetting. Unfortunately it required
persian.ly (see email earlier today) and v 2.12
but the "meterless" aspect does not depend on that so I hope it's still
useful.


On Sat, Jul 31, 2021 at 7:30 AM  wrote:

> Hello !
>
> I have a question about whether Lilypond can manage a certain type of
> notation.
>
> I happen to love a lot of music that is completely free time/ad
> libitum/rubatto/recitativoso I am curious about different ways to
> notate music that has no rythmic pattern, no concept of measures, beats.
>
> I recently found in a book this transcription of a lute solo ( see the
> attachment), where instead of measure bars the pentagram has marks
> indicating seconds into the recording. it reminds me a bit of an old piano
> scroll. The horizontal axis is in time, not measures.
>
> My question is can I make a score like that using Lilypond ?
>
> thanks,
>
> Ariel//
>
\include "persian.ly"
\version "2.12.2"

%#(set-global-staff-size 20)

staffText = #(define-music-function (parser location marktext)
  (string?)
  #{
  \once \override NoteHead  #'stencil = #ly:text-interface::print
  \once \override NoteHead #'text = #(markup #:whiteout $marktext ) 
  \once \override Stem  #'stencil = #ly:text-interface::print
  \once \override Stem #'text = ""
  #})

startGraceMusic = { \override Stem #'stroke-style = #"grace" }
stopGraceMusic = { \revert Stem #'stroke-style }

\header {
  title = "Daramad Shur"
  tagline = ##f

}

\paper {
%  between-system-space = 0\cm
%  between-system-padding = #3
%  ragged-bottom=##t
%  ragged-last-bottom=##t
}


daramad = {
  \relative c' {
\override Score.PaperColumn #'keep-inside-line = ##t
\override Score.NonMusicalPaperColumn #'keep-inside-line = ##t
\set Staff.extraNatural = ##f
\compressFullBarRests
\cadenzaOn
\override Staff.TimeSignature #'stencil = ##f
\override Score.DynamicText #'transparent = ##t
\override Score.PhrasingSlur #'transparent = ##t
\set Staff.keySignature = \shurD
\override Staff.KeySignature #'text = #shurDKey
\set Staff.midiInstrument = #"clarinet"

\tempo 4 = 84
d1 \f \teeny c16 \pp \normalsize  d1 \f \teeny c16 \pp \normalsize d8 \f  r2  fv2~fv8[ ek8..]  d16 \grace{\stemDown ek8 } d16 \grace{\stemDown fv16} 
d4 ek d8. c16[ \grace{\stemDown fv16} c16] \grace{\stemDown fv16} c4

d4 \teeny c16 \pp \normalsize d4. \f r8 r2 \bar "" \break

g4 fv2~fv8 ek16 \grace{\stemDown fv16} ek16 \grace{\stemDown fv16} ek8[ \teeny d16 \pp] \normalsize  fv4~ \f fv16[ ek8.] 
d16 \grace{\stemDown fv16} d16 \grace{\stemDown fv16} d4 ek \teeny d8 \pp \normalsize  r8 \f r2

fv2~ fv16[ ek8] d16 \grace{\stemDown fv16} d16 \grace{\stemDown fv16} d4 ek d8. c16[ \grace{\stemDown fv16} c16] \grace{\stemDown fv16} c4 d8. \teeny c16 \pp \normalsize d4 \f r8 r2 \bar "" \break

\times 2/3 {r8 \grace{\stemDown c8} fv8 ek}  \grace {\stemDown fv8} d4.~ \times 2/3 {d8 fv ek} \grace{\stemDown fv8} 
d4~ \times 2/3 {d8 ek \teeny d \pp} \normalsize fv4. \f g16 \breathe

fv32[ ek16 \grace{\stemDown fv16}  ek d \grace{\stemDown fv16} d c \grace{\stemDown fv16} c8] d4 \teeny c16 \pp \normalsize d2. \f  r2

\bar "|."
  }
}

kereshmeh = {
<<
  \new Staff  \with {
\override VerticalAxisGroup #'minimum-Y-extent = #'(-0 . 0)
  }

  \new Voice = melody \relative c' {
%\override Score.PaperColumn #'keep-inside-line = ##t
%\override Score.NonMusicalPaperColumn #'keep-inside-line = ##t
\set Staff.extraNatural = ##f
\compressFullBarRests
\cadenzaOn
\override Staff.TimeSignature #'stencil = ##f
\override Score.DynamicText #'transparent = ##t
\override Score.PhrasingSlur #'transparent = ##t
\set Staff.keySignature = \shurD
\override Staff.KeySignature #'text = #shurDKey
\set Staff.midiInstrument = #"clarinet"

c16[ \f d8 ek16] fv4. ek16[ fv] ek16[ fv32 ek8] \teeny d16[( ek] \pp \normalsize  d8) \f d8 r4

ek16 fv8.~ fv16[ \teeny ek16] \pp \normalsize g32 \f fv16 g16. fv4  ek16[ d8] 
ek32[ fv16 \grace{\stemDown g16} fv] ek[ \grace{\stemDown g16} ek d \grace{\stemDown g16} d] \teeny ek \pp \normalsize d4 \f r2

\bar "|."
  }

  \new Lyrics \with {
\override VerticalAxisGroup #'minimum-Y-extent = #'(-0 . 0)
  }

  \lyricsto melody {
ko han sha wad ha me kas - - - rA
be ru - ze gA - - A - re e rA - - - - - dat
  }
>>
}




\book {
  \header {
title = \markup \center-column { "Vocal radif according to Karimi" "Dastgah Shur" }
composer =  "Karimi"  
  }

  \score {
\daramad
\midi { 
  \context {
\Score
tempoWholesPerMinute = #(ly:make-moment 84 4)
  }
}
\header {
  piece = "1. Daramad"
}
\layout { 
  \context {
%  \Score
%\override SpacingSpanner #'base-shortest-duration = #(ly:make-moment 1 16)
%\override SpacingSpanner #'shortest-duration-space  = #1

Custom note names, or meta-score?

2021-07-31 Thread Craig Comstock
Hello,

I am writing a piece for a 9 piece ensemble in which I want the players to 
choose 9 different pitches along with articulations and/or other additional 
symbols to indicate extended techniques and such. I want to take those 81 
different “glyphs” if you will and generate a score and parts. The part I 
specify as the composer is only rhythm and which glyph to use.

I would like to bring along the pitch level and say stocatto, accent, things 
like that but keep them separated from rhythm.

So say ‘aa’ is middle C stocatto I could write { aa4 aa2 aa aa } which would be 
the same as { c’4-. c2-. c-. c-. }

At first I thought I might just use variables like

aa = { ‘c }
{ \aa4 \aa2 \aa \aa }

But that didn’t parse and is also an extra backslash and such I’d rather not 
have in there if possible.

So said another way, I’d like to write a meta-score like { aa4 aa2 aa aa ab ab 
ab ac ac ca ca } and those note names relate to a set of pitches determined 
maybe in another file (not code hopefully) so that as the pitches are 
chosen/changed it is easy to regenerate the score/parts.

So maybe something near 
https://gitlab.com/lilypond/lilypond/-/blob/master/scm/define-note-names.scm 
 
I could add in a list of pitch names from another file included in the score 
somehow?

Thanks!
Craig

Persian music package

2021-07-31 Thread Kees van den Doel
A decade ago I wrote the attached header persian.ly which supports Persian
music notation + microtuning.
A hack with a downloaded font is necessary as the Persian microtonal
symbols, the koron and sori are not available in Lilypond,
Strange, as these have been standard for over a century and there is a
substantial body of music written requiring it.
I'm still getting occasional requests for the package and I've used it to
transcribe and compose many hours of Persian traditional music.

At the time it was version 2.12.2 and I took a snapshot of that version
with the additional fonts already installed and an "example" directory to
illustrate usage of persian.ly.

Available at https://persianney.com/misc/LilyPond.zip


It does not work anymore with current Lilypond version: when compiling
provided  example (after copying font files as documented in persian.ly) it
trips over

"(ly:parser-set-note-names parser pitchnames)"

but that may not be all. I noticed there is no type1 directory anymore in
the current Lilypond version.

Anyone have an idea on how I can get it to work with current version?  It
works perfectly fine with the old version, but it is a bit annoying to be
forced to use 2.12.

Thanks,
Kees
\version "2.12.2"
%{
Author: Kees van den Doel kvand...@shaw.ca

Init file for Persian music notation.

To  use download  the PostScript  Type  1 Microtonal  Font from  Andrián
Pertout  (http://www.pertout.com/PhD2007Introduction.htm)  and copy  the
.pfbfileintothedirectory
LilyPond/usr/share/lilypond/current/fonts/type1.

This header file defines Persian microtonal alterations, the approximate
quartertone   flat  (koron)  and   the  approximate   quartertone  sharp
(sori). They can be obtained by  appending 'k' (koron) and 'o' (sori) to
the English note symbol.  The  standard symbols for this were introduced
by Vaziri.

Key  signatures are  defined  for all  the  Persian modes,  there are  5
distinct scales  with microtones  and the normal  major scale.   All the
gushe's from all dastgahs can be notated with just these 6.

The note immediately  following a koron is sometimes  (when the interval
defined by  the note  before the koron  and after  the koron is  a minor
third, and the note below the  finalis in esfahan according to some (but
not all)  Persian musicians))  lowered by about  20 cents.  This  is not
notated, but considered part of the scale tuning. To accomodate this for
getting better sounding  MIDI I've introduced the "vlat"  (append 'v' to
the note) to indicate this. Actually  this note should also get a strong
vibrato,  and the  vibrato and  low tuning  are  perceptually integrated
(serialism!). This is just for MIDI and has no effect on the notation.

In the tuning  I've followed "Traditional Persian Art  Music, by Dariush
Tala'i".  The  tunings are  also very close  to those suggested  in "The
Dastgah  Concept in  Persian Music,  by  Hormoz Farhat".   See also  "Le
repertoire-modele  de  la  musique  iranienne,  by  Jean  During"  which
contains measurements  of the  intervals in actual  practice, consistent
with the tuning in this file.

There are no other tuning issues  in Persian music. Because the music is
monophonic  the difference  between  just intonation  (for example)  and
equal temperament is merely academic, because are no chords where out of
tune intervals are noticeable.

Note name suffixes:

ff for double-flat
			f  for flat
			k  for koron (about quarter-flat, -3/10 of whole tone, 60 cent)
			o  for sori  (about quarter-sharp, 2/10 of whole tone, 40 cent)
			s  for sharp
			x  for double-sharp
v  for 20 cent flat tuned note ("vlat", not notated)
fv for flat tuned 20C down (notated as a normal flat)
sv for sharp tuned 20C down (notated as a normal sharp: will never occur in traditional Persian music)

6 Persian  key signatures are  provided they are:

shur?   (shur gushe's with natural 5th degree)
shurk?  (shur gushe's with koron 5th degree)
esfahan?
mokhalefsegah?
chahargah?
mahur?

where ? is the key (A-G) of the mode.

Setting the  key signatures  requires two commmands,  one to  define the
alterations,  and one  to set  the key  signature (append  "Key"  to the
name). For example for chahargah in D:

\include "persian.ly"
\score {
  \relative c' {
   \set Staff.keySignature = \chahargahD
   \override Score.KeySignature #'text = #chahargahDKey
bk'8 a gs fo r g ak g fs ek d c d ef16 d c4
 }
  \midi { }
  \layout { }
  }
}


%}

% Define tunings:

#(define-public KORON -3/10)
#(define-public SORI 1/5)
#(define-public VLAT -1/10)
#(define-public FVLAT -3/5)
#(define-public SVLAT 2/5)

pitchnamesEnglish = #`(
	(cflatflat . ,(ly:make-pitch -1 0 DOUBLE-FLAT))
	(cflat . ,(ly:make-pitch -1 0 FLAT))
	(c . ,(ly:make-pitch -1 0 NATURAL))
	(csharp . ,(ly:make-pitch 

Re: Question about Lilypond and meterless/free time music

2021-07-31 Thread Jean Abou Samra



Le 31/07/2021 à 17:05, ar...@aramburu.org a écrit :


Thank you Jean for your answer !

I would be happy to know if

1) I can have a pentagram with notes, but without measure bars  -> the 
answer is yes, that is posssible


2) I can place those tick marks manually in the pentagram

3) I can put a number on top of those tick marks

Do you know the answer to 2) and 3)  ?


Thanks,

Ariel//




Hi,

Please keep the list copied, this way everyone can
answer and others can benefit from searching the list
archives in the future.

Here's a start:

\version "2.22.1"

\layout {
  \context {
    \Score
    \cadenzaOn
    % Print all bar numbers. See
    % http://lilypond.org/doc/v2.23/Documentation/notation/bars#bar-numbers
    \override BarNumber.break-visibility = #begin-of-line-invisible
    barNumberVisibility = #all-bar-numbers-visible
    % First tick number is 1, not 2.
    currentBarNumber = 0
    % The tick marks.
    \override BarLine.bar-extent = #'(2.5 . 3.5)
    % Center bar number on the ticks.
    \override BarNumber.self-alignment-X = \CENTER
  }
}

% Bar numbers are not automatically incremented at
% manual bar lines.
incrementBarNumber =
\context Score \applyContext
  #(lambda (context)
 (set! (ly:context-property context 'currentBarNumber)
   (1+ (ly:context-property context 'currentBarNumber

tick = {
  \bar "|"
  \incrementBarNumber
}

%%

\repeat unfold 10 {
  c'4 \tick 8[ 16 32] \tick 16[ 32.] \tick
}
Best,
Jean



Re: Question about Lilypond and meterless/free time music

2021-07-31 Thread N. Andrew Walsh
Hello Ariel,

please also see the section in the Notation Reference regarding writing
cadenzas and other unmetered music:
https://lilypond.org/doc/v2.23/Documentation/notation/displaying-rhythms#unmetered-music
.

You could just treat this passage as a sort of cadenza, and control the
barlines manually.

As for applying a tick at exact *temporal* intervals, that's outside of my
competence.

Sincerely,

A

On Sat, Jul 31, 2021 at 4:29 PM  wrote:

> Hello !
>
> I have a question about whether Lilypond can manage a certain type of
> notation.
>
> I happen to love a lot of music that is completely free time/ad
> libitum/rubatto/recitativoso I am curious about different ways to
> notate music that has no rythmic pattern, no concept of measures, beats.
>
> I recently found in a book this transcription of a lute solo ( see the
> attachment), where instead of measure bars the pentagram has marks
> indicating seconds into the recording. it reminds me a bit of an old piano
> scroll. The horizontal axis is in time, not measures.
>
> My question is can I make a score like that using Lilypond ?
>
> thanks,
>
> Ariel//
>


Re: Question about Lilypond and meterless/free time music

2021-07-31 Thread Jean Abou Samra

Le 31/07/2021 à 08:59, ar...@aramburu.org a écrit :


Hello !

I have a question about whether Lilypond can manage a certain type of 
notation.


I happen to love a lot of music that is completely free time/ad 
libitum/rubatto/recitativoso I am curious about different ways to 
notate music that has no rythmic pattern, no concept of measures, beats.


I recently found in a book this transcription of a lute solo ( see the 
attachment), where instead of measure bars the pentagram has marks 
indicating seconds into the recording. it reminds me a bit of an old 
piano scroll. The horizontal axis is in time, not measures.


My question is can I make a score like that using Lilypond ?

thanks,

Ariel//



Are you looking after marks added automatically, spread
evenly based on the durations and the tempo? Or rather
a \tick command allowing to insert one at any given moment?

Best,
Jean



Re: Setting global staff size after the \paper block nullifies font setting

2021-07-31 Thread Brent Annable
Aah, thank you for clarifying that Aaron. And thank you for the hack, I'll
give that a go!

Regards,

Brent.

On Sat, 31 Jul 2021, 5:42 pm Aaron Hill,  wrote:

> On 2021-07-30 11:05 pm, Brent Annable wrote:
> > I've come across a little problem that I don't know how to fix. I've
> > changed the text font in a vocal score by using the scheme #define font
> > procedure, and have noticed that if I subsequently use
> > #(set-global-staff-size) *after* the \paper block, the font reverts
> > back to
> > the default. It doesn't do this if I use #(set-global-staff-size)
> > *before *the
> > paper block.
>
> This is a long-standing known issue [1] with LilyPond.  You need to set
> the staff size before specifying any custom fonts because
> layout-set-absolute-staff-size-in-module rebuilds the font tree for the
> new staff size.
>
> [1]: https://gitlab.com/lilypond/lilypond/-/issues/1129
>
> The best I can come up with is a hack that redefines the
> make-default-fonts-tree procedure:
>
> 
> \version "2.22.0"
>
> changeDefaultFonts =
> #(define-void-function
>(roman-str sans-str typewrite-str)
>(string? string? string?)
>(define (proc factor)
> (make-pango-font-tree roman-str sans-str typewrite-str factor))
>(set! make-default-fonts-tree proc))
>
> \paper { indent = 0 }
>
> foo = {
>\mark \markup \sans Sans
>b'1^\markup \typewriter Mono
>   _\markup \roman Serif
> }
> \markup {
>\score { \foo \layout { #(layout-set-staff-size 15) } }
>\score { \foo \layout { #(layout-set-staff-size 20) } }
>\score { \foo \layout { #(layout-set-staff-size 25) } }
> }
> \changeDefaultFonts "Cambria" "Calibri" "Consolas"
> \markup {
>\score { \foo \layout { #(layout-set-staff-size 15) } }
>\score { \foo \layout { #(layout-set-staff-size 20) } }
>\score { \foo \layout { #(layout-set-staff-size 25) } }
> }
> 
>
>
> -- Aaron Hill


Re: Setting global staff size after the \paper block nullifies font setting

2021-07-31 Thread Aaron Hill

On 2021-07-30 11:05 pm, Brent Annable wrote:

I've come across a little problem that I don't know how to fix. I've
changed the text font in a vocal score by using the scheme #define font
procedure, and have noticed that if I subsequently use
#(set-global-staff-size) *after* the \paper block, the font reverts 
back to
the default. It doesn't do this if I use #(set-global-staff-size) 
*before *the

paper block.


This is a long-standing known issue [1] with LilyPond.  You need to set 
the staff size before specifying any custom fonts because 
layout-set-absolute-staff-size-in-module rebuilds the font tree for the 
new staff size.


[1]: https://gitlab.com/lilypond/lilypond/-/issues/1129

The best I can come up with is a hack that redefines the 
make-default-fonts-tree procedure:



\version "2.22.0"

changeDefaultFonts =
#(define-void-function
  (roman-str sans-str typewrite-str)
  (string? string? string?)
  (define (proc factor)
   (make-pango-font-tree roman-str sans-str typewrite-str factor))
  (set! make-default-fonts-tree proc))

\paper { indent = 0 }

foo = {
  \mark \markup \sans Sans
  b'1^\markup \typewriter Mono
 _\markup \roman Serif
}
\markup {
  \score { \foo \layout { #(layout-set-staff-size 15) } }
  \score { \foo \layout { #(layout-set-staff-size 20) } }
  \score { \foo \layout { #(layout-set-staff-size 25) } }
}
\changeDefaultFonts "Cambria" "Calibri" "Consolas"
\markup {
  \score { \foo \layout { #(layout-set-staff-size 15) } }
  \score { \foo \layout { #(layout-set-staff-size 20) } }
  \score { \foo \layout { #(layout-set-staff-size 25) } }
}



-- Aaron Hill

Setting global staff size after the \paper block nullifies font setting

2021-07-31 Thread Brent Annable
Hi all,

I've come across a little problem that I don't know how to fix. I've
changed the text font in a vocal score by using the scheme #define font
procedure, and have noticed that if I subsequently use
#(set-global-staff-size) *after* the \paper block, the font reverts back to
the default. It doesn't do this if I use #(set-global-staff-size) *before *the
paper block.

This is a little annoying, because I would like to use a global \paper
block for all the motets in the edition, but still be able to tweak the
staff sizes for each score somewhat to achieve consistent system counts
(which messes up the font setting if I do it before each \score in the
file). I am also using a global \layout block, so I can't put the staff
size setting there either (unless someone can show me a way of defining *some
*layout settings in a global variable file without freaking Lilypond out -
I have tried but not succeeded.)

 A sample file is attached. Just toggle the staff-sizing commands before
and after the \paper block to see how the header font changes.

I would appreciate any help!

Regards,

Brent.
\version "2.22.1"

  %Setting staff size before the paper block, everything is okay
  
  %#(set-global-staff-size 16)
  
\paper {
  #(define fonts
(set-global-fonts 
 #:roman "Cambria"
 #:factor (/ staff-height pt 20)
   ))
}

%Setting staff size after the paper block, the font setting reverts.

#(set-global-staff-size 16)

\header {
  title = "HEADER" }

\relative c' { c4 c c c 
c4 c c c
c4 c c c
c4 c c c
c4 c c c
c4 c c c
c4 c c c}