Transcript Syntax

eMuse
“Rapid Screenplay Prototyping Language”
Mark Ayzenshtat
Elena Filatova
Kristina Holst
Vlad Shchogolev
Motivation



Screenplays can succeed on paper but
fail on stage.
Screenplay is the natural blueprint or
“source code” for a play.
Writers and directors couldn’t care less
about loops, functions, scope, etc.
Overview

eMuse is 2 things:

a language



screenplay-like syntax
allows more-or-less free-form English
a 2D animation framework


simple: stick figures with superimposed images
extensible: custom behaviors
Source Structure


Title / Author
Definitions





Characters
Props
Settings
Each of these is typed (e.g. Romeo: LovesickTeenager)
Exposition


Dialogue
Actions
Syntax

As close to the syntax of a play written in natural language as
possible, e.g.

Authors’ names
 All possible formats can be accepted
Stephen A. Edwards, Sasha, etc

Action format might include any combination (all combinations
are parsed by one rule)
 Direct object
 Preposition
 Indirect object
 Adverb
Francisco (appears on stage), Bernardo (takes sword),
Francisco (appears away quickly)
Semantics

eMUSE has quite simple semantics
 No scoping
 All variable names must be unique
Romeo: <Young noble guy>
Romeo: <Old peasant>
Juliet: (kisses Romeo)
Illegal
Semantics (cont’d)

eMUSE has quite simple semantics
 Characters and Props mentioned in the
actions should be defined
Definitions
Character
Romeo: <Young noble guy>
Prop
Book: <The Dragon Book>
Exposition
Juliet: (hits Romeo with Book)
Compiler

Two halves:




Lexer, Parser, Semantic Checker
Back end: OutputGenerator
Just an API – an interface – lots of
different implementations possible
Default Implementation: Java source
code
Default
Screenplay
Java
eMuse
Compiler
Java Output Generator

A Java Model API


Models classes, methods, modifiers, etc. as Java
objects.
Not This:
writeSource(“public class Foo {”);
But This:
Class c = new Class(“Foo”);
c.addModifier(Modifier.kPublic);
…
sourceWriter.write(c);

Advantage: generated source is readable,
consistent
Java Output Generator
(cont’d)


What does the generated Java source
do when compiled and run?
Answer: Animates the screenplay using
our Animation Framework
Animator Design

Two basic entities derived from parse
tree




Actions
Stage objects
Actions occur over discrete time
intervals
Stage objects are organized in a class
hierarchy
Animator Design (cont’d)

Affine Transformation


Composition of matrix
multiplications define
transformation of local to
global coordinate system.
used to construct scene
graph in which individual
objects can be
manipulated from any
node in the scene graph
 x'   cos 
  
 y '    sin 
1  0
  
 sin 
cos 
0
tx  x 
 
ty  y 
1  1 
v  Mv0
Global
Stage
Character
Prop
Left Arm
Right Arm
Left Leg
Right Leg
Head
Body
Speech Balloon
Local
Dubya shares a serene moment with Prof. Edwards.