Re: Arrow on cross-staves arpeggio

2017-01-18 Thread Caio Giovaneti de Barros



The above doesn't work: it produces an arpeggiando sign across the two
staves as required, but without the requested arrow head.

Man, you read my mind. I was trying to solve the exact same problem just 
now.


Caio

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


Trying to make pitch and duration independent

2016-10-05 Thread Caio Giovaneti de Barros
I've been experimenting with building a function that can accept 
different durations/rhythm for given pitches and vice versa. I don't 
know if that is already possible, but I don't seem to find any reference 
to it, except:


http://lsr.di.unimi.it/LSR/Item?id=346 (different pitches with same 
rhythm). This is more or less what I imagine, except I also want to be 
able to do the opposite, namely, create a variable with some pitches 
that I can manipulate to change its durations.


There is also:

http://lsr.di.unimi.it/LSR/Item?id=305 (shiftDurations) which is too 
restrictive with the changes in durations (only multiples).


So far, here is what I got:

%%

\version "2.19.46"

#(define (lilyListLength ls) (length (ly:music-property ls 'elements)))

#(define (getDuration i ls)
   (ly:music-property
(list-ref (ly:music-property ls 'elements) i) 'duration))

#(define (setDuration! i ls dur)
   (set!
(ly:music-property
 (list-ref (ly:music-property ls 'elements) i) 'duration)
dur))

#(define (mapDurations! pitches durations)
   (let rec ((i 0))
 (if (= i (lilyListLength pitches))
 '()
 (begin (rec (1+ i)) (setDuration! i pitches (getDuration i 
durations))


setDurations = #(define-music-function (pitches durations) (ly:music? 
ly:music?)

  (begin (mapDurations! pitches durations) pitches))

pitches = { c' d' e' f' g' }

durations = { 8 8 4. 8 4 }

{
  \setDurations #pitches #durations
}

{
  \setDurations { c' b c' d' e' } #durations
}

{
  \setDurations { c' d' e' d' c' } {16 16 8 4. 8 }
}

%%

This is almost what I want, but doesn't work right:
- Tuplets don't work (maybe some recursive way of getting the 'duration 
property no matter how deep it is nested?)
- If, for instance, I have: \setDurations #pitches { 16 16 8 4. 8 } the 
first appearance of \pitches will also have these new durations (insert 
a new line in the code above to see what I mean).


Is there some easier way of getting what I want or fixing the code 
above? Also, it would be nice to have the option of changing only the 
octaves of a pitch group. I'm using this to work with 12 tone rows and 
it is common to repeat the same row many times but with pitches in 
different octaves. It would make my life easier to automate some 
manipulations of rows and immediately see the result instead of loosing 
a lot of time doing it by hand only to find out that it doesn't sound 
very nice. I believe this would also speed up typing in some situations.


Caio Barros

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


Remove staff in one particular section

2016-07-07 Thread Caio Giovaneti de Barros
Can I remove a staff in a single section? Like \removeEmptyStaves but 
not for the whole score. In my case it is just for the last system.



Sorry if this topic was already discussed, I searched the manuals and 
archive but I'm in a bit of a hurry now to be honest.



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


Re: Choice of pitch input mode

2016-04-29 Thread Caio Giovaneti de Barros


 On 4/29/16 7:27 AM, "Carl Sorensen"  wrote:

About a year ago, Kieren indicated that he has decided to go completely
absolute mode, even to the point
of redoing his historic code:

https://lists.gnu.org/archive/html/lilypond-user/2015-04/msg00846.html


I was not aware of Kieren's opinion, but after my last work on Lilypond 
I'm arriving at almost the same conclusion. At least for music that 
works outside the tonal (and in a way also modal) paradigm of pitch 
ranges and intervals it is preferable to use absolute mode almost 
always. What a pain it is to write, say, a line by Webern in relative 
mode. And if you make a mistake along the way (and you will make it) you 
have to be prepared to hunt the right note to correct the octave next. 
At least with Frescobaldi you can click on the pdf viewer and it puts 
your cursor directly where you want, which is awesome.




I find his arguments interesting.  And if I were engraving things as
complex as his, I might also move to absolute.

But I am working on simple, short, pieces.  The longest I have done to
this point is about 8 pages.
For my use case, the convenience of less typing (and to be fair, not
having to worry about the octave
I'm using) overrides the inconvenience of the occasional octave mistake.

So I use relative.


I do believe that at the end this is a choice the engraver has to make 
based on the type of music she or he is working with. Many decisions in 
code organization comes down to convenience, your habits and comfort, 
but just like music engraving in general there are good practices to 
make your work more productive, and if you need to be read and 
understood by others, this is even more critical.


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


Re: Embedding eps over staff lines and music as graphical notation

2016-04-29 Thread Caio Giovaneti de Barros
I think I solved it. The trick was removing the the vertical-skylines 
property:


impMrkp =
%\tweak staff-padding #'() %% not sure if needed
%\tweak staff-padding #'()
\tweak outside-staff-priority #'()
\tweak layer #-30
\tweak Y-offset #-3
\tweak vertical-skylines #'()
-\markup { \hspace #3 \vcenter \epsfile #X #25 #"improv.eps" }

<<
  \new Staff = "UP" {
\relative c''' {
  \stemDown
  \textLengthOn b32[ \impMrkp \change Staff = "DOWN" b,,]
}
  }
  \new Staff = "DOWN" {
\relative c''' {
      s16
    }
  }
>>

Em 29-04-2016 10:27, Caio Giovaneti de Barros escreveu:

Well, actually... Now I have another problem I didn't realize before.
In the piece I'm actually engraving the dots must cross staves and in 
the solution below the eps does ignore the staff above, but avoids 
collision with the staff below. Any suggestions?


\version "2.19.35"

impMrkp =
%\tweak staff-padding #'() %% not sure if needed
\tweak staff-padding #'()
\tweak outside-staff-priority #'()
\tweak layer #-30
\tweak Y-offset #'()
-\markup { \hspace #3 \vcenter \epsfile #X #25 #"improv.eps" }

<<
  \new Staff = "UP" {
\relative c''' {
  \stemDown
  \textLengthOn b32[ \impMrkp \change Staff = "DOWN" b,,]
}
  }
  \new Staff = "DOWN" {
\relative c''' {
  s16
}
  }
>>




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


Re: Embedding eps over staff lines and music as graphical notation

2016-04-29 Thread Caio Giovaneti de Barros

Well, actually... Now I have another problem I didn't realize before.
In the piece I'm actually engraving the dots must cross staves and in 
the solution below the eps does ignore the staff above, but avoids 
collision with the staff below. Any suggestions?


\version "2.19.35"

impMrkp =
%\tweak staff-padding #'() %% not sure if needed
\tweak staff-padding #'()
\tweak outside-staff-priority #'()
\tweak layer #-30
\tweak Y-offset #'()
-\markup { \hspace #3 \vcenter \epsfile #X #25 #"improv.eps" }

<<
  \new Staff = "UP" {
\relative c''' {
  \stemDown
  \textLengthOn b32[ \impMrkp \change Staff = "DOWN" b,,]
}
  }
  \new Staff = "DOWN" {
\relative c''' {
  s16
}
  }
>>


Em 29-04-2016 10:01, Caio Giovaneti de Barros escreveu:



Em 28-04-2016 18:01, Thomas Morley escreveu:
2016-04-28 15:35 GMT+02:00 Caio Giovaneti de Barros 
<caio.bar...@gmail.com>:

How can I insert an EPS file over the staff lines, ignoring collisions?


Is the below of some help?

\version "2.19.35"

impMrkp =
  %\tweak staff-padding #'() %% not sure if needed
  \tweak staff-padding #'()
  \tweak outside-staff-priority #'()
  \tweak layer #-30
  \tweak Y-offset #'()
  -\markup { \hspace #3 \vcenter \epsfile #X #25 #"improv.eps" }

\relative c''' {
   \textLengthOn b32[ \impMrkp b,,]
}
Yes, that did the trick. Thank you! I was not aware of \textLengthOn. 
Awesome.


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


Re: Embedding eps over staff lines and music as graphical notation

2016-04-29 Thread Caio Giovaneti de Barros



Em 28-04-2016 18:01, Thomas Morley escreveu:

2016-04-28 15:35 GMT+02:00 Caio Giovaneti de Barros <caio.bar...@gmail.com>:

How can I insert an EPS file over the staff lines, ignoring collisions?


Is the below of some help?

\version "2.19.35"

impMrkp =
  %\tweak staff-padding #'() %% not sure if needed
  \tweak staff-padding #'()
  \tweak outside-staff-priority #'()
  \tweak layer #-30
  \tweak Y-offset #'()
  -\markup { \hspace #3 \vcenter \epsfile #X #25 #"improv.eps" }

\relative c''' {
   \textLengthOn b32[ \impMrkp b,,]
}
Yes, that did the trick. Thank you! I was not aware of \textLengthOn. 
Awesome.


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


Embedding eps over staff lines and music as graphical notation

2016-04-28 Thread Caio Giovaneti de Barros

How can I insert an EPS file over the staff lines, ignoring collisions?

I want to suggest random notes played from high to low pitches with 
graphical notation by inserting the attached eps file, linking the first 
note with the last, in the following snippet. I can't find how to make 
lilypond ignore the object extent and collisions. Also, by looking at 
the output I'm getting in Frescobaldi, it seems that even if I do that, 
the eps image is not transparent.


I'm open to suggestions for alternatives to solve this problem, of 
course. I just don't want to have to manually insert the graphic in an 
SVG file after the compilation since it's very annoying to do that every 
single time I have to recompile due to revisions.


\version "2.19.35"

\relative c''' {
  b32[ -\markup {
\epsfile #X #25 #"improv.eps"
  }
  s s s s s s s s s s s s b,,]
}

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


Re: Music function for arrow directions in arpeggios

2016-02-23 Thread Caio Giovaneti de Barros
Yes, that works perfectly. No need to use a function, of course. That 
was just my first approach to solve this problem.

Thanks Malte and Kieren!

Em 23-02-2016 12:14, Abraham Lee escreveu:
On Tue, Feb 23, 2016 at 8:04 AM, Malte Meyn <lilyp...@maltemeyn.de 
<mailto:lilyp...@maltemeyn.de>> wrote:




Am 23.02.2016 um 15:52 schrieb Caio Giovaneti de Barros:

I'm trying to write a function to make easier for me to change
arrow
directions in arpeggios.


I would prefer an event function with a tweak:

\version "2.19.36"

arpeggioUp = \tweak arpeggio-direction #UP \arpeggio

\relative c' { \arpeggioUp }


I like this a lot and I feel like I've seen this exact discussion 
before, but it didn't result in any core changes.


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


Music function for arrow directions in arpeggios

2016-02-23 Thread Caio Giovaneti de Barros
I'm trying to write a function to make easier for me to change arrow 
directions in arpeggios. When writing music for guitar is very annoying 
to be constantly changing the arrow directions. Consider, for instance:


\relative c' {
 \arpeggioArrowDown
 8.\arpeggio
 \arpeggioArrowUp
 q16\arpeggio
 \arpeggioArrowDown
 q8.\arpeggio
 \arpeggioArrowUp
 q16\arpeggio
 \arpeggioArrowDown
 q4\arpeggio
}

I tried the following code, but lilypond doesn't understand it. Any 
suggestions?


arpeggioUp = #(define-music-function (chord) (ly:music?)
#{
  \arpeggioArrowUp
  #chord \arpeggio
#})

\relative c' { \arpeggioUp {  } }

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


Re: Learning more complicated lilypond coding

2016-01-29 Thread Caio Giovaneti de Barros

The "s" is an invisible rest (or spacer rest):
http://www.lilypond.org/doc/v2.19/Documentation/notation/writing-rests#invisible-rests

On 29-01-2016 21:27, Charles O. Lawrence wrote:


Thanks Trevor for the “hack”.  I understand the code, but what is the 
s, and where is it documented?


Charles




Caio

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


Re: lyp - a Package Manager for Lilypond

2016-01-29 Thread Caio Giovaneti de Barros



On 28-01-2016 19:52, Sharon Rosner wrote:

Hello all,

I'd like to announce lyp - a package manager for Lilypond:

https://github.com/noteflakes/lyp 


Great work, Sharon! I'm very excited!

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


Re: attach glissandi to stems instead of noteheads

2016-01-27 Thread Caio Giovaneti de Barros

I think I got it. It's a bit of an ugly code, but works.

\version "2.19.35"


\relative c' {

\override NoteHead.stencil = #ly:text-interface::print

\override NoteHead.text = \markup { \null }

\override NoteHead.stem-attachment = #'(0 . 0)

\override Glissando.thickness = #5

\override Glissando.bound-details.left.padding = #0

\override Glissando.bound-details.right.padding = #0

e8[\glissando g\glissando b\glissando g\glissando e\glissando 
d'\glissando e,]


}



On 27-01-2016 15:37, Caio Giovaneti de Barros wrote:
I'm trying to draw a suggestion for glissando in changing directions. 
The ideal notation would be beamed stems without note heads connected 
by glissandi. Here's what I got so far:


\version "2.19.35"


\relative c' {

\override NoteHead.stem-attachment = #'(0 . 0)

\hide NoteHead

\override Glissando.thickness = #5

\override Glissando.bound-details.left.padding = #-1

\override Glissando.bound-details.right.padding = #-1

e8[\glissando g\glissando b\glissando g\glissando e\glissando 
d'\glissando e,]


}

but is not looking very good... any suggestions?

Caio


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


attach glissandi to stems instead of noteheads

2016-01-27 Thread Caio Giovaneti de Barros
I'm trying to draw a suggestion for glissando in changing directions. 
The ideal notation would be beamed stems without note heads connected by 
glissandi. Here's what I got so far:


\version "2.19.35"


\relative c' {

\override NoteHead.stem-attachment = #'(0 . 0)

\hide NoteHead

\override Glissando.thickness = #5

\override Glissando.bound-details.left.padding = #-1

\override Glissando.bound-details.right.padding = #-1

e8[\glissando g\glissando b\glissando g\glissando e\glissando 
d'\glissando e,]


}

but is not looking very good... any suggestions?

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


Re: attach glissandi to stems instead of noteheads

2016-01-27 Thread Caio Giovaneti de Barros
Well, you can see that this code is much bigger than mine. I'm a bit 
uncomfortable because I don't have yet the lilypond-scheme vocabulary to 
understand it.


OTOH, it has a more convenient syntax, not needing to add a \glissando 
in every note. It should be a good solution for longer passages. I'm 
saving it for future use ;)


On 27-01-2016 16:25, Pierre Perol-Schneider wrote:

Hi Caio,

How about:

\version "2.19.35"

#(define path-gliss
(lambda (handle)
  (lambda (grob)
(if (ly:stencil? (ly:line-spanner::print grob))
  (let* ((stencil (ly:line-spanner::print grob))
(X-ext (ly:stencil-extent stencil X))
(Y-ext (ly:stencil-extent stencil Y))
(width (interval-length X-ext))e
(height (interval-length Y-ext))
(lefty (cdr (assoc 'Y (ly:grob-property grob 'left-bound-info
(righty (cdr (assoc 'Y (ly:grob-property grob 
'right-bound-info

(deltay (- righty lefty))
(dir (if (> deltay 0) 1 -1)))
(ly:stencil-translate
  (grob-interpret-markup grob
(markup
  ;(#: tiny (format "~a" (ly:grob-properties grob)))
  ;(format "~a" (cdr (assoc 'Y (ly:grob-property grob 
'left-bound-info

  ;(#: tiny (format "~a" handle))
  (#:path glissWidth
(list (list 'moveto 0 0)
  (list 'curveto 0 0 (first handle) (second handle) width (* 
height dir))

  (if (> dir 0)
 (cons (interval-start X-ext) (+ (interval-start Y-ext) 0.1))
 (cons (interval-start X-ext) (+ (interval-start Y-ext) 
height)

   

#(define (add-gliss m)
   (case (ly:music-property m 'name)
 ((NoteEvent) (set! (ly:music-property m 'articulations)
  (append (ly:music-property m 'articulations)
 (list (make-music (quote GlissandoEvent)
   m)
 (else #f)))

addGliss = #(define-music-function (music)
 (ly:music?) (map-some-music add-gliss music))

equal-staff-stems =
%%% => 
http://lilypond.1069038.n5.nabble.com/Stem-length-at-a-fixed-height-td172661.html#a172686

#(define-music-function (val)(number?)
  #{
\override Stem.direction =
  #(lambda (grob)
(if (negative? val)
DOWN
UP))

\override Stem.after-line-breaking =
  #(lambda (grob)
(let* ((stem-begin-position (ly:grob-property grob 
'stem-begin-position)))

  ;; the override for Beam.positions counts from staff-position 0
  ;; thus we need to go there for the (unbeamed) stem-length 
as well
;; beam-thickness is taken from engraver-init.ly 
<http://engraver-init.ly>:

(ly:grob-set-property! grob
  'length
  (+ (if (negative? val)
 stem-begin-position
 (- stem-begin-position))
 (* (abs val) 2)
 ;; beam-thickness:
 0.32

\override Beam.positions = #(cons val val)
  #})

%%% So, here it goes:
\score {
  \new Staff  \relative {
\addGliss {
  e'8[ g b g e d' e,]
}
  }
  \layout {
\override NoteHead.transparent =##t
\equal-staff-stems #6
\override Stem.avoid-note-head =##t
\override Glissando.minimum-length = #5
\override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
\override Glissando.thickness = #4
\override Glissando.bound-details =#'(
   (right (attach-dir . 1) (padding . 0))
   (left  (attach-dir . 1) (padding . 0)))
\override NoteHead.no-ledgers = ##t
\stemUp
  }
}

Cheers,
Pierre


2016-01-27 19:12 GMT+01:00 Caio Giovaneti de Barros 
<caio.bar...@gmail.com <mailto:caio.bar...@gmail.com>>:


I think I got it. It's a bit of an ugly code, but works.

\version "2.19.35"


\relative c' {

\override NoteHead.stencil = #ly:text-interface::print

\override NoteHead.text = \markup { \null }

\override NoteHead.stem-attachment = #'(0 . 0)

\override Glissando.thickness = #5

\override Glissando.bound-details.left.padding = #0

\override Glissando.bound-details.right.padding = #0

e8[\glissando g\glissando b\glissando g\glissando e\glissando
d'\glissando e,]

}

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


Sustain pedal cautionary after line break

2016-01-27 Thread Caio Giovaneti de Barros
I would like to add a cautionary indication that the sustain pedal 
should remain pressed after a line break, so in the code below ideally 
there would be a (Ped.) in the second line. Any suggestions?


\version "2.19.35"


\relative c'' {

\set Staff.pedalSustainStyle = #'mixed

c1\sustainOn \break

c1 c1\sustainOff

}

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


Re: Sustain pedal cautionary after line break

2016-01-27 Thread Caio Giovaneti de Barros


On 27-01-2016 19:30, Pierre Perol-Schneider wrote:

Hi Caio,

Here's a possible workaround:

 Awesome, Pierre!

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


Re: Square note head style

2016-01-26 Thread Caio Giovaneti de Barros



On 26-01-2016 02:06, Bockett Hunter wrote:

Are you trying to set mensural notation?  If so,

\override Voice.NoteHead #'style = #'neomensural

will do what you want.



Actually, no. I'm using it in a contemporary piece to indicate to stroke 
the piano strings with a pick. I need a real square, not a diamond 
shape. But thanks!


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


Re: Square note head style

2016-01-26 Thread Caio Giovaneti de Barros



On 25-01-2016 19:18, Pierre Perol-Schneider wrote:

Hi Caio,

How about:

Thanks Pierre, that's it!

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


Rests in Dynamics context

2016-01-26 Thread Caio Giovaneti de Barros
Is there a way to write rests in the Dynamics context? (or something 
like it)


I'm engraving a piece for piano in which there are rests used by both 
staves. It would be much cleaner for the musician to read some of the 
rests between staves (same as dynamics in the Dynamics context).


So far the only way I could think of is to add the rest as a markup, but 
(1) this doesn't write the rest in the middle and (2) there is no way to 
differentiate a whole note rest and a half note rest:


\version "2.19.35"


\new PianoStaff <<

\new Staff { s4 e'4 s2 e'4 }

\new Dynamics {

r4^\markup { \musicglyph #"rests.2"} s4 r2_\markup { \musicglyph 
#"rests.1" } s4


r1-\markup { \musicglyph #"rests.0" }

}

\new Staff { \clef F s4 c s2 c4 }

>>




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


Re: Rests in Dynamics context

2016-01-26 Thread Caio Giovaneti de Barros

I think that's it. You saved me again, Pierre!

On 26-01-2016 14:57, Pierre Perol-Schneider wrote:

\new PianoStaff <<
  \new Staff { s4 e'4 s2 e'4 }
  \new Dynamics
\with { \consists "Rest_engraver" }
{  r4 s4 r2 s4 r1 }
  \new Staff { \clef F s4 c s2 c4 }
>>


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


Re: Rests in Dynamics context

2016-01-26 Thread Caio Giovaneti de Barros



On 26-01-2016 14:56, Urs Liska wrote:


I don't think so.

But you can try using a regular Staff and adjust it by hiding/omitting 
everything you don't want:




Yes, i like this idea, but it still takes too much space, that's why I 
thought about using the Dynamics context. The ideal solution would be to 
"turn on the note/rest engraver" in the Dynamics context, or "turn off" 
the  space a regular Staff takes...



\score {
  \new PianoStaff <<
\new Staff { c'4 s4 c' }
\new Staff \with {
  \omit TimeSignature
  \omit KeySignature
  \omit Clef
  \hide StaffSymbol
}
{
  s4 r4
}
\new Staff { c'4 s4 c' }
  >>
}


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


Re: Rests in Dynamics context

2016-01-26 Thread Caio Giovaneti de Barros

Just a little addendum, I'm just tested this:
If you want dotted rests, you need to include "Dots_engraver" and 
"Dot_column_engraver":


\new PianoStaff <<

\new Staff { s4 e'4 s2 e'4 }

\new Dynamics

\with {

\consists "Rest_engraver"

\consists "Dots_engraver"

\consists "Dot_column_engraver"

}

{ r4. s4 r2 s4 r1 }

\new Staff { \clef F s4 c s2 c4 }

>>



On 26-01-2016 15:09, Urs Liska wrote:



Am 26.01.2016 um 18:01 schrieb Caio Giovaneti de Barros:

I think that's it. You saved me again, Pierre!


Yes, definitely better than my suggestion. And semantically more 
appropriate.




On 26-01-2016 14:57, Pierre Perol-Schneider wrote:

\new PianoStaff <<
  \new Staff { s4 e'4 s2 e'4 }
  \new Dynamics
\with { \consists "Rest_engraver" }
{  r4 s4 r2 s4 r1 }
  \new Staff { \clef F s4 c s2 c4 }
>>


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


proportional horizontal space in accelerando and ritardando

2016-01-26 Thread Caio Giovaneti de Barros
Here's a problem more or less common in contemporary music notation (and 
very common in contemporary me, right now)


In some pieces of music it's common to reflect accelerandos and 
ritardandos by proportionally increasing and decreasing (respectively) 
the distance between notes.


Here is an example, after a quick search:

http://www.music.indiana.edu/departments/academic/composition/style-guide/images/newimages/featherEX.gif

What do you think would be the best way to implement this in Lilypond?

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


Re: Rests in Dynamics context

2016-01-26 Thread Caio Giovaneti de Barros


That's nice! It can be very useful for writing instructions for the players.

Adding the rest and dots engravers to the Dynamics context was the 
solution of choice for me, though.



On 26-01-2016 18:15, Thomas Morley wrote:

For the record, we have a rest-markup-command.

https://sourceforge.net/p/testlilyissues/issues/2966/

commit ffa21bb1a55d2436bb432c4dff7ec04df95dc6f0
Author: Thomas Morley 
Date:   Wed Dec 5 01:56:11 2012 +0100

 markup-commands rest-by-number and rest

 Introduces two new markup-commands:
 rest-by-number and rest
 similiar to the existing note-by-number and note.
 Two regression-tests for them are added.


See output of:

\markup
   \override #'(word-space . 2)
   \line { \rest #"1" \rest #"2" \rest #"1." \rest #"2." }






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


Re: proportional horizontal space in accelerando and ritardando

2016-01-26 Thread Caio Giovaneti de Barros



On 26-01-2016 18:48, Malte Meyn wrote:

This is already implemented; see section 1.2.4 of the notation reference
(this is called “feathered beams”).

You are right. I guess after 4 hours of music editing my brain went on 
strike


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


Re: proportional horizontal space in accelerando and ritardando

2016-01-26 Thread Caio Giovaneti de Barros

Thanks!!

On 26-01-2016 19:12, Pierre Perol-Schneider wrote:

Oops my fault.
So here it goes:

\version "2.19.35"

\relative c'' {
  \set Score.proportionalNotationDuration = #(ly:make-moment 1/40)
  \override Beam.grow-direction = #RIGHT
  \featherDurations #(ly:make-moment 2/3)
  { e32[
\override NoteHead.transparent = ##t
e e e e e e e e e e e e e e]
  }

  \override Beam.grow-direction = #LEFT
  \featherDurations #(ly:make-moment 3/2) %% <= !!!
  { e32[ e e e e e e e e e e e
\revert NoteHead.transparent
e]
  }
  \override Beam.grow-direction = #'()
  s8
}

Cheers,
Pierre


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


Square note head style

2016-01-25 Thread Caio Giovaneti de Barros

Hi,

I'm needing a note head style with square note heads. Ideally it should 
be filled for black note heads and open for white notes. I'm struggling 
to understand how to change the note head stencil, let alone change it 
according to note duration. Con someone, please, help?


Thanks!
Caio

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


Re: Programmatically building music-function names

2016-01-15 Thread Caio Giovaneti de Barros

On 15-01-2016 15:06, Chris Yate wrote:

 What I'm trying to do instead looks like:


```
printTheScore =
#(define-music-function
 (parser location number )
 (string? )
#{
\score {
 \music#number
}
#})

\printTheScore "One"
\printTheScore "Two"
```


Maybe something like this... but If I uncomment the \score block it 
doesn't work


musicOne = { c' d' e' }

musicTwo = { e' f' g' }


printTheScore = #(define-music-function (parser location number) (string?)

(let* ((number number) (function (string->symbol (string-append "music" 
number


#{

%\score {

#(eval function (interaction-environment))

%

#}))


\printTheScore "One"

\printTheScore "Two"


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


Re: A twelve tone matrix engraver

2016-01-04 Thread Caio Giovaneti de Barros


Oh I understand now. Indeed this can be very useful for (at least) 
having the 12 tone rows displayed in a more human readable way, mixing 
sharps and flats. Maybe it can help in having the input row as pitches 
instead of numbers. I'll see what I can come up with in the next days. 
These objects are excellent!


On 03-01-2016 11:31, David Kastrup wrote:

Caio Giovaneti de Barros <caio.bar...@gmail.com> writes:


On 02-01-2016 16:18, David Kastrup wrote:

It might also be worth taking a look at the facilities provided by
issue 4702
<URL:http://sourceforge.net/p/testlilyissues/issues/4702/> to see
how (or whether) they would have helped here.

Do you think you could write some small example of what those
functions do? I didn't understand how they are used. One thing that I
really wanted is an automatic way for the software to decide what
notes should be flat and what should be sharp, even if it's not
perfect. Currently my code only outputs sharps and to be honest this
is not very natural to read (pun intended).



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


Re: A twelve tone matrix engraver

2016-01-03 Thread Caio Giovaneti de Barros

Hello!

On 02-01-2016 15:52, Urs Liska wrote:

Hi,

unfortunately I have only *very* limited time right now, but this 
looks absolutely great!



Thanks!


Just one minor suggestion: I'd insert
\accidentalStyle dodecaphonic
in the \layout block.


That's a good idea. The less ambiguity the better.

I think this would be an extremely nice topic for a post on Scores of 
Beauty, if you'd like to write one.


I actually thought about that,  having learned a lot of things from 
there. I'll send you a private message! Thanks, Urs!
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: A twelve tone matrix engraver

2016-01-03 Thread Caio Giovaneti de Barros

Hi Kieren

On 02-01-2016 16:22, Kieren MacMillan wrote:
1. How difficult would it be to add a function which produced a row in 
“traditional format”, i.e., \tonerow #”RI4” would give you [from your 
example] { a’ gs’ c’’ d’’ ds’’ fs’ f’ e’ cs’’ g’ b’ as' } 
Not difficult at all! Try the attached files. Open the 12tone-matrix.ly 
and write at the end of the file:


\writeRow #'RI #3


(don't forget the single quote in the first argument)

You can do this in any file, just include this tree lines at the beginning:

#(define row '(some row))

\include "12tone-calc.scm"

\include"12tone-engravers.ily"


Right now the second argument is mandatory. This means that if you don't 
want any transpositions you need to write #0 as the second argument of 
\writeRow.


2. Can your code be extended easily/quickly to support arbitrary pitch 
sets and row counts? For example, I used a 10-tone row drawn from 
[only] 8 distinct pitch classes in a recent piece, and would love to 
have tools available to help with similar efforts in the future.
Well, that's exactly my intention! In theory it should be very easy to 
extend it this way. I have little time right now, but I'll keep the list 
updated in further implementations.


Cheers,
Caio
%
% Pitch manipulations in Scheme %
%

%% Creating Transpositions and inversions
% Transpositions

#(define (transpose ls int mod)
   (map (lambda (x) (modulo (+ int x) mod)) ls))

% Set first pitch as "0" and maintain interval relations

#(define (zero-pset ls mod)
   (transpose ls (* (car ls) -1) mod))

% Inversion
#(define (invert ls mod)
   (map (lambda (x) (modulo x mod))		 ; keep inside modulos (e.g. 12 for 12-tone rows)
 (map (lambda (y) (+ y (car ls)))		 ; sum the inverted intervals with the first pitch of the original pitch set
   (map (lambda (z) (* z -1)) (zero-pset ls mod) % invert zeroed pitch set signals

% Apply the chosen operation in different ways depending on the number of arguments

#(define (pset-op op pset . ls)
   (cond 
   ((null? ls) (op pset))
   ((null? (cdr ls)) (op pset (car ls)))
   (else (op pset (car ls) (cadr ls)

% 12 tone specific operations (always inside modulos 12)

#(define (12transpose pset n) (transpose pset n 12))

#(define (12invert pset) (invert pset 12))

#(define (12retrograde pset) (reverse pset))

#(define (12retinvert pset) (reverse (invert pset 12)))

#(define (get-row pset type transp)
   (cond
((eqv? type 'O) (pset-op 12transpose pset transp))
((eqv? type 'R) (12retrograde (pset-op 12transpose pset transp)))
((eqv? type 'I) (12invert (pset-op 12transpose pset transp)))
((eqv? type 'RI) (12retinvert (pset-op 12transpose pset transp)))
(else (error "Wrong type of operation. Should be O, R, I or RI"

% Transpose the original 12 tone row according to the intervals of the inverted form

#(define (squareTranspose 12set n)
   (list-ref (invert (zero-pset 12set 12) 12) n))




% Some further pitch manipulations (no used yet)
% List all transpositions

#(define (all-transpositions pset mod)
   (let loop ((x pset) (y '()))
 (if (null? x)
 (reverse y)
 (loop (cdr x) (cons (transpose (zero-pset pset) (car x) mod) y)

% list all transpositions in ascending order

#(define (all-transpositions-order pset mod)
   (let loop ((x pset) (y '()) (z 0))
 (if (null? x)
 (reverse y)
 (loop (cdr x) (cons (transpose pset z mod) y) (+ z 1)

% list all inversions

#(define (all-inversions pset mod)
   (let loop ((x (all-transpositions pset mod)) (y '()))
 (if (null? x)
 (reverse y)
 (loop (cdr x) (cons (invert (car x) mod) y)

% List all inversions in ascending order

#(define (all-inversions-order pset mod)
   (let loop ((x (all-transpositions-order pset mod)) (y '()))
 (if (null? x)
 (reverse y)
 (loop (cdr x) (cons (row-invert (car x) mod) y)\version "2.18.2"

% "square" transpositions linked to the defined row

#(define (squareNumber n) (squareTranspose row n))

% List the rows that will be written

#(define (squareRows n) (pset-op 12transpose row (squareTranspose row n)))

% Convert the numbers in the row to Lilypond pitches

#(define (number->note n)
   (cond
((= n 0) (ly:make-pitch 1 0))
((= n 1) (ly:make-pitch 1 0 1/2))
((= n 2) (ly:make-pitch 1 1))
((= n 3) (ly:make-pitch 1 1 1/2))
((= n 4) (ly:make-pitch 0 2))
((= n 5) (ly:make-pitch 0 3))
((= n 6) (ly:make-pitch 0 3 1/2))
((= n 7) (ly:make-pitch 0 4))
((= n 8) (ly:make-pitch 0 4 1/2))
((= n 9) (ly:make-pitch 0 5))
((= n 10) (ly:make-pitch 0 5 1/2))
((= n 11) (ly:make-pitch 0 6))
(else (error "Pitch not found"

% Write elements (markups or note)

writeElements = #(define-music-function (parser location sym1 sym2 fn1 ls) 
(symbol? symbol? procedure? list?)
   (make-music 'SequentialMusic 'elements
 (let loop ((ls ls))
   (if 

Re: A twelve tone matrix engraver

2016-01-03 Thread Caio Giovaneti de Barros



On 02-01-2016 16:18, David Kastrup wrote:
It might also be worth taking a look at the facilities provided by 
issue 4702  
to see how (or whether) they would have helped here. 
Do you think you could write some small example of what those functions 
do? I didn't understand how they are used. One thing that I really 
wanted is an automatic way for the software to decide what notes should 
be flat and what should be sharp, even if it's not perfect. Currently my 
code only outputs sharps and to be honest this is not very natural to 
read (pun intended).


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


A twelve tone matrix engraver

2016-01-02 Thread Caio Giovaneti de Barros

Hi!

I've been working on a automatic way to engrave a 12 tone row matrix in 
Lilypond (See, for instance, http://unitus.org/FULL/12tone.pdf for an 
explanation of what it is). I'm doing it as a project to teach myself 
Scheme. I wanted to have something concrete to work with wile learning 
and create something useful at the same time.


There are some websites and softwares that already generate this kind of 
matrix:

http://composertools.com/Tools/matrix/MatrixCalc.html
http://in.music.sc.edu/fs/bain/software/tta-v2.22d/default.htm
http://www.musictheory.net/calculators/matrix

but I don't know any that outputs proper engraved sheet music, which 
would be very convenient for me. I any case the point is not to create 
something new, but to have some project that would require me to learn 
Scheme and be useful.


It's being a very interesting experience, sometimes fun, sometimes 
frustrating, a lot of times obsessive, but I finally arrived at 
something which I'm satisfied and wanted to share. So here it is! Just 
put all files in the same directory and run 12tone-matrix.ly to see what 
it looks like. All criticisms and suggestions are very much appreciated.


You can read all the 12 transpositions and inversions of the rows. For 
the retrogrades, just read it from right to left. The inversions are 
read vertically, delimited by the dashed lines, and retrograde-inversion 
is read from bottom to top. I'll explain some (nasty) details in the 
following lines.


---

I found it easier to separate the pure scheme calculations in one file 
and the lilypond specific variables in another one (these correspond to 
12tone-calc.scm and 12tone-engravers.ily as you may gess). This would 
allow me possibly to use the same Scheme functions with other software, 
although lilypond requires placing a # before each scheme function, 
which make the task a little harder.


I tried to start building some very generic and abstract pitch 
calculations and define functions progressively more specific, so I can 
expand the code more easily and possibly experiment with other types or 
pitch sets or even other musical parameters like durations, etc. That's 
why I have a different concept of an inversion and an inversion for 12 
tone rows, for instance. I will not go into details of how the 
calculations work since I think it's not appropriate to this list, maybe 
I'll do it in the future in another place. What is interesting is that 
in the process I had to learn and apply the concepts of higher-order 
functions and recursion which are very convenient in Scheme.


The engravers were interesting. Since I was basically going to engrave 
12 rows which are equal in all aspects except the pitches I wanted to 
create some function that would create a new staff with some specific 
configurations and recursively call itself 12 times. The Scheme tutorial 
by Urs Liska 
(lilypondblog.org/category/using-lilypond/advanced/scheme-tutorials/) 
was very useful, I had a hard time trying to imagine how I could do it 
with "the Lilypond way" of defining functions, but with the help of the 
tutorial I was able to arrive at something that works, although I'm not 
100% satisfied with it yet.


I have the code being controlled by git (another thanks to the lilypond 
blog for showing me the importance of learning git and have version 
control) but it is not published yet since it is mainly a personal 
project, I may do it in the next days, though.


Enjoy! And please send me some feedback.
Caio Barros
\version "2.18.2"

% "square" transpositions linked to the defined row

#(define (squareNumber n) (squareTranspose row n))

% List the rows that will be written

#(define (squareRows n) (pset-op 12transpose row (squareTranspose row n)))

% Convert the numbers in the row to Lilypond pitches

#(define (number->note n)
   (cond
((= n 0) (ly:make-pitch 1 0))
((= n 1) (ly:make-pitch 1 0 1/2))
((= n 2) (ly:make-pitch 1 1))
((= n 3) (ly:make-pitch 1 1 1/2))
((= n 4) (ly:make-pitch 0 2))
((= n 5) (ly:make-pitch 0 3))
((= n 6) (ly:make-pitch 0 3 1/2))
((= n 7) (ly:make-pitch 0 4))
((= n 8) (ly:make-pitch 0 4 1/2))
((= n 9) (ly:make-pitch 0 5))
((= n 10) (ly:make-pitch 0 5 1/2))
((= n 11) (ly:make-pitch 0 6))
(else (error "Pitch not found"

% Write elements (markups or note)

writeElements = #(define-music-function (parser location sym1 sym2 fn1 ls) 
(symbol? symbol? procedure? list?)
   (make-music 'SequentialMusic 'elements
 (let loop ((ls ls))
   (if (null? ls)
   '()
   (cons 
(make-music
 sym1 ;'LyricEvent / 'NoteEvent
 sym2 ; 'text / 'pitch
 (fn1 (car ls)) ; (markup #:concat (#:larger "RI" #:sub 
(number->string (car ls / (number->note (car ls))
 'duration
 (ly:make-duration 2))
(loop (cdr ls)))

% customBarLine by Janek Warchoł
% 

Re: Text centralized above a TextSpan

2015-09-03 Thread Caio Giovaneti de Barros



On 02-09-2015 10:08, Andrew Bernard wrote:


I am not sure how long you may have been following things, but this topic came 
up for me recently, and there is various discussion in the archives.


Yes, I made a search through the list the best I could, but I didn't 
find this (maybe the titles are not so obvious?). Also, the list is just 
too active to follow each topic. I'm just saying this not to give the 
impression I asked without consulting the documentation first



I came up with two half baked solutions, one involving modifying a text 
spanner, another modifying a markup, but neither of these is satisfactory.


Ok, I'll look into the archive to find a solution.


I continue to be amazed how useful such a capability would be, and how many 
people request it. Certainly this sort of thing is all through the contemporary 
music scores I deal with.


Exactly! I, too, am dealing with contemporary music (my compositions), 
maybe that's it.


Thank you for the reply.

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


Text centralized above a TextSpan

2015-09-02 Thread Caio Giovaneti de Barros

Hi,

Is it possible to have text centralized above a TextSpan? I've already 
saw in the documentation text added in the middle of hairpins and of 
course there is a tuplet number or fraction in the middle of the tuplet 
bracket. But it seems that in Text Span this is not so easy to do.


Thanks!
Caio

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


Re: Print Double Percent Repeat inside a markup

2015-08-30 Thread Caio Giovaneti de Barros



On 29-08-2015 21:56, Thomas Morley wrote:
If you want to stick to LilyPond's markup-commands, I'd suggest to 
split construction into steps otherwise it's confusing.

Awesome!

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


Re: Print Double Percent Repeat inside a markup

2015-08-29 Thread Caio Giovaneti de Barros

Thanks guys!

On 28-08-2015 15:26, tisimst wrote:

On 8/28/2015 12:18 PM, Stephen MacNeil [via Lilypond] wrote:

 how is


Nice! That looks like a good one, too! Isn't it great to have this kind
of flexibility? I love it!

- Abraham
I'm tinkering here with Stephen's code to try to draw the second beam. 
Just because it seems easier to me to understand this them Abraham's (I 
have 0 experience with postscript). I'll be back working in the edition 
again by Monday and decide which solution I'll take. I appreciate your 
help very very much!


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


Print Double Percent Repeat inside a markup

2015-08-28 Thread Caio Giovaneti de Barros

Hello!

I want to print a double percent repeat inside a markup so I can use it 
as a graphic in a footnote. How can I do that?


I read in the manual - 
lilypond.org/doc/v2.19/Documentation/notation/short-repeats  under 
/Isolated percent repeats /- that it is possible to print a single 
percent as a note but that doesn't seems to help.


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


Defining a markup text using Scheme

2015-07-20 Thread Caio Giovaneti de Barros

Hello!

I'm trying to build a function that creates a circled text of my choice 
using \markup and a bit of Scheme. So far what I have is:


circled = #(define-music-function (parser location txt) (string?)

#{ \markup { \circle #txt } #})


\relative c' { c \circled #1 }



But when I run it with Lilypond 2.19.23 I get:


In expression (value-lily-string m):

/home/caio/lilypond/usr/share/lilypond/current/scm/ly-syntax-constructors.scm:33:14 
1: Unbound variable: value-lily-string




Version 2.18.2 gives me:

music function cannot return (#procedure line-markup (layout props 
args) ((#procedure circle-markup (layout props arg) 1)))


\relative c' { c
\circled #1 }


What am I doing wrong?
Caio G. de Barros

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


Re: (hypothetical) Availability of LilyPond engravers

2015-04-16 Thread Caio Giovaneti de Barros



On 16-04-2015 21:31, Urs Liska wrote:



Am 17.04.2015 um 02:16 schrieb Jay Anderson:

On Thu, Apr 16, 2015 at 11:03 AM, Urs Liska u...@openlilylib.org wrote:

If I should be asked to engrave a big score (as fast as possible) in a
commercial context and wouldn't want to reply well, I will ask 
around and

see how many people I can get together, what could I say? Would it be
realistic to say that we could (at any time) provide a team of 10 
quailfied

engravers working full time on a project? Or 15-20 working half time?
And what if it were a request for continuous work? Is it realistic 
to say

there are always enough engravers at hand to accept work?

Considering the public responses there seems to be quite a few people
qualified and able. We'll see if you get 20 responses. The liedboek
team did sometime similar. They may have good insights.

I feel that one aspect that makes publishers hesitate to consider 
LilyPond
is exactly this question: They know that there will always be a 
sufficient
number of available and qualified Finale and Sibelius users, and 
presumably

even Score users, but they don't have an idea about this with LilyPond.

Any opinions or estimates?

Sounds like a great idea. I'd be very willing, though I most likely
wouldn't be able to work full time.

Jay


Hey all,

thank you for your responses, I won't reply to all of them individually.
Just to make this clear: The question _is_ hypothetical. But I am 
really interested in getting an impression about how powerful our 
community is when it comes to providing professional service.


The question I had to answer today (or to find a way around answering 
honestl) is: If we (hypothetically) commissioned you to produce a 
large opera in publication quality and with a tight schedule, would 
LilyPond be able to cope with that, and would you be able to provide 
the appropriate manpower and experience so we can be comfortably 
expect delivery and quality?


This made me think of that question. It would be a sad irony if we 
wouldn't be able to provide that - not because of deficiencies of our 
software but simply because to lack of the right number of users.


Urs
To be honest working on engraving music would be a dream to me, but 
since I'm always in need of money to survive and this is somenthing that 
don't make enough of it, is a thing I do mostly with my own music and 
ocasionally for other people in my free time. I'm currently employed so 
I would only agree to join such a team if it were something more or less 
permanent.


I also don't know exactly If I'm qualified, since I don't know exactly 
what skills would be needed in such a commission. I've already done 
large (orchestral) and small scores on Lilypond and got paid to do it. 
Normally I engrave music from live composers, which, in my experience, 
means at least some bits of non-traditional notation. I'm currently 
working (in my spare time) in engraving small snippets to illustrate 
itens in a scientific experiment.


Caio

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