lilypond-user
[Top][All Lists]

## Transposition with arrow quarter-tone notation

 From: Joseph Wakeling Subject: Transposition with arrow quarter-tone notation Date: Sun, 19 Apr 2009 14:39:43 +0200 User-agent: Thunderbird 2.0.0.21 (X11/20090409)

```Hello everyone,

A return to this query, which I'd quite like to see if there is a
solution to ... :-)

Graham Breed wrote:
> The cheating looks fine until you want to do transpositions.
>  Transposing C up-a-quartertone up by the same quartertone won't give C
> sharp, for example.  If you think it should that's an indication you're
> treating quartertones equally, of course.

I've extended my 'cheat' a bit with the following rules (based on
english.ly note names).

qs = +999/4000  (as opposed to +1/4)
af = -999/4000  (as opposed to -1/4)
sqf = +1001/4000 (i.e. 1/2 - 999/4000, 'sharp-quarter-flat')
fqs = -1001/4000 (i.e. -1/2 + 999/4000, 'flat-quarter-sharp')
tqs = +2999/4000 (i.e. 1/2 + 999/4000, 'sharp-quarter-sharp')
tqf = -2999/4000 (i.e. -1/2 - 999/4000, 'flat-quarter-flat')

The last two I'm tempted to rename sqs and fqf for clarity, but have
kept (for now) to be in line with standard Lilypond syntax.

Demo files attached.

This setup is aimed allow for a full arrow quarter-tone notation with
arrows being preserved across all regular transpositions -- a given
regular pitch plus arrow should transpose to its equivalent pitch plus
the same arrow.  It is not intended to work with quarter-tone
transpositions, although with luck I suppose it might...

However, transposition errors do in fact occur even with regular
transposition:

qtatest.ly:11:91: warning: Could not find glyph-name for alteration -3/2
\transpose b c' { \relative c' { c8[ cqs cqf csqf cfqs
cs cf ctqs ctqf css cff] } }

qtatest.ly:11:82: warning: Could not find glyph-name for alteration
-4999/4000
\transpose b c' { \relative c' { c8[ cqs cqf csqf cfqs
cs cf ctqs
ctqf css cff] } }

So the problem is how to let Lilypond know that e.g. -3/2 translates to
'the note below, flat' and -4999/4000 translates to 'the note below,
quarter-flat'.

(I'm surprised that -3/2 or +3/2 generates an error since wouldn't this
occur -- and be taken care of -- by transposition rules for the normal
12-note system?)

The code would generate further errors if I had not included rules for
+/-3001/4000, which frankly I don't want to do (all the more because
there appear to be no 'flatflat.uparrow' or 'doublesharp.downarrow'
glyphs[*]).  I'd rather the code was able to realise that +3001/4000
translates to, 'the note above, -999/4000' and -3001/4000 'the note
below, +999/4000'.

I presume it is possible to resolve these errors, so ... can people

Thanks & best wishes,

-- Joe

[*] I suppose there _is_ a case for 'flatflat.arrowup' or whatever if
you're writing a tonal line altered by a quarter-tone, but there's only
SO many cases one can take into account in one go ... :-P
```
```\version "2.12.1"
\include "quartertonearrows.ly"

\score {
{
#(set-accidental-style 'dodecaphonic)
\time 11/8
\relative c' { c8[ cqs cqf csqf cfqs cs cf ctqs ctqf css cff] }
\transpose bf c' { \relative c' { c8[ cqs cqf csqf cfqs cs cf
ctqs ctqf css cff] } }
\transpose f c' { \relative c' { c8[ cqs cqf csqf cfqs cs cf
ctqs ctqf css cff] } }
\transpose b c' { \relative c' { c8[ cqs cqf csqf cfqs cs cf
ctqs ctqf css cff] } }
\transpose af c' { \relative c' { c8[ cqs cqf csqf cfqs cs cf
ctqs ctqf css cff] } }
\transpose ef' c' { \relative c' { c8[ cqs cqf csqf cfqs cs cf
ctqs ctqf css cff] } }
\transpose a c' { \relative c' { c8[ cqs cqf csqf cfqs cs cf
ctqs ctqf css cff] }}
}
\layout{}
\midi{}
}
```
```#(define-public Q-SHARP 999/4000)
#(define-public Q-FLAT -999/4000)
#(define-public SHARP-Q-FLAT 1001/4000)
#(define-public FLAT-Q-SHARP -1001/4000)
#(define-public SHARP-Q-SHARP 2999/4000)
#(define-public FLAT-Q-FLAT -2999/4000)

quartertonearrowPitchNames =  #`(
(cff . ,(ly:make-pitch -1 0 DOUBLE-FLAT))
(ctqf . ,(ly:make-pitch -1 0 FLAT-Q-FLAT))
(cf . ,(ly:make-pitch -1 0 FLAT))
(cfqs . ,(ly:make-pitch -1 0 FLAT-Q-SHARP))
(cqf . ,(ly:make-pitch -1 0 Q-FLAT))
(c . ,(ly:make-pitch -1 0 NATURAL))
(cqs . ,(ly:make-pitch -1 0 Q-SHARP))
(csqf . ,(ly:make-pitch -1 0 SHARP-Q-FLAT))
(cs . ,(ly:make-pitch -1 0 SHARP))
(ctqs . ,(ly:make-pitch -1 0 SHARP-Q-SHARP))
(css . ,(ly:make-pitch -1 0 DOUBLE-SHARP))
(cx . ,(ly:make-pitch -1 0 DOUBLE-SHARP))

(dff . ,(ly:make-pitch -1 1 DOUBLE-FLAT))
(dtqf . ,(ly:make-pitch -1 1 FLAT-Q-FLAT))
(df . ,(ly:make-pitch -1 1 FLAT))
(dfqs . ,(ly:make-pitch -1 1 FLAT-Q-SHARP))
(dqf . ,(ly:make-pitch -1 1 Q-FLAT))
(d . ,(ly:make-pitch -1 1 NATURAL))
(dqs . ,(ly:make-pitch -1 1 Q-SHARP))
(dsqf . ,(ly:make-pitch -1 1 SHARP-Q-FLAT))
(ds . ,(ly:make-pitch -1 1 SHARP))
(dtqs . ,(ly:make-pitch -1 1 SHARP-Q-SHARP))
(dss . ,(ly:make-pitch -1 1 DOUBLE-SHARP))
(dx . ,(ly:make-pitch -1 1 DOUBLE-SHARP))

(eff . ,(ly:make-pitch -1 2 DOUBLE-FLAT))
(etqf . ,(ly:make-pitch -1 2 FLAT-Q-FLAT))
(ef . ,(ly:make-pitch -1 2 FLAT))
(efqs . ,(ly:make-pitch -1 2 FLAT-Q-SHARP))
(eqf . ,(ly:make-pitch -1 2 Q-FLAT))
(e . ,(ly:make-pitch -1 2 NATURAL))
(eqs . ,(ly:make-pitch -1 2 Q-SHARP))
(esqf . ,(ly:make-pitch -1 2 SHARP-Q-FLAT))
(es . ,(ly:make-pitch -1 2 SHARP))
(etqs . ,(ly:make-pitch -1 2 SHARP-Q-SHARP))
(ess . ,(ly:make-pitch -1 2 DOUBLE-SHARP))
(ex . ,(ly:make-pitch -1 2 DOUBLE-SHARP))

(fff . ,(ly:make-pitch -1 3 DOUBLE-FLAT))
(ftqf . ,(ly:make-pitch -1 3 FLAT-Q-FLAT))
(ff . ,(ly:make-pitch -1 3 FLAT))
(ffqs . ,(ly:make-pitch -1 3 FLAT-Q-SHARP))
(fqf . ,(ly:make-pitch -1 3 Q-FLAT))
(f . ,(ly:make-pitch -1 3 NATURAL))
(fqs . ,(ly:make-pitch -1 3 Q-SHARP))
(fsqf . ,(ly:make-pitch -1 3 SHARP-Q-FLAT))
(fs . ,(ly:make-pitch -1 3 SHARP))
(ftqs . ,(ly:make-pitch -1 3 SHARP-Q-SHARP))
(fss . ,(ly:make-pitch -1 3 DOUBLE-SHARP))
(fx . ,(ly:make-pitch -1 3 DOUBLE-SHARP))

(gff . ,(ly:make-pitch -1 4 DOUBLE-FLAT))
(gtqf . ,(ly:make-pitch -1 4 FLAT-Q-FLAT))
(gf . ,(ly:make-pitch -1 4 FLAT))
(gfqs . ,(ly:make-pitch -1 4 FLAT-Q-SHARP))
(gqf . ,(ly:make-pitch -1 4 Q-FLAT))
(g . ,(ly:make-pitch -1 4 NATURAL))
(gqs . ,(ly:make-pitch -1 4 Q-SHARP))
(gsqf . ,(ly:make-pitch -1 4 SHARP-Q-FLAT))
(gs . ,(ly:make-pitch -1 4 SHARP))
(gtqs . ,(ly:make-pitch -1 4 SHARP-Q-SHARP))
(gss . ,(ly:make-pitch -1 4 DOUBLE-SHARP))
(gx . ,(ly:make-pitch -1 4 DOUBLE-SHARP))

(aff . ,(ly:make-pitch -1 5 DOUBLE-FLAT))
(atqf . ,(ly:make-pitch -1 5 FLAT-Q-FLAT))
(af . ,(ly:make-pitch -1 5 FLAT))
(afqs . ,(ly:make-pitch -1 5 FLAT-Q-SHARP))
(aqf . ,(ly:make-pitch -1 5 Q-FLAT))
(a . ,(ly:make-pitch -1 5 NATURAL))
(aqs . ,(ly:make-pitch -1 5 Q-SHARP))
(asqf . ,(ly:make-pitch -1 5 SHARP-Q-FLAT))
(as . ,(ly:make-pitch -1 5 SHARP))
(atqs . ,(ly:make-pitch -1 5 SHARP-Q-SHARP))
(ass . ,(ly:make-pitch -1 5 DOUBLE-SHARP))
(ax . ,(ly:make-pitch -1 5 DOUBLE-SHARP))

(bff . ,(ly:make-pitch -1 6 DOUBLE-FLAT))
(btqf . ,(ly:make-pitch -1 6 FLAT-Q-FLAT))
(bf . ,(ly:make-pitch -1 6 FLAT))
(bfqs . ,(ly:make-pitch -1 6 FLAT-Q-SHARP))
(bqf . ,(ly:make-pitch -1 6 Q-FLAT))
(b . ,(ly:make-pitch -1 6 NATURAL))
(bqs . ,(ly:make-pitch -1 6 Q-SHARP))
(bsqf . ,(ly:make-pitch -1 6 SHARP-Q-FLAT))
(bs . ,(ly:make-pitch -1 6 SHARP))
(btqs . ,(ly:make-pitch -1 6 SHARP-Q-SHARP))
(bss . ,(ly:make-pitch -1 6 DOUBLE-SHARP))
(bx . ,(ly:make-pitch -1 6 DOUBLE-SHARP))
)

%% set pitch names.
pitchnames = \quartertonearrowPitchNames
#(ly:parser-set-note-names parser pitchnames)

quartertonearrowGlyphs = #`(
(1 . "accidentals.doublesharp")
(3001/4000 . "accidentals.doublesharp.arrowdown")
(2999/4000 . "accidentals.sharp.arrowup")
(1/2 . "accidentals.sharp")
(1001/4000 . "accidentals.sharp.arrowdown")
(999/4000 . "accidentals.natural.arrowup")
(0 . "accidentals.natural")
(-999/4000 . "accidentals.natural.arrowdown")
(-1001/4000 . "accidentals.flat.arrowup")
(-1/2 . "accidentals.flat")
(-2999/4000 . "accidentals.flat.arrowdown")
(-3001/4000 . "accidentals.flatflat.arrowup")
(-1 . "accidentals.flatflat")
)

\layout {
\context {
\Score
\override KeySignature #'glyph-name-alist = \quartertonearrowGlyphs
\override Accidental #'glyph-name-alist = \quartertonearrowGlyphs
\override AccidentalCautionary #'glyph-name-alist = \quartertonearrowGlyphs
\override TrillPitchAccidental #'glyph-name-alist = \quartertonearrowGlyphs
\override AmbitusAccidental #'glyph-name-alist = \quartertonearrowGlyphs
}
}
```