
    rhm                    j   S SK Jr  S SKrS SKJr  \R
                  " S5      rSrSrSr	Sr
S	rS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!S r"S!r#S"r$S#r%S$r&S%r'S&r(S'r)S(r*\\	\
\\\\\\\\\\\\\ \!\"/r+S) r, " S* S+\RZ                  5      r.\/S,:X  a  S SKr\R`                  " \.5        gg)-    )annotationsN)environmentzabcFormat.testFilesTu  
%%abc-charset utf-8

X: 1
T: Fyrareprisarn
O: Jät, Småland
S: efter August Strömberg
D: Svensson, Gustafsson mfl - Bålgetingen
Z: Till abc av Jon Magnusson 100517
R: Hambo
M: 3/4
L: 1/8
K: F
c2 a>g f>e|d>c BA G>F|E>F GA B>c|d>c AB c>c|
c>a a>g f>e|d>c BA G>F|E>F Gd c>E|F2 f4::
{A}d>^c de f>g|e>f de =c>A|A>B AG FE|DE FG A>A|
d>^c de fg|e>f de =c>A|A>B AG FE|D2 d4::
c2 f2 c>c|B>d B4|G>c e2 c>e|f>>g a>f c2|
c2 f2 c>c|B>d g4|G2 e>g c>>>e|f2 f4::
f>f f4|e>e e3A|A>B AG FE|D>E FD E2|
f>f f4|e>e e3A|A>B AG FE|D2 d4:|
aj  
X:254
T:Mystery Reel
R:reel
Z:transcribed by Dave Marshall
M:C|
K:G
|: egdB A3B | ~G3B A2Bd | e2dB A2BA |1 GEDE GABd :|2 GEDE GBdc |
|: B~G3 GEDG | BGAB GEDG | A2GB A2GA |1 Bdef gedc :|2 Bdef gedB |
|: ~G3E DEGB | dBGB A~E3 | GAGE DEGF | GBdB A2G2 :|
| gede g2ag | egde ge (3eee | gede g2ag | egde ~g3a |
gede g2ag | egde ge (3eee | ~g3e a2ba | ge (3eee b2ag |
ai  X: 1
T:Full Rigged Ship
M:6/8
L:1/8
Q:100
C:Traditional
S:From The Boys of the Lough
R:Jig
O:Boys Of The Lough
A:Shetland
D:Boys of the Lough "Wish You Were Here"
K:G
|:e2a aea|aea b2a|e2f~g3|eag fed|
e2a aea|aea b2a|~g3 edB|A3A3:|!
|:efe edB|A2Bc3|BAG BAG|BcdE3|
efe edB|A2Bc2d|efe dBG|A3A3:|!
|:EFE EFE|EFE c3|EFE E2D|E2=F GEC|
EFE EFE|EFE c2d|efe dBG|A3A3:|
a_  %  <A name="D1X180"></A>
X: 180
T:Ale is Dear, The
M: 4/4
L: 1/8
R:Reel
Q:1/4=211
% Last note suggests Locrian mode tune
K:D % 2 sharps
% (c) SSF January 2006
V:1
f2 ef B2 fe| fa ef cA ec| f2 ef B2 fe| fa ec B2 Bc|
f2 ef B2 fe| fa ef cA ec| f2 ef B2 fe| fa ec B2 Bc|
B3/2B<Bc/2 d2 cB| A3/2A<AB<AB/2 c<A| B3/2B<Bc/2 d2 cB| f<a e3/2c/2 B2 B2|
B3/2B<Bc/2 d2 cB| A3/2A<AB<AB/2 c<A| d2 f3/2d/2 c2 e3/2c/2| d<f e3/2c<BB<Bc/2|
V:2
% Chords
B,,z [FDB,]z B,,z [FDB,]z| B,,z [FDB,]z A,,z [ECA,]z| B,,z [FDB,]z B,,z [FDB,]z| B,,z [ECA,]z B,,z [FDB,]z|
B,,z [FDB,]z B,,z [FDB,]z| B,,z [FDB,]z A,,z [ECA,]z| B,,z [FDB,]z B,,z [FDB,]z| B,,z [ECA,]z B,,z [FDB,]z|
B,,z [FDB,]z B,,z [FDB,]z| A,,z [ECA,]z A,,z [ECA,]z| B,,z [FDB,]z B,,z [FDB,]z| B,,z [ECA,]z B,,z [FDB,]z|
B,,z [FDB,]z B,,z [FDB,]z| A,,z [ECA,]z A,,z [ECA,]z| B,,z [FDB,]z A,,z [ECA,]z| B,,z [ECA,]z B,,z [FDB,]
a  X: 57
T:Kitchen Girl
% Nottingham Music Database
S:via PR
M:4/4
L:1/4
K:D
'A"[c2 a2 ]"G"[B2g2]|"A"e/2f/2e/2d/2 cc/2d/2|"A"e/2c/2e/2f/2 "G"g/2a/2b/2a/2|"E"^ge ee/2=g/2|
"A"a/2b/2a/2f/2 "G"g/2a/2g/2f/2|"A"e/2f/2e/2d/2 c/2d/2e/2f/2|"G"gd "E"e/2f/2e/2d/2|"A"cA A2::
"Am"=cc/2A/2 "G"B/2A/2G/2B/2|"Am"A/2B/2A/2G/2 E/2D/2E/2G/2|"Am"A/2G/2A/2B/2 "C"=c/2B/2c/2d/2|"Em"ee/2g/2 e/2d/2B/2A/2|
"Am"=cc/2A/2 "G"B/2A/2G/2B/2|"Am"A/2B/2A/2G/2 E/2D/2E/2G/2|"Am"=c/2B/2A/2c/2 "G"B/2A/2G/2B/2|"Am"A3/2B/2 A2:|
a  X: 31
T:William and Nancy
% Nottingham Music Database
P:A(AABBB)2(AACCC)2
S:Bledington
M:6/8
K:G
P:A
D|"G"G2G GBd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2F "G"G2:|
P:B
d|"G"e2d B2d|"C"gfe "D7"d2d|"G"e2d B2d|"A7""C"gfe "D7""D"d2c|
"G""Em"B2B Bcd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2F "G"G2:|
P:C
"G"d3 "C"e3|"G"d3 "Em"B3|"G"d3 "C"g3/2f3/2|"C"e3 "G"d3|"D7"d3 "G"e3|"G"d3 B2d|"A7""C"gfe "D7""D"d2c|
"G""Em"B2B Bcd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2F "G"G2:|
aB  X:297
T:Morrison's
O:Ireland
F:http://www.banjolin.co.uk/tunes/abcs/morrisons.abc
M:6/8
L:1/8
R:jig
K:Edor
|:E3 B3|E2B AFD|EBE B2c|dcB AFD|
|EDE B3|E2B AFD|GBG FGA|1 dAG FED:|2 dAG FGA|
|Bee fee|aee fed|Bee fee|fag fed|
|Bee fee|aee fed|gfe d2A|BAG FGA|
|Bee fee|aee fed|Bee fee|faf def|
|g3 gfe|def gfg|edc d2A|BAG FED||
a^  X: 48
T:Hector the Hero
M:3/4
L:1/8
C:Scott Skinner
K:A
A2B2|:"A"c3 BA2|"D"f4ec|"A"e4-ef|e4AB|"F#m"c4BA|"D"f4ec|"Bm"B4-Bc|"E"B4ce|
"F#m"c3 BA2|"D"f4ec|"A"e4A2|"D"a4f2|"A"e4Ac|"E"B4A2|"A"A6 -|[1 A2A2B2:|[2 A2c2e2||
:"D"f4df|a4gf|"A"e4-ef|e4ce|"F#m"f4ec|e4Ac|"Bm"B4-Bc|"E"B4ce|
"D"f4df|a4gf|"A"e4dc|"D"a4d2|"A"c4Ac|"E"B4A2|"A"A6 -|[1 A2c2e2:|[2 A2 z2|
a  X: 979
T: King of the fairies
C: anon.
O: Ireland
B: Francis O'Neill: "The Dance Music of Ireland" (1907) no. 979
R: Long dance, set dance
Z: Transcribed by Frank Nordberg - http://www.musicaviva.com
F: http://www.musicaviva.com/abc/tunes/ireland/oneill-1001/oneill-1001-0979.abc
M: 2/4
L: 1/16
K: Edor
B,2|E^DE(F GF)GA|B2B2 TG3A|B2E2 E(FGE)|FGFE TD2B,2|E(^DEF) GFGA|B(AGB) d3
c|B2E2 (GF)E^D|"^1)"E4E2:|
d2|e2e2 Bde(f|ga)gf e2f2|e2B2 (BAB)c|d(edc) BcdB|e2B2 Bdef|g(agf) efed|Bd
e(g fe)df|"^2)"e6(ef)|
g3e f2d2|e(dBc) Td3e|dBA(F GA)B^c|dBA(F GF)ED|B,2E2 (EFG)A|B2e2 edef|e2B2
 BAG(F|TE4)E2|]
W:
W:
W: 1) org. dotted 4th note.
W: 2) org. not dotted.
W:
W:
W: From Musica Viva - http://www.musicaviva.com
W: the Internet center for free sheet music downloads.
a.  X:1
T:9v. Sicut rosa
C:Orlando Lassusio
O: Bicinia, sive Cantionis
H: transcribed from the Musica Alamire facsimile of the original
H: printed in Antwerp by Petrum Phalesium, 1609
%%gchordfont Helvetica 12 box
%%MIDI nobarlines
M:C|
L:1/4
K:G mixolydian treble8
T:Tenor
%%MIDI transpose -12
%1
G3 A B c d B e4 d2 B4 e3 d c2 B2 d4 d2 G  A B c d3 c B4 G4 d3 c
w:Si- - - - - - - cut ro * -  - sa si- cut ro- - - - - - - sa in- -
%2
B A G4 F2 E4 "A"D2 A4 B2 c4 B2 d3 c B A G F E D C2 C2 G4 z2 G4 E2 G4 A2 c3 B A G
w:- - - ter spi- nas il - lis ad- dit spe- - - - - - - -  ci- em, sic ve- nu- stat su- - - -
%3
_B2 A2 A4 D2 F2 E2 F2 G4 G3 A B2 A2 F2 c2 B2 c2 d2 c3 B d4 c B c A c4 B2 "B"c4 z2 G2 A2 B4 F2 c4
w:- am vir- go Ma- ri- am pro- ge- - - ni- am Ma- ri- am pro- ge- - - - - - - - ni- am ger- mi- na- vit e-
%4
d2 e3 d/ c/ B c d A d3 c/ B/ c2 "C"d4-d4 z2 d2 e2 d3 B ^c2 d2 e2 c2 G A B c d2 G4 z2 G2
w:nim flo- - - - - - - - - - - rem, * qui vi- ta- - -  lem dat o- do- - - - - rem qui
%5
A2 G3 E ^F2 G2 A2 c4 B3 A/ G/ A4 HG4 |]
w:vi- ta- - - lem dat o- do- - - - rem.
a  X:1
T:The Ale Wife's Daughter
Z:Jack Campin: "Embro, Embro", transcription (c) 2001
F:17riot/abc/AleWife.abc
S:John Hamilton: A Collection of Twenty-Four Scots Songs (Chiefly Pastoral.), 1796
B:NLS Glen.311
M:C
L:1/8
Q:1/4=80
N:Slow and Supplicative
K:G Mixolydian
(E/F/)|G<G GE  GA  c>B|A>A A>G Ac d3/ (c//d//)| e>g          d>e c>d e>d|cA A>G G3||
(c/d/)|e<e e>c e>f g>e|d>d d>c de f3/ (e//f//)|(g/f/) (e/f/) ed  c>d e>d|cA A>G G3|]
a  
X:5
T:The Begger Boy
R:Jig
H:The tune name may derive from the song "The Begger Boy of the North"
H:(c. 1630)
N:This tune is in the rare Phrygian mode--suggested chords are given
M:6/8
L:1/8
Q:90
K:APhry
AAAf2f|ec2d2c|AF2G2G|A2B cA2||
AAAf2f|ec2d2c|Ac2ede|fA2G3|
Acc e>dc|dfg/2f/2 efd|cAF G2G|A2B cA2||
W:From ancient pedigree, by due descent
W:I well can derive my generation
W:Throughout all Christendome, and also Kent
W:My calling is known both in terme and vacation
W:My parents old taught me to be bold
W:Ile never be daunted, whatever is spoken
W:Where e're I come, my custome I hold
W:And cry, Good your worship, bestow one token!
W:--Roxburghe Ballads
a~  X:1
T:The Battle of the Sna' Ba's
Z:Jack Campin: "Embro, Embro", transcription (c) 2001
F:17riot/abc/SnaBas.abc
S:NLS MH.v.549
N:identical format, typeface and engraving style to The Lyre, but anonymous
M:C|
L:1/8
Q:1/2=72
K:Eb Lydian
e|B>EE>E B>EG>e|B>EE>E B2G>B |A>FF>F A>FG>B|A>FF>F B2GF|
  E>ee>f e>cB>G|F>ff>g f>ed>c|B>ee>f e>cB>e|
  d>fc>e d>fc>e|d>fc>e d>ec>d|e>fg>f e2e  |]
a  X:0912
T:"A Draught of Ale"    (jig)     0912
C:after  Sg't. J. O'Neill
B:O'Neill's Music Of Ireland (The 1850) Lyon & Healy, Chicago, 1903 edition
Z:FROM O'NEILL'S TO NOTEWORTHY, FROM NOTEWORTHY TO ABC, MIDI AND .TXT BY VINCE BRENNAN June 2003 (HTTP://WWW.SOSYOURMOM.COM)
I:abc2nwc
M:6/8
L:1/8
K:G
D|GBA G2A|Bdg Bdg|GBA G2B|AFD AFD|
GBA G2A|Bdg Bdg|ecA dBG|cAF G2:|
|:d|egf g2f|ege dBG|GFG dBG|BAA A2d|
egf g2f|ege dBG|GFG dBG|cAF G2:|
a  
X:166
T:166  Valentine Jigg   (Pe)
M: 9/8
L: 1/8
S: original in 6/8 major reconstruction -AH
K:D
A3 F2A c2d | efe d2c BAG|A3 F2A c2d| A2a g>fg a3 :|
|: a2e c2e gag |e2c d2f efe |d3 G2B cdc |ABc dcB A3:|
%%vskip 1.5cm

X:167
T:167  The Dublin Jig     (HJ)
A:Wyresdale, Lancashire
B:H.S.J. Jackson, 1823
L:1/8
M:9/8
K:A
f|ecA ABA agf | ecA FBA GFE |ecA Ace agf | ecA FBG A2  :|
|:c|BGE EGB dcB | cAc ece aec |BGE EGB dcB | cde dcB A2  :|
%%vskip 1.5cm

X:168
T:168  The Castle Gate   (HJ)
A:Wyresdale, Lancashire
B:H.S.J. Jackson, 1823
L:1/8
S: original in E
M:9/8
K:A
E | Ace Ace Ace | Ace BcA GFE | Ace Ace Ace | cag fe^d e2 :|
|:e | fga def Bcd | FGA BcA GFE | FAd GBe Ace | fdB BAG A2 :|
%%vskip 1.5cm
z
X: 979
T: Triplets in Slurs, Slurs in Triplets, Nested Slurs
M: 2/4
L: 1/16
K: Edor
B,2|E^DEE ((3GFG)BA)|E^DEF (3(GFG))BA|(E(^DE)F) (3(GF)G)BA|(E^DEF (3(GFG)))BA|G6
z
X: 979
T: Slur test, plus tie tokens
M: 2/4
L: 1/16
K: Edor
B,2|E^DE-E ((3GFG)BA)|E^DEF (3(G-GG))BA|(E(^DE)F) (3(GF)G)A-A|(E^DEF (3(GFG)))BA|G6
z
X: 979
T: Tie test, plus crescendo tokens
M: 2/4
L: 1/16
K: Edor
B,2|!crescendo(!E^DE-E!crescendo)! ((3GFG)BA)|E^DEF (3(G-GG))BA|(E(^DE)F) (3(GF)G)A-A|(E^DEF (3(GFG)))BA|G6
z
X: 979
T: Tie test, plus diminuendo tokens
M: 2/4
L: 1/16
K: Edor
B,2|!diminuendo(!E^DE-E!diminuendo)! ((3GFG)BA)|E^DEF (3(G-GG))BA|(E(^DE)F) (3(GF)G)A-A|(E^DEF (3(GFG)))BA|G6
z
X: 979
T: Diminuendo test, plus staccato tokens
M: 2/4
L: 1/16
K: Edor
B,2|!diminuendo(!.E^D.E-E!diminuendo)! ((3.G.F.G)BA)|E^DEF (3(G-GG))BA|(E(^DE)F) (3(GF)G)A-A|(E^DEF (3(GFG)))BA|G6
z
X: 979
T: Staccato test, plus bowing articulations
M: 2/4
L: 1/16
K: Edor
B,2|!diminuendo(!.E^D.E-E!diminuendo)! ((3.G.F.G)BvA)|E^DEF (3(G-GG))BuA|(E(^DuE)F) (3(GF)G)A-A|(E^DEF (3(GFG)))BA|G6
z
X: 979
T: Staccato test, plus accents and tenuto marks
M: 2/4
L: 1/16
K: Edor
B,2|!diminuendo(!.E^D.E-E!diminuendo)! ((3.G.F.KG)BA)|E^DMEF (3(G-GG))BkMA|(E(^DE)F) (3(kGKF)G)A-A|(E^DEF (3(GFG)))BA|G6
z
X: 979
T: Slur test, plus grace notes
M: 2/4
L: 1/16
K: Edor
B,2|{E^DEE} E^DEE ((3GFG)BA)|E^DEF {CDEFGAB}(3(GFG))BA|(E(^DE)F) (3(GF)G)BA|(E^DEF (3(GFG)))BA|G6
z
X: 979
T: Guinea Pig
M: 2/4
L: 1/16
K: Edor
B,2|!diminuendo(!KE^DkK.uvME-E!diminuendo)! !GARBAGE! {CDEFGAB} ((3.G.FG){BA}BA)|{E^DMEF} E^DMEF(3(G-GG))BA|(E(^DE)F) (3(GF)G)A-A|(E^DEF (3(GFG)))BA|G6
z
M:4/4
ed|cecA B2ed|cAcA E2ed|cecA B2ed|c2A2 A2:|
K:G

AB|cdec BcdB|ABAF GFE2|cdec BcdB|c2A2 A2:|

% comment line

E2E EFE|E2E EFG|M:9/8
A2G F2E D2|]

"C"[CEGc] "Gm7"[.=G,^c']

(3.a.b.c  % stacato
vAuBvA  % up down bow
zM:6/8
L:1/8
K:G
V:1 name="Whistle" snm="wh"
B3 A3 | G6 | B3 A3 | G6 ||
V:2 name="violin" snm="v"
BdB AcA | GAG D3 | BdB AcA | D6 ||
V:3 name="Bass" snm="b" clef=bass
D3 D3 | D6 | D3 D3 | D6 ||
zM:4/4
K:E
T:Test Tuplet Primitive
(3.c=c^c (5ccc=cc (6ccccc=f (7Bcc^^c=cc^f

(3.c2=c2^c2 (3.c2=c2^c2

(6c/c/c/c/c/=f/ (6B/c/c/^^c/c/^f/ z4
a  %abc-2.1
M:4/4
O:Irish
R:Reel

X:1
T:Untitled Reel
C:Trad.
K:D
eg|a2ab ageg|agbg agef|g2g2 fgag|f2d2 d2:|ed|cecA B2ed|cAcA E2ed|cecA B2ed|c2A2 A2:|
K:G
AB|cdec BcdB|ABAF GFE2|cdec BcdB|c2A2 A2:|

X:2
T:Kitchen Girl
C:Trad.
K:D
[c4a4] [B4g4] | efed c2cd|e2f2 gaba|g2e2 e2fg|
a4 g4|efed cdef|g2d2 efed|c2A2 A4:|
K:G
ABcA BAGB|ABAG EDEG|A2AB c2d2|e3f edcB|ABcA BAGB|
ABAG EGAB|cBAc BAG2|A4 A4:|
zM
X:1
T:Example 16-13
L:1/4
M:3/4
K:F
V:1
fz((6:4F,//A,//C//F//A//c// e/d/)dz
zA
X:4
T:D Fragment
C:Czerny
M:C
K:C#
L:1/16
CEDF EGFA GBAc Bdce|]
z
X:213
T:Through Measure
L:1/16
Q:1/4=104
M:4/4
K:G
V:1 treble
V:1
(=fe^d^c _BcdB) fB=BB c=cc^c|c4d2f2 ^G2=f2B2^A2-|A4F4 A2B2  c2f2|]
zU
X:213
T:Tie Through Measure
L:1/8
M:4/4
K:G
V:1 treble
V:1
z8 ^G=fB^A-|A2F2 AB cf|]
z~
%abc-2.1
%%propagate-accidentals octave
X:213
T:Directive Octave
L:1/8
M:4/4
K:G
V:1 treble
V:1
g^G_ag a=ffF|=F2^c2 FB =ca|]
z|
%abc-2.1
%%propagate-accidentals pitch
X:213
T:Directive Pitch
L:1/8
M:4/4
K:G
V:1 treble
V:1
g^G_ag a=ffF|=F2^c2 FB =ca|]
zx
%abc-2.1
%%propagate-accidentals not
X:213
T:Directive Not
L:1/8
M:4/4
K:G
V:1 treble
V:1
g^G_ag a=ffF|=F2^c2 FB =ca|]
c                    g)z&
Get test material by type of content
N )contentRequests    U/home/james-whalen/.local/lib/python3.13/site-packages/music21/abcFormat/testFiles.pygetr	     s     	    c                  J    \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rSrg)Testi  c                   SSK Jn  SSKJn  SSKJn  UR                  5       nUR                  5       n[        [        5       H_  u  pgUR                  U5      nUR                  5       n	[        R                  U	/5        UR                  U5      n
 UR                  U
5      nMa     g ! [          a  n[        R#                  SU 35        UeS nAff = f)Nr   	abcFormat	translate)m21ToXmlzAbout to fail on ABC file #)music21r   music21.abcFormatr   music21.musicxmlr   ABCFileGeneralObjectExporter	enumerateALLreadstrgetTitleenvironLocal
printDebugabcToStreamScoreparseUnicodeDecodeErrorwarn)selfr   r   r   afGEXitfahtitles
unused_outudes                r   	testBasicTest.testBasic  s    %/- ,,.s^EABBKKME##UG,**2.A YYq\
 $ & !!$?s"CD	s   B&&
C0C

Cc                    SSK Jn  SSKJn  UR	                  5       nUR                  [        5      nUR                  U5      nUR                  S   R                  R                  nU R                  USS5        g )Nr   r   r      z-C# key signature should be parsed as 7 sharps)r   r   r   r   r   r   czernyCsharpr   partskeySignaturesharpsassertEqual)r"   r   r   r#   r'   r)   r3   s          r   testKeySignaturesTest.testKeySignatures  s`    %/ ZZ%&&r*((//$STr
   c                   SSK Jn  SSK Jn  SSKJn  UR                  SS9nUR                  [        5      nUR                  5       n[        R                  U/5        UR                  U5      nUR                  5       R                  UR                  5      nUS   n	US   n
U R                  U	R                   R"                  U
R                   R"                  S	5        US
   nUS   nU R                  UR                   R"                  UR                   R"                  S5        US   nUS   nU R                  UR                   R"                  UR                   R"                  S5        U R                  US   R                   R"                  SS	5        U R                  US   R                   R"                  SS5        U R                  US   R                   R"                  SS5        U R                  US   R                   R"                  SS5        U R                  US   R                   R"                  SS5        U R                  US   R                   R"                  SS5        g )Nr   r   noter         r   )
abcVersion      $Sharp does not carry through measure   r/   #Flat does not carry through measure
      &Natural does not carry through measure   I      H   Natural is ignored      z&Sharp carries over measure incorrectly   J   z+Sharp (D5) carries over measure incorrectly   N   z-Natural (F5) carries over measure incorrectly)r   r   r9   r   r   r   r   carryThroughr   r   r   r   flattengetElementsByClassNoter4   pitchmidi)r"   r   r9   r   r#   r'   r(   r)   notescSharpcThroughbFlatbLastbNatbNatNexts                  r   	testAbc21Test.testAbc21  s   % /)4ZZ%(&&r*		..tyy9q8**HNN,?,??	Aaa))5;;+;+;=bcRy9(..*=*=A	Cr--r3YZr--r3GHr--r3[\r--r3[\r--r3`ar--r3bcr
   c                   SSK Jn  SSK Jn  SSKJn  UR                  5       nUR                  [        5      nUR                  U5      nUR                  5       R                  UR                  5      nUS   nUS   n	U R                  UR                  R                  S-  U	R                  R                  S-  S5        US	   n
US
   nU R                  U
R                  R                  UR                  R                  S5        US   nUS   nUS   nU R                  UR                  R                  UR                  R                  S5        U R                  UR                  R                  S-  UR                  R                  S-  S5        U R                  US   R                  R                  SS5        U R                  US   R                  R                  SS5        g )Nr   r   r8   r   r<   r>   rF   r@   r;   rA   rB   r?      r/   rE      A   rJ   rI   )r   r   r9   r   r   r   r   directiveCarryPitchr   rR   rS   rT   r4   rU   rV   r"   r   r9   r   r#   r'   r)   rW   gSharpg8vaaFlatafNatff8bas                  r   testAbc21DirectiveCarryPitch!Test.testAbc21DirectiveCarryPitch  s   % / ZZ+,&&r*		..tyy9qQx**R/2-?	A a!H))>	@ Qx!HQxA	C 	2-2-A	C 	q,,b2FGr--r3GHr
   c                4   SSK Jn  SSK Jn  SSKJn  UR                  5       nU R                  UR                  S5        UR                  [        5      nU R                  UR                  S5        UR                  U5      nUR                  5       R                  UR                  5      nUS   nUS   n	U R                  UR                  R                   S	-  U	R                  R                   S	-  S
5        US   n
US   nU R                  U
R                  R                   UR                  R                   S5        US   nUS   nUS   nU R                  UR                  R                   UR                  R                   S5        U R#                  UR                  R                   S	-  UR                  R                   S	-  S5        U R                  US   R                  R                   SS5        U R                  US	   R                  R                   SS5        g )Nr   r   r8   r   )r<   r>   r   r:   r<   r>   rF   Sharp carries beyond its octaver;   rA   rB   r?   ra   r/   rE   !Natural carries beyond its octaverb   rc   rJ   rI   )r   r   r9   r   r   r   r4   r=   r   directiveCarryOctaver   rR   rS   rT   assertGreaterrU   rV   
assertLessre   s                  r   testAbc21DirectiveCarryOctave"Test.testAbc21DirectiveCarryOctave  s   % / 	2ZZ,-	2&&r*		..tyy9qQx6<<,,r1::??R/<	> a!H))>	@ Qx!HQxA	C 	

",

",;	= 	q,,b2FGr--r3GHr
   c                   SSK Jn  SSK Jn  SSKJn  UR                  5       nUR                  [        5      nUR                  U5      nUR                  5       R                  UR                  5      nUS   nUS   n	U R                  UR                  R                  S-  U	R                  R                  S-  S5        US	   n
US
   nU R                  U
R                  R                  UR                  R                  S5        US   nUS   nUS   nU R                  UR                  R                  UR                  R                  S5        U R                  UR                  R                  S-  UR                  R                  S-  S5        U R!                  US   R                  R                  SS5        U R!                  US   R                  R                  SS5        g )Nr   r   r8   r   r<   r>   rF   rp   r;   rA   zFlat carries through measurer?   ra   r/   zNatural carries through measurerq   rb   rc   rJ   rI   )r   r   r9   r   r   r   r   directiveCarryNotr   rR   rS   rT   rs   rU   rV   rt   r4   re   s                  r   testAbc21DirectiveCarryNotTest.testAbc21DirectiveCarryNot  s   % / ZZ)*&&r*		..tyy9qQx6<<,,r1::??R/<	> a!H((6	8 Qx!HQx

9	; 	

",

",;	= 	q,,b2FGr--r3GHr
   c                &   SSK Jn  SSK Jn  SSKJn  UR                  5       nSnS Hf  nUR                  US-   5      nUR                  U5      nUR                  S   n	U R                  U	R                  UR                  5      SU S	35        Mh     S
S/ SQ4SSSS/ SQ4SSS/ SQ4SSSS/ SQ4SSS/ SQ4S/n
U
 H  u  pknUR                  XV-   5      nUR                  U5      nU R                  UR                  R                  USU S35        UR                  S   R                  nUS   nU R                  [!        U5      SS5        U R#                  XR                  S5        U H#  nU R%                  XR&                  S U S35        M%     M     g!)"z%
Translation of ABC Chord variations
r   r   )chordr   L:1/8
)[]z[z]r~   zEmpty chord "z
" in Scorez[c_eg]      ?)CzE-G)z[ceg]r   CEG)z[ceg]2      ?r   z	[c2e2^g2]r   )r   EzG#)z[c'e2g]r   r   z[ce^g2])z[c,2e2g2]/2r   r   )z[c/2e'/2=g/2]      ?r   z[c2_e,,/2g/2]/2)z[c/2e/2g/2]2r   r   z[^c/2e/2g/2]/2      ?)zC#r   r   zinvalid duration of chord ""r<   zWrong number of chords found,zNot a Chord!zPitch not in Chord "N)r   r   r|   r   r   r   r   r   r1   assertFalserS   Chordr4   durationquarterLengthrW   lenassertIsInstanceassertIn
pitchNames)r"   r   r|   r   r#   abc_dl	abc_chordr'   r)   part
abc_chordsquarter_lengthchord_pitchesrW   chord0
pitch_names                   r   testAbc21ChordsTest.testAbc21Chords-  s    	&!/  'IFTM*B**2.A771:DT44U[[A,YKzBD	 ' s,-!"#/0#-.'*%56(u&67!

 9C4I}F./B**2.AQZZ55~:9+QGI GGAJ$$E1XFSZ,KL!!&++~F+
j*;*; 4YKqAC , 9Cr
   c           	     z   SSK Jn  SSK Jn  SSKJn  SnUR                  5       nS H  nUR                  XF-   5      nUR                  U5      R                  S   nUR                  UR                  5      n	U R                  U	SU S35        S	 H&  n
U R                  XS   R                  S
U S35        M(     M     g )Nr   r   )harmonyr   r}   )z"C"Cz"C"[ceg]zNo ChordSymbol found in abc: "r   r   z"Pitch not in ChordSymbol of abc: ")r   r   r   r   r   r   r   r   r1   rS   ChordSymbol
assertTruer   r   )r"   r   r   r   r   r#   abc_textr'   r   chord_symbolr   s              r   testAbc21ChordSymbolTest.testAbc21ChordSymbol`  s    %#/  ,HF-.B--b177:D2273F3FGLOOL,J8*TU*VW#
jq/*D*D B8*ANP $ -r
   c                   SSK Jn  SSK Jn  SSKJn  Sn/ SQnUR                  5       nU H  u  pxn	UR                  XG-   5      n
UR                  U
5      R                  S   nUR                  UR                  5      nU R                  [        U5      SSU S	35        Uu  pU R                  UR                  R                  US
U 35        U R                  UR                  R                  U	SU 35        M     g )Nr   r   r8   r   zL:1/4
))z[ceg]<fr         ?)zf<[ceg]r   r   )zc>gr   r   )zc<gr   r   )zc>>=g      ?r   )zc<<gr   r   )zc>>>g      ?r   )zc<<<_gr   r   )z[ceg]>^fr   r   )z	[ce^g]>>fr   r   )z[ceg]<<fr   r   )z	[ceg]>>>fr   r   )z	[ceg]<<<fr   r   )zf>[ceg]r   r   )z	f>>[_ceg]r   r   )z	f'<<[ceg]r   r   )z
f,>>>[ceg]r   r   )z
f<<<[ce_g]r   r   )z	f<<<[ceg]r   r   )zf2>[ceg]r>   r   )z[ceg]>f2r   r<   )z	f>[c_eg]2r   r<   )z	[c^eg]2>fr>   r   )zf2<[ceg]r   r   )z[ceg]<f2r   r>   )zf<[ceg]2r   r>   )z[ceg]2<fr   r   r;   z%Wrong numbers of Notes found in abc: !z5Invalid left note/chord length of abc broken rhythm: z6Invalid right note/chord length of abc broken rhythm: )r   r   r9   r   r   r   r   r   r1   rS   GeneralNoter4   r   r   r   )r"   r   r9   r   r   datar#   abc	soll_left
soll_rightr'   r   general_notesist_left	ist_rights                  r   testAbc21BrokenRhythmTest.testAbc21BrokenRhythms  s    % / 

<  *.&CJFL)B--b177:D 33D4D4DEMS/DSEKM"/HX..<<iTUXTYZ\Y//==zUVYUZ[] +/r
   r   N)__name__
__module____qualname____firstlineno__r,   r5   r^   rm   ru   ry   r   r   r   __static_attributes__r   r
   r   r   r     s:    ,UdBI>IBI>1CfP&5]r
   r   __main__)1
__future__r   unittestr   r   Environmentr   _DOC_IGNORE_MODULE_OR_PACKAGEfyrareprisarnmysteryReelfullRiggedShip	aleIsDear	kitchGirlwilliamAndNancymorrisonsJighectorTheHerokingOfTheFairies	sicutRosatheAleWifesDaughtertheBeggerBoytheBattleOfTheSnaBasdraughtOfAlevalentineJiggslurTesttieTest	crescTestdimTest	staccTestbowTestaccTest	graceTestguineapigTesttestPrimitivetestPrimitivePolyphonictestPrimitiveTuplet
reelsABC21
sponge1613r0   rQ   tieOverrr   rd   rx   r   r	   TestCaser   r   mainTestr   r
   r   <module>r      s   #   &&'<= $ 
2,-	`	(*&, :	@ $: $$!N			&	  
2

	    k>9i}6F&6J.0C		[]8 []| zT r
   