not present in chord.
2003-02-22 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ * scm/chord-entry.scm (construct-chord): mark inversion as bass if
+ not present in chord.
+
* lily/chord.cc: junk contents.
2003-02-17 Heikki Junes <hjunes@cc.hut.fi>
* INPUT
+** Completely rewritten support for chord entry. Cleaner and more flexible.
+
** Text entry is now done in a separate mode, and is more ergonomic
than the previous Scheme texts.
** Completely rewritten text formatting support. It is implemented in a
completely modular way.
-** Better chord names.
+** Chord name formatting completely rewritten.
** Texts on multimeasure rests can be set by the user.
\header {
-texidoc = "Test file for the new chordname entry code: the suffixes are printed below the pitches."
+texidoc = "Test file for the new chordname entry code (@code{\chords}
+mode): the suffixes are printed below the pitches."
}
\score
{
\notes { \context Voice \chords {
-c1_"1"
-c:7_"7"
+c1_"(nothing)"
+c:7_":7"
c:m_":m"
c:m7_":m7"
c:aug_":aug"
c:sus2_":sus2"
c:6_":6"
c:m6_":m6"
+c:7sus4_":7sus4"
c:3-_":3-"
c:3+_":3+"
c:5+.3-_":5+.3-"
c:7^5_":7\\^{ }5"
c^3_"\\^{ }3"
c/g_"/g"
+c/gis_"/gis"
+c/a_"/a"
c/+f_"/+f"
+c/+g_"/+g"
}
}
}
-\header {
- texidoc = " show different naming conventions"
-}
-
-\version "1.7.10"
-
-scheme = \chords {
- % major chords
- c1
- c:6 % 6 = major triad with added sixth
- c:maj % triangle = maj
- c:6.9^7 % 6/9
- c:9^7 % add9
-
- % minor chords
- c:m % m = minor triad
- c:m.6 % m6 = minor triad with added sixth
- c:m.7+ % m triangle = minor major seventh chord
- c:3-.6.9^7 % m6/9
- c:m.7 % m7
- c:3-.9 % m9
- c:3-.9^7 % madd9
-
- % dominant chords
- c:7 % 7 = dominant
- c:7.5+ % +7 = augmented dominant
- c:7.5- % 7b5 = hard diminished dominant
- c:7+.5- %
- c:7+.5+ %
-
- % ninth chords
- c:9 % 7(9)
- c:9- % 7(b9)
- c:9+ % 7(#9)
- c:13^9.11 % 7(13)
- c:13-^9.11 % 7(b13)
- c:13^11 % 7(9,13)
- c:13.9-^11 % 7(b9,13)
- c:13.9+^11 % 7(#9,13)
- c:13-^11 % 7(9,b13)
- c:13-.9-^11 % 7(b9,b13)
- c:13-.9+^11 % 7(#9,b13)
-
- % half diminished chords
- c:m5-.7 % slashed o = m7b5
- c:9.3-.5- % o/7(pure 9)
-
- % diminished chords
- c:m5-.7- % o = diminished seventh chord
-
-
- % suspended (?) 4ths
- c:sus c:m.sus c:m7.sus
- c:m7.sus^3
- c:7.4.3
- c:7.4^3.5
- c:2^3
- c:2.7^3
- c:4^5.3
-
-}
-
-\score {
- \notes <
- \context ChordNames = bn {
- #(set-chord-name-style 'banter)
- \property ChordNames.instrument = # "Banter"
- \property ChordNames.instr = #"Bn"
- \scheme }
- \context ChordNames = jz {
- #(set-chord-name-style 'jazz)
- \property ChordNames.instrument = #"Jazz"
- \property ChordNames.instr = #"Jz"
- \scheme }
- \context ChordNames = am {
- #(set-chord-name-style 'american)
- \property ChordNames.instr = #"Am"
- \property ChordNames.instrument = #"American"
- \scheme }
- \context Staff \transpose c c' \scheme
- >
-\paper {
-linewidth = 16.0\cm
-
-\translator {
- \ChordNamesContext \consists Instrument_name_engraver }
-}
-}
-%% new-chords-done %%
-\version "1.7.10"
-\header{
-texidoc="
-Chord names are generated from a list pitches, and are customisable
-from guile. For some unlogical names, guile customisation is used
-by default.
-"
-}
-
-chord = \notes\transpose c c'\chords{
- c1
- c:m
- c:m5-
- c:m5-.7-
- c:7+
- c:m5-.7
- c:5-.7+
- c:m7
- c:7
- d
- d/a
- d/+gis
-}
-
-\score{
- <
- \context ChordNames \chord
- \context Staff \chord
- >
- \paper{
-
- \translator {
- \ChordNamesContext
- ChordName \override #'word-space = #1
- }
- }
-}
-
-%% new-chords-done %%
\ No newline at end of file
<<c d e f g bes c' d' e'>>1
<<c e g bes c' d' e'>>1
<<c e g a bes>>1
+<<c e g a d'>>1
}
\header {
-texidoc = "Jazz chords, following [Ignatzek1995], page 17 and 18."
+texidoc = " Chord names are generated from a list pitches. The
+functions constructing the names are customisable. This file shows
+Jazz chords, following [Ignatzek1995], page 17 and 18."
}
-
chs = \notes \transpose c' c'
{
<<c e g>>1
- <<c es g>>
+ <<c es g>>% m = minor triad
<<c e gis>>
<<c es ges>> \break
<<c e g bes>>
<<c es g bes>>
- <<c e g b>>
+ <<c e g b>> % triangle = maj
<<c es ges beses>>
<<c es ges b>> \break
<<c e gis bes>>
<<c es g b>>
<<c e gis b>>
<<c es ges bes>>\break
- <<c e g a>>
- <<c es g a>>
- <<c e g bes d'>> % ??
+ <<c e g a>> % 6 = major triad with added sixth
+ <<c es g a>> % m6 = minor triad with added sixth
+ <<c e g bes d'>>
<<c es g bes d'>> \break
<<c es g bes d' f' a' >>
<<c es g bes d' f' >>
<<c f g>>
<<c f g bes>>\break
<<c f g bes d'>>
- <<c e g d'>>
+ <<c e g d'>> % add9
<<c es g f'>>
}
+++ /dev/null
-\version "1.7.10"
-\header {
- texidoc="Jazz chord names, but with lower case names for minor chords
-
-BROKEN. FIXME.
-"
-}
-
-
-%%%
-%% UGH UH GUG UHGUHGHGH GHG
-% -- this is fucking up global name space.
-%
-% imagine doing
-%
-% lilypond Cc-chords.ly ..other-files-testing-chords...
-%
-% then the other files will get messed up.
-%%
-
-%{
-
-FIXME:
-
-%#(assoc-set! chord::names-alist-jazz
-% '((0 . 0) (2 . -1)) '(""))
-
-%#(assoc-set! chord::names-alist-jazz
-% '((0 . 0) (2 . -1) (4 . 0) (6 . -1)) '("7"))
-
-#(define (pitch->chord-name-text-banter pitch additions)
- (let ((name (pitch->text-banter pitch)))
- (if (member '(2 . -1) (map pitch->note-name additions))
- (cons (string-append
- (string-downcase (substring (car name) 0 1))
- (substring (car name) 1))
- (cdr name))
- name)))
-%}
-
-
-\score {
- <
- #(set-chord-name-style 'jazz)
- \context ChordNames \chords { c1 c:m c:m7 }
- >
-}
-%% new-chords-done %%
+++ /dev/null
-\version "1.7.10"
-
-\header{
-texidoc="property chordChanges: only display chord names when
-there's a change in the chords scheme, but always display the
-chord name after a line break.
-"
-}
-
-scheme = \chords {
- % ugh ugh: this breaks the output of notes in the regular staff
-% \property ChordNamesVoice.chordChanges = ##t
- c1:m \break c:m c:m c:m d
-}
-
-\score {
- \notes <
- \context ChordNames \scheme
- \context Staff \transpose c c' \scheme
- >
- \paper{
- linewidth = 40 * \staffspace
- \translator {
- \ChordNamesContext
- chordChanges = ##t
- }
- }
-}
-%% new-chords-done %%
+++ /dev/null
-\version "1.7.10"
-\header{
-enteredby = "jcn"
-copyright = "public domain"
-TestedFeatures = "chord inversions"
-}
-
-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
-
- % added bass
- c/+e c/+c c/+b
-}
-
-\score{
- <
- \context ChordNames \inversions
- \context Staff \inversions
- >
-}
-
-
-%% new-chords-done %%
+++ /dev/null
-\version "1.7.10"
-\header{
-filename = "chord-table.ly"
-copyright = "public domain"
-enteredby = "jcn"
-}
-
-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' 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 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{
- textheight = \vsize - 4.0 * \staffheight
- }
-
-}
-
-
-%% new-chords-done %%
+++ /dev/null
-\version "1.7.10"
-\header {
- title="Chord Taxonomy of LilyPond -- jazz"
-}
-scheme = \chords {
- c1
- c:4
- c:9
- bes:9^7
- c:11^7
- c:9+
- % TODO
- c:m5-.7
- c:m5-.7-
- c:7+
- c:m7+
- }
-
-\score {
- <
- #(set-chord-name-style 'jazz)
- \context ChordNames \scheme
- \context Staff \notes \transpose c c' \scheme
- >
-}
-%% new-chords-done %%
(cdr mods)))
(else (interpret-removals chord mods))
))
+ (define (pitch-octavated-below p root)
+ "return P, but octavated, so it is below ROOT"
+ (ly:make-pitch
+ (+
+ (ly:pitch-octave root)
+ (if (>= (ly:pitch-notename root)
+ (ly:pitch-notename p))
+ 0 -1))
+ (ly:pitch-notename p)
+ (ly:pitch-alteration p)))
(define (process-inversion complete-chord)
"Take out inversion from COMPLETE-CHORD, and put it at the bottom.
Return (INVERSION . REST-OF-CHORD).
Side effect: put original pitch in INVERSION.
+If INVERSION is not in COMPLETE-CHORD, it will be set as a BASS, overriding
+the bass specified.
+
"
(let*
(
(root (car complete-chord))
(inv? (lambda (y)
- (= (ly:pitch-notename y)
- (ly:pitch-notename inversion))))
+ (and (= (ly:pitch-notename y)
+ (ly:pitch-notename inversion))
+ (= (ly:pitch-alteration y)
+ (ly:pitch-alteration inversion))
+ )))
+
(rest-of-chord (filter-out-list inv? complete-chord))
(inversion-candidates (filter-list inv? complete-chord))
- (down-inversion (ly:make-pitch
- (+
- (ly:pitch-octave root)
- (if (>= (ly:pitch-notename root)
- (ly:pitch-notename inversion))
- 0 -1))
- (ly:pitch-notename inversion)
- (ly:pitch-alteration inversion)))
+ (down-inversion (pitch-octavated-below inversion root))
)
(if (pair? inversion-candidates)
- (set! inversion (car inversion-candidates)))
-
- (cons down-inversion rest-of-chord)
+ (set! inversion (car inversion-candidates))
+ (begin
+ (set! bass inversion)
+ (set! inversion #f))
+ )
+ (if inversion
+ (cons down-inversion rest-of-chord)
+ rest-of-chord
+ )
))
;; root is always one octave too low.
(write-me "base: " base-chord)
(write-me "bass: " bass)))
- ;; skip the leading : , we need some of the stuff following it.
+ ;; skip the leading : , we need some of the stuff following it.
(if (pair? flat-mods)
(if (eq? (car flat-mods) 'chord-colon)
(set! flat-mods (cdr flat-mods))
)
(if inversion
- (begin
- (set! complete-chord (process-inversion complete-chord))
- (make-chord (cdr complete-chord) bass duration (car complete-chord)
- inversion
- ))
+ (set! complete-chord (process-inversion complete-chord)))
+ (if bass
+ (set! bass (pitch-octavated-below bass root)))
+ (if inversion
+ (make-chord (cdr complete-chord) bass duration (car complete-chord)
+ inversion)
(make-chord complete-chord bass duration #f #f))
))