Analytic Martial Arts

Friday, June 29, 2012

Automated Typesetting For Analytic Martial Arts Notation

I've finally put together some code that makes it much easier to translate notation into HTML. I've used it to typeset a bunch of things already and it has greatly improved my efficiency in this regard. Briefly, here's how it works:

  • Techniques are collected into Analytic Martial Arts Notation (AMAN) documents. The documents are XML-based and optimized for hand-composition.
  • Each individual technique has a notation block which represents the notation proper.
  • The entire thing can be run through a set of typesetting scripts to produce HTML suitable for stand-alone publication or pasting into a blog.

Details of the document format and notation syntax follows.

Document Format

Here's a small sample document which execerises all the features I've developed to date:

<doc>
    <title>Title</title>
    <commentary>
        A Demonstration of the AMAN document format.
    </commentary>
    <actions>
        OB = Outward Block
        SK = Snap Kick
    </actions>
    <regions>
        T = Temple
        S = Stomach
    </regions>
    <definitions>
        <definition name="block_kick">
            SK,,
            OB,,
        </definition>
    </definitions>
    <techniques>
        <technique>
            <format columns="2"/>
            <englishname>Technique 1</englishname>
            <phonetic>TEK NEEK WUN</phonetic>
            <commentary>
                A technique demonstrating the features of AMAN.
            </commentary>
            <notation>
                RP,,,1
                block_kick
                ,"Bow",
            </notation>
            <notes>
                <note id="1">
                    Extended explanation of annotation 1.
                </note>
            </notes>
        </technique>
    </techniques>
</doc>

The document is enclosed in a single element, "<doc>" in this case, which is required for compatibility with XML::Parser. This outermost element is ignored and can be whatever suits your fancy. Each document has the following attributes:

  • title: A descriptive title.
  • commentary: An optional, free-form text string describing the overall contents of the document.
  • actions: A newline-separated block of <action symbol>/<description> pairs. This is one of the places where I've broken the XML standard a bit in order to make hand-composition easier.
  • regions: Like the actions element but contains <region>/<description> pairs. This element is optional since a collection of techniques may not make use of region specifiers.
  • definitions: An optional element enclosing one or more definition elements.
    • definition: The document may optionally include one or more definitions. These are named chunks of notation which can be interpolated into the techniques defined within the document. This feature is generally designed to assist with the transcription of longer forms which may have recurring sequences of moves.
  • techniques: Encloses one or more technique elements.

technique Elements

Each technique element describes one technique, where "technique" can be read as "sequence of moves which the author wants to group together for whatever reason". A technique may be as short or as long as necessary and has the following elements:

  • format: An optional directive use to pass formatting hints on to whatever typesetter you're using. The one which I've written, AMAN::HTMLFormatter, will produce a single column per notation block when columns equals 1, otherwise it produces a two-column, side-by-side layout.
  • commentary: An optional, free-form text string providing commentary on the technique.
  • notation: A block of AMAN; see description below.
  • notes: An optional element enclosing one or more note elements.
    • note: A free-form text string with associated ID. This was specifically developed as a footnoting mechanism with the ID referring back to one or more lines in the associated notation block via annotation column. However, there's no enforcement of this relationship, so this is a good place for general notes as well.

notation Elements

Each notation element contains a block of AMAN in a parser-friendly (and, hopefully, human-friendly) format. This block contains one or more lines, each of which has a left, center, and right portion separated by commas. A fourth column containing a text string may optionally be included to annotate the line.

Each section (left, center, and right) of a line is composed of 0 or more atoms. These atoms may be any of the following:

  • jump: A jump.
  • release: Instructs the performed to release eir grip on eir opponent/weapon.
  • A direction keyword indicating motion of the dan tien in the indicated direction. The direction keywords are: left, right, forward, back, forwardleft, forwardright, backleft, and backright.
  • look (<direction keyword>): Indicates the performer should focus eir attention on the indicated region.
  • <turnleft|turnright> [ ( <integer> ) ]: Denotes a left or right turn. An integer may optionall be included in parentheses following the keyword, indicating a turn of number degrees; 90° is assumed if this modifier is omitted.
  • "<literal string>": Indicates that a literal string should be inserted into the notation block at that location.
  • <action specifier> [ ( [ grapple|grip ] [ <diection keyword> ] [ <region specifier> ] ) ]: Describes a strike/block/grapple; most of the atoms in a technique will use this form. An arbitrary string of characters is assumed to be an action specifier if it is not a keyword or literal string. Each specifier may optionally be followed by a list of modifiers enclosed in parentheses:
    • grapple | grip: May be used to indicate that the action is a grapple or a weapon grip; a standard strike is assumed if these keywords are omitted.
    • <direction keyword>: Indicates the direction of application of the action. The default direction of application is assumed if no direction modifier is provided. Does not apply to grip actions.
    • <region specifier>: An aribtrary character string denoting a region.

A complete grammar with a more detailed description can be found in NotationParser.pm.

Getting Started

The code and more details on how it works can be found here. The easiest way to get an idea of how all this works in practice is to take a look at the posts where I've presented typeset material along with source files:

I hope this is useful to y'all; have fun.

Thursday, June 28, 2012

Studio X: Short Forms:Rank 2

Source: short_forms_rank_2.xml


This group of short forms is required for promotion from Rank 1 to Rank 2.

Actions

  • BF: Backfist
  • BS: Bow Stance
  • CS: Cat Stance
  • DBB: Downward Backfist Block
  • DBF: Downward Backfist
  • DE: Downward Elbow
  • DPB: Downward Palm Block
  • E: Elbow
  • FS: Front Sweep
  • G: Guard
  • HP: Horizontal Punch
  • HS: Horse Stance
  • IB: Inward Block
  • IFT: Inverted Finger Thrust
  • IS: Inward Smash
  • IntB: Intercepting Block
  • KT: Knee Trap
  • MG: Monkey Grab
  • MK: Mule Kick
  • NS: Natural Stance
  • OB: Outward Block
  • OS: Outward Smash
  • RBS: Reverse Bow Stance
  • RP: Reverse Punch
  • RSBK: Rising Side Blade Kick
  • S: Stomp
  • SB: Scoop Block
  • SK: Snap Kick
  • STK: Side Thrust Kick
  • TH: Twist Hit
  • UB: Upward Block
  • VP: Vertical Punch
  • VSH: Vertical Sidehand

Regions

  • C: Chin
  • LIF: Left Inner Forearm
  • LIW: Left Inner Wrist
  • T: Temple

Short Forms 6 - 10

Short forms 6 through 10 are performed in an unbroken sequence like short forms 1 - 5.

SK

Short Form 8
BS
HP
1

Transition
SK
4
DPBBS
UB
FS
LIF
MG
LIW
MG
3
IB
OB

Short Form 7
HP
BS
1

Transition
TH
T
SK
G
IntB
HP
BFBS
2
SBRBS
TH
T
G
T
G
TH
HP
IntB

Short Form 6
BS
HP
1
 
VP
HS
CS
6
OB
VP
HS
CS
6
IB

Short Form 10
VP
HS>
UB
5
MK
NS
STK
SK
SK

Short Form 9
BS
HP
1
OB
↺180
E
BS
STK
↺180
SK

1: Not actually a horizontal punch; hand is held out as though a punch had just been thrown.

2: The twist hit, scooping block, and backfist should be strung together in one smooth, circular motion. The transition from bow stance to reverse bow and back to bow stance should match the timing of the strikes.

3: Pivot right foot outward in preparation for front sweep.

4: Maintain blocks while performing kick.

5: Not actually a vertical punch; hand is held out as though a punch had just been thrown. Maintain upward block throughout short form 10.

6: Transitory cat.

Short Form 11

SK
RP
RP
SK
SK
RP
OB
NS

Short Form 12

BS
↻180
BS
SKDBB
S
DBF
DE
RP
↻180
VSHBS
E
NS

Short Form 13

T
G
IFT
1
BS
SK
IS
RBS
NS

1: Guard is open-handed in this case.

Short Form 14

C
RSBK
OS
RBS
NS

Short Form 15

STK
KT
3
BS
FS
2
LIF
MG
LIW
MG
1
IB
OB
BS
NS

1: Turn right foot out in preparation for front sweep.

2: Remainder of technique assumes that defender pulls lead foot up and doges sweep.

3: The sweep missed, so step forward and pull the attacker into the knee trap.

Studio X: Short Forms: Rank 1

Source: short_forms_rank_1.xml


Short forms are formal techniques designed to emphasize proper stances and strikes. As such, the practitioner should focus on executing each action "the right way". Contrast this with the sparring techniques, where the general goal is to string all of the strikes together in a way which approximates how they'd be used in actual combat. This group of short forms is required for promotion from Rank 1 to Rank 2.

Actions

  • BS: Bow Stance
  • DBB: Downward Backfist Block
  • FS: Forward Sweep
  • G: Guard
  • HP: Horizontal Punch
  • IB: Inward Block
  • IFT: Inverted Finger Thrust
  • IntB: Intercepting Block
  • MG: Monkey Grab
  • NS: Natural Stance
  • OB: Outward Block
  • SK: Snap Kick
  • TH: Twist Hit

Regions

  • A: Abdomen
  • H: Head
  • LIF: Left Inner Forearm
  • LIW: Left Inner Wrist
  • T: Temple

Short Forms 1 - 5

Ideally the first 5 forms are performed as a continuous sequence without breaks. They will be presented as such below, with individual techniques denoted by section markers.


Transition
T
SK
G
TH
HP
IntB
DBB
DBB
IntB
HP

Short Form 2
HP
BS
OB

Transition
DBB
DBB
HP
IntB

Short Form 1
BS
HP
OB
Bow
NS
 
BS

Transition
H
SK
A
SK
4

Short Form 5
BS
HP

Transition
FS
3
LIF
MG
LIW
MG
2
IB
OB

Short Form 4
HP
BS
1

Transition
TH
T
SK
G
IntB
HP
IFT
IntB

Short Form 3
BS
HP
1

1: Not really a horizontal punch; just land in bow stance with hand extended as if a punch had just been thrown.

2: Pivot right foot outward at this point in preparation for the front sweep.

3: Maintain control of attacker's arm during the sweep.

4: Both kicks are delivered while jumping, right first then left. Keep right hand extended throughout entire technique.

Studio X: Sparring Techniques: Rank 4 Revisited

Source: sparring_rank_4.xml


The final set of sparring techniques, required for promotion from Rank 4 to Rank 5.

Actions

  • BS: Back Sweep
  • DFB: Downward Forearm Block
  • FS: Front Sweep
  • HBS: High Bird Stance
  • HK: Hook Kick
  • KT: Knee Trap
  • OB: Outward Block
  • OSH: Outward Sidehand
  • RK: Roundhouse Kick
  • RP: Reverse Punch
  • SS: Sparring Stance
  • STK: Side Thrust Kick
  • ShS: Shuffule Step
  • TH: Twist Hit
  • TS: Twist Stance
  • VP: Vertical Punch

Regions

  • A: Abdomen
  • H: Head

16

This technique is a lot like number 15. Try to maintain momentum and flow from front sweep to hook kick to outward block.

RK
TH
OB
↻180
HK
SS
↻180
FS

17

VP
VP
VP
1
RK
KT
SS

1: These are rolling punches. Imagine hitting a speed bag.

18

This is like 16, except with a back sweep rather than a front sweep. Properly executing the transition from the back sweep to the hook kick will take some practice.

RK
TH
OB
SS
↻315
HK
SS
1
↻45
BS
ShS
SS

1: Transitory, held just long enough to transfer weight to the front foot in preparation for the hook kick.

19

OSH
HBS
1
ShS
DFB
SS
H
STK
SS
A
STK
SS

1: This ends in high bird stance like sparring technique 10.

20

RP
DFB
SS
RK
TH
OB
HK
TS
SS

Studio X: Sparring Techniques: Rank 3 Revisited

Source: sparring_rank_3.xml


Sparring techniques required for promotion from Rank 3 to Rank 4.

Actions

  • CS: Cat Stance
  • DBB: Downward Backfist Block
  • DFB: Downward Forearm Block
  • IS: Inward Smash
  • JRS: Jade Ring Stance
  • OB: Outward Block
  • RP: Reverse Punch
  • SK: Snap Kick
  • SS: Sparring Stance
  • STK: Side Thrust Kick
  • UB: Upward Block
  • VP: Vertical Punch

11

RP
DFB
SS

12

RP
UBJRS
RP
DFB
SS

13

SKDBB
VP
VP
VP
OB
SS

14

SS
VP
VP
VP
OB
SS
DBBSK
STK
CS
SS

15

Try to maintain smooth rotation throughout the technique. The momentum generated by the inward smash should be smoothly redirect into the side thrust kick and should then flow on to the outward block.

SKDBB
VP
VP
VP
OB
SS
↺180
STK
SS
↺180
IS
SS