Re: Can't use NoteNames twice in score block ??

2011-02-11 Thread Phil Holmes
- Original Message - 
From: Michael Ellis


I'm not having much luck reducing it down to a minimal example.   I have 
family visiting for the next few days, so I'll try to pick it back up 
after Christmas.



Cheers and happy holidays to all!,
Mike


Michael,

Did you make any progress with creating a Tiny example of this issue?

--
Phil Holmes




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


Re: Can't use NoteNames twice in score block ??

2011-02-11 Thread Michael Ellis
On Fri, Feb 11, 2011 at 8:53 AM, Phil Holmes m...@philholmes.net wrote:

 Michael,

 Did you make any progress with creating a Tiny example of this issue?


No.  I tried for a while and then decided to let it sleep.  It's not
impacting the things I'm currently doing with LilyPond.  Thanks for
asking! If it's a real bug I'm sure it will come back to bite me again
and I'll pursue it then.

Cheers,
Mike

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


Re: Can't use NoteNames twice in score block ??

2010-12-24 Thread Michael Ellis
Hi Jakob,

I'm not having much luck reducing it down to a minimal example.   I have
family visiting for the next few days, so I'll try to pick it back up after
Christmas.

Cheers and happy holidays to all!,
Mike


On Thu, Dec 23, 2010 at 4:28 PM, jakob lund jakob.be...@gmail.com wrote:

 2010/12/23 Michael Ellis michael.f.el...@gmail.com:
  Thanks, Jakob! I didn't understand that a music-filter acts recursively
 on
  containers and their contents.  I had some vague notion that it simply
  passed or rejected elements at the top  level of a list.  Your example is
  what I needed.  For my purposes I needed to add RestEvent and
  TransposedMusic to the list of types but that was a logical extension
 once I
  saw the pattern.
  #(define (filterEvent event)
  (let ((name (ly:music-property event 'name)))
   (or
 (eq? name 'EventChord)
 (eq? name 'NoteEvent)
 (eq? name 'RestEvent)
 (eq? name 'RelativeOctaveMusic)
 (eq? name 'TransposedMusic)
 (eq? name 'SequentialMusic
  With this, I can now create multiple staff scores with solfege symbols
 under
  each staff.  The only problem remaining is that the page layout is
  apparently not taking into account the extra vertical space needed for
 the
  solfege text, so I get incomplete systems at the bottom of the page. The
  layout has no problems if I remove the NoteNames contexts that generate
 the
  solfege.

 that sounds strange -- from what you write, it sounds like a problem
 with the NoteNames context rather than with what you feed into it...
 Can you give a simple example where that happens? Have you tried if
 something simple like
  \context NoteNames { \repeat unfold 40 c'4 }
 can provoke the same problem?

  Do I need to add some other types to my filter or is this another problem
  altogether?
  Cheers,
  Mike
 
 
  On Thu, Dec 23, 2010 at 5:15 AM, jakob lund jakob.be...@gmail.com
 wrote:
 
  #(define (filterEvent event)
  (let ((name (ly:music-property event 'name)))
   (or
 (eq? name 'EventChord)
 (eq? name 'NoteEvent)
 (eq? name 'RelativeOctaveMusic)
 (eq? name 'SequentialMusic
 
  onlynotes = #(define-music-function (P L M) (ly:music?)
 (music-filter filterEvent M))
 
  { %\displayMusic
   \onlynotes
   \relative c'' { \key a \major cis d16 } }
  -
 

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

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


Re: Can't use NoteNames twice in score block ??

2010-12-23 Thread jakob lund
2010/12/23 Michael Ellis michael.f.el...@gmail.com:
 I'm clearly Scheme challenged. I've spent several hours trying different
 variations of the following.
 #(define (note? x)
      (eq? 'EventChord (ly:music-property x 'name)))
 #(define notesOnly
 ;; Remove anything that is not a note.
   (define-music-function (parser location music) (ly:music?)
         (music-filter (lambda (x)  (if (note? x) x #f) )  music)))
 If I run different versions \notesOnly  on music containing notes plus other
 things, I get either everything passing through unchanged or everything
 removed.  What's the right way to construct  a music filter that returns
 only the pitch-carrying elements?

You have to permit more types of music, that act as containers, as
well as the actual 'NoteEvent objects:

#(define (filterEvent event)
 (let ((name (ly:music-property event 'name)))
  (or
(eq? name 'EventChord)
(eq? name 'NoteEvent)
(eq? name 'RelativeOctaveMusic)
(eq? name 'SequentialMusic

onlynotes = #(define-music-function (P L M) (ly:music?)
(music-filter filterEvent M))

{ %\displayMusic
  \onlynotes
  \relative c'' { \key a \major cis d16 } }
-
the \displayMusic command is only for debugging your function - if
your music disappears you uncomment it and comment out \onlynotes, so
you get a text representation of the unfiltered music. For example,
adding  \relative c'' caused the music to be wrapped in a
'RelativeOctaveMusic

Jakob.



 Cheers,
 Mike


 On Wed, Dec 22, 2010 at 2:14 PM, Michael Ellis michael.f.el...@gmail.com
 wrote:

 Thanks, Carl.  This looks promising ...
 Cheers,
 Mike


 On Wed, Dec 22, 2010 at 10:46 AM, Carl Sorensen c_soren...@byu.edu
 wrote:

 On 12/22/10 8:08 AM, Michael Ellis michael.f.el...@gmail.com wrote:
 
 
  Putting this together with your workaround produces the code and output
  shown
  below.  This works quite well.  So the issue I'm wrestling with now is
  whether
  it's feasible to automate the editing of 400+ files to separate the
  clef and
  instrument names from the notation, detect the original key, and
  rewrite the
  score block to produce the desired results.
 
  Thanks again for your help and any suggestions for how proceed with the
  automation are more than welcome.

 You might try using music-filter to help you.  Since you already have
 blocks
 by voice, you could filter the full block to keep only EventChords (every
 note, whether or not it's in a chord, is in an EventChord) and used the
 filtered music for your NoteNames context.

 Note that I haven't tried this, and won't have time to try it today.

 You can see an example of how Valentin has done this here:

 http://repo.or.cz/w/opus_libre.git/blob/HEAD:/lib/libdynamic.scm#l58

 HTH,

 Carl






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



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


Re: Can't use NoteNames twice in score block ??

2010-12-23 Thread Phil Hézaine
Le 22/12/2010 16:08, Michael Ellis a écrit :
 Carl, thanks for taking the time to figure it out!  I really appreciate the
 help. It's good to know there's a workaround.
 
 I'm undertaking a project to produce files containing all the Bach Chorales
 with solfege syllables (movable Do, La-based minor) under each part.  I'm
 starting with the MusicXML files created by Margaret Greentree at
 www.jsbchorales.net.  It turns out that MusesScore can be run in batch modes
 to produce LilyPond files.  I was able to convert all 400 of them in about
 10 minutes of run time.
 

Hi,

Welcome to the club! Thanks to Frescobaldi which saves me a lot of time,
I'm currently typesetting a bunch of Bach Chorales
from a Breitkopf  Härtel's edition. At this time I use the BWV
references of jsbchorales.net. but not the sources which are different
from mine.
It seems there are a lot of corrections but I don't know if it's allowed
to use them with the aim of a copyleft *publishing*. (Probably under a
Free Art license). More exactly whose sources are coming from? Are they
all authentified? No copyright editor behind the hood?  Has anyone more
informations?
My idea is to publish in a book different versions of a chorale one
after the other. I join 2 examples. And later, I'd like to upload the
voices as dictations in GNU Solfege.
I'm very curious of your batch modes. More about this? May be it could
be useful for a diff beetween my old reference and this new rather than
checking PDFs.

Regards.
Phil.



\version 2.12.2

 #(ly:set-option 'delete-intermediate-files #t)

  \paper {
%   between-system-padding = #0.1
%   ragged-bottom = ##f
%   ragged-last-bottom = ##f
}

  \header {
   title = (16) Es woll' uns Gott genädig sein - BWV 311
  }

  guidemidi = {
%%%\repeat volta 2 {
\tempo 4 = 78

%%%} % fin du repeat

}

  upper = {
\time 4/4
\key b \minor
\clef treble
\partial 4
\voiceOne
 { 
% SOPRANO
\set Voice.midiInstrument = acoustic grand
\relative c'' {
\repeat volta2 {
cis4 |
d4 cis b cis8 d |
e4 fis e d |
cis2\fermata r4 e |
d4 cis d b |
a4 fis8 g a4 g |
fis2.\fermata } %fin du repeat
a4 |
g4 fis e fis |
d4 e fis\fermata cis' |
d4 cis b cis8 d |
e4 d cis\fermata fis |
e8 d cis d e4 b |
a4 g! fis\fermata e |
a4 b cis8 d e4 |
d4 cis b\fermata d |
cis4 b a8 g fis g |
a4 g fis2 ~ |
fis2.\fermata
\bar |.
} % fin de relative
}

\context Voice=1 { \voiceTwo 
% ALTO
\set Voice.midiInstrument = acoustic grand
\relative c' {
\repeat volta2 {
fis4 |
fis4 fis g a |
g4 fis8 gis ais4 b |
ais2 r4 cis |
b8 a g4 a g8 fis |
e4 d8 e fis4 e8 d |
cis2. } %fin du repeat
cis4 |
d4 d cis cis |
d8 cis b4 cis fis |
fis8 gis ais4 b ais8 b |
cis8 fis, fis4 fis a! |
gis4 a e e |
e8 d e cis d4 cis |
cis8 dis e4 e8 fis g! fis |
fis8 gis a4 gis fis |
e8 fis g4 fis8 e d4 |
e2. d4 ~ |
d4 cis8 b cis4
\bar |.
} % fin de relative
\oneVoice
} 
}

  lower = {
\time 4/4
\key b \minor
\clef bass
\partial 4
\voiceOne
 { 
% TENOR
\set Voice.midiInstrument = acoustic grand
\relative c' {
\repeat volta2 {
ais4 |
b4 cis8 d e4 a, |
b8 cis d4 e fis |
fis2 r4 fis |
fis4 e d d |
e4 a,8 b c4 b |
ais2. } %fin du repeat
a4 |
b4 a a8 g fis4 |
fis4 b ais ais |
b4 e fis e8 d |
cis4 b ais! b |
b4 a b8 a gis4 |
a4 a a a |
a4 gis ais8 b cis4 ~ |
cis8 b8 e4 e a,8 b |
cis4 d d a |
a4 b cis! b ~ |
b4 ais8 gis ais4
\bar |.
} % fin de relative
}
\context Voice=1 { \voiceTwo 
% BASS
\set Voice.midiInstrument = acoustic grand
\relative c {
\repeat volta2 {
fis4 |
b4 a! g fis |
e4 d cis b |
fis'2\fermata r4 ais |
b4 e, fis g |
cis,4 d dis e |
fis2.\fermata } %fin du repeat
fis4 |
b,8 cis d4 a ais |
b4 g fis\fermata fis' |
b4 cis d cis8 b |
ais4 b fis\fermata dis |
e4 fis gis8 fis e d |
cis8 b cis a d4\fermata a'8 gis |
fis4 e8 d cis b ais4 |
b4 cis8 dis e4\fermata fis8 gis |
a4 b8 cis d4 d, |
c4 b ais b |
fis 2.\fermata
\bar |.
} % fin de relative
\oneVoice
} 
}


  \score { 

\new PianoStaff 
%\set PianoStaff.instrumentName = \markup{ \fontsize #6 { 

Re: Can't use NoteNames twice in score block ??

2010-12-23 Thread Michael Ellis
Thanks, Jakob! I didn't understand that a music-filter acts recursively on
containers and their contents.  I had some vague notion that it simply
passed or rejected elements at the top  level of a list.  Your example is
what I needed.  For my purposes I needed to add RestEvent and
TransposedMusic to the list of types but that was a logical extension once I
saw the pattern.

#(define (filterEvent event)
(let ((name (ly:music-property event 'name)))
 (or
   (eq? name 'EventChord)
   (eq? name 'NoteEvent)
   (eq? name 'RestEvent)
   (eq? name 'RelativeOctaveMusic)
   (eq? name 'TransposedMusic)
   (eq? name 'SequentialMusic

With this, I can now create multiple staff scores with solfege symbols under
each staff.  The only problem remaining is that the page layout is
apparently not taking into account the extra vertical space needed for the
solfege text, so I get incomplete systems at the bottom of the page. The
layout has no problems if I remove the NoteNames contexts that generate the
solfege.

Do I need to add some other types to my filter or is this another problem
altogether?

Cheers,
Mike


On Thu, Dec 23, 2010 at 5:15 AM, jakob lund jakob.be...@gmail.com wrote:

 #(define (filterEvent event)
 (let ((name (ly:music-property event 'name)))
  (or
(eq? name 'EventChord)
(eq? name 'NoteEvent)
(eq? name 'RelativeOctaveMusic)
(eq? name 'SequentialMusic

 onlynotes = #(define-music-function (P L M) (ly:music?)
(music-filter filterEvent M))

 { %\displayMusic
  \onlynotes
  \relative c'' { \key a \major cis d16 } }
 -

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


Re: Can't use NoteNames twice in score block ??

2010-12-23 Thread Michael Ellis
Hi Phil! Thanks for the encouragement. I'll try to respond to all your
questions later,  but for now here's the python script I used to invoke
MuseScore (command line name is mscore) on the files I downloaded from
Margaret Greentree's site. I'm running on a Mac with OS 10.6 so this should
work on Linux, too and possibly on Windows with appropriate changes to
accommodate the differences in path specs.

 cat xml2ly.py
#!/usr/bin/env python

Script that invokes mscore to convert MusicXml files in current directory
to Lilypond files.

import os, sys
from subprocess import Popen
import glob
xmlfiles = glob.glob(*.xml)

## Replace with path to mscore on your system
mscore = /Applications/MuseScore.app/Contents/MacOS/mscore

for x in xmlfiles:
print Converting %s ...%x
ly = os.path.splitext(x)[0] + .ly
cmd = %(mscore)s %(x)s -o %(ly)s%locals()
print cmd
p = Popen(cmd,shell=True)
p.wait()
print Done



Cheers,
Mike


On Thu, Dec 23, 2010 at 10:28 AM, Phil Hézaine philippe.heza...@free.frwrote:

 Le 22/12/2010 16:08, Michael Ellis a écrit :
  Carl, thanks for taking the time to figure it out!  I really appreciate
 the
  help. It's good to know there's a workaround.
 
  I'm undertaking a project to produce files containing all the Bach
 Chorales
  with solfege syllables (movable Do, La-based minor) under each part.  I'm
  starting with the MusicXML files created by Margaret Greentree at
  www.jsbchorales.net.  It turns out that MusesScore can be run in batch
 modes
  to produce LilyPond files.  I was able to convert all 400 of them in
 about
  10 minutes of run time.
 

 Hi,

 Welcome to the club! Thanks to Frescobaldi which saves me a lot of time,
 I'm currently typesetting a bunch of Bach Chorales
 from a Breitkopf  Härtel's edition. At this time I use the BWV
 references of jsbchorales.net. but not the sources which are different
 from mine.
 It seems there are a lot of corrections but I don't know if it's allowed
 to use them with the aim of a copyleft *publishing*. (Probably under a
 Free Art license). More exactly whose sources are coming from? Are they
 all authentified? No copyright editor behind the hood?  Has anyone more
 informations?
 My idea is to publish in a book different versions of a chorale one
 after the other. I join 2 examples. And later, I'd like to upload the
 voices as dictations in GNU Solfege.
 I'm very curious of your batch modes. More about this? May be it could
 be useful for a diff beetween my old reference and this new rather than
 checking PDFs.

 Regards.
 Phil.



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


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


Re: Can't use NoteNames twice in score block ??

2010-12-23 Thread Phil Hézaine
Le 23/12/2010 18:05, Michael Ellis a écrit :
 Hi Phil! Thanks for the encouragement. I'll try to respond to all your
 questions later,  but for now here's the python script I used to invoke
 MuseScore (command line name is mscore) on the files I downloaded from
 Margaret Greentree's site. I'm running on a Mac with OS 10.6 so this should
 work on Linux, too and possibly on Windows with appropriate changes to
 accommodate the differences in path specs.
 
 cat xml2ly.py
 #!/usr/bin/env python
 
 Script that invokes mscore to convert MusicXml files in current directory
 to Lilypond files.
 
 import os, sys
 from subprocess import Popen
 import glob
 xmlfiles = glob.glob(*.xml)
 
 ## Replace with path to mscore on your system
 mscore = /Applications/MuseScore.app/Contents/MacOS/mscore
 
 for x in xmlfiles:
 print Converting %s ...%x
 ly = os.path.splitext(x)[0] + .ly
 cmd = %(mscore)s %(x)s -o %(ly)s%locals()
 print cmd
 p = Popen(cmd,shell=True)
 p.wait()
 print Done
 
 
 
 Cheers,
 Mike

Thanks Michael for sharing it. I will try it later on my Gentoo-Linux.
Cheers.

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


Re: Can't use NoteNames twice in score block ??

2010-12-23 Thread jakob lund
2010/12/23 Michael Ellis michael.f.el...@gmail.com:
 Thanks, Jakob! I didn't understand that a music-filter acts recursively on
 containers and their contents.  I had some vague notion that it simply
 passed or rejected elements at the top  level of a list.  Your example is
 what I needed.  For my purposes I needed to add RestEvent and
 TransposedMusic to the list of types but that was a logical extension once I
 saw the pattern.
 #(define (filterEvent event)
         (let ((name (ly:music-property event 'name)))
              (or
                (eq? name 'EventChord)
                (eq? name 'NoteEvent)
                (eq? name 'RestEvent)
                (eq? name 'RelativeOctaveMusic)
                (eq? name 'TransposedMusic)
                (eq? name 'SequentialMusic
 With this, I can now create multiple staff scores with solfege symbols under
 each staff.  The only problem remaining is that the page layout is
 apparently not taking into account the extra vertical space needed for the
 solfege text, so I get incomplete systems at the bottom of the page. The
 layout has no problems if I remove the NoteNames contexts that generate the
 solfege.

that sounds strange -- from what you write, it sounds like a problem
with the NoteNames context rather than with what you feed into it...
Can you give a simple example where that happens? Have you tried if
something simple like
  \context NoteNames { \repeat unfold 40 c'4 }
can provoke the same problem?

 Do I need to add some other types to my filter or is this another problem
 altogether?
 Cheers,
 Mike


 On Thu, Dec 23, 2010 at 5:15 AM, jakob lund jakob.be...@gmail.com wrote:

 #(define (filterEvent event)
         (let ((name (ly:music-property event 'name)))
              (or
                (eq? name 'EventChord)
                (eq? name 'NoteEvent)
                (eq? name 'RelativeOctaveMusic)
                (eq? name 'SequentialMusic

 onlynotes = #(define-music-function (P L M) (ly:music?)
                                    (music-filter filterEvent M))

 { %\displayMusic
  \onlynotes
  \relative c'' { \key a \major cis d16 } }
 -


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


Re: Can't use NoteNames twice in score block ??

2010-12-22 Thread Michael Ellis
Carl, thanks for taking the time to figure it out!  I really appreciate the
help. It's good to know there's a workaround.

I'm undertaking a project to produce files containing all the Bach Chorales
with solfege syllables (movable Do, La-based minor) under each part.  I'm
starting with the MusicXML files created by Margaret Greentree at
www.jsbchorales.net.  It turns out that MusesScore can be run in batch modes
to produce LilyPond files.  I was able to convert all 400 of them in about
10 minutes of run time.

The mechanism for producing the solfege syllables is fairly well resolved.
 I adapted an example from Valentin ( see
http://stackoverflow.com/questions/4378228/lilypond-extracting-pitch-names-from-music)
that uses a scheme function to work around another NoteNames problem:
default reversion to dutch pitch names.

To apply it to the chorale files, I just need to put the dutch to solfa
mapping and the scheme function at the top of each file and in the score
block, call the NoteNames engraver like so:

\context NoteNames = NNS \with {
   \override NoteName #'stencil = #solfaNames
} { transpose fa do \Snotes }

where the transposition is from the original key signature back to C major
to produce movable Do solfa.

Putting this together with your workaround produces the code and output
shown below.  This works quite well.  So the issue I'm wrestling with now is
whether it's feasible to automate the editing of 400+ files to separate the
clef and instrument names from the notation, detect the original key, and
rewrite the score block to produce the desired results.

Thanks again for your help and any suggestions for how proceed with the
automation are more than welcome.

Cheers,
Mike

\version 2.12.3
dutchtosolfa =
#`((ces . de)
   (c . do)
   (cis . di)
   (des . ra)
   (d . re)
   (dis . ri)
   (ees . me)
   (e . mi)
   (f . fa)
   (fis . fi)
   (ges . se)
   (g . sol)
   (gis . si)
   (aes . le)
   (a  . la)
   (ais . li)
   (bes . te)
   (b   . ti)
   )

solfaNames =
#(lambda (grob)
   (let* ((default-name (ly:grob-property grob 'text))
  (new-name (assoc-get default-name dutchtosolfa)))
 (ly:grob-set-property! grob 'text (markup #:italic #:smaller
new-name))
 (ly:text-interface::print grob)))

Snotes = \relative c' {
 \time 4/4
 \partial 4
 a'4 |
 bes4 a g d' |
}

Bnotes = \relative c {
 \time 4/4
 \partial 4
 d4 |
 g4 a bes a8 g |
}

ASvoiceAA = {
 \set Staff.instrumentName = #Soprano
 \clef treble
 \key f \major
 \Snotes
}


ABvoiceDA = {
 \set Staff.instrumentName = #Bass
 \clef bass
 \key f \major
 \Bnotes
}


\score {
 
   \new Voice = ASVoiceAA  { \ASvoiceAA }
   \new NoteNames = NNS  \with {
   \override NoteName #'stencil = #solfaNames
} {\transpose f c \Snotes}

   \new Voice = ABvoiceDA {\ABvoiceDA}
   \new NoteNames = NNB \with {
   \override NoteName #'stencil = #solfaNames
} {\transpose f c \Bnotes}
 
}%% end of score-block

On Tue, Dec 21, 2010 at 10:17 PM, Carl Sorensen c_soren...@byu.edu wrote:




 On 12/21/10 5:14 PM, Michael Ellis michael.f.el...@gmail.com wrote:

  On Tue, Dec 21, 2010 at 7:12 PM, Michael Ellis 
 michael.f.el...@gmail.com
  wrote:
  While working with a much larger version of the score below  (BWV 206
 chorale
  in 4 voices),  I tried using the NoteNames engraver to put note names
 under
  each voice.  For some reason,  invoking it twice causes the clef and
  instrument name to change on the top staff.  The notes (and the note
 names)
  are correct, but the Soprano line gets a bass clef and the bass
 instrument
  name.   Is this a known problem?

 Mike,

 The problem is apparently that the \clef command implicitly creates some
 kind of staff context if it's in a NoteNames context.

 If you take the \clef commands out of the music passed to the NoteNames
 context, then things seem to work right.  (I haven't fully tested the
 instrumentName to see if it can be part of the NoteNames context or not).

 Here's some code that works:

 \version 2.12.3

 Snotes = \relative c' {
   \time 4/4
  \partial 4
  a'4 |
   bes4 a g d' |
 }

 Bnotes = \relative c {
   \time 4/4
  \partial 4
  d4 |
   g4 a bes a8 g |
 }

 ASvoiceAA = {
   \set Staff.instrumentName = #Soprano
  \clef treble
  \key f \major
   \Snotes
 }


 ABvoiceDA = {
   \set Staff.instrumentName = #Bass
  \clef bass
  \key f \major
   \Bnotes
 }


 \score {
  
\new Voice = ASVoiceAA  { \ASvoiceAA }
\new NoteNames = NNS  {\Snotes}

\new Voice = ABvoiceDA {\ABvoiceDA}
\new NoteNames = NNB {\Bnotes}
  
 }%% end of score-block


 HTH,

 Carl


attachment: solfa.png___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Can't use NoteNames twice in score block ??

2010-12-22 Thread Carl Sorensen
On 12/22/10 8:08 AM, Michael Ellis michael.f.el...@gmail.com wrote:

 
 Putting this together with your workaround produces the code and output shown
 below.  This works quite well.  So the issue I'm wrestling with now is whether
 it's feasible to automate the editing of 400+ files to separate the clef and
 instrument names from the notation, detect the original key, and rewrite the
 score block to produce the desired results.  
 
 Thanks again for your help and any suggestions for how proceed with the
 automation are more than welcome.  

You might try using music-filter to help you.  Since you already have blocks
by voice, you could filter the full block to keep only EventChords (every
note, whether or not it's in a chord, is in an EventChord) and used the
filtered music for your NoteNames context.

Note that I haven't tried this, and won't have time to try it today.

You can see an example of how Valentin has done this here:

http://repo.or.cz/w/opus_libre.git/blob/HEAD:/lib/libdynamic.scm#l58

HTH,

Carl




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


Re: Can't use NoteNames twice in score block ??

2010-12-22 Thread Michael Ellis
Thanks, Carl.  This looks promising ...
Cheers,
Mike


On Wed, Dec 22, 2010 at 10:46 AM, Carl Sorensen c_soren...@byu.edu wrote:

 On 12/22/10 8:08 AM, Michael Ellis michael.f.el...@gmail.com wrote:
 
 
  Putting this together with your workaround produces the code and output
 shown
  below.  This works quite well.  So the issue I'm wrestling with now is
 whether
  it's feasible to automate the editing of 400+ files to separate the clef
 and
  instrument names from the notation, detect the original key, and rewrite
 the
  score block to produce the desired results.
 
  Thanks again for your help and any suggestions for how proceed with the
  automation are more than welcome.

 You might try using music-filter to help you.  Since you already have
 blocks
 by voice, you could filter the full block to keep only EventChords (every
 note, whether or not it's in a chord, is in an EventChord) and used the
 filtered music for your NoteNames context.

 Note that I haven't tried this, and won't have time to try it today.

 You can see an example of how Valentin has done this here:

 http://repo.or.cz/w/opus_libre.git/blob/HEAD:/lib/libdynamic.scm#l58

 HTH,

 Carl




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


Re: Can't use NoteNames twice in score block ??

2010-12-22 Thread Michael Ellis
I'm clearly Scheme challenged. I've spent several hours trying different
variations of the following.

#(define (note? x)
 (eq? 'EventChord (ly:music-property x 'name)))

#(define notesOnly
;; Remove anything that is not a note.
  (define-music-function (parser location music) (ly:music?)
(music-filter (lambda (x)  (if (note? x) x #f) )  music)))

If I run different versions \notesOnly  on music containing notes plus other
things, I get either everything passing through unchanged or everything
removed.  What's the right way to construct  a music filter that returns
only the pitch-carrying elements?



Cheers,
Mike


On Wed, Dec 22, 2010 at 2:14 PM, Michael Ellis michael.f.el...@gmail.comwrote:

 Thanks, Carl.  This looks promising ...
 Cheers,
 Mike



 On Wed, Dec 22, 2010 at 10:46 AM, Carl Sorensen c_soren...@byu.eduwrote:

 On 12/22/10 8:08 AM, Michael Ellis michael.f.el...@gmail.com wrote:
 
 
  Putting this together with your workaround produces the code and output
 shown
  below.  This works quite well.  So the issue I'm wrestling with now is
 whether
  it's feasible to automate the editing of 400+ files to separate the clef
 and
  instrument names from the notation, detect the original key, and rewrite
 the
  score block to produce the desired results.
 
  Thanks again for your help and any suggestions for how proceed with the
  automation are more than welcome.

 You might try using music-filter to help you.  Since you already have
 blocks
 by voice, you could filter the full block to keep only EventChords (every
 note, whether or not it's in a chord, is in an EventChord) and used the
 filtered music for your NoteNames context.

 Note that I haven't tried this, and won't have time to try it today.

 You can see an example of how Valentin has done this here:

 http://repo.or.cz/w/opus_libre.git/blob/HEAD:/lib/libdynamic.scm#l58

 HTH,

 Carl





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


Can't use NoteNames twice in score block ??

2010-12-21 Thread Michael Ellis
While working with a much larger version of the score below  (BWV 206
chorale in 4 voices),  I tried using the NoteNames engraver to put note
names under each voice.  For some reason,  invoking it twice causes the clef
and instrument name to change on the top staff.  The notes (and the note
names) are correct, but the Soprano line gets a bass clef and the bass
instrument name.   Is this a known problem?

Thanks,
Mike

\version 2.12.3

ASvoiceAA = \relative c'{
\set Staff.instrumentName = #Soprano
\clef treble
\key f \major
\time 4/4
\partial 4
a'4 bes a g d'  | % 1
}% end of last bar in partorvoice


ABvoiceDA = \relative c{
\set Staff.instrumentName = #Bass
\clef bass
\key f \major
\time 4/4
\partial 4
d4 g a bes a8 g  | % 1
}% end of last bar in partorvoice


\score {

\context Voice = ASvoiceAA  { \ASvoiceAA }
\context NoteNames = NNS  \ASvoiceAA

\context Voice = ABvoiceDA \ABvoiceDA
%% ok.png when line below commented out.  withbug.png if
left in.
\context NoteNames = NNB \ABvoiceDA


}%% end of score-block
attachment: ok.pngattachment: withbug.png___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Can't use NoteNames twice in score block ??

2010-12-21 Thread Michael Ellis
Oops wrong image for ok.png in previous msg.
Cheers,
Mike


On Tue, Dec 21, 2010 at 7:12 PM, Michael Ellis michael.f.el...@gmail.comwrote:

 While working with a much larger version of the score below  (BWV 206
 chorale in 4 voices),  I tried using the NoteNames engraver to put note
 names under each voice.  For some reason,  invoking it twice causes the clef
 and instrument name to change on the top staff.  The notes (and the note
 names) are correct, but the Soprano line gets a bass clef and the bass
 instrument name.   Is this a known problem?

 Thanks,
 Mike

 \version 2.12.3

 ASvoiceAA = \relative c'{
 \set Staff.instrumentName = #Soprano
 \clef treble
 \key f \major
 \time 4/4
 \partial 4
 a'4 bes a g d'  | % 1
 }% end of last bar in partorvoice


 ABvoiceDA = \relative c{
 \set Staff.instrumentName = #Bass
 \clef bass
 \key f \major
 \time 4/4
 \partial 4
 d4 g a bes a8 g  | % 1
 }% end of last bar in partorvoice


 \score {
 
 \context Voice = ASvoiceAA  { \ASvoiceAA }
 \context NoteNames = NNS  \ASvoiceAA

 \context Voice = ABvoiceDA \ABvoiceDA
 %% ok.png when line below commented out.  withbug.png if
 left in.
 \context NoteNames = NNB \ABvoiceDA

 
 }%% end of score-block



attachment: ok.png___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Can't use NoteNames twice in score block ??

2010-12-21 Thread Carl Sorensen



On 12/21/10 5:14 PM, Michael Ellis michael.f.el...@gmail.com wrote:

 On Tue, Dec 21, 2010 at 7:12 PM, Michael Ellis michael.f.el...@gmail.com
 wrote:
 While working with a much larger version of the score below  (BWV 206 chorale
 in 4 voices),  I tried using the NoteNames engraver to put note names under
 each voice.  For some reason,  invoking it twice causes the clef and
 instrument name to change on the top staff.  The notes (and the note names)
 are correct, but the Soprano line gets a bass clef and the bass instrument
 name.   Is this a known problem?

Mike,

The problem is apparently that the \clef command implicitly creates some
kind of staff context if it's in a NoteNames context.

If you take the \clef commands out of the music passed to the NoteNames
context, then things seem to work right.  (I haven't fully tested the
instrumentName to see if it can be part of the NoteNames context or not).

Here's some code that works:

\version 2.12.3

Snotes = \relative c' {
  \time 4/4
  \partial 4
  a'4 |
  bes4 a g d' |
}

Bnotes = \relative c {
  \time 4/4
  \partial 4
  d4 |
  g4 a bes a8 g |
}

ASvoiceAA = {
  \set Staff.instrumentName = #Soprano
  \clef treble
  \key f \major
  \Snotes
}


ABvoiceDA = {
  \set Staff.instrumentName = #Bass
  \clef bass
  \key f \major
  \Bnotes
}


\score {
  
\new Voice = ASVoiceAA  { \ASvoiceAA }
\new NoteNames = NNS  {\Snotes}

\new Voice = ABvoiceDA {\ABvoiceDA}
\new NoteNames = NNB {\Bnotes}
  
}%% end of score-block


HTH,

Carl


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