Re: notes regex expression

2017-09-12 Thread Jim Tisdall

Sorry for all the ? replacing the tabs in my last post -
not sure which step made that transformation -
I try again after removing all the tabs

Jim

I have been using a perl regular expression to parse lilypond notes for my own 
application,
which handles guitar notes with possible right hand, left hand, plectrum, 
string, glissando markings.
Thus it only includes some of the features of lilypond notes.  It assumes 
english note names
(easily modified).

$noteRE = '
(?
(
(
(<  # lilypond grouping
(?   # $-{pitch}[0]
(? [a-g](ss*|ff*)?\b) # 
$-{name}[0]
(? (,,*|\'\'*)?)# 
$-{octave}[0]
)
(? (\d+\.*)?) # 
$-{duration}[0]
(
((\\\(? [1-6]))?)   # 
$-{string}[0]
|
(((-(? [0-4])) | none )?)   
# $-{LH}[0]
|
(? \\\downbow|\\\upbow)   
# $-{plectrum}[0]
|
(? -?\\\(RH|rightHandFinger)\ 
\#[0-4]\ )  # $-{PIMA}[0]
)*
>)  # lilypond grouping
(

((\\\(? glissando))?)# 
$-{glissando}[0]
|
(? (\d+\.*)?) # 
$-{duration}[1]
|
(? ([\\^_\-]"\S")?  | \S*) # other 
arbitrary constructs
)*
)
|
(
(   # without lilypond grouping
(?   # $-{pitch}[1]
(? [a-g](ss*|ff*)?\b) # 
$-{name}[1]
(? (,,*|\'\'*)?)# 
$-{octave}[1]
)
(? (\d+\.*)?) # 
$-{duration}[2]
(
((\\\(? [1-6]))?)   # 
$-{string}[1]
|
(((-(? [0-4])) | none )?)   
# $-{LH}[1]
|
(? \\\downbow|\\\upbow)   
# $-{plectrum}[1]
|
(? -?\\\(RH|rightHandFinger)\ 
\#[0-4]\ )  # $-{PIMA}[1]
)*
)   # without lilypond grouping
(
(? (\d+\.*)?) # 
$-{duration}[3]
|
((\\\(? glissando))?)# 
$-{glissando}[1]
|
(? ([\\^_\-]"\S")?  | \S*) # other 
arbitrary constructs
)*
)
)
|
(
(?   # $-{pitch}[2]
(? [rR])  # $-{name}[2]
)
(? (\d+\.*)?) # $-{duration}[4]
)
)
';



I use the regular expression $noteRE in the following parse function which 
creates a note object:

sub parsenote {
my($self, $lilynote) = @_;

# best used on new note: may reset e.g. duration
# if called on pitch of existing note

unless((defined $lilynote) and $lilynote) {
Error(Trace("Cannot parse note: input lilynote is not 
defined"));
return 0;
}

# simple case of name and octave
if($lilynote =~ /^([ra-gA-G][sf]*)([,']*)$/) {
$self->set_type('note');
$self->set_pitch($lilynote);
$self->set_name($1);
$self->set_octave($2);
return(1);
}

$lilynote =~ /$noteRE/x or return 0;

$self->set_type('note');
if(defined $-{pitch}[0]) {
$self->set_pitch($-{pitch}[0]);
}elsif(defined $-{pitch}[1]) {
$self->set_pitch($-{pitch}[1]);
}elsif(defined $-{pitch}[2]) {
$self->set_pitch($-{pitch}[2]);
}
if(defined $-{name}[0]) {
$self->set_name($-{name}[0]);
}elsif(defined $-{name}[1]) {
$self->set_name($-{name}[1]);
}elsif(defined $-{name}[2]) {
$self->set_name($-{name}[2]);
}
if(defined $-{octave}[0]) {
$self->set_octave($-{octave}[0]);
}elsif(defined $-{octave}[1]) {
  

Re: notes regex expression

2017-09-12 Thread Jim Tisdall

I have been using a perl regular expression to parse lilypond notes for my own 
application,
which handles guitar notes with possible right hand, left hand, plectrum, 
string, glissando markings.
Thus it only includes some of the features of lilypond notes.  It assumes 
english note names
(easily modified).


$noteRE = '
(?
    (
    (
    (<  # lilypond grouping
(?   # $-{pitch}[0]
    (? [a-g](ss*|ff*)?\b) # 
$-{name}[0]
    (? (,,*|\'\'*)?)    # 
$-{octave}[0]
    )
    (? (\d+\.*)?) # 
$-{duration}[0]
    (
    ((\\\(? [1-6]))?)   # 
$-{string}[0]
    |
    (((-(? [0-4])) | none )?)   
# $-{LH}[0]
    |
    (? \\\downbow|\\\upbow)   
# $-{plectrum}[0]
    |
    (? -?\\\(RH|rightHandFinger)\ 
\#[0-4]\ )  # $-{PIMA}[0]
    )*
    >)  # lilypond grouping
    (

    ((\\\(? glissando))?)    # 
$-{glissando}[0]
    |
    (? (\d+\.*)?) # 
$-{duration}[1]
    |
    (? ([\\^_\-]"\S")?  | \S*) # other 
arbitrary constructs
    )*
    )
    |
    (
    (   # without lilypond grouping
(?   # $-{pitch}[1]
    (? [a-g](ss*|ff*)?\b) # 
$-{name}[1]
    (? (,,*|\'\'*)?)    # 
$-{octave}[1]
    )
    (? (\d+\.*)?) # 
$-{duration}[2]
    (
    ((\\\(? [1-6]))?)   # 
$-{string}[1]
    |
    (((-(? [0-4])) | none )?)   
# $-{LH}[1]
    |
    (? \\\downbow|\\\upbow)   
# $-{plectrum}[1]
    |
    (? -?\\\(RH|rightHandFinger)\ 
\#[0-4]\ )  # $-{PIMA}[1]
    )*
    )   # without lilypond grouping
    (
    (? (\d+\.*)?) # 
$-{duration}[3]
    |
    ((\\\(? glissando))?)    # 
$-{glissando}[1]
    |
    (? ([\\^_\-]"\S")?  | \S*) # other 
arbitrary constructs
    )*
    )
    )
    |
    (
    (?   # $-{pitch}[2]
    (? [rR])  # $-{name}[2]
    )
    (? (\d+\.*)?) # $-{duration}[4]
    )
)
';



I use the regular expression $noteRE in the following parse function which 
creates a note object:

sub parsenote {
    my($self, $lilynote) = @_;

    # best used on new note: may reset e.g. duration
    # if called on pitch of existing note

    unless((defined $lilynote) and $lilynote) {
    Error(Trace("Cannot parse note: input lilynote is not 
defined"));
    return 0;
    }

    # simple case of name and octave
    if($lilynote =~ /^([ra-gA-G][sf]*)([,']*)$/) {
    $self->set_type('note');
    $self->set_pitch($lilynote);
    $self->set_name($1);
    $self->set_octave($2);
    return(1);
    }

    $lilynote =~ /$noteRE/x or return 0;

    $self->set_type('note');
    if(defined $-{pitch}[0]) {
    $self->set_pitch($-{pitch}[0]);
    }elsif(defined $-{pitch}[1]) {
    $self->set_pitch($-{pitch}[1]);
    }elsif(defined $-{pitch}[2]) {
    $self->set_pitch($-{pitch}[2]);
    }
    if(defined $-{name}[0]) {
    $self->set_name($-{name}[0]);
    }elsif(defined $-{name}[1]) {
    $self->set_name($-{name}[1]);
    }elsif(defined $-{name}[2]) {
    $self->set_name($-{name}[2]);
    }
    if(defined $-{octave}[0]) {
    $self->set_octave($-{octave}[0]);
    }elsif(defined $-{octave}[1]) {
    $self->set_octave($-{octave}[1]);
    }
    if(defined $-{duration}[0]) {
    $self->set_duration($-{duration}[0]);
   

function to end melody with rests to end of measure

2016-07-18 Thread Jim Tisdall
I need to fill in the end of a score (a melody) with
rests to the end of the final measure, if needed.

Any ideas for how to do that, like writing a new function or ...?
Thanks,
Jim


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


keyboard graphic

2016-06-01 Thread Jim Tisdall
I need to display small graphics of a piano keyboard with selected
notes indicated by color.

It will be used similarly as the guitar fret diagrams and actually
in conjunction with them (and with standard and tablature notation,
and explanatory comments) as guitarists examine chord voicings.

I've found a few things but thought I'd ask here if some lilypond user
has developed such a graphic in the system.  Or, an expert advice on
where to begin to develop one myself within lilypond, would be most
appreciated.

My wish list is parameters for range, width/height, and pressed keys;
labels under the pressed keys would be a nice plus.

Thanks,
Jim

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


make many icons

2016-04-24 Thread Jim Tisdall

I want to create about a hundred icons that contain short (2- 5-note) rhythms
or melodic shapes, without staff lines.  They will have no staff (which I see 
how
to do).  Ideally I could write them all in one file and invoke lilypond to 
create
the hundred or so svg files.  (My current solution is to create individual files
and compile, with perl script.)

Any advice about svg settings, lilypond input format, etc., to create many 
icons of short phrases?

Thanks,
Jim

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


new lilypond guitar site

2016-03-11 Thread Jim Tisdall

Hi,

Although it's still early days...

http://GuitarAvatar.net

creates scores for student/teacher use.

Scales, arpeggios, rhythms, melodic patterns, audio,
lots of fingering alternatives.

Chords/harmony in active development but not live yet.

Examples of fingering approaches
from the chapters of a book in development.

And no doubt plenty of bugs in what is live ;>)

I thought you lot might like to see how I'm using lilypond.

Peace,
Jim

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


fill last measure with rests?

2016-03-09 Thread Jim Tisdall
Does there exist a directive that will automatically fill
the last measure of a voice with rests?

If not, any pointers for programming such would be welcome.

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


fill last measure with rests

2016-03-03 Thread Jim Tisdall
Is there a directive that will automatically fill
the last measure with rests?

For instance,
if the music ends on a quarter note on the first
beat of a 4/4 measure, the directive would
fill that measure with 3 beats of rests so that
the measure is filled to the bar line?

(I'm generating scores algorithmically and this
would be a pleasant shortcut ...)

Peace,
Jim

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


Completion_heads_engraver and repeated marks

2016-03-03 Thread Jim Tisdall

When using the Completion_heads_engraver,
I'm having a problem with repeated fingering markings in my guitar music,
as described in the comments included in these three staves.
.ly and .png image attached.

I have written external code to insert ties across moments and bar lines myself,
but I'm hoping there's a fix within the existing lilypond system that I've
just not found in my state of internals, and general typesetting, ignorance.

(I much prefer the first version, as I'm processing scores algorithmically
and they're a lot easier to parse with the < > groupings, especially
with the right-hand markup syntax as "\RH #2 " (space at the end required) )

Thanks all,
Jim Tisdall


\version "2.18.2"
\language "english"
\score {
 \new StaffGroup <<
 \new Staff {
   \language "english"
   \clef "treble_8"
   #(define RH rightHandFinger)

   \new Voice \with {
 \remove "Note_heads_engraver"
 \consists "Completion_heads_engraver" completionUnit = #(ly:make-moment 
1/2)
 \remove "Rest_engraver"
 \consists "Completion_rest_engraver" completionUnit = #(ly:make-moment 1/2)
   }
   {
   %% (guitar music)
   %%
   %% With "Completion_heads_engraver",
   %% ties across the bar line or the "moment"
   %% generate repeats of markings for:
   %% bow, left-hand finger, circled string,
   %% and right-hand "p"
   %%
 <c\6\downbow-4\RH #1 >8
 r4
 <d\5\downbow-1\RH #1 >
 <d\5\downbow-1\RH #1 >
 <d\5\downbow-1\RH #1 >
 <e\upbow-3\RH #1 >
 <f\downbow-4\RH #1 >
   }
 }
 \new Staff {
   \language "english"
   \clef "treble_8"
   #(define RH rightHandFinger)
   \new Voice \with {
 \remove "Note_heads_engraver"
 \consists "Completion_heads_engraver" completionUnit = #(ly:make-moment 
1/2)
 \remove "Rest_engraver"
 \consists "Completion_rest_engraver" completionUnit = #(ly:make-moment 1/2)
   }
   {
   %%
   %% The same as before but notes not grouped
   %% with the < > symbols.
   %% Bow and left-hand fingers now correct,
   %% but still generate repeated circled string
   %% and right-hand "p" markings
   %%
 c8\6\downbow-4\RH #1
 r4
 d\5\downbow-1\RH #1
 d\5\downbow-1\RH #1
 d\5\downbow-1\RH #1
 e\upbow-3\RH #1
 f\downbow-4\RH #1
   }
 }
 \new Staff {
   \language "english"
   \clef "treble_8"
   #(define RH rightHandFinger)
   \new Voice {
   %%
   %% Without "Completion_heads_engraver",
   %% the markings are correct and are not repeated across bar lines
   %% (tie across bar must be explictly specified)
   %%
 c8\6\downbow-4\RH #1
 r4
 d\5\downbow-1\RH #1
 d\5\downbow-1\RH #1
 d8\5\downbow-1\RH #1
 ~
 d8
 e4\upbow-3\RH #1
 f\downbow-4\RH #1
   }
 }



 \layout { }
}



\version "2.18.2"
\language "english"
\score {
  \new StaffGroup <<
  \new Staff {
\language "english"
\clef "treble_8"
#(define RH rightHandFinger)

\new Voice \with {
  \remove "Note_heads_engraver"
  \consists "Completion_heads_engraver" completionUnit = #(ly:make-moment 
1/2)
  \remove "Rest_engraver"
  \consists "Completion_rest_engraver" completionUnit = #(ly:make-moment 
1/2)
}
{
%% (guitar music)
%%
%% With "Completion_heads_engraver",
%% ties across the bar line or the "moment"
%% generate repeats of markings for:
%% bow, left-hand finger, circled string,
%% and right-hand "p"
%%
  <c\6\downbow-4\RH #1 >8
  r4
  <d\5\downbow-1\RH #1 > 
  <d\5\downbow-1\RH #1 >
  <d\5\downbow-1\RH #1 >
  <e\upbow-3\RH #1 >
  <f\downbow-4\RH #1 >
}
  }
  \new Staff {
\language "english"
\clef "treble_8"
#(define RH rightHandFinger)

\new Voice \with {
  \remove "Note_heads_engraver"
  \consists "Completion_heads_engraver" completionUnit = #(ly:make-moment 
1/2)
  \remove "Rest_engraver"
  \consists "Completion_rest_engraver" completionUnit = #(ly:make-moment 
1/2)
}
{
%%
%% The same as before but notes not grouped
%% with the < > symbols.
%% Bow and left-hand fingers now correct,
%% but still generate repeated circled string
%% and right-hand "p" markings
%%
  c8\6\downbow-4\RH #1
  r4
  d\5\downbow-1\RH #1 
  d\5\downbow-1\RH #1 
  d\5\downbow-1\RH #1 
  e\upbow-3\RH #1 
  f\downbow-4\RH #1 
}
  }
  \new Staff {
\language "english"
\clef "treble_8"
#(define RH rightHandFinger)
\new Voice {
%%
%% Without "Completion_heads_engraver",
%% the markings are correct and are not repeated across bar lines
%% (tie across bar must be explictly specified)
%%
  c8\6\downbow-4\RH #1
  r4
  d\5\downbow-1\RH #1  
  d\5\downbow-1\RH #1 
  d8\5\downbow-1\RH #1 
  ~
  d8
  e4\upbow-3\RH #1 
  f\downbow-4\RH #1 
}
  }
>>
  \layout { }
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: mac web fontconfig slowdown

2016-02-04 Thread Jim Tisdall

I seem to have found a fix ...


Message: 5
Date: Wed, 3 Feb 2016 19:06:21 -0500
From: Jim Tisdall <tisd...@tisdall.net>
To: lilypond-user@gnu.org
Subject: mac web fontconfig slowdown
Message-ID: <56b295fd.5040...@tisdall.net>

on mac os x 10.11.2, lilypond 2.18.2, plenty nice mac pro plenty ram

Serious slowdown due to font configuration - 30 seconds delay
while "FontConfig" is called - happens when you do a
lilypond -V   for instance.

Fixed from command line using /opt/local/bin/fc-cache
for each user (root, me, ...) which creates files
.lilypond-fonts.cache-2 in home directories

But I still have delay problem running lilypond from a web program -
I use user:group _www:_www which works fine for everything but this.
30 second delay.  (No home directory for _www due to security)


(First, I believe it was lilypond -V, not fc-cache, that
as creating the .lilypond-fonts.cache-2 files.  Anyway ...)


To fix for web operation, an apache2 httpd that uses
  User/Group _www/_www where _www has no login directory)

Edit

/Applications/LilyPond.app/Contents/Resources/etc/fonts/local.conf

change

~/.lilypond-fonts.cache-2
to
.lilypond-fonts.cache-2

cd to cgi-bin, which on my system is

root# cd /Applications/WebServer/CGI-Executables

and run

root# /Applications/LilyPond.app/Contents/Resources/bin/lilypond -V

which creates a cache in my cgi-bin called .lilypond-fonts.cache-2

 -->  That did it!  The web program now takes 1 second on a small score 
instead of 30 seconds


I then re-edited
/Applications/LilyPond.app/Contents/Resources/etc/fonts/local.conf

so that both these lines appear one after the other:

~/.lilypond-fonts.cache-2
.lilypond-fonts.cache-2

That's so that when a home directory can be found,
lilypond will use the cache there instead of the one in cgi-bin

(Caveat: there well may be an easier way to accomplish this - but this
works at least.)  (Thanks to Jacques Menu for looking at this problem.)

Jim

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


mac web fontconfig slowdown

2016-02-03 Thread Jim Tisdall

on mac os x 10.11.2, lilypond 2.18.2, plenty nice mac pro plenty ram


Serious slowdown due to font configuration - 30 seconds delay
while "FontConfig" is called - happens when you do a
lilypond -V   for instance.

Fixed from command line using /opt/local/bin/fc-cache
for each user (root, me, ...) which creates files
.lilypond-fonts.cache-2 in home directories

But I still have delay problem running lilypond from a web program -
I use user:group _www:_www which works fine for everything but this.
30 second delay.  (No home directory for _www due to security)

Admittedly I'm not expert at font management.  Any way to have every
user of lilypond on my system use a good font cache?

Here's parts of my detailed DEBUG output from web invocation:

Log level set to 287
Relocation: is absolute:
argv0=/Applications/LilyPondDevel.app/Contents/Resources/bin/lilypond

etc etc

Setting FONTCONFIG_FILE to
/Applications/LilyPondDevel.app/Contents/Resources/bin/../etc/fonts/fonts.conf
Setting FONTCONFIG_PATH to
/Applications/LilyPondDevel.app/Contents/Resources/bin/../etc/fonts


etc. etc.

Initializing FontConfig...
Adding font directory:
/Applications/LilyPondDevel.app/Contents/Resources/share/lilypond/current/fonts/otf
Building font database...


 here's where it hangs for about 30 seconds 

etc. etc.

Interpreting music...
[/Applications/LilyPondDevel.app/Contents/Resources/share/lilypond/current/fonts/otf/emmentaler-20.otf]
[emmentaler-11_3.9453125]

etc etc

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


lilypond ram disk

2014-05-16 Thread Jim Tisdall

Has anyone had good - or bad or indifferent- results by installing
the lilypond software onto a ram disk?

I find that my fairly spiffy server, typesetting a very small score,
takes about 12-15 seconds ... unless I've just typeset another one,
and the program is still mostly loaded in memory,
in which case it takes maybe 3 seconds.

If I could make that speedup permanent, it would be huge
for my (interactive) work.   And that's what a ram disk may
possibly enable - anyone done this?

(I work on a mac server but any linux/unix/pc experience
would be very interesting to me.)

Peace,
Jim


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


Re:Two possible bugs when dealing with Automatic note splitting

2013-10-03 Thread Jim Tisdall



I posted some details about this a week ago,


No, you didn't.  Not wanting a repetition of fingerings and string
numbers would be a feature request: I don't think that would ever have
worked differently.

-- David Kastrup




Ah, true.  I reported fingerings and string numbers being repeated
unnecessarily when automatic note splitting was invoked, whereas
this new post reported some accidentals being repeated in somewhat
similar circumstances.  Pardon my confusion.

Since I find the note splitting unusable with the proliferation of
incorrect fingerings (incorrect in the sense of how scores are
normally fingered) I do request this feature.  I would be willing
to tackle it myself if I can ask someone to help me identify the
parts of the code which would need attention.  Before the rest completion
was added, I wrote some score filter code that handled splitting, so I can just
use that for rests and notes for the time being.

Thanks,
Jim

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


Re: Two possible bugs when dealing with Automatic note splitting

2013-10-02 Thread Jim Tisdall

I posted some details about this a week ago, here's
a repeat of that post, it contains some version info.


Date: Tue, 24 Sep 2013 18:35:33 -0400
From: Jim Tisdall supp...@jimtisdall.com
To: lilypond-user@gnu.org
Subject: fingering problem with Note_heads_engraver
Message-ID: 524213b5.5080...@jimtisdall.com
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

I've come across the following problem using
Note_heads_engraver (and the Completion_rests_engraver)
on a guitar score that includes fingering.

The following score rewrites notes that span a quarter-note
beat as two notes with a tie.  That's what I want ...

but it also duplicates the fingering on the new, second,
tied note ... which is not desirable.

\version 2.16.2 % also with latest development version
\header {
   piece = demonstrate fingering problem with Note_heads_engraver
}

\score {
 \new Staff {
 \time 3/4
 \key c \major
 \clef treble_8
 \new Voice \with {
 \remove Note_heads_engraver
 \consists Completion_heads_engraver completionUnit = 
#(ly:make-moment 1/4)
%   \remove Rest_engraver
%   \consists Completion_rest_engraver completionUnit = 
#(ly:make-moment 1/4)
 }
 {
 % fingers are represented by e.g. -3 for the 3rd finger
 % strings are represented by e.g. \5 for the 5th 
string (in a circle)

 % the following line duplicates string and finger
 g,\6-38 c\5-44 e\4-24.

 % the following line duplicates string only (not 
finger)
 g,8\6-3 c4\5-4 e4.\4-2
 }
   }
   \layout {
   }
}





On 10/2/13 1:59 PM, lilypond-user-requ...@gnu.org wrote:

Send lilypond-user mailing list submissions to
lilypond-user@gnu.org

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.gnu.org/mailman/listinfo/lilypond-user
or, via email, send a message with subject or body 'help' to
lilypond-user-requ...@gnu.org

You can reach the person managing the list at
lilypond-user-ow...@gnu.org

When replying, please edit your Subject line so it is more specific
than Re: Contents of lilypond-user digest...


Today's Topics:

1. Two possible bugs when dealing with Automatic note splitting
   (Gilberto Agostinho)
2. Re:Two possible bugs when dealing with Automatic note
   splitting (David Kastrup)
3. Re:Two possible bugs when dealing with Automatic note
   splitting (SoundsFromSound)
4. Re:Two possible bugs when dealing with Automatic note
   splitting (Phil Holmes)
5. Re:Two possible bugs when dealing with Automatic note
   splitting (David Kastrup)
6. Re:Two possible bugs when dealing with Automatic note
   splitting (Gilberto Agostinho)
7. Re:Hairpin with pro/preceeding text (EdBeesley)


--

Message: 1
Date: Wed, 2 Oct 2013 18:45:08 +0200
From: Gilberto Agostinho gilbertohasn...@googlemail.com
To: lilypond-user lilypond-user@gnu.org
Subject: Two possible bugs when dealing with Automatic note splitting
Message-ID:
CAK2dkfpm9MJSuGc=srzdhagcomleo-nm2b2vnycypvfrena...@mail.gmail.com
Content-Type: text/plain; charset=iso-8859-1

Hello,

I think I found two possible bugs when dealing with Automatic note
splitting.

1) when a note has an accidental and it has to be split, the ligaturas look
out of place.

2) when a note has an accidental (regular accidental, or forced accidental
with an !, or even due to *dodecaphonic style*) and it has to be split,
these accidentals appear in all repeated notes.

Here is an example:

\version 2.17.26


\markup {This works perfectly well}

\new Voice \with {

   \remove Note_heads_engraver

   \consists Completion_heads_engraver

   \remove Rest_engraver

   \consists Completion_rest_engraver

}

{

   g'2\pp~g'8. f'1\mf a''2..\mf cis''4..\ff

}


\markup {But this don't, the ligaturas are out of place when notes have
accidentals}

\new Voice \with {

   \remove Note_heads_engraver

   \consists Completion_heads_engraver

   \remove Rest_engraver

   \consists Completion_rest_engraver

}

{

   g'2\pp~g'8. fis'1\mf aes''2..\mf cis''4..\ff

}


\markup {Also, accidentals (including forced ones with ! and with
dodecaphonic style) are repeated for all notes...}

\new Voice \with {

   \remove Note_heads_engraver

   \consists Completion_heads_engraver

   \remove Rest_engraver

   \consists Completion_rest_engraver

}

{

   g'2\pp~g'8. f'!1\mf

   #(set-accidental-style 'dodecaphonic)

   a''2..\mf cis''4..\ff

}


The result can be seen on this link:
http://s18.postimg.org/aty44yta1/split.png


So are these bugs or am I misusing the rhythm splitting?


Thanks a lot,

Gilberto
-- next part

fingering problem with Note_heads_engraver

2013-09-24 Thread Jim Tisdall

I've come across the following problem using
Note_heads_engraver (and the Completion_rests_engraver)
on a guitar score that includes fingering.

The following score rewrites notes that span a quarter-note
beat as two notes with a tie.  That's what I want ...

but it also duplicates the fingering on the new, second,
tied note ... which is not desirable.

\version 2.16.2 % also with latest development version
\header {
  piece = demonstrate fingering problem with Note_heads_engraver
}

\score {
\new Staff {
\time 3/4
\key c \major
\clef treble_8
\new Voice \with {
\remove Note_heads_engraver
\consists Completion_heads_engraver completionUnit = 
#(ly:make-moment 1/4)
%   \remove Rest_engraver
%   \consists Completion_rest_engraver completionUnit = 
#(ly:make-moment 1/4)
}
{
% fingers are represented by e.g. -3 for the 3rd finger
% strings are represented by e.g. \5 for the 5th string 
(in a circle)

% the following line duplicates string and finger
g,\6-38 c\5-44 e\4-24.

% the following line duplicates string only (not finger)
g,8\6-3 c4\5-4 e4.\4-2
}
  }
  \layout {
  }
}

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


Re: lilypond slowdown in CGI web program

2013-09-24 Thread Jim Tisdall

No one else reported the same problem on mac w/apache
(or anywhere else) -- in brief, a 30 second delay running lilypond
called from web page.

But just to finish up, I did get some expert attention and I tried
several things, and *something* worked, but I'm not sure what was
the change that actually solved the problem.

After including the
original post, I append some of the troubleshooting exchanges,
and, as I say, something did finally work.  (And by the way, I
tried all sorts of things, permissions, apache config files,
ad infinitum in a subjective sense.)

Thanks to Jan Nieuwenhuizen.

On 9/18/13 8:55 PM, Jim Tisdall wrote:

Hi, I'm going to briefly sketch this problem, just to see if anyone
else has come across it ... and because being specific would be a
real bear, given the interacting systems involved ...

When I call lilypond to compile a score by means of a web page
that is using CGI, lilypond takes about 25 seconds to
*successfully* complete.  From the commandline,
same files and flags, under a second; from a similar but non-web
program, under a second.

Has anyone else encountered this kind of behavior?

I have many similar scripts that call all sorts of programs under
the same (perl CGI) (apache2) (mac) unix server, no problems.
Problem appears on all attempted web browsers, so seems to be
in the lilypond-apache interaction.  My knowledge of python is slim
and of scheme is rusty; c and perl okay.  Many googles of various
ideas over several months have not worked.  I have seen some stuff
about python slowdowns and fixes, but not sure what to do with that.
I admit I've not dug too deeply into lilypond source code yet, my
c is okay (I'm a bell labs c programmer in a former incarnation.)

I've tried many different flags ... here's the current set:
/Applications/LilyPond.app/Contents/Resources/bin/lilypond
-dmidi-extension=mid -fps -fpng -dbackend=eps
-deps-box-padding=3.00 --output=basename lilyfile

Thanks for listening ;) -- Jim Tisdall




Jan,

...  In this whodunnit
my pick for the villain is FcFontSetList rescan 30 second timeout as detailed 
following.

Peace,
Jim

In more (and perhaps unwanted) detail:

...



Assuming that you're right, though, what I can imagine is something
like fontconfig's setup running each time and failing to write its
cache.


Ah, I like the sound of that.  I'm not familiar with the system, but
I look and I find
/Applications/LilyPond.app/Contents/Resources/etc/fonts/fonts.conf
in which are
!-- Font cache directory list --

cachedir/usr/var/cache/fontconfig/cachedir
cachedir~/.fontconfig/cachedir

and, tantalizingly, at the end of the fonts.conf file I find
!--
  Rescan configuration every 30 seconds when FcFontSetList is called
 --
rescan
int30/int
/rescan
/config

/fontconfig

...

There is no /usr/var/cache on my system

a locate cache/fontconfig leads me to this (among others):
$ ls -ld /Applications/LilyPond.app/Contents/Resources/var/cache/fontconfig
drwxr-xr-x@ 2 tisdall  staff  68 Jan  4  2013 
/Applications/LilyPond.app/Contents/Resources/var/cache/fontconfig

So, no write permissions for group or other.  Also, the directory is
empty.  What the hell, I try,
chmod 777 /Applications/LilyPond.app/Contents/Resources/var/cache/fontconfig

didn't solve the problem.




Have you tried running this lilypond command as the same user as the
cgi is running under?


...

I see an error message
*** Warning: GenericResourceDir doesn't point to a valid resource directory.
   the -sGenericResourceDir=... option can be used to set this.

There is a lot of font stuff including warnings.  Looks like it's setting up 
caches,
and then probably the FcFontSetList rescan 30seconds configuration kicks in ...
it's an attractive theory.

To repeat: I attach the verbose output.  I realize you are busy, hopefully 
you've got me started
down the happy path, thanks so much I really appreciate this.



Try setting LILYPOND_VERBOSE=1



I also reinstalled, and further installed the development version.

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


click track lead-in invisible bar

2013-09-18 Thread Jim Tisdall

I'm generating a click track.  I need it to start a measure
(or two) before the music in a staffgroup.  I want the extra
beginning measure to be hidden, so it doesn't show up in the
typeset score, but just sounds in the midi output.  I already
have the clicktrack hidden.  I just need it to start a measure
early, without displaying an empty measure in the score.
Thanks for considering my problem, any pointers or suggestions
will be most appreciated. -- Jim Tisdall

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


lilypond slowdown in CGI web program

2013-09-18 Thread Jim Tisdall

Hi, I'm going to briefly sketch this problem, just to see if anyone
else has come across it ... and because being specific would be a
real bear, given the interacting systems involved ...

When I call lilypond to compile a score by means of a web page
that is using CGI, lilypond takes about 25 seconds to
*successfully* complete.  From the commandline,
same files and flags, under a second; from a similar but non-web
program, under a second.

Has anyone else encountered this kind of behavior?

I have many similar scripts that call all sorts of programs under
the same (perl CGI) (apache2) (mac) unix server, no problems.
Problem appears on all attempted web browsers, so seems to be
in the lilypond-apache interaction.  My knowledge of python is slim
and of scheme is rusty; c and perl okay.  Many googles of various
ideas over several months have not worked.  I have seen some stuff
about python slowdowns and fixes, but not sure what to do with that.
I admit I've not dug too deeply into lilypond source code yet, my
c is okay (I'm a bell labs c programmer in a former incarnation.)

I've tried many different flags ... here's the current set:
/Applications/LilyPond.app/Contents/Resources/bin/lilypond
-dmidi-extension=mid -fps -fpng -dbackend=eps
-deps-box-padding=3.00 --output=basename lilyfile

Thanks for listening ;) -- Jim Tisdall

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


Re:completion_heads_engraver within a bar

2013-06-05 Thread Jim Tisdall

Many thanks for the help with completion_heads_engraver.

I've got a related question about completion_rest_engraver

In this example, I'm trying to split the rhythms in bars of 4/4
time, so that note values that span the beginning of the third
beat, are rewritten with ties.  (The idea is that it's easier to
read rhythms in 2-beat chunks with ties between them.)

But I'm trying to do a similar thing with rests.
I'd like to have the rests that span the 3rd downbeat, to be split
into two rests, the second one starting at the 3rd downbeat.

Either I'm using the wrong syntax for \with, or the
Completion_rest_engraver just doesn't do what I would desire, or ??

This example score is 4/4 time and I'm asking for adjustments
every 2 beats (with 1/2).  The rests in the 2nd and 3rd bars
span the 3rd downbeat: I'd like to get a quarter rest followed
by an eighth rest, and an eighth rest followed by a quarter rest,
respectively, in those bars.

Peace,
Jim

\version 2.16.0
\score {
  \new Staff {
\clef treble_8
\key c \major
\time 4/4

\new Voice \with {
  \remove Note_heads_engraver
  \consists Completion_heads_engraver
  completionUnit = #(ly:make-moment 1/2)
  \remove Rest_engraver
  \consists Completion_rest_engraver
  completionUnit = #(ly:make-moment 1/2)
}
{  r4 c'4. r8 c'4 c'4 r4. c'4. c'4. r4. c'4 r8 c'4. c'4. r8 }
  }
}


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


completion_heads_engraver within a bar

2013-06-03 Thread Jim Tisdall

Relative newbie alert.

I'd like to have the action of the completion_heads(rests)_engraver
*within* a bar --- so that, for example, rhythms that cross over the
start of the 3rd beat in a measure of 4/4 rewrite as two groups of
two-beat rhythms with a tie between them.  (Also, between bars
as before).

I had the idea of changing the time signature to 2/4 (in that example),
calling the completion_heads_engraver and completion_rests_engraver,
and then wrapping that back into a 4/4 time signature.  But I'm not
sure if that's the happy path to take.

(I'd also, for example, like to handle 3/8 time signatures, by rewriting
as 3 groups of 1/8 beat-long groups, with ties between them as needed.
And etc...)

I'm generating random rhythms from user input, so this will be a
help.  I've actually got a perl rewrite program that's mostly working,
but then I found the completion_heads_engraver and realized that my
needs might already be met by the lilypond system.  Any built-in
solution or sage advice would be much appreciated.

Thanks for your help, and
Peace,
Jim

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


lilypond on webserver

2013-06-01 Thread Jim Tisdall

I'm making interactive typesetting to provide material
to users of a music book.  First pass, I'm using mac pro
system and perl CGI and apache 2.2 server.  (I've programmed
in scheme in the past, but perl is likely the best - quickest -
tool for what I'm doing.)

1) I don't see a way to have the actual graphics (e.g. png) output to
   a pipe like STDOUT, instead of to a file, when invoking
   lilypond, on a unix command line.  Right?

2) I'm getting an error message to STDOUT (appears on my
   web page) related to permissions of webuser ... anyway,
   it's


*** Warning: GenericResourceDir doesn't point to a valid resource directory. 
the -sGenericResourceDir=... option can be used to set this.


Advice on how to pass that through to ghostscript when compiling a
score with lilypond?

3) Has anyone ever put lilypond into webserver memory, using ModPerl
   or similar, performance-enhancing, facility?

4) Are there any lilypond/perl programmers within the sound of my voice?
   I'm developing some typical perl-style parsing and transformation and
   system-calling perl code for lilypond.  I'd love to not reinvent this
   wheel.

Peace,
Jim

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


publish music book

2013-04-22 Thread Jim Tisdall

I'm preparing a book for publication.

My book incorporates many short examples and a fair amount
of text.  I am developing a web site so that
readers can  be presented with customized exercises and hear
midi playback.  The complete exercises will be only
available on the web.  I've got a couple publishers interested
(I've published books before).

Lilypond has several methods to combine text and examples.
One is lilypond-book, but due to the many examples in my
chapters, I find that is too slow, so I'm
deciding on other ways to include the graphics.  No problem
since everything is made possible, especially for a
programmer.  Probably some combo of lilypond with make.

If you've been down this road, providing a book that
incorporates lilypond typesetting to a publisher, I'd
be very grateful to hear about your experience and
advice on successful practices as well as pitfalls;
and in past experience, which publishers accept/dislike
lilypond and may prefer other formats for submissions.

Peace,
Jim

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


sudo frescobaldi for music view

2013-04-17 Thread Jim Tisdall

Hi everybody.

I finally got frescobaldi running on my mac pro os x 10.7.5,
by backing out of previous installs and using macports
instead -- and by lots of trial and error.  The Music View
pane now opens and works ... but only if I start up
frescobaldi with sudo frescobaldi.   Otherwise, with
just frescobaldi and no sudo, the graphics
start up without the Music View pane, but no error messages.

(A previous post by
Paul Morris had recommended sudo python setup.py install
for poppler-qt and that did seem to work, but maybe is
a cause of this.)

Anyone seen this, and have an idea for what's wrong?
Nothing obvious that I've seen yet.  (I'm an old Bell Labs unix
hand and a programmer, but I have little python
or mac sysadmin experience.)

Peace,
Jim


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


sudo frescobaldi for music view

2013-04-17 Thread Jim Tisdall

All,

By reinstalling the sudo is no longer necessary for Music View.
Not sure what happened previously, some conflicting permissions
between macport and non-macport installations, is my guess.

Thanks,
Jim

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


frescobaldi on mac

2013-01-12 Thread Jim Tisdall

In trying to compile frescobaldi on my mac pro osx10.7.5, I have the
program running but I've run into the following problem with trying
to get the python-poppler-qt4-0.16.3 extension to work:

$ python setup.py build
running build
running build_ext
building 'popplerqt4' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe
-fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE
-DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g
-fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch
x86_64 -pipe -I/Users/tisdall/src/QtSDK/Desktop/Qt/4.8.1/gcc/include
-I/Users/tisdall/src/QtSDK/Desktop/Qt/4.8.1/gcc/include/QtCore
-I/Users/tisdall/src/QtSDK/Desktop/Qt/4.8.1/gcc/include/QtGui
-I/Users/tisdall/src/QtSDK/Desktop/Qt/4.8.1/gcc/include/QtXml
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-c build/temp.macosx-10.7-intel-2.7/sippopplerqt4cmodule.cpp -o
build/temp.macosx-10.7-intel-2.7/build/temp.macosx-10.7-intel-2.7/sippopplerqt4cmodule.o
cc1plus: warning: command line option -Wstrict-prototypes is valid for
Ada/C/ObjC but not for C++
In file included from
build/temp.macosx-10.7-intel-2.7/sippopplerqt4cmodule.cpp:7:
poppler-qt4.sip:24:29: error: qt4/poppler-qt4.h: No such file or directory
poppler-link.sip:41:30: error: qt4/poppler-link.h: No such file or directory


and etc etc.  I have python2.7.1, sip4.14.2, and PyQT4.9.6

Any suggestions would be welcome, if you've successfully compiled
this on the mac.

Peace,
Jim

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


newbie guitar fingering layout question

2012-10-07 Thread Jim Tisdall

Greetings!  I'll introduce myself after asking my question.

I'm new to Lilypond and have a question about laying out some
fingering in guitar material for a new book I'm writing.  I'm
not neglecting the copious documentation, but I'm still on the
learning curve for sure and have missed or misunderstood a lot
as of yet.

Using LilyPond 2.16.0, modified the scripts.scm definitions of
\upbow and \downbow  so they are DOWN instead of UP (couldn't
see a way to do that in the score ... yes, I'm a newbie).

The following small example produces a brace of standard notation and 
tablature:


lilypond
 
\new Staff {
   \clef treble_8
 \set fingeringOrientations = #'(down)
 \set stringNumberOrientations = #'(up)
 \set strokeFingerOrientations = #'(down)  % these are RH

  e\6\downbow-1 f\upbow-3 g\downbow-4
  a\5\downbow-1 b\upbow-3 c'\downbow-4
  d'\4\downbow-1 e'\upbow-3 f'\downbow-4
  g'\3\downbow-1 a'\upbow-3
  b'\2\downbow-1 c''\upbow-2
  d''\downbow-4 e''\1\downbow-1 f''\upbow-2 g''\downbow-4
}

\new TabStaff {
\clef moderntab

 \set fingeringOrientations = #'(down)
 \set stringNumberOrientations = #'(up)
 \set strokeFingerOrientations = #'(down)  % these are RH

  e\6 f\6 g\6
  a\5 b\5 c'\5
  d'\4 e'\4 f'\4
  g'\3 a'\3
  b'\2 c''\2 d''\2
  e''\1 f''\1 g''\1
}
 
 /lilypond

My main question is this: I'd like to have the bow and
left-hand fingering and right-hand fingering appear in the
space between the two staffs, in a straight line, so they
can be seen easily by those reading either the standard
staff above, or the tablature staff below.  How to do?  The
staffs are in synch, so I just need to take the fingering
info from the standard staff and push it down so it will
line up underneath (and therefore between the two staffs.)

As part of this, I'll need to figure out how to adjust the
spacing between the staffs ... well really I have many
things I need to learn how to do!


to introduce myself:
I'm a musician and scientist, published author and so forth.
I got interested in computer music way back when and ended
up working with Max Mathews at Bell Labs for seven years.
The computer skills I learned I then used in human genome
project.  But now I'm back to full-time music.  I've played
with some names ... I'm fairly eclectic.

I'm writing a large book on guitar technique, Sibelius didn't
have what I needed so I'm turning to Lilypond which does.
I like the edit-compile-run ; I'm trained in several computer
languages.  I'm developing Perl classes to process my
Lilypond scores.  I have programmed in Scheme but not recently,
but it's a comfort to have a real programming language embedded.
(Again, Sibelius with Manuscript seems a bit painful, although
it is a nice WYSIWYG and has many excellent features.)

Thanks and I'm glad I found this software and this community!
Peace,
Jim Tisdall

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