Read a Good Tango Lately?

Scripting and Animating Social Dances,

or What Jim Did on Sabbatical

Jim Mahoney

Marlboro College


old business

internet work: 1997 & 2005

(Was 1999 really that long ago?)


Fall 2010 sabbatical

point of information

What do computer scientists do?

"Computer Science is no more about computers than astronomy is about telescopes." - Edsger Dijkstra"
"So let me get this straight - you've changed fields from cosmology and the origins of the universe to ... video games?" - Dana Howell

Use computers & data as ways to study math, music, games, thinking, vision, motion - you name it.

Next: two examples that lead into my project.

example 1 : Donald Knuth & TeX

"I have always been attracted to computer science because it involves beautiful patterns, rather like the way dancers enjoy choreography."

"I had spent 15 years writing those books, but if they were going to look awful I didn't want to write any more."

TeX itself

TeX strengths

example 2 : music by computer

low level vs high level representations

David Cope (UC Santa Cruz)

    Many books (e.g. Virtual Music, 2001) and recordings (e.g. Virtual Rachmaninoff, 2008) spanning decades.

    "Since the early days of Experiments in Musical Intelligence, many audiences have heard its output in the styles of classical composers. The works have delighted, angered, provoked, and terrified those who have heard them." - David Cope
    "But the day when music is finally and irrevocably reduced to syntactic pattern and pattern alone will be, to my old-fashioned way of looking at things, a very dark day indeed." - Douglas Hofstadter

Abe Stimson, Marlboro 2008


another point of information

What can today's computers can do?

-- data sizes --
 20 pages of text:   0.02 MB  (1 MB is 8 million bits)
 an 800x600 image:   0.15 MB
 4 min of sound:    40    MB raw; compressed 10x to 4MB
 4 min of video:  1000    MB raw; compressed 25x to 40MB 

 -- consumer hard disk capacity --
 1985     10 MB       50 images     2 songs
 1990    100 MB      500 images    20 songs     2 music videos
 1995      1 GB     5000 images   200 songs    20 music videos
 2000     10 GB                  2000 songs   200 music videos
 2005    100 GB                                 5 hours of raw video
 2010      1 TB                                50 hours of raw video

The cutting edge:
text → images → sound → motion

new business: dance

Argentine tango (source: "Cafe Dominguez", Osvaldo Zotto & Lorena Ermocida)

and more dance

contra dance

dance notation

How are dances notated?

  • best known is Labanotation
  • ... but rarely used in practice
  • read it bottom to top
    • legs marked inside staff
    • arms marked outside staff
  • here: man's footwork for ballroom tango basic.
  • (source: Dance Notation Bureau)

animation formats

Digital animation formats such as BVH are another way to represent character motion.

 ROOT hip
	OFFSET 0.000000 0.000000 0.000000
	CHANNELS 6 Xposition Yposition Zposition Xrotation ...
	JOINT abdomen
        { ...
 Frames: 361
 Frame Time: 0.0333
 0.000 41.000 -0.518 -4.77 -0.00 -0.00  ...

Here's the ball toss in BVH.

contra dance calling

 Comfort Deluxe
 By Rick Mohr; January 1, 1998
 Contra, Duple Improper
 Level: Intermediate

 A1:	Women allemande left 1 1/2 (8)
        Swing partner (8)
 A2:	Men allemande left 1 1/2 (8)
        Half hey (neighbors pass right shoulders to start) (8)
 B1:	Balance and swing neighbor (16)
 B2:	Circle left (8)
        (With next couple) Circle right (8)
source: Rick Mohr

Quick quiz: which of those three would you want to read?

dance script project

  • PivotStep: a high level scripting language for dance.
  • Create tools to turn a dance in this language into an animation.
  • In short, do for tango (or contra, or ...) what TeX did for typesetting.

  • Should be:
    • written with open source tools only
    • Turing-complete : new steps defined in terms of simpler steps (or BVH)
    • legible to non-programmers
    • low-level motions compatible with common animation formats

example: box step - people

example: box step - animation

example: box step - PivotStep

    dance: argentine tango
    tempo: 1 beat per line
  man & woman embrace open;     # ';' means 'no elapsed time'
  man stands on right foot;
  woman stands on left foot;
  man            &  woman:
    forward      !    back 
    side         !    side
    shift        !    shift
    back         !    forward
    side         !    side
    shift        !    shift

  # Anything after a # sign is a comment.
  # Could also say "man forward onto left foot",
  # but alternating feet is implied.

PivotStep language version 0.0001

 # A dance is made up of steps.
 # Each step is like "who.what(how)" in object programming :
 who what how 

 # time duration can be at end of line
 men allemand by left   (2 beats)    

 # indented blocks like in python
 at 3 sec:                      # specific start time
     side long, shift weight    # man takes two steps
     side                       # ... while woman takes one

 # a lot of the syntax (including functions, loops, meta-data) is  still in flux.


open source 3D modeling and animation system

second life

  • The blender models are from Jacek Antonelli's Blender to Second Life BVH animation exporter.
  • So it may be possible to "perform" these dances in SecondLife.

future possibilities & challenges

  • input of low-level dance steps with a GUI?
  • automatic input from video clips??
  • public library of dances and moves?
  • creation of new dances by AI that 'listens' to music?


  • PivotStep is a scripting language for social dances.
  • It's a new research project in the early stages.
  • It may eventually be very cool.
  • It's open source.
  • Find it at