Re: [PATCH] Re: relative mode occasionally gets forgotten?
Jonathan Kulp wrote: Here's a patch incorporating your suggestions, Carl. Thanks for the help. Jon Carl, when you get a moment would you mind checking the patch I sent last night, and push if it looks ok? I don't think Trevor's going to be around for a while to do doc patches. Thanks, Jon -- Jonathan Kulp http://www.jonathankulp.com ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: [PATCH] Re: relative mode occasionally gets forgotten?
Carl D. Sorensen wrote: OK, done. Everything looked great -- you even took out some pre-existing line-ending whitespace. Must be the excellent training I've gotten. ;) One (or maybe all) of you guys--Trevor, Graham, or you--taught me to strip the trailing spaces before creating the patch. Thanks for taking care of this for me. Best, Jon -- Jonathan Kulp http://www.jonathankulp.com ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
Carl, I'm working on your suggestions and have come across a problem. \relative c' { \chordmode { c \relative c'' { c }} This last example won't compile. (It was missing the last curly brace but I added it.) Here's the terminal output: chordmode.ly:1:40: error: syntax error, unexpected TONICNAME_PITCH \relative c' { \chordmode { c \relative c'' { c }}} Does this mean you can't put a chordmode in this context? I never use chordmode so I'll have a hard time debugging this. The other examples worked fine. Jon -- Jonathan Kulp http://www.jonathankulp.com ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
Jonathan == Jonathan Kulp jonlancek...@gmail.com writes: Jonathan Carl, I'm working on your suggestions and have come across a Jonathan problem. \relative c' { \chordmode { c \relative c'' { c }} Jonathan This last example won't compile. (It was missing the last Jonathan curly brace but I added it.) Here's the terminal output: \relative can't be used inside \chordmode I think. \relative introduces a sequence of note-names; \chordmode introduces a sequence of chord names. -- Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au http://www.ertos.nicta.com.au ERTOS within National ICT Australia ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
On 5/18/09 6:04 PM, Jonathan Kulp jonlancek...@gmail.com wrote: Carl, I'm working on your suggestions and have come across a problem. \relative c' { \chordmode { c \relative c'' { c }} This last example won't compile. (It was missing the last curly brace but I added it.) Here's the terminal output: chordmode.ly:1:40: error: syntax error, unexpected TONICNAME_PITCH \relative c' { \chordmode { c \relative c'' { c }}} Apparently, you can't use \relative c'' inside of chordmode. \relative needs a note (I think, but am not sure, it's called a NOTENAME_PITCH, not a chord, and in chordmode c is read as a tonic for a chord, not as a note (hence, a TONICNAME_PITCH). Interestingly enough, you can get the following to compile: \relative c' { \chordmode { c \relative {c}}} but the result is not at all what I expected, although I can explain it. I think the knownissue was wrong, and what should be said is Items inside a \chordmode block are always in absolute mode, even if the \chordmode block is in a \relative block. with an example of { \relative c'' {\chordmode {c1}} \chordmode {c1} } And the \chordmode section should say \relative cannot be used inside a \chordmode block. HTH, Carl ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
[PATCH] Re: relative mode occasionally gets forgotten?
Here's a patch incorporating your suggestions, Carl. Thanks for the help. Jon On Mon, May 18, 2009 at 8:50 PM, Carl D. Sorensen c_soren...@byu.eduwrote: On 5/18/09 6:04 PM, Jonathan Kulp jonlancek...@gmail.com wrote: Carl, I'm working on your suggestions and have come across a problem. \relative c' { \chordmode { c \relative c'' { c }} This last example won't compile. (It was missing the last curly brace but I added it.) Here's the terminal output: chordmode.ly:1:40: error: syntax error, unexpected TONICNAME_PITCH \relative c' { \chordmode { c \relative c'' { c }}} Apparently, you can't use \relative c'' inside of chordmode. \relative needs a note (I think, but am not sure, it's called a NOTENAME_PITCH, not a chord, and in chordmode c is read as a tonic for a chord, not as a note (hence, a TONICNAME_PITCH). Interestingly enough, you can get the following to compile: \relative c' { \chordmode { c \relative {c}}} but the result is not at all what I expected, although I can explain it. I think the knownissue was wrong, and what should be said is Items inside a \chordmode block are always in absolute mode, even if the \chordmode block is in a \relative block. with an example of { \relative c'' {\chordmode {c1}} \chordmode {c1} } And the \chordmode section should say \relative cannot be used inside a \chordmode block. HTH, Carl -- Jonathan Kulp http://www.jonathankulp.com From 2bc8a54769f112eef85fbbebbfea51a3ecb3f297 Mon Sep 17 00:00:00 2001 From: Jonathan Kulp j...@bashtop.(none) Date: Mon, 18 May 2009 23:05:14 -0500 Subject: [PATCH] DOCS: clarify the effect of \relative on \transpose and \chordmode --- Documentation/user/chords.itely |7 +++- Documentation/user/pitches.itely | 53 - 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/Documentation/user/chords.itely b/Documentation/user/chords.itely index 9e548ef..c1b6c03 100644 --- a/Documentation/user/chords.itely +++ b/Documentation/user/chords.itely @@ -61,6 +61,9 @@ found at @ref{Input modes}. Chords entered using chord mode are music elements, and can be transposed just like chords entered using simultaneous music. +...@code{\chordmode} is absolute, as @code{\relative} has no effect +on @code{chordmode} blocks. However, in @code{\chordmode} the +absolute pitches are one octave higher than in note mode. Chord mode and note mode can be mixed in sequential music: @@ -141,7 +144,7 @@ Seventh chords can be created: The table belows shows the actions of the quality modifiers on triads and seventh chords. The default seventh step added to chords is a minor or flatted seventh, which makes the dominant -seventh the basic seventh chord. All alterations are relative to +seventh the basic seventh chord. All alterations are relative to the dominant seventh. A more complete table of modifier usage is found at @ref{Common chord modifiers}. @@ -231,7 +234,7 @@ Snippets: @rlsr{Chords}. @knownissues -Only one quality modifier should be used per chord, typically on the +Only one quality modifier should be used per chord, typically on the highest step present in the chord. Chords with more than quality modifier will be parsed without an error or warning, but the results are unpredictable. Chords that cannot be achieved with a single diff --git a/Documentation/user/pitches.itely b/Documentation/user/pitches.itely index 1b7c2c8..d2c9829 100644 --- a/Documentation/user/pitches.itely +++ b/Documentation/user/pitches.itely @@ -175,6 +175,47 @@ large intervals: } @end lilypond +When @code{\relative} blocks are nested, the innermost +...@code{\relative} block applies. + +...@lilypond[verbatim,quote] +\relative c' { + c d e f + \relative c'' { +c d e f + } +} +...@end lilypond + +...@code{\relative} has no effect on @code{\chordmode} blocks. + +...@lilypond[verbatim,quote] +\new Staff { + \relative c''' { +\chordmode { c1 } + } + \chordmode { c1 } +} +...@end lilypond + +...@code{\relative} is not allowed inside of @code{\chordmode} blocks. + +Music inside a @code{\transpose} block is absolute unless a +...@code{\relative} is included. + +...@lilypond[verbatim,quote] +\relative c' { + d e + \transpose f g { +d e +\relative c' { + d e +} + } +} +...@end lilypond + + @cindex chords and relative octave entry @cindex relative octave entry and chords @@ -238,13 +279,6 @@ Internals Reference: @funindex relative -...@knownissues - -The relative conversion will not affect @code{\transpose}, -...@code{\chordmode} or @code{\relative} sections in its argument. -To use relative mode within transposed music, an additional -...@code{\relative} must be placed inside @code{\transpose}. - @c DEPRECATED If no @var{startpitch} is specified for @code{\relative}, t...@tie{}@code{c'} is assumed. However, this is a deprecated @@ -648,6 +682,9 @@ with
Re: relative mode occasionally gets forgotten?
In message c6334c1b.93d6%c_soren...@byu.edu, Carl D. Sorensen c_soren...@byu.edu writes On 5/15/09 3:06 PM, Anthony W. Youngman lilyp...@thewolery.demon.co.uk wrote: In message 200905151909580...@1654122929, David Pounder pound...@lineone.net writes I don't know if it's worth mentioning, but you can also run into problems using \repeat inside a \relative block if an \unfoldRepeats is used outside the block. For example in Tune = \relative c' { \partial 4 d4 | \repeat volta 2 { c4 d e g | } } the first c will be relative to the last g on the second play through using \unfoldRepeats. Rewriting as Tune = { \partial 4 d'4 | \repeat volta 2 \relative c' { c4 d e g | } } resolves the problem. I try to make sure I keep \relatives at the innermost block for this reason. Is this a case of programming style, and should the docs cover it? Han-Wen gave me a resetOctave function that deals with this. I don't know if it's made its way into the docs, though. I just use the octave check construct and ignore the warning. Example of resetOctave and its use attached ... \version 2.8.2 resetOctave = #(define-music-function (parser location reference-note) (ly:music?) (let* ((notes (ly:music-property reference-note 'elements)) (pitch (ly:music-property (car notes) 'pitch)) ) (set! (ly:music-property reference-note 'elements) '()) (set! (ly:music-property reference-note 'to-relative-callback) (lambda (music last-pitch) pitch)) reference-note )) pennsylvania = \context Voice = pennsylvania { \override NoteHead #'style = #'cross r2_\markup{ shout } f8. f16 f8. f16 f4 f f8. f16 r4 } pennsylvaniaLyrics = \lyricmode { \small { Penn syl van ia six five thou sand } } voiceTromboneI = \relative c' { r2 ef4.-- ef8- ~ ef1 r2 r4 bf8.-( ef16-.) r2 r4 ef,8. af,16- ~ | af2 c-- df-- d-- ef-- df-- c-- bf-- | \repeat volta 2 { R1*6 } \alternative { { \resetOctave f \pennsylvania } { \pennsylvania } } bf8-. cf4- bf8- ~ bf4 bf8.-- af16-. r8 af4.---. r2 bf8-. cf4-- bf8- ~ bf4 bf8.-- af16- ~ | af2~ af8 r8 r8. b16( ~ c4-.) cs8-- c8- ~ c8 b4.-- bf4 af8. bf16 ~ bf4 r c2( d4.) df8- ~ | df8 d4-- df8- ~ df4 r4 R1*6 \resetOctave f \pennsylvania | af,2-- cf-- af2.-- r4 af2-- cf-- af-- a-- | bf2.-- r4 ef2.-- ef4-- af,2 c df4.--- d8--- ~ d ef4.--- | af,2-- cf-- af2.-- r4 af2-- cf-- af-- a-- | bf2.-- r4 ef2.-- ef4-- af,2-- c-- df4 ef8.-( af,16) ~ af4 r | r8 c'4.--- ~ c2 r8 b4.--- ~ b2 r8. c16- b8.- b16- c8.- c16- b8.- b16- c4- r r2 \repeat volta 2 { \repeat percent 3 { df8^+ df4.^o ~ df4 r R1 } df4.^\markup{ +o } df8^\markup{ +o } ~ df4. df8^\markup{ +o } ~ } \alternative { { df4. df8^\markup{ +o } ~ df4. r8 } { df4 df8. d16 r8 df4.--- } } R1*7 r2 r8 b4.^-^+( \glissando c1^o) ~ c4 r r8 b4.^-^+( \glissando c1^o) ~ c4 r r8 c4.^-^+( \glissando df1^o) ~ df4 r r8 b4.^-^+( \glissando c1^o) ~ c4 r r8 e4.^-^+( \glissando \repeat volta 2 { f1) ~ f4 r r8 e4.^-^+( \glissando f1) ~ f4 r r8 e4.^-^+( \glissando f1) ~ f4 r r8 e4.^-^+( \glissando f1) ~ } \alternative { { f2 r8 e4.^-^+( \glissando } { f2) r8 e4.^-^+( \glissando } } f1) ~ f4 r r8 e4.^-^+( \glissando f1) ~ f4 r r8 ef4.^-^+( \glissando f1) ~ f4. f8 r4 d8.- df16- r8 d4.--- ef8.- e16- f8.- gf16- ~ gf1 } Cheers, Wol -- Anthony W. Youngman - anth...@thewolery.demon.co.uk ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
Patrick McCarty wrote: On Thu, May 14, 2009 at 8:05 PM, Chip c...@wiegand.org wrote: Chip wrote: I've come across this a couple times - when I am inputting a song it all works fine in \relative mode. I do some editing, some copy/paste from one part to another, view the resulting pdf and see the octaves are all messed up. The only way to fix them is to use absolute octave marks in small sections, usually only a few measures, to get the song to print correctly. Then for whatever reason, after those few measures the rest of the song is just fine. This seems to be completely random, has happened in a couple different songs, in different versions of lilypond. Has anyone seen this kind of behavior? Just seems rather odd. -- Chip I found the problem - I had the \relative c and the \transpose ef f bits seperated like this - bari = \transpose f ef { e4-- e8-- e8-- e4-. r ... stuff } barisax = \relative c' { \global \set Staff.instrumentName = #Bari Sax \set Staff.shortInstrumentName = #Bari \clef treble \bari%I've been told I don't need the here in this usage but without them I get errors } After I moved the \relative c' up to the same line as the \transpose the octave problems were fixed. It appears that the two have to be together, not seperated like I had them. I think this is the issue mentioned in the Known Issues for Chapter 1.1.2 Transpose in the Notation Reference. However, the two sentences included there are very confusing and should be rewritten to make the issue more clear. -Patrick Yes, I see what you mean. Not sure I understand it myself. -- Chip ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
Chip wrote: Patrick McCarty wrote: On Thu, May 14, 2009 at 8:05 PM, Chip c...@wiegand.org wrote: Chip wrote: I've come across this a couple times - when I am inputting a song it all works fine in \relative mode. I do some editing, some copy/paste from one part to another, view the resulting pdf and see the octaves are all messed up. The only way to fix them is to use absolute octave marks in small sections, usually only a few measures, to get the song to print correctly. Then for whatever reason, after those few measures the rest of the song is just fine. This seems to be completely random, has happened in a couple different songs, in different versions of lilypond. Has anyone seen this kind of behavior? Just seems rather odd. -- Chip I found the problem - I had the \relative c and the \transpose ef f bits seperated like this - bari = \transpose f ef { e4-- e8-- e8-- e4-. r ... stuff } barisax = \relative c' { \global \set Staff.instrumentName = #Bari Sax \set Staff.shortInstrumentName = #Bari \clef treble \bari%I've been told I don't need the here in this usage but without them I get errors } After I moved the \relative c' up to the same line as the \transpose the octave problems were fixed. It appears that the two have to be together, not seperated like I had them. I think this is the issue mentioned in the Known Issues for Chapter 1.1.2 Transpose in the Notation Reference. However, the two sentences included there are very confusing and should be rewritten to make the issue more clear. -Patrick Yes, I see what you mean. Not sure I understand it myself. -- Chip If someone who understands the issue can send me new wording for this passage that makes it clearer, I will make a patch for the docs. Jon -- Jonathan Kulp http://www.jonathankulp.com ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
Hi Jon, Jonathan Kulp wrote: Chip wrote: snip I think this is the issue mentioned in the Known Issues for Chapter 1.1.2 Transpose in the Notation Reference. However, the two sentences included there are very confusing and should be rewritten make the issue more clear. -Patrick Yes, I see what you mean. Not sure I understand it myself. -- Chip If someone who understands the issue can send me new wording for this passage that makes it clearer, I will make a patch for the docs. There are two issues 1. The information is in the wrong place 2. It's written in confusing developer-speak. 1. The text should be in section 1.1.2 Transposing after the first example. Put it just before the bit reading If a part written in C (normal /concert pitch/) 2. The text should be changed from The relative conversion will not affect \transpose, \chordmode or \relative sections in its argument. To use relative mode within transposed music, an additional \relative must be placed inside \transpose. to Note that in the previous example the music supplied as /musicexpr/ uses a \relative command. This is because \transpose does not pick up any \relative settings you may have set up in the outer block containing your \transpose statement. If you use \relative pitches, always code /musicexpr/ as a \relative block when using \transpose Jon Cheers, Ian ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
On 5/15/09 5:05 AM, Jonathan Kulp jonlancek...@gmail.com wrote: Chip wrote: Patrick McCarty wrote: On Thu, May 14, 2009 at 8:05 PM, Chip c...@wiegand.org wrote: I think this is the issue mentioned in the Known Issues for Chapter 1.1.2 Transpose in the Notation Reference. However, the two sentences included there are very confusing and should be rewritten to make the issue more clear. -Patrick Yes, I see what you mean. Not sure I understand it myself. -- Chip If someone who understands the issue can send me new wording for this passage that makes it clearer, I will make a patch for the docs. How about: Music inside a \transpose or \chordmode block is absolute, unless a \relative is included inside the the \transpose or \chordmode block. When \relative blocks are nested, the innermost relative block applies. I think that this information should be put in several places in the NR. First, I think that the information above should be put into 1.1.1 Writing Pitches as examples under Relative octave entry. There should be three separate items/examples: When relative blocks are nested, the innermost relative block applies. \relative c' { d e f \relative c'' { d e f}} Music inside a \chordmode block is absolute unless a \relative is included in the block. \relative c' { \chordmode { c \relative c'' { c }} Music inside a \transpose block is absolute unless a \relative is included. \relative c' { d e \transpose f g { d e \relative c' { d e }}} Second, I think a warning (inside a box, not just a known issue) under t1.1.2 Changing multiple pitches Transpose should say Music inside a \transpose block is absolute unless a \relative is included in the block. with a see-also to \relative. Similarly, a warning in 2.7.1. Chord mode should say Music inside a \chordmode block is absolute unless a \relative is included in the block. with a see-also to \relative. Note: I haven't tested any of these examples. HTH, Carl ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
I'm not sure that the relative mode gets forgotten but that LilyPond follows its own internal rules. I find that LilyPond behaves the way that the manual says it does: it picks the closest pitch. If I write { c2 a2 } it picks the A below that C rather than the A above that C. If I want the A above the C, I write { c2 a'2 } and all is well. Sometimes when I first compile the song there are pitches wildly out of their intended octave; then it's a matter of finding the proper places to change the pitch octaves with ' or , and the problem is usually solved with two or three of these. Pretty quick and simple without needing to resort to sticking \relative commands into the middle of the music information- something I hate doing because it makes it hard to debug the song. I use LilyPond to write out jazz lead sheets using the template below (with some modifications, e.g., \include and \repeat etc., as needed) which shows how I use the \relative command. When I transpose the music, I use two \transpose commands, one before each of the \relative commands. This seems to minimize the problems reported by the OP. Someone on the list sent me this template but I can't remember who it was. It works very well for my purposes and probably would not work well for many other purposes and perhaps not the OP's. \version 2.12.2 \paper { indent = 0.0 } \header { title = composer = meter = copyright = } harmonies = \chordmode { } melody = \relative c' { \override Staff.TimeSignature #'style = #'() \time 4/4 \clef treble \key \bar |: \bar :| } \addlyrics { } \score { \new ChordNames { \set chordChanges = ##t \harmonies } \new Staff \melody } ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
Carl D. Sorensen wrote: Music inside a \transpose or \chordmode block is absolute, unless a \relative is included inside the the \transpose or \chordmode block. When \relative blocks are nested, the innermost relative block applies. I don't understand why \chordmode (and \chords) changes back to absolute mode, when \notemode doesn't. Is it just since it's less common that the roots of the chords span several octaves, or is there any other good reason why LilyPond is implemented in this way? /Mats ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
On Fri, May 15, 2009 at 06:46:39AM -0600, Carl D. Sorensen wrote: First, I think that the information above should be put into 1.1.1 Writing Pitches as examples under Relative octave entry. There should be three separate items/examples: When relative blocks are nested, the innermost relative block applies. \relative c' { d e f \relative c'' { d e f}} Woah, that's froody! I would have never expected that! Note: I haven't tested any of these examples. I tested the above, because I just couldn't believe it. Anyway, I agree with these proposals. Cheers, - Graham ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
Tim McNamara wrote: I'm not sure that the relative mode gets forgotten but that LilyPond follows its own internal rules. I find that LilyPond behaves the way that the manual says it does: it picks the closest pitch. If I write { c2 a2 } it picks the A below that C rather than the A above that C. If I want the A above the C, I write { c2 a'2 } and all is well. Sometimes when I first compile the song there are pitches wildly out of their intended octave; then it's a matter of finding the proper places to change the pitch octaves with ' or , and the problem is usually solved with two or three of these. Pretty quick and simple without needing to resort to sticking \relative commands into the middle of the music information- something I hate doing because it makes it hard to debug the song. Here is an example of the issue I came across - r4 r8 ef~ ef d c bf a4. g8~ g2~ g2-- r In any mode the tied notes are the same octave, of course. But for whatever reason, with the \transpose and the \relative split as originally described, they were in different octaves, which obviously, broke the ties. Putting the \transpose ef f \relative c' together fixed the problem. With the \transpose and \relative split there were quite a few random instances of such odd octave issues, some would be just a single note or two, others 3 or 4 measures of music where almost every other note jumped octaves up and down. It's really a weird thing to see. In my template I typically use \transpose x x \relative x but for whatever reason I don't even recall now I moved the \transpose up to the notes section of the code. I think what I did was entered the notes of the tenor sax part in their actual tenor sax key (and all other instruments in concert key), then \transposed them, the tenor sax notes, down to concert key for the purpose viewing the score entirely in concert key. Thus the tenor sax part had the really wicked octave issue. Regards -- Chip I used the following template for all my transcriptions of texmex and tejano music (for a 7 piece horn section)- % LilyPond \include english.ly \version 2.12.2 \header{ title = composer = As Recorded By: arranger = Transcribed by: Chip Wiegand } global = { \time 4/4 \key bf \major #(override-auto-beam-setting '(end 1 8 * *) 1 4 'Staff) #(override-auto-beam-setting '(end 1 8 * *) 2 4 'Staff) #(override-auto-beam-setting '(end 1 8 * *) 3 4 'Staff) \override Glissando #'thickness = #3 \override Glissando #'style = #'zigzag \override Glissando #'minimum-length = #6 \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods \override MultiMeasureRest #'expand-limit = 1 \set Score.skipBars = ##t \numericTimeSignature } \paper { top-margin = 0.1\cm page-top-space = 0.1\cm ragged-bottom = ##t left-margin = 20\mm line-width = 175\mm } tagline = \markup { \simple #(strftime %b %d, %Y (localtime (current-time))) \with-url #http://lilypond.org/web/; { LilyPond \simple #(lilypond-version) (http://lilypond.org/) } } % -- Trumpet 1-- trpta = {} trumpeta = \transpose bf c \relative c'' { \global \set Staff.instrumentName = #Trumpet 1 \set Staff.shortInstrumentName = #Trpt 1 \clef treble \trpta } % -- Trumpet 2-- trptb = {} trumpetb = \transpose bf c \relative c'' { \global \set Staff.instrumentName = #Trumpet 2 \set Staff.shortInstrumentName = #Trpt 2 \clef treble \trptb } % -- Alto Sax 1 -- altoa = {} altosaxa = \transpose bf g \relative c'' { \global \set Staff.instrumentName = #Alto Sax \set Staff.shortInstrumentName = #Alto \clef treble \altoa } % -- Tenor-- tenor = {} tenorsax = \transpose bf c \relative c'' { \global \set Staff.instrumentName = #Tenor Sax \set Staff.shortInstrumentName = #Tenor \clef treble \tenor } % -- Bari-- bari = {} barisax = \transpose bf g \relative c''{ \global \set Staff.instrumentName = #Bari Sax \set Staff.shortInstrumentName = #Bari \clef treble \bari } % -- Trombone 1-- tbonea = {} trombonea = \relative c { \global \set Staff.instrumentName = #Trombone 1 \set Staff.shortInstrumentName = #Tbn 1 \clef bass \tbonea } % -- Trombone 2-- tboneb= {} tromboneb = \relative c { \global \set Staff.instrumentName = #Trombone 2 \set Staff.shortInstrumentName = #Tbn 2 \clef bass \tboneb } \book { \score { \new StaffGroup = trumpets \new Staff = trpta \trumpeta \new Staff = trptb \trumpetb \new StaffGroup = saxes \new Staff = altoa \altosaxa \new Staff = tenor \tenorsax \new Staff = bari \barisax \new StaffGroup = trombones \new Staff = tbonea \trombonea \new Staff = tboneb \tromboneb } } \book { \score { \new Staff = trumpeta \with { \remove Instrument_name_engraver } \trumpeta \header {piece=Trumpet 1} \layout { indent = 0\mm} } } \book { \score { \new Staff = trumpetb \with { \remove
Re: relative mode occasionally gets forgotten?
On 5/15/09 8:43 AM, Mats Bengtsson mats.bengts...@ee.kth.se wrote: Carl D. Sorensen wrote: Music inside a \transpose or \chordmode block is absolute, unless a \relative is included inside the the \transpose or \chordmode block. When \relative blocks are nested, the innermost relative block applies. I don't understand why \chordmode (and \chords) changes back to absolute mode, when \notemode doesn't. Is it just since it's less common that the roots of the chords span several octaves, or is there any other good reason why LilyPond is implemented in this way? I have no idea why LilyPond is implemented in this way. \chords behaves the same as \chordmode because \chords is just equivalent to \new ChordNames \chordmode, which I am sure you already knew. Thanks, Carl ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
In message 20090515145035.ga3...@nagi, Graham Percival gra...@percival-music.ca writes On Fri, May 15, 2009 at 06:46:39AM -0600, Carl D. Sorensen wrote: First, I think that the information above should be put into 1.1.1 Writing Pitches as examples under Relative octave entry. There should be three separate items/examples: When relative blocks are nested, the innermost relative block applies. \relative c' { d e f \relative c'' { d e f}} Woah, that's froody! I would have never expected that! Note: I haven't tested any of these examples. I tested the above, because I just couldn't believe it. Anyway, I agree with these proposals. When I first saw Chip's example, my reaction was why on earth would you want to do that? As I understand it, \relative converts from note names to absolute pitches. Pretty much everything else in lily works on pitches. In a .ly file you don't know, on seeing a c, which c it is - middle, top, low, whatever. If it's wrapped in a \relative{}, that assigns a pitch to it. Anything else on seeing it assumes it's c in the bass clef as that's the pitch assigned to the note c. So, I don't know how to word it, but when you're talking about \relative in the manual it should say that you should only use \relative immediately around your note names because it converts note names to absolute pitches. If there's another operator inside your \relative (ie in Chip's case, a \transpose, in the example above an inner \relative) that forces absolute pitches, then the \relative will do nothing because it doesn't know what to do with a pitch. Cheers, Wol -- Anthony W. Youngman - anth...@thewolery.demon.co.uk ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
--- Original Message --- From: Anthony W. Youngman lilyp...@thewolery.demon.co.uk To: lilypond-user@gnu.org Sent: 15.5.09, 18:03:43 Subject: Re: relative mode occasionally gets forgotten? In message 20090515145035.ga3...@nagi, Graham Percival gra...@percival-music.ca writes On Fri, May 15, 2009 at 06:46:39AM -0600, Carl D. Sorensen wrote: First, I think that the information above should be put into 1.1.1 Writing Pitches as examples under Relative octave entry. There should be three separate items/examples: When relative blocks are nested, the innermost relative block applies. \relative c' { d e f \relative c'' { d e f}} Woah, that's froody! I would have never expected that! Note: I haven't tested any of these examples. I tested the above, because I just couldn't believe it. Anyway, I agree with these proposals. When I first saw Chip's example, my reaction was why on earth would you want to do that? As I understand it, \relative converts from note names to absolute pitches. Pretty much everything else in lily works on pitches. In a .ly file you don't know, on seeing a c, which c it is - middle, top, low, whatever. If it's wrapped in a \relative{}, that assigns a pitch to it. Anything else on seeing it assumes it's c in the bass clef as that's the pitch assigned to the note c. So, I don't know how to word it, but when you're talking about \relative in the manual it should say that you should only use \relative immediately around your note names because it converts note names to absolute pitches. If there's another operator inside your \relative (ie in Chip's case, a \transpose, in the example above an inner \relative) that forces absolute pitches, then the \relative will do nothing because it doesn't know what to do with a pitch. Cheers, Wol -- Anthony W. Youngman - anth...@thewolery.demon.co.uk I don't know if it's worth mentioning, but you can also run into problems using \repeat inside a \relative block if an \unfoldRepeats is used outside the block. For example in Tune = \relative c' { \partial 4 d4 | \repeat volta 2 { c4 d e g | } } the first c will be relative to the last g on the second play through using \unfoldRepeats. Rewriting as Tune = { \partial 4 d'4 | \repeat volta 2 \relative c' { c4 d e g | } } resolves the problem. I try to make sure I keep \relatives at the innermost block for this reason. Is this a case of programming style, and should the docs cover it? ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
On May 15, 2009, at 9:54 AM, Chip wrote: Tim McNamara wrote: I'm not sure that the relative mode gets forgotten but that LilyPond follows its own internal rules. I find that LilyPond behaves the way that the manual says it does: it picks the closest pitch. If I write { c2 a2 } it picks the A below that C rather than the A above that C. If I want the A above the C, I write { c2 a'2 } and all is well. Sometimes when I first compile the song there are pitches wildly out of their intended octave; then it's a matter of finding the proper places to change the pitch octaves with ' or , and the problem is usually solved with two or three of these. Pretty quick and simple without needing to resort to sticking \relative commands into the middle of the music information- something I hate doing because it makes it hard to debug the song. Here is an example of the issue I came across - r4 r8 ef~ ef d c bf a4. g8~ g2~ g2-- r In any mode the tied notes are the same octave, of course. But for whatever reason, with the \transpose and the \relative split as originally described, they were in different octaves, which obviously, broke the ties. Putting the \transpose ef f \relative c' together fixed the problem. With the \transpose and \relative split there were quite a few random instances of such odd octave issues, some would be just a single note or two, others 3 or 4 measures of music where almost every other note jumped octaves up and down. It's really a weird thing to see. In my template I typically use \transpose x x \relative x but for whatever reason I don't even recall now I moved the \transpose up to the notes section of the code. I think what I did was entered the notes of the tenor sax part in their actual tenor sax key (and all other instruments in concert key), then \transposed them, the tenor sax notes, down to concert key for the purpose viewing the score entirely in concert key. Thus the tenor sax part had the really wicked octave issue. I recall reading in the documentation for the \transpose command that transposition should be done to or from concert to the target key using C as one of the arguments for \transpose. So, if I write a song that's nominally in Bb for the concert instruments, then for transposing for the Bb horns/Eb horns, etc. is done this way, respectively: \transpose c d (putting the tenor sax chart in C) \transpose c a (putting the also sax chart in G) So my source code in the .ly file is all in concert, modified by the \transpose command. There is a separate .ly file for each transposition, the way I do it, and I print a separate lead sheet for each transposition. There is probably an elegant way to do this from only one .ly file and automagically print separate lead sheets for each instrument in the right key, but I don't know what it is. Now, for orchestral music and such where you have a conductor who needs to see all the parts at once, my approach might not work very well, but for jazz it gets the job done because I don't need all the parts on one sheet. I would think that the It may be that \tranpose ef f is what's creating your problem by confusing LilyPond? ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
In message 200905151909580...@1654122929, David Pounder pound...@lineone.net writes --- Original Message --- From: Anthony W. Youngman lilyp...@thewolery.demon.co.uk To: lilypond-user@gnu.org Sent: 15.5.09, 18:03:43 Subject: Re: relative mode occasionally gets forgotten? In message 20090515145035.ga3...@nagi, Graham Percival gra...@percival-music.ca writes On Fri, May 15, 2009 at 06:46:39AM -0600, Carl D. Sorensen wrote: First, I think that the information above should be put into 1.1.1 Writing Pitches as examples under Relative octave entry. There should be three separate items/examples: When relative blocks are nested, the innermost relative block applies. \relative c' { d e f \relative c'' { d e f}} Woah, that's froody! I would have never expected that! Note: I haven't tested any of these examples. I tested the above, because I just couldn't believe it. Anyway, I agree with these proposals. When I first saw Chip's example, my reaction was why on earth would you want to do that? As I understand it, \relative converts from note names to absolute pitches. Pretty much everything else in lily works on pitches. In a .ly file you don't know, on seeing a c, which c it is - middle, top, low, whatever. If it's wrapped in a \relative{}, that assigns a pitch to it. Anything else on seeing it assumes it's c in the bass clef as that's the pitch assigned to the note c. So, I don't know how to word it, but when you're talking about \relative in the manual it should say that you should only use \relative immediately around your note names because it converts note names to absolute pitches. If there's another operator inside your \relative (ie in Chip's case, a \transpose, in the example above an inner \relative) that forces absolute pitches, then the \relative will do nothing because it doesn't know what to do with a pitch. Cheers, Wol -- Anthony W. Youngman - anth...@thewolery.demon.co.uk I don't know if it's worth mentioning, but you can also run into problems using \repeat inside a \relative block if an \unfoldRepeats is used outside the block. For example in Tune = \relative c' { \partial 4 d4 | \repeat volta 2 { c4 d e g | } } the first c will be relative to the last g on the second play through using \unfoldRepeats. Rewriting as Tune = { \partial 4 d'4 | \repeat volta 2 \relative c' { c4 d e g | } } resolves the problem. I try to make sure I keep \relatives at the innermost block for this reason. Is this a case of programming style, and should the docs cover it? Han-Wen gave me a resetOctave function that deals with this. I don't know if it's made its way into the docs, though. Cheers, Wol -- Anthony W. Youngman - anth...@thewolery.demon.co.uk ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
On 5/15/09 3:06 PM, Anthony W. Youngman lilyp...@thewolery.demon.co.uk wrote: In message 200905151909580...@1654122929, David Pounder pound...@lineone.net writes I don't know if it's worth mentioning, but you can also run into problems using \repeat inside a \relative block if an \unfoldRepeats is used outside the block. For example in Tune = \relative c' { \partial 4 d4 | \repeat volta 2 { c4 d e g | } } the first c will be relative to the last g on the second play through using \unfoldRepeats. Rewriting as Tune = { \partial 4 d'4 | \repeat volta 2 \relative c' { c4 d e g | } } resolves the problem. I try to make sure I keep \relatives at the innermost block for this reason. Is this a case of programming style, and should the docs cover it? Han-Wen gave me a resetOctave function that deals with this. I don't know if it's made its way into the docs, though. I just use the octave check construct and ignore the warning. Carl ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
--- Original Message --- From: Carl D. Sorensen c_soren...@byu.edu To: Anthony W. Youngman lilyp...@thewolery.demon.co.uk, lilypond-user@gnu.org lilypond-user@gnu.org Sent: 15.5.09, 23:43:07 Subject: Re: relative mode occasionally gets forgotten? On 5/15/09 3:06 PM, Anthony W. Youngman lilyp...@thewolery.demon.co.uk wrote: In message 200905151909580...@1654122929, David Pounder pound...@lineone.net writes I don't know if it's worth mentioning, but you can also run into problems using \repeat inside a \relative block if an \unfoldRepeats is used outside the block. For example in Tune = \relative c' { \partial 4 d4 | \repeat volta 2 { c4 d e g | } } the first c will be relative to the last g on the second play through using \unfoldRepeats. Rewriting as Tune = { \partial 4 d'4 | \repeat volta 2 \relative c' { c4 d e g | } } resolves the problem. I try to make sure I keep \relatives at the innermost block for this reason. Is this a case of programming style, and should the docs cover it? Han-Wen gave me a resetOctave function that deals with this. I don't know if it's made its way into the docs, though. I just use the octave check construct and ignore the warning. Carl That works, but makes it harder to see useful warnings as they fly up the screen. I suppose it just comes down to personal preference - it took me a couple of years to realise I could get rid of the warnings by changing where I put the \relatives - so to speak. Dave. ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
Chip wrote: I've come across this a couple times - when I am inputting a song it all works fine in \relative mode. I do some editing, some copy/paste from one part to another, view the resulting pdf and see the octaves are all messed up. The only way to fix them is to use absolute octave marks in small sections, usually only a few measures, to get the song to print correctly. Then for whatever reason, after those few measures the rest of the song is just fine. This seems to be completely random, has happened in a couple different songs, in different versions of lilypond. Has anyone seen this kind of behavior? Just seems rather odd. -- Chip I found the problem - I had the \relative c and the \transpose ef f bits seperated like this - bari = \transpose f ef { e4-- e8-- e8-- e4-. r ... stuff } barisax = \relative c' { \global \set Staff.instrumentName = #Bari Sax \set Staff.shortInstrumentName = #Bari \clef treble \bari%I've been told I don't need the here in this usage but without them I get errors } After I moved the \relative c' up to the same line as the \transpose the octave problems were fixed. It appears that the two have to be together, not seperated like I had them. -- Chip ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
Chip wrote: Chip wrote: I've come across this a couple times - when I am inputting a song it all works fine in \relative mode. I do some editing, some copy/paste from one part to another, view the resulting pdf and see the octaves are all messed up. The only way to fix them is to use absolute octave marks in small sections, usually only a few measures, to get the song to print correctly. Then for whatever reason, after those few measures the rest of the song is just fine. This seems to be completely random, has happened in a couple different songs, in different versions of lilypond. Has anyone seen this kind of behavior? Just seems rather odd. -- Chip I found the problem - I had the \relative c and the \transpose ef f bits seperated like this - bari = \transpose f ef { e4-- e8-- e8-- e4-. r ... stuff } barisax = \relative c' { \global \set Staff.instrumentName = #Bari Sax \set Staff.shortInstrumentName = #Bari \clef treble \bari%I've been told I don't need the here in this usage but without them I get errors } After I moved the \relative c' up to the same line as the \transpose the octave problems were fixed. It appears that the two have to be together, not seperated like I had them. -- Chip I can remember another situation where this happened to me. I think I was trying to use the \addStacc scheme macro found in the LSR and the stuff inside the curly braces went to absolute mode instead of staying relative. I believe I ended up using -. on each pitch instead. Glad you sorted it out. :) Jon -- Jonathan Kulp http://www.jonathankulp.com ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: relative mode occasionally gets forgotten?
On Thu, May 14, 2009 at 8:05 PM, Chip c...@wiegand.org wrote: Chip wrote: I've come across this a couple times - when I am inputting a song it all works fine in \relative mode. I do some editing, some copy/paste from one part to another, view the resulting pdf and see the octaves are all messed up. The only way to fix them is to use absolute octave marks in small sections, usually only a few measures, to get the song to print correctly. Then for whatever reason, after those few measures the rest of the song is just fine. This seems to be completely random, has happened in a couple different songs, in different versions of lilypond. Has anyone seen this kind of behavior? Just seems rather odd. -- Chip I found the problem - I had the \relative c and the \transpose ef f bits seperated like this - bari = \transpose f ef { e4-- e8-- e8-- e4-. r ... stuff } barisax = \relative c' { \global \set Staff.instrumentName = #Bari Sax \set Staff.shortInstrumentName = #Bari \clef treble \bari %I've been told I don't need the here in this usage but without them I get errors } After I moved the \relative c' up to the same line as the \transpose the octave problems were fixed. It appears that the two have to be together, not seperated like I had them. I think this is the issue mentioned in the Known Issues for Chapter 1.1.2 Transpose in the Notation Reference. However, the two sentences included there are very confusing and should be rewritten to make the issue more clear. -Patrick ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user