\transpose FROM TO MUSIC.
+2002-11-06 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * lily/parser.yy (Composite_music): new transpose syntax,
+ \transpose FROM TO MUSIC.
+
2002-11-04 Jan Nieuwenhuizen <janneke@gnu.org>
* scripts/lilypond-book.py:
\score {
\notes <
\context ChordNames \scheme
- \context Staff \transpose c'' \scheme
+ \context Staff \transpose c c' \scheme
>
\paper {
linewidth = 5.7\in
\score {
\notes <
\context ChordNames \scheme
- \context Staff \transpose c'' \scheme
+ \context Staff \transpose c c' \scheme
>
\paper {
linewidth = 5.7\in
@example
\repeat @var{expr}
-\transpose @var{pitch} @var{expr}
+\transpose @var{from} @var{to} @var{expr}
\apply @var{func} @var{expr}
\context @var{type} = @var{id} @var{expr}
\times @var{fraction} @var{expr}
@lilypond[13pt]
\context Staff {
\time 3/4
- \transpose bes\relative c'' {
+ \transpose bes\relative c' c'' {
\key g \major
d4 g,8 a b c | d4 g, g | e' c8 d e fis | g4 g, g \bar "|."
}
up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
down = \notes { bassdrum4 snare8 bd r bd sn4 }
\include "nederlands.ly"
-bass = \notes \transpose c, { a4. e8 r e g e }
+bass = \notes \transpose c c,, { a4. e8 r e g e }
\score {
<
\apply #(drums->paper 'drums) \context Staff = drums <
LilyPond has support for both entering and printing chords.
@lilypond[verbatim,singleline]
-twoWays = \notes \transpose c'' {
+twoWays = \notes \transpose c c' {
\chords {
c1 f:sus4 bes/f
}
using @code{\transpose}.
@lilypond[fragment,verbatim]
-\transpose c'' {
+\transpose c c' {
\chords {
c1 c:3- c:7 c:8
c:9 c:9-.5+.7+ c:3-.5-
which replaces the 5th with a 4th.
@lilypond[fragment,verbatim]
-\transpose c'' {
+\transpose c c' {
\chords {
c1:m c:min7 c:maj c:aug c:dim c:sus
}
separated by dots.
@lilypond[fragment,verbatim,center]
- \transpose c'' {
+ \transpose c c' {
\chords {
c1^3 c:7^5.3 c:8^7
}
is not in the chord, a warning will be printed.
@lilypond[fragment,verbatim,center]
- \transpose c''' {
+ \transpose c c'' {
\chords {
c1 c/e c/g c:7/e
}
so it becomes the lowest note in the chord.
@lilypond[fragment,verbatim,center]
- \transpose c''' {
+ \transpose c c'' {
\chords {
c1 c/+c c/+g c:7/+b
}
\score {
\notes<
\context ChordNames \scheme
- \context Staff \transpose c'' \scheme
+ \context Staff \transpose c c' \scheme
>
}
@end lilypond
\context ChordNames {
\property ChordNames.chordChanges = ##t
\scheme }
- \context Staff \transpose c'' \scheme
+ \context Staff \transpose c c' \scheme
>
\paper{linewidth= 9.\cm}
}
\context ChordNames = jazz {
\property ChordNames.ChordName \override
#'style = #'jazz \scheme }
- \context Staff \transpose c'' \scheme
+ \context Staff \transpose c c' \scheme
>
}
@end lilypond
@end example
@lilypond[noindent,noquote]
\score {
- \context Staff \notes \transpose c''' {
+ \context Staff \notes \transpose c c'' {
\property Score.BarNumber \override #'break-visibility = #end-of-line-invisible
\property Score.barNumberVisibility = #(every-nth-bar-number-visible 5)
\property Score.BarNumber \override #'molecule-callback =
A music expression can be transposed with @code{\transpose}. The syntax
is
@example
- \transpose @var{pitch} @var{musicexpr}
+ \transpose @var{from} @var{to} @var{musicexpr}
@end example
-This means that middle C in @var{musicexpr} is transposed to
-@var{pitch}.
+This means that @var{musicexpr} is transposed to by the interval
+between @var{from} is @var{to}.
@code{\transpose} distinguishes between enharmonic pitches: both
-@code{\transpose cis'} or @code{\transpose des'} will transpose up half
-a tone. The first version will print sharps and the second version
-will print flats.
+@code{\transpose c cis} or @code{\transpose c des} will transpose up
+half a tone. The first version will print sharps and the second
+version will print flats.
@lilypond[singleline, verbatim]
mus =\notes { \key d \major cis d fis g }
\score { \notes \context Staff {
\clef "F" \mus
\clef "G"
- \transpose g'' \mus
- \transpose f'' \mus
+ \transpose c g' \mus
+ \transpose c f' \mus
}}
@end lilypond
@lilypond[singleline,verbatim]
\score {
- \notes \transpose c'' {
+ \notes \transpose c c' {
\[ g c a f d' \]
a g f
\[ e f a g \]
@lilypond[singleline,verbatim]
\score {
- \notes \transpose c'' {
+ \notes \transpose c c' {
\property Score.timing = ##f
\property Score.defaultBarType = "empty"
\property Voice.NoteHead \set #'style = #'neo_mensural
@lilypond[singleline,verbatim]
\score {
- \notes \transpose c'' {
+ \notes \transpose c c' {
\property Score.timing = ##f
\property Score.defaultBarType = "empty"
\property Voice.NoteHead \set #'style = #'neo_mensural
@lilypond
\score {
- \context PianoStaff \notes \transpose c''' <
+ \context PianoStaff \notes \transpose c c'' <
\context Staff = up { s1 }
\context Staff = down { [c8 c \translator Staff=up <c d> c
\translator Staff=down c c c] }
@lilypond[notime]
\property Score.timing = ##f
-\transpose c'' { c d e f g a b }
+\transpose c c' { c d e f g a b }
@end lilypond
We will continue with this format: First we show a snippet of input,
@lilypond[notime]
\property Score.timing = ##f
\property Staff.autoBeaming = ##f
-\transpose c'' { a1 a2 a4 a16 a32 s16_" " }
+\transpose c c' { a1 a2 a4 a16 a32 s16_" " }
@end lilypond
If you don't specify a @rglos{duration}, the previous one is used:
@lilypond[notime]
\property Score.timing = ##f
-\transpose c'' { a a a2 a s16_" " }
+\transpose c c' { a a a2 a s16_" " }
@end lilypond
A @rglos{sharp} (@texisharp{}) is made by adding @samp{is}, a
@lilypond[notime]
\property Score.timing = ##f
-\transpose c'' { cis1 ees fisis aeses s16_" " }
+\transpose c c' { cis1 ees fisis aeses s16_" " }
@end lilypond
Add a dot @samp{.} after the duration to get a @rglos{dotted note}:
@lilypond[notime]
\property Score.timing = ##f
-\transpose c'' { a2. a4 a8. a16 s16_" " }
+\transpose c c' { a2. a4 a8. a16 s16_" " }
@end lilypond
The @rglos{meter} (or @rglos{time signature}) can be set with the
footer = "Mutopia-2001/04/27-xx"
}
-\version "1.7.3"
+\version "1.7.5"
dynamicUp = \property Voice.DynamicLineSpanner \override #'direction = #1
dynamicRevert = \property Voice.DynamicLineSpanner \revert #'direction
%{
Transpose as you like for your voice
Range untransposed is c' to f'' (for tenors and sopranos)
- \transpose a gives a' to d'' (for basses, who sing an octave down)
+ \transpose c' a gives a' to d'' (for basses, who sing an octave down)
\addlyrics
- \notes \transpose a \vocalStaff
+ \notes \transpose c' a \vocalStaff
\lyricStaff
- \notes \transpose a \grandStaff
+ \notes \transpose c' a \grandStaff
%}
\addlyrics
This file was partly generated using m4.
%}
-\version "1.7.3"
+\version "1.7.5"
-upper = \notes \transpose c'' {
+upper = \notes \transpose c c' {
r16 [c es g] [es c es c] r c r c |
r16 [c es g] [es c es c] r c r c |
r16 [c f as] [f c f c] r c r c |
lastupdated = "1999/Oct/14"
}
-\version "1.5.68"
+\version "1.7.5"
% should do programmable input.
soprane =
- \notes \transpose c'' {
+ \notes \transpose c c' {
\context Staff <
% Real soprane
\context Voice = uVoice {
%% 19 is broken --hwn.
%\include "paper19.ly"
-\version "1.7.3"
+\version "1.7.5"
\header {
title = "Romanzen"
\repeat volta 2 { s2.*8 } s2.*26 \bar "|."
}
-righta = \notes \transpose cis'' {
+righta = \notes \transpose c cis' {
% \stemUp \slurUp \tieUp
\stemUp
\property Voice.Slur \override #'attachment = #'(stem . stem)
}
-rightb = \notes \transpose cis'' {
+rightb = \notes \transpose c cis' {
\relative c { \stemDown \slurDown
\repeat volta 2 {
a4^1( g8^1 b4^1 a8^1 |
\property Voice.Slur \override #'extra-offset = #'(0 . 3)
\property Voice.Slur \override #'beautiful = #42
g( fes des fes b g_3 \! es_1 ges_2 a^3 ges f_1 ges_2 |
- r ges_2 b des_1 ges b,_2 des ges,^1 b, \d des,^1 \stemDown \transpose c {[b,_1 as,] |
+ r ges_2 b des_1 ges b,_2 des ges,^1 b, \d des,^1 \stemDown \transpose c' c {[b,_1 as,] |
g,8 [b,16 g, e, cis,] )d,_4 \< f, h, d_3 f_2 \! r16 }
\property Voice.Slur \revert #'extra-offset
\property Voice.Slur \revert #'beautiful
f g16_2 b_1 a_2 gis_1 c_2 h, c cis_1 d_2 b,_1 |
\tieDown c4.~<f,16 c \< > \tieBoth <f h>~[< \! f8^3 h \> > < \! e b^2>] |
\translator Staff=mid
- \transpose c {
+ \transpose c' c {
a4^1( g8^1 b4 a8^2 |
f8..^1 f32^1 g8^2 )a8.. \slurUp <f32 f'^3(> <g8 g'^4> |
<)a8.. a'^5> <f32 f'^3(> <g8 g'^4> <)a4. a'^5 \> > ~ |
}
}
-lefta = \notes \transpose cis' {
+lefta = \notes \transpose c cis {
\stemUp \slurUp \tieUp
\repeat volta 2 {
f4^1( e8^1 g4^1 f8^1 |
}
\d \tieBoth \slurDown
<
- \transpose c {
+ \transpose c' c {
g4 a8~a f g | a4 g8~g f e |
d4 g8~g es f | g4 f8~f es d |
c4 r8 f4 as8~ | as g b as4 ces'8~ |
ces' b des' c'4 \context Voice=another { \stemUp \tieUp <es'8 es>~ |
es' des'4^1~ \stemDown [des'8. c'16] }
}
- \transpose c, {
+ \transpose c' c, {
g4(-4 a8-3~a f-5 g-4 | a4-3 g8-#'(finger "4-3") ~g f-4 e-5 |
)d4-#'(finger "4-5")( g8-3~g es f-4 | g4-3 f8-4~f es d-4 |
)c4 r8 f4-4( as8-5~ | as g-4 )b-5 as4-5( ces'8-4~ |
f~ f-\fermata |
}
-leftb = \notes \transpose cis' {
+leftb = \notes \transpose c cis {
\stemDown \slurDown \tieDown
\repeat volta 2 {
f16^\p c f, c e c-3 g c-2 f, c f c |
fis^1 d d, d [a d_2] g, d g d_3 [b,_5( g_2] |
) a c_3 f, c [c' f_2] b, f b f_3 d' as |
h, as d' as h, as() f'4.^\fermata-\arpeggio_2 ~
- \d \stemDown f'8. \clef G \stemBoth \tieBoth \transpose c'' {[e16_4( f g] [as des_3] [c8_4 <h, d f d'>]~ |
+ \d \stemDown f'8. \clef G \stemBoth \tieBoth \transpose c c' {[e16_4( f g] [as des_3] [c8_4 <h, d f d'>]~ |
<h, d f d'>} \clef F [<c_3( f_1> <b,_4 e^2>] <)a,8._5 eis^1> h,16_4( c d |
\voiceTwo
es as,_3 g,8 fis,~fis, g,_4-\arpeggio gis,_5~ |
-\version "1.5.68"
+\version "1.7.5"
\include "mozart-hrn3-defs.ly"
allegro =
\score
{
- \notes { \transpose bes \allegro }
+ \notes { \transpose c' bes \allegro }
\paper{ }
\header { piece = "allegro" opus = "" }
\midi{ \tempo 4=90 }
-\version "1.5.68"
+\version "1.7.5"
\include "mozart-hrn3-defs.ly"
romanze = \notes \relative c' {
\score
{
- \notes { \transpose bes \romanze }
+ \notes { \transpose c' bes \romanze }
\header { piece = "romanze" opus = "" }
\midi{ \tempo 4 = 70 }
\paper{}
-\version "1.5.68"
+\version "1.7.5"
% \include "mozart-hrn3-defs.ly"
\score
{
- \notes { \transpose bes \rondo }
+ \notes { \transpose c' bes \rondo }
\header { piece = "rondo" opus = "" }
\midi{ \tempo 4 = 100 }
\paper { }
-\version "1.5.68"
+\version "1.7.5"
\header{
filename = "denneboom.ly"
enteredby = "jcn"
licht ge- spreid
}
-oboom = \notes\transpose c''{
+oboom = \notes\transpose c c'{
g,8 |
c8. c16 c4. d8 |
e8. e16 e4. e8 |
d8. c16 c4 r8
}
-bos = \notes\transpose c''{
+bos = \notes\transpose c c'{
g8 |
g e a4. g8 |
g8. f16 f4 r8 f8 |
-\version "1.5.68"
+\version "1.7.5"
\header {
filename = "praeludium-fuga-E.ly"
title = "praeludium and fuga in E-major"
-\version "1.5.68"
+\version "1.7.5"
\header {
texidoc = "If two forced accidentals happen at the same time, only one
sharp sign is printed."
}
-\score { \notes \transpose c''
+\score { \notes \transpose c c'
\context Staff <
\key g \major
\context Voice=va { \stemUp c' fis! }
-\version "1.7.3"
+\version "1.7.5"
\header {
texidoc="
\include "paper16.ly"
-mel = \notes \transpose c'' {
+mel = \notes \transpose c c' {
\time 4/4 \key d \major
gis4 g' g gis' | gis2 g' | g1 | gis | g | gis' | g |
fis4 f' f fis' | fis2 f' | f1 | fis | f | fis' | f |
-\version "1.5.68"
+\version "1.7.5"
\header {
texidoc ="Accidentals are placed as closely as possible.
Accidentals in corresponding octaves are aligned.
\score { \notes \context Voice \relative c' {
cis4
c4
- \transpose c'' {
+ \transpose c c' {
<bis4 es gis>
<es! as!>
<gis! cis!>
-\version "1.7.3"
+\version "1.7.5"
\header{
texidoc="
music))
-voicea = \notes \transpose c'' {
+voicea = \notes \transpose c c' {
\stemUp
fis2 a2 f4 fis a2
}
-voiceb = \notes \transpose c'' {
+voiceb = \notes \transpose c c' {
\stemDown
c2 fis2 f4 c f2
}
-\version "1.7.3"
+\version "1.7.5"
\header{
texidoc="
\score { \notes
<
- \context Staff \transpose c''' {
+ \context Staff \transpose c c'' {
\mel
% \property Score.oneMeasureLazy = ##t
\property Score.autoAccidentals = #'(Staff (same-octave . 0))
-\version "1.5.68"
+\version "1.7.5"
\header {
texidoc = "arpeggio stays clear of accidentals and flipped note heads.
\score{
- \notes \transpose c'' {
+ \notes \transpose c c' {
\context Voice < fis''-\arpeggio g d a >
\context Voice < fis,-\arpeggio g d a >
\context Voice < fis''-\arpeggio g d a >
-\version "1.5.68"
+\version "1.7.5"
\header{
texidoc="
Beams should behave reasonably well, even under extreme circumstances.
a'16 cis a, g''' % Used to give a nice beam directed upwards.
\stemBoth
- \transpose c' {
+ \transpose c c {
\stemDown [e'8 e e']
}
}
-\version "1.5.68"
+\version "1.7.5"
\header {
texidoc = "Knee beaming. (funky)"
}
[c,,,16 c c c
b''' b b b]
- \transpose a, { \relative b'' { [g,16 g'''16
+ \transpose c' a, { \relative b'' { [g,16 g'''16
g,,,16 g'''16
g,,,16 g'''16
g,,,16 g'''16
-\version "1.5.68"
+\version "1.7.5"
\header{
texidoc="property chordChanges: only display chord names when
\score {
\notes <
\context ChordNames < \scheme \settings >
- \context Staff \transpose c'' \scheme
+ \context Staff \transpose c c' \scheme
>
\paper{
linewidth = 40 * \staffspace
-\version "1.5.68"
+\version "1.7.5"
\header{
texidoc="
Chord names are generated from a list pitches, and are customisable
"
}
-chord = \notes\transpose c''\chords{
+chord = \notes\transpose c c'\chords{
c1
c:m
c:m5-
-\version "1.5.68"
+\version "1.7.5"
\header {
texidoc = "Oppositely stemmed chords, meshing into each other,
are resolved."
}
\score {
- \context Staff \notes \transpose c'' {
+ \context Staff \notes \transpose c c' {
\time 3/4
% Here's what I was trying to do:
< \context Voice = VI {\stemDown
-\version "1.5.68"
+\version "1.7.5"
\header{
texidoc="
Normal collisions. We have support for polyphony, where the
\score{
- \notes \transpose c'' {
+ \notes \transpose c c' {
\twovoice
\twovoicechords
-\version "1.5.68"
+\version "1.7.5"
\header {
texidoc = "Hara kiri should not upset fixed distance alignment like in pianostaff. In this example the middle staff is harakiried."
}
-\score { \notes \transpose c'''
+\score { \notes \transpose c c''
\context PianoStaff <
\context Staff = up { c c c c \break }
\context Staff = mid { s1 \break }
-\version "1.5.68"
+\version "1.7.5"
\header {
texidoc = "There is limited support for mensural notation: note head
\score {\notes { \context Voice {
\property Voice.NoteHead \set #'font-family = #'ancient
\property Voice.NoteHead \override #'style = #'mensural
-\transpose d''' { c4 c2 c8 c16 c16 c1 c\breve c\longa }
-\transpose c'' { c4 c2 c8 c16 c16 c1 c\breve c\longa }
+\transpose c d'' { c4 c2 c8 c16 c16 c1 c\breve c\longa }
+\transpose c c' { c4 c2 c8 c16 c16 c1 c\breve c\longa }
}}}
-\version "1.5.68"
+\version "1.7.5"
\header{
texidoc="
Rests should not collide with beams, stems and noteheads. Rests may
\context Staff < {\stemUp r} { \stemDown r} >
\context Staff < {\stemUp r} r { \stemDown r} >
\stemUp
- \transpose c'' { [c''8 r8 c''8 c''8]
+ \transpose c c' { [c''8 r8 c''8 c''8]
[c8 r8 c8 c8]
[c8 r8 r8 c'''8]
\stemDown
-\version "1.5.68"
+\version "1.7.5"
\header{
texidoc="
When tieing chords, the outer slurs point outwards, the inner slurs
\score {
\notes \context Voice {
\t
- \transpose g' \t
+ \transpose c g \t
\property Voice.TieColumn \override #'direction = #-1
\t
-\version "1.5.68"
+\version "1.7.5"
\header{
filename = "rhythm.ly"
enteredby = "HWN"
-ritme = \notes\transpose c'' {
+ritme = \notes\transpose c c' {
\time 4/4
\partial 8
c8 |
-\version "1.5.68"
+\version "1.7.5"
\include "deutsch.ly"
marks = \lyrics {
}
}
}
-guitar = \notes \transpose c' {
+guitar = \notes \transpose c c {
\time 2/2
\key e \minor
\property Staff.Arpeggio \override #'arpeggio-direction = #1
-\version "1.5.68"
+\version "1.7.5"
\include "deutsch.ly"
marks = \lyrics {
}
}
-guitar = \notes \transpose c' {
+guitar = \notes \transpose c c {
\guitar
\time 2/2
\key e \minor
-\version "1.5.68"
+\version "1.7.5"
\include "paper13.ly"
mu = {}
\context Voice = kor <
\voiceOne
\property Voice.MultiMeasureRest \override #'transparent = ##t
- \transpose c \kormel
+ \transpose c' c \kormel
>
\context Lyrics=korlyr \korlyr
>
\addlyrics
\context Voice = mel <
\voiceTwo
- \transpose c \mel
+ \transpose c' c \mel
>
\context Lyrics=lyr \lyr
>
\clef "F_8"
\global
- \transpose c \bas
+ \transpose c' c \bas
>
\context Staff = drums <
\property Staff.instrument = "Trommer"
>
\context Staff = bas <
\property Staff.instrument = "electric bass (finger)"
- < \transpose c \bas s1-\ff >
+ < \transpose c' c \bas s1-\ff >
>
\context Staff = trom <
\property Staff.instrument = "drums"
-\version "1.5.68"
+\version "1.7.5"
%{
Converted from star.mup with the aid of mup2ly.py
http://www.arkkra.com/doc/star.html
\global
\clef treble
\property Staff.automaticMelismata = ##t
- \context Voice = one \transpose c'' {
+ \context Voice = one \transpose c c' {
\voiceOne
\staffBVoiceB
\bar "|."
}
- \context Voice = two \transpose c'' {
+ \context Voice = two \transpose c c' {
\voiceTwo
\staffBVoiceC
}
-\version "1.5.68"
+\version "1.7.5"
\header {
texidoc = "Chord names in american styles, according to one of our users."
}
\score {
\notes <
\context ChordNames \scheme
- \context Staff \transpose c'' \scheme
+ \context Staff \transpose c c' \scheme
>
\paper {
\translator {
-\version "1.5.68"
+\version "1.7.5"
\header {
title = "ancient font test"
date = "2002"
\context Staff \outputproperty #(make-type-checker 'staff-symbol-interface)
#'line-count = #4
- \notes \transpose c' {
+ \notes \transpose c c {
\property Staff.KeySignature \override #'style = #'vaticana
\property Staff.Accidental \override #'style = #'vaticana
\property Voice.NoteHead \override #'style = #'vaticana_punctum
\context Staff \outputproperty #(make-type-checker 'staff-symbol-interface)
#'line-count = #5
- \notes \transpose c' {
+ \notes \transpose c c {
\property Voice.autoBeaming = ##f
\property Voice.NoteHead \override #'style = #'neo_mensural
\property Voice.Rest \override #'style = #'neo_mensural
\clef "mensural_g"
r4 r8 r16 r16
\property Voice.NoteHead \override #'style = #'mensural
- \property Voice.Stem \override #'style = #'mensural
+ \property Voice.Stem \override #'flag-style = #'mensural
\property Voice.Stem \override #'thickness = #1.0
\property Voice.Rest \override #'style = #'mensural
\clef "petrucci_f"
% FIXME: must set Voice.Stem style to #'neo_mensural to avoid
% segmentation fault on r8/r16/r32. (Strange: what has
% Voice.Stem style to do with mensural rests?)
- \property Voice.Stem \override #'style = #'neo_mensural
+ \property Voice.Stem \override #'flag-style = #'neo_mensural
r2 r4 r8 r16 r16
- \property Voice.Stem \override #'style = #'mensural
+ \property Voice.Stem \override #'flag-style = #'mensural
\property Staff.forceClef = ##t
\clef "mensural_f"
e\breve f g a1
\remove Ligature_bracket_engraver
\consists Mensural_ligature_engraver
NoteHead \set #'style = #'mensural
-% Stem \set #'style = #'mensural %%%%%%%% FIXME: this core dumps
+% Stem \set #'flag-style = #'mensural %%%%%%%% FIXME: this core dumps
Stem \set #'thickness = #1.0
Rest \set #'style = #'mensural
autoBeaming = ##f
-\version "1.5.68"
+\version "1.7.5"
\header{
% }
-chord = \notes\transpose c''\chords{
+chord = \notes\transpose c' c''\chords{
% dim modifier means: lower all implicit additions
c:dim9
c:dim
-\version "1.5.68"
+\version "1.7.5"
\header {
texidoc = "Hmm. what's this supposed to test?"
}
\score{
- \notes\transpose c'{
+ \notes \transpose c' c'{
\property Voice.Beam \set #'position-callbacks =
#`(,Beam::least_squares
,Beam::check_concave
-\version "1.5.68"
+\version "1.7.5"
\header{
filename = "beams.ly"
composer = "heu"
\score{
<
\context GrandStaff <
-\context Staff = SA \notes\transpose c' {
+\context Staff = SA \notes\transpose c c {
\time 8/4
\stemUp [c8 c'' a' f']
\stemUp [g128 g g g]
r32
- \transpose c{
+ \transpose c' c{
\stemBoth
[c'8 c'] [b b] [a a] [g g] [f f] [e e]
[c'16 c'] [b b] [a a] [g g] [f f] [e e]
>
<
\context Staff = SB \notes {
-\transpose c' {
+\transpose c c {
\time 8/4
\stemDown [a'8 a, c e]
\stemDown [a'16 a, c e]
\stemDown [a'128 a, c e]
r32}
- \transpose c{
+ \transpose c' c{
\stemDown [d''8 d'' d'' d'']
\stemDown [d''16 d'' d'' d'']
\stemDown [d''32 d'' d'' d'']
\stemDown [d''128 d'' d'' d'']
r32}
- \transpose c''{
+ \transpose c c'{
\stemBoth
[a8 a] [b b] [c' c'] [d' d'] [e' e'] [f' f']
[a16 a] [b b] [c' c'] [d' d'] [e' e'] [f' f']
-\version "1.5.68"
+\version "1.7.5"
\header{
enteredby = "jcn"
copyright = "PD"
c c c )c |
}
-broken = \notes\transpose c''{
+broken = \notes\transpose c c'{
c c c c()
c c c c(
-\version "1.5.68"
+\version "1.7.5"
%% FIXME
-\score { \notes \context Staff \transpose c''' {
+\score { \notes \context Staff \transpose c c'' {
\key d \major
% \property Staff.autoReminders = #'cautionary
\property Staff.Accidental \override #'font-relative-size = #0
-\version "1.5.68"
+\version "1.7.5"
\header{
filename = "chord-table.ly"
copyright = "public domain"
enteredby = "jcn"
}
-tab = \notes\transpose c'''\chords{
+tab = \notes\transpose c c''\chords{
c1 c:m c:4 c:m4 c:5+ \break
c:5- c:dim c:5-.5+ c:6 c:m6\break
c:4.6 c:7 c:m7 c:4.7 c:m4.7\break
\score{
% \context StaffGroup <
<
- \context Staff=c \notes\transpose c\tab
- \context ChordNames=c \notes\transpose c\tab
+ \context Staff=c \notes\transpose c' c\tab
+ \context ChordNames=c \notes\transpose c' c\tab
%{
- \context Staff=cis \notes\transpose cis\tab
- \context ChordNames=cis \notes\transpose cis\tab
- \context Staff=des \notes\transpose des\tab
- \context ChordNames=des \notes\transpose des\tab
- \context Staff=d \notes\transpose d\tab
- \context ChordNames=d \notes\transpose d\tab
- \context Staff=es \notes\transpose es\tab
- \context ChordNames=es \notes\transpose es\tab
- \context Staff=e \notes\transpose e\tab
- \context ChordNames=e \notes\transpose e\tab
- \context Staff=fis \notes\transpose fis\tab
- \context ChordNames=fis \notes\transpose fis\tab
- \context Staff=g \notes\transpose g\tab
- \context ChordNames=g \notes\transpose g\tab
- \context Staff=as \notes\transpose as\tab
- \context ChordNames=as \notes\transpose as\tab
- \context Staff=a \notes\transpose a\tab
- \context ChordNames=a \notes\transpose a\tab
- \context Staff=bes \notes\transpose bes,\tab
- \context ChordNames=bes \notes\transpose bes,\tab
- \context Staff=b \notes\transpose b,\tab
- \context ChordNames=b \notes\transpose b,\tab
+ \context Staff=cis \notes\transpose c' cis\tab
+ \context ChordNames=cis \notes\transpose c' cis\tab
+ \context Staff=des \notes\transpose c' des\tab
+ \context ChordNames=des \notes\transpose c' des\tab
+ \context Staff=d \notes\transpose c' d\tab
+ \context ChordNames=d \notes\transpose c' d\tab
+ \context Staff=es \notes\transpose c' es\tab
+ \context ChordNames=es \notes\transpose c' es\tab
+ \context Staff=e \notes\transpose c' e\tab
+ \context ChordNames=e \notes\transpose c' e\tab
+ \context Staff=fis \notes\transpose c' fis\tab
+ \context ChordNames=fis \notes\transpose c' fis\tab
+ \context Staff=g \notes\transpose c' g\tab
+ \context ChordNames=g \notes\transpose c' g\tab
+ \context Staff=as \notes\transpose c' as\tab
+ \context ChordNames=as \notes\transpose c' as\tab
+ \context Staff=a \notes\transpose c' a\tab
+ \context ChordNames=a \notes\transpose c' a\tab
+ \context Staff=bes \notes\transpose c' bes,\tab
+ \context ChordNames=bes \notes\transpose c' bes,\tab
+ \context Staff=b \notes\transpose c' b,\tab
+ \context ChordNames=b \notes\transpose c' b,\tab
%}
>
\paper{
-\version "1.5.68"
+\version "1.7.5"
\header{
texidoc="property chordChanges: only display chord names when
\score {
\notes <
\context ChordNames \scheme
- \context Staff \transpose c'' \scheme
+ \context Staff \transpose c c' \scheme
>
\paper{
linewidth = 40 * \staffspace
-\version "1.5.68"
+\version "1.7.5"
\header{
enteredby = "jcn"
copyright = "public domain"
TestedFeatures = "chord inversions"
}
-inversions = \notes\transpose c''\chords{
+inversions = \notes\transpose c c'\chords{
% inversions
c1 c:sus c:6 c/e c/g
c/d % this triggers a warning: no 'd' in chord of c
-\version "1.5.68"
+\version "1.7.5"
\header{
filename = "chord-table.ly"
copyright = "public domain"
enteredby = "jcn"
}
-tab = \notes\transpose c'''\chords{
+tab = \notes\transpose c c''\chords{
c1 c:m c:4 c:m4 c:5+ c:5- c:dim c:5-.5+ c:6\break %c:m6\break
}
\score{
\context StaffGroup <
- \context Staff=c \notes\transpose c\tab
- \context ChordNames=c \notes\transpose c\tab
- \context Staff=cis \notes\transpose cis\tab
- \context ChordNames=cis \notes\transpose cis\tab
- \context Staff=des \notes\transpose des\tab
- \context ChordNames=des \notes\transpose des\tab
- \context Staff=d \notes\transpose d\tab
- \context ChordNames=d \notes\transpose d\tab
- \context Staff=es \notes\transpose es\tab
- \context ChordNames=es \notes\transpose es\tab
- \context Staff=e \notes\transpose e\tab
- \context ChordNames=e \notes\transpose e\tab
+ \context Staff=c \notes\transpose c' c\tab
+ \context ChordNames=c \notes\transpose c' c\tab
+ \context Staff=cis \notes\transpose c' cis\tab
+ \context ChordNames=cis \notes\transpose c' cis\tab
+ \context Staff=des \notes\transpose c' des\tab
+ \context ChordNames=des \notes\transpose c' des\tab
+ \context Staff=d \notes\transpose c' d\tab
+ \context ChordNames=d \notes\transpose c' d\tab
+ \context Staff=es \notes\transpose c' es\tab
+ \context ChordNames=es \notes\transpose c' es\tab
+ \context Staff=e \notes\transpose c' e\tab
+ \context ChordNames=e \notes\transpose c' e\tab
%{ FIXME: remove some, gs barfs
- \context Staff=fis \notes\transpose fis\tab
- \context ChordNames=fis \notes\transpose fis\tab
- \context Staff=g \notes\transpose g\tab
- \context ChordNames=g \notes\transpose g\tab
- \context Staff=as \notes\transpose as\tab
- \context ChordNames=as \notes\transpose as\tab
- \context Staff=a \notes\transpose a\tab
- \context ChordNames=a \notes\transpose a\tab
- \context Staff=bes \notes\transpose bes,\tab
- \context ChordNames=bes \notes\transpose bes,\tab
- \context Staff=b \notes\transpose b,\tab
- \context ChordNames=b \notes\transpose b,\tab
+ \context Staff=fis \notes\transpose c' fis\tab
+ \context ChordNames=fis \notes\transpose c' fis\tab
+ \context Staff=g \notes\transpose c' g\tab
+ \context ChordNames=g \notes\transpose c' g\tab
+ \context Staff=as \notes\transpose c' as\tab
+ \context ChordNames=as \notes\transpose c' as\tab
+ \context Staff=a \notes\transpose c' a\tab
+ \context ChordNames=a \notes\transpose c' a\tab
+ \context Staff=bes \notes\transpose c' bes,\tab
+ \context ChordNames=bes \notes\transpose c' bes,\tab
+ \context Staff=b \notes\transpose c' b,\tab
+ \context ChordNames=b \notes\transpose c' b,\tab
%}
>
\paper{
-\version "1.5.68"
+\version "1.7.5"
\header {
title="Chord Taxonomy of LilyPond -- jazz"
}
<
\property ChordNames.ChordName \set #'style = #'jazz
\context ChordNames \scheme
- \context Staff \notes \transpose c'' \scheme
+ \context Staff \notes \transpose c c' \scheme
>
}
-\version "1.5.68"
+\version "1.7.5"
%{
%}
% used to be quarter notes here. Why? --hwn
-scales = \notes \transpose c'' \chords{
+scales = \notes \transpose c c' \chords{
%<c1 e g>
c1:m c:min c:dim c:aug c:sus c:maj
c1:6 c:7 c:9 c:11 c:13
-\version "1.5.68"
+\version "1.7.5"
\header {
title="Chord Taxomony of LilyPond -- jazz"
subtitle="Amy's chord tests"
<
\property ChordNames.ChordName \set #'style = #'jazz
\context ChordNames \scheme
- \context Staff \notes \transpose c'' \scheme
+ \context Staff \notes \transpose c c' \scheme
>
}
-\version "1.5.68"
+\version "1.7.5"
\header {
texidoc = "Test figured bass.
" }
\score { \notes <
-\context FiguredBass \transpose c'' {
+\context FiguredBass \transpose c c' {
<e! g >
<f8 ais >
\figures {
%{ TODO: the construct with separet SquashVoice context is a little
gory. FIXME. %}
-\version "1.5.68"
+\version "1.7.5"
improOn = \notes {\translator Voice = impro }
improOff = \notes {\translator SquashVoice = melo }
\context ChordNames \chords {e8*7:m7 a2.:m7 bes4:m7 b1:m7 e8:m }
\context Staff \notes <
\context SquashVoice = impro { \global }
- \context Voice = melo \transpose c'' {
+ \context Voice = melo \transpose c c' {
e8 e g a a16()bes()a8 g \improOn e8
~e2~e8 f4 fis8
~fis2 \improOff a16()bes a8 g e
-\version "1.5.68"
+\version "1.7.5"
\score {
\notes <
\context ChordNames \scheme
- \context Staff \transpose c'' \scheme
+ \context Staff \transpose c c' \scheme
>
\paper {
\translator {
-\version "1.5.68"
+\version "1.7.5"
somewhatLong = \lyrics{
>
melody = \notes
-\transpose c'{
+\transpose c c{
c4 e4 g4 e4 c4 e4 g4 e4 c4 e4 g4 e4 c4 e4 g4 e4
c4 e4 g4 e4 c4 e4 g4 e4 c4 e4 g4 e4 c4 e4 g4 e4
}
-\version "1.5.68"
+\version "1.7.5"
\header {
title = "mensural ligature test"
date = "2002"
% graphical width of the ligatures rather to the musical moment in time.
% This is intended behaviour.
-voice = \notes \transpose c'' {
+voice = \notes \transpose c c' {
\property Score.timing = ##f
\property Score.defaultBarType = "empty"
g\longa c\breve a\breve f\breve d'\longa^\fermata
}
\include "deutsch.ly"
-\version "1.7.3"
+\version "1.7.5"
#(define (transform music)
(let* ((es (ly:get-mus-property music 'elements))
-\version "1.7.3"
+\version "1.7.5"
-pat = \notes \transpose c'' \repeat unfold 2 {
+pat = \notes \transpose c c' \repeat unfold 2 {
< { \context Staff=up {r8 e16 f g e f g } }
{ \context Staff=down <
\context Voice=vup { \stemUp \tieUp r16 d8.~d4 }
endc = \notes {\stemDown \tieDown c,,2~c,, c,,~c,, c,,1_\fermata }
\score {
- \notes \transpose c'' \context PianoStaff <
+ \notes \transpose c c' \context PianoStaff <
\context Staff=up { \clef "G" s1*32 \enda }
\context Staff=down { \clef "F" s1*32 < \context Voice=vup \endb
\context Voice=vdwn \endc
-\version "1.5.68"
+\version "1.7.5"
\score{
- \notes \transpose c''{
+ \notes \transpose c c'{
% 1.1.53: @x@ syntax dropped
% if you want fingering, write chord explicitily eg < c1-1 e-2 g-3 >
% @c1@ @c-7@ @c-7^5@-1-3
-\version "1.5.68"
+\version "1.7.5"
\header {
texidoc="Octave duplicate parts of music"
}
}
upperOctave = \notes <
- \context Thread=upperOne { \transpose c \upperOne }
+ \context Thread=upperOne { \transpose c' c \upperOne }
\context Thread=upperOne {
\property Thread.devNullThread = #'allways s1*2
\property Thread.devNullThread = #'() s1*2
}
lowerOctave = \notes <
- \context Thread=lowerOne { \transpose c \lowerOne }
+ \context Thread=lowerOne { \transpose c' c \lowerOne }
\context Thread=lowerOne {
\repeat "unfold" 4 { \firstEight }
}
-\version "1.7.3"
+\version "1.7.5"
\header {
texidoc="Template for part-combining orchestral scores"
\End
>
-violaI = \notes\transpose c, \violinoI
+violaI = \notes\transpose c' c, \violinoI
-violaII = \notes\transpose c, \violinoII
+violaII = \notes\transpose c' c, \violinoII
violeGroup = \notes \context VoiceCombineStaff = oneViole <
\property VoiceCombineStaff.midiInstrument = #"viola"
-\version "1.7.3"
+\version "1.7.5"
\header {
}
-foo = \notes \transpose c' { d''4-. }
-bra = \notes \transpose c' { e'4-. }
+foo = \notes \transpose c c { d''4-. }
+bra = \notes \transpose c c { e'4-. }
\score {
\context Voice \notes\relative c' {
-\version "1.5.68"
+\version "1.7.5"
-blah = \notes{ \transpose c'' {
+blah = \notes{ \transpose c c' {
c,4 ->-.-\fermata-"text"
c ->-.-\fermata-"text"
-\version "1.5.68"
+\version "1.7.5"
\header{
enteredby = "jcn"
copyright = "public domain"
c c c )c |
}
-dirs = \notes\transpose c' {
+dirs = \notes\transpose c c {
c'1() g' () c () g () c |
}
-over = \notes\transpose c'{
+over = \notes\transpose c c{
e( g' g' )e
e( c'' f )e
}
-under = \notes\transpose c'{
+under = \notes\transpose c c{
\stemDown
f'( \stemBoth d d \stemDown )f'
f'( \stemBoth c c \stemDown )f'
f'( e, f )f'
}
-eccentric = \notes\transpose c'{
+eccentric = \notes\transpose c c{
\stemUp
\times 4/7 { f( a' f f f f )f } |
\times 4/7 { f( f f f f a' )f } |
\times 4/7 { e'( e' e' e' e' c )e' } |
}
-tiltup = \notes\transpose c'{
+tiltup = \notes\transpose c c{
e( c'' c'' )e'
\stemUp
e( c'' c'' )e'
f'( a, a, )f''
}
-tiltdown = \notes\transpose c'{
+tiltdown = \notes\transpose c c{
e'( c'' c'' )e
\stemUp
e'( c'' c'' )e
f''( a, a, )f'
}
-broken = \notes\transpose c''{
+broken = \notes\transpose c c'{
c c c c()
c c c c(
c )c c c(
f,( c c )f,
}
-blend = \notes\transpose c'{
+blend = \notes\transpose c c{
e( c'' c'' )e
\stemUp
f'( c'' c'' )f'
}
-bug = \notes\transpose c'{
+bug = \notes\transpose c c{
a()g( f )e
b'()a'( g' )f'
c' () b () c' c'
}
-clipping = \notes\transpose c'{
+clipping = \notes\transpose c c{
\stemBoth
c( c''' c''')c
c( c''' c )c''
-\version "1.7.3"
+\version "1.7.5"
\header {
texidoc="
\score {
\notes \context Staff {
- \transpose ais' \music
- \apply #simplify \transpose ais' \music
+ \transpose c ais \music
+ \apply #simplify \transpose c ais \music
}
\paper { linewidth = -1. }
}
-\version "1.5.68"
+\version "1.7.5"
\header{
title= "Stems and Beams"
subtitle = "proofsheet"
beamintervals = \notes{
\time 7/4
\stemUp
- \transpose c''{
+ \transpose c c'{
[ c8 d ] [ c e ] [ c f ] [ c g ] [ c a ] [ c b ] [ c c' ] |
[ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] |
}
- \transpose c'''{
+ \transpose c c''{
[ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] |
\stemDown
}
- \transpose c''''{
+ \transpose c c'''{
[ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] |
}
- \transpose c'''{
+ \transpose c c''{
[ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] |
[ c d ] [ c e ] [ c f ] [ c g ] [ c a ] [ c b ] [ c c' ] |
}
d c b a g f e d c b a g f e d c b a g
}
\beamintervals
- \transpose d' \beamintervals
- \transpose e' \beamintervals
- \transpose f' \beamintervals
- \transpose g' \beamintervals
- \transpose a' \beamintervals
- \transpose b' \beamintervals
+ \transpose c d \beamintervals
+ \transpose c e \beamintervals
+ \transpose c f \beamintervals
+ \transpose c g \beamintervals
+ \transpose c a \beamintervals
+ \transpose c b \beamintervals
}
\paper{
indent = 0.0\mm
-\version "1.5.68"
+\version "1.7.5"
%{
Hi all,
I have extend Mats' patches to allow accidental transposition:
\keysignature bes es fis
- = \transpose d =>
+ = \transpose c' d =>
\keysignature gis
As you can see in output = the example file "test.ly" there are a few problems left:
- key undo (already in the Todo)
-- "wrong" transposition: e.g. \transpose d of fis-major = gis-major (better as-major?).
+- "wrong" transposition: e.g. \transpose c' d of fis-major = gis-major (better as-major?).
The solution gis=as etc. would concern both note and key transposistion
Eric
c4 c |
}
-vTwo = \notes \transpose d' { \vOne }
+vTwo = \notes \transpose c d { \vOne }
vThree = \notes \relative c''{
\clef"violin"
cis4 ais4 |
}
-vFour = \notes \transpose d' \vThree
+vFour = \notes \transpose c d \vThree
\score {
\context StaffGroup <
-\version "1.5.68"
+\version "1.7.5"
\include "paper16.ly"
}
hoomPah = \repeat unfold 8 \notes
- \transpose c' {
+ \transpose c c {
\translator Staff = down
\stemUp
c8
-\version "1.5.68"
+\version "1.7.5"
\header{
filename = "twinkle-pop.ly"
xtitle = "Ah, vous dirais-je, maman "
\score {
<
- \chords \context ChordNames \transpose d'\acc
- \notes \context Staff=melody \transpose d'\melodie
+ \chords \context ChordNames \transpose c d\acc
+ \notes \context Staff=melody \transpose c d\melodie
\lyrics \context Lyrics \text
>
\header{
}
ENTER_DESCRIPTION (Auto_beam_engraver,
-/* descr */ "Generate beams based on measure characteristics and observed
-Stems. Uses beatLength, measureLength and measurePosition to decide
-when to start and stop a beam. Overriding beaming is done through
-@ref{Stem_engraver} properties stemLeftBeamCount and
-stemRightBeamCount.
-",
+/* descr */ "Generate beams based on measure characteristics and observed "
+"Stems. Uses beatLength, measureLength and measurePosition to decide "
+"when to start and stop a beam. Overriding beaming is done through "
+"@ref{Stem_engraver} properties stemLeftBeamCount and "
+"stemRightBeamCount. "
+,
/* creats*/ "Beam",
/* accepts */ "",
/* acks */ "stem-interface rest-interface beam-interface bar-line-interface",
Hara_kiri_engraver::Hara_kiri_engraver(){}
ENTER_DESCRIPTION(Hara_kiri_engraver,
-/* descr */ "Like Axis_group_engraver, but make a hara kiri spanner, and add
-interesting items (ie. note heads, lyric syllables and normal rests)
-",
+/* descr */ "Like Axis_group_engraver, but make a hara kiri spanner, and add "
+"interesting items (ie. note heads, lyric syllables and normal rests) ",
/* creats*/ "HaraKiriVerticalGroup",
/* accepts */ "",
/* acks */ "grob-interface",
ENTER_DESCRIPTION(Bar_engraver,
-/* descr */ "Create barlines. This engraver is controlled through the
-@code{whichBar} property. If it has no bar line to create, it will forbid a linebreak at this point",
+/* descr */ "Create barlines. This engraver is controlled through the "
+"@code{whichBar} property. If it has no bar line to create, it will forbid a linebreak at this point",
/* creats*/ "BarLine",
/* accepts */ "",
/* acks */ "",
Forbid_line_break_engraver::Forbid_line_break_engraver(){}
ENTER_DESCRIPTION(Forbid_line_break_engraver,
-/* descr */ "Forbid line breaks when note heads are still playing
-at some point.",
+/* descr */ "Forbid line breaks when note heads are still playing at some point.",
/* creats*/ "",
/* accepts */ "",
/* acks */ "",
/// return pitch from central c (in halfnotes)
int semitone_pitch () const;
String string () const;
-
-
SCM smobbed_copy () const;
DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
DECLARE_SIMPLE_SMOBS (Pitch,);
-
-
};
+
SCM ly_pitch_transpose (SCM p, SCM delta);
DECLARE_UNSMOB(Pitch,pitch);
int compare (Array<Pitch>*, Array<Pitch>*);
extern SCM pitch_less_proc;
+Pitch interval (Pitch const & from , Pitch const & to );
#endif /* MUSICAL_PITCH_HH */
ENTER_DESCRIPTION(Instrument_name_engraver,
-/* descr */ " Prints the name of the instrument (specified by
-@code{Staff.instrument} and @code{Staff.instr})
-at the left of the
-staff.",
+/* descr */ " Prints the name of the instrument (specified by "
+" @code{Staff.instrument} and @code{Staff.instr}) "
+"at the left of the staff. ",
/* creats*/ "InstrumentName",
/* accepts */ "",
/* acks */ "bar-line-interface axis-group-interface",
ENTER_DESCRIPTION(Lyric_phrasing_engraver,
- /* descr */ "
-This engraver combines note heads and lyrics for alignment.
-
-This engraver is switched on by default. Turn it off for faster
-processing of orchestral scores.
-",
+ /* descr */
+"This engraver combines note heads and lyrics for alignment. "
+"\n\n"
+"This engraver is switched on by default. Turn it off for faster "
+"processing of orchestral scores. ",
/* creats*/ "",
/* accepts */ "",
/* acks */ "lyric-syllable-interface note-head-interface lyric-extender-interface",
ENTER_DESCRIPTION(Note_head_line_engraver,
-/* descr */ "Engrave a line between two note heads, for example a glissando. If
-followVoice is set, staff switches also generate a line.",
+/* descr */ "Engrave a line between two note heads, for example a glissando. If "
+" followVoice is set, staff switches also generate a line.",
/* creats*/ "Glissando VoiceFollower",
/* accepts */ "glissando-event",
/* acks */ "rhythmic-head-interface",
}
ENTER_DESCRIPTION(Output_property_engraver,
-/* descr */ "Interpret Music of Output_property type, and apply a function
-to any Graphic objects that satisfies the predicate.",
+/* descr */ "Interpret Music of Output_property type, and apply a function "
+" to any Graphic objects that satisfies the predicate.",
/* creats*/ "",
/* accepts */ "layout-instruction",
/* acks */ "grob-interface",
%type <scm> pre_events post_events
%type <music> gen_text_def
-%type <scm> steno_pitch pitch absolute_pitch
+%type <scm> steno_pitch pitch absolute_pitch pitch_also_in_chords
%type <scm> explicit_pitch steno_tonic_pitch
%type <scm> chord_additions chord_subtractions chord_notes chord_step
| Repeated_music { $$ = $1; }
| Simultaneous_music { $$ = $1; }
| Sequential_music { $$ = $1; }
- | TRANSPOSE pitch Music {
+ | TRANSPOSE pitch_also_in_chords pitch_also_in_chords Music {
$$ = MY_MAKE_MUSIC("TransposedMusic");
- Music *p = $3;
- Pitch pit = *unsmob_pitch ($2);
-
- p->transpose (pit);
- $$->set_mus_property ("element", p->self_scm ());
- scm_gc_unprotect_object (p->self_scm ());
- }
- | TRANSPOSE steno_tonic_pitch Music {
- $$ = MY_MAKE_MUSIC("TransposedMusic");
- Music *p = $3;
- Pitch pit = *unsmob_pitch ($2);
+ Music *p = $4;
+ Pitch from = *unsmob_pitch ($2);
+ Pitch to = *unsmob_pitch ($3);
- p->transpose (pit);
+ p->transpose (interval (from, to));
$$->set_mus_property ("element", p->self_scm ());
scm_gc_unprotect_object (p->self_scm ());
-
}
| APPLY embedded_scm Music {
SCM ret = gh_call1 ($2, $3->self_scm ());
}
;
+pitch_also_in_chords:
+ pitch
+ | steno_tonic_pitch
+ ;
+
explicit_pitch:
PITCH embedded_scm {
$$ = $2;
}
| DIGIT {
Music * t = MY_MAKE_MUSIC("FingerEvent");
- SCM finger = ly_symbol2scm ("finger");
t->set_mus_property ("digit", gh_int2scm ($1));
t->set_spot (THIS->here_input ());
$$ = t;
}
ENTER_DESCRIPTION(Pitch_squash_engraver,
-/* descr */ "Treat all pitches as middle C. Note that the notes move, but
-the locations of accidentals stay the same.
-Set the position field of all note heads to zero. This useful for
-making a single line staff that demonstrates the rhythm of a melody.",
+/* descr */ "Treat all pitches as middle C. Note that the notes move, but "
+"the locations of accidentals stay the same. "
+"Set the position field of all note heads to zero. This useful for "
+"making a single line staff that demonstrates the rhythm of a melody.",
/* creats*/ "",
/* accepts */ "",
/* acks */ "note-head-interface",
void
Pitch::transpose (Pitch delta)
{
- int old_semi = semitone_pitch ();
- int delta_semi = delta.semitone_pitch ();
+ int new_semi = semitone_pitch () +delta.semitone_pitch();
octave_ += delta.octave_;
notename_ += delta.notename_;
-
- int new_semi = semitone_pitch ();
- int delta_acc = new_semi - old_semi - delta_semi;
- alteration_ -= delta_acc;
+ alteration_ += new_semi - semitone_pitch();
normalise ();
}
+Pitch
+interval (Pitch const & from , Pitch const & to )
+{
+ int sound = to.semitone_pitch() - from.semitone_pitch ();
+ Pitch pt ;
+ pt.octave_ = to.octave_ - from.octave_;
+ pt.notename_ = to.notename_ - from.notename_;
+ pt.alteration_ = to.alteration_ - from.alteration_;
+ pt.alteration_ += sound - pt.semitone_pitch();
+
+ return pt;
+}
+
/* FIXME
Merge with *pitch->text* funcs in chord-name.scm
LY_DEFINE(ly_pitch_transpose,
"ly:transpose-pitch", 2, 0, 0,
(SCM p, SCM delta),
- "Transpose @var{p} by the amount @var{delta}, where @var{delta} is the
-pitch that central C is transposed to.
-")
+ "Transpose @var{p} by the amount @var{delta}, where @var{delta} is the "
+" pitch that central C is transposed to.")
{
Pitch* t = unsmob_pitch (p);
Pitch *d = unsmob_pitch (delta);
LY_DEFINE(make_pitch, "ly:make-pitch", 3, 0, 0,
(SCM o, SCM n, SCM a),
- "
-@var{octave} is specified by an integer, zero for the octave containing
-middle C. @var{note} is a number from 0 to 6, with 0 corresponding to C
-and 6 corresponding to B. The shift is zero for a natural, negative for
-flats, or positive for sharps.
-
-")
+ "@var{octave} is specified by an integer, zero for the octave containing "
+ "middle C. @var{note} is a number from 0 to 6, with 0 corresponding to C "
+ "and 6 corresponding to B. The shift is zero for a natural, negative for "
+ "flats, or positive for sharps. ")
{
SCM_ASSERT_TYPE(gh_number_p (o), o, SCM_ARG1, __FUNCTION__, "number");
SCM_ASSERT_TYPE(gh_number_p (n), n, SCM_ARG2, __FUNCTION__, "number");
}
ENTER_DESCRIPTION(Repeat_acknowledge_engraver,
-/* descr */ "Acknowledge repeated music, and convert the contents of
-repeatCommands ainto an appropriate setting for whichBar",
+/* descr */ "Acknowledge repeated music, and convert the contents of "
+"repeatCommands ainto an appropriate setting for whichBar.",
/* creats*/ "",
/* accepts */ "",
/* acks */ "",
ENTER_DESCRIPTION(Score_engraver,
-/* descr */ "Top level engraver. Takes care of generating columns and the complete system (ie. System)
-
-
-This engraver decides whether a column is breakable. The default is
-that a column is always breakable. However, when every Bar_engraver
-that does not have a barline at a certain point will call
-Score_engraver::forbid_breaks to stop linebreaks. In practice, this
-means that you can make a breakpoint by creating a barline (assuming
-that there are no beams or notes that prevent a breakpoint.)
-
-
-",
-/* creats*/ "System PaperColumn NonMusicalPaperColumn",
+/* descr */ "Top level engraver. Takes care of generating columns and the complete system (ie. System) "
+"\n\n "
+"This engraver decides whether a column is breakable. The default is "
+"that a column is always breakable. However, when every Bar_engraver "
+"that does not have a barline at a certain point will call "
+"Score_engraver::forbid_breaks to stop linebreaks. In practice, this "
+"means that you can make a breakpoint by creating a barline (assuming "
+"that there are no beams or notes that prevent a breakpoint.) "
+,
+/* creats*/ "System PaperColumn NonMusicalPaperColumn",
/* accepts */ "break-event",
/* acks */ "note-spacing-interface staff-spacing-interface",
/* reads */ "currentMusicalColumn currentCommandColumn",
def conv(str):
str = re.sub (r'<<', '< <', str)
str = re.sub (r'>>', '> >', str)
+ return str
+
+ conversions.append (((1,7,4), conv, '<< >> -> < < > >'))
+if 1:
+ def conv(str):
+ str = re.sub (r"\\transpose", r"\\transpose c'", str)
+ str = re.sub (r"\\transpose c' *([a-z]+)'", r"\\transpose c \1", str)
+ return str
+ conversions.append (((1,7,5), conv, '\transpose TO -> \transpose FROM TO'))
+
+if 0:
+ def conv(str):
kws = ['arpeggio',
'sustainDown',
'sustainUp',
origstr = string.join (kws, '|')
str = re.sub (r'([^-])\\(%s)\b' % origstr, r'\1-\\\2', str)
- return str
+ conversions.append (((1,7,4), conv, 'note\\script -> note-\script'))
- conversions.append (((1,7,4), conv, '<< >> -> < < > >'))
-
################################
# END OF CONVERSIONS