xxxxxxxxxx
276
let outputP;
let genButton;
function setup() {
noCanvas();
background(255);
textAlign(LEFT, TOP);
textSize(24);
genButton = createButton("Click to generate");
genButton.position(40,10);
genButton.size(285,60);
genButton.style('background-color', '#990022');
genButton.style('font-size', '28px');
genButton.style('color', '#ffffff');
genButton.mousePressed(generate);
outputP = createP("");
}
function draw() {}
function generate() {
var grammar = tracery.createGrammar(grammarSource);
grammar.addModifiers(tracery.baseEngModifiers);
var output = grammar.flatten("#origin#");
outputP.html(output);
}
// cut and paste your grammar below (as the value for variable "grammarSource")
var grammarSource = {
// "origin": "#interjection.capitalize#, #name#! I'm #profession.a#, not #profession.a#!",
"origin": "In the heart of my art practice, lies #FEELING# of #WONDER# from #THE WAR MACHINE#. With a #CONVENTIONAL# background in #H#, it is #CLEAR# that my main influences are #A# from #B#. After graduating from #COLLEGE#, I’ve established a #STUDIO# that #PRINTS# #MONEY#. The materials I commonly use are #C#, #C# and #D# #C#. A unique #H# technique I developed #F# the materials in order to #G# the audience, and hopefully #E# #FEELING# of #WONDER#.",
"FEELING": ["a feeling", "a realization", "a fleeting emotion", "a reaction", "a notion", "a revelation", "a meditation", "a yearning", "a deep need"],
"WONDER": ["wonder",
"disgust",
"urgency",
"discomfort",
"surprise",
"awe",
"worthlessness",
"fear",
"excitement",
"release",
"awareness",
"respect",
"connection",
"relief",
"unconditional love",
"conflict",
"nostalgia",
"disillusionment",
"fascination"
],
"THE WAR MACHINE": ["the war machine",
"patriarchy",
"my inner demons",
"my romantic partner",
"society",
"heights",
"nature's beauty",
"god",
"conventions",
"the human race",
"my biological father",
"my mother",
"my family",
"my birth country",
"the leaders who run this disaster",
"the human boy",
"my sexuality"
],
"CONVENTIONAL": ["conventional",
"international",
"unconventional",
"complex",
"somewhat lacking",
"autodidactic",
"professional",
"incomparable",
"invaluable ",
"musical",
"traumatic",
"painfully personal"
],
"H": ["origami",
"welding",
"dance",
"programing",
"projection mapping",
"webcasting",
"molding",
"filmmaking",
"3D printing",
"3D modeling",
"image manipulation",
"mosaic",
"sculpture",
"pottery",
"printing",
"AI",
"machine learning",
"Virtual reality",
"Augmented reality",
"modeling",
"poetry",
"audiovisual composition"
],
"CLEAR": ["clear",
"unusual",
"surprising",
"groundbreaking",
"unfortunate",
"not obvious",
"shocking",
"inconvenient",
"meaningful",
"uncomfortable for many",
"somewhat concerning",
"not easy",
"concerning"
],
"A": ["artists",
"ruins",
"archeological findings",
"research results",
"books",
"wall paintings",
"live data streams",
"finding",
"predictions",
"live feeds",
"radical activists",
"propaganda",
"realizations",
"supernatural phenomena",
"forgotten archives",
"folk musicians"
],
"B": ["the paleolithic era",
"biochemistry labs",
"NASA’s space shuttle",
"pagan mythology",
"the midwest",
"Portland, Oregon",
"the cold war era",
"the dark web",
"facebook’s AI department",
"Trump’s twitter",
"google’s algorithms",
"my dreams",
"my rundown little hometown",
],
"COLLEGE": ["a french atelier",
"the art school Hitler did not get into",
"NYU’s Tisch School of the arts",
"school of hard knocks",
"an Ivy League College",
"dentistry school"
],
"STUDIO": ["studio",
"art institute",
"practice",
"startup company",
"collective",
"nonprofit",
"performance art space",
"underground venue",
"production company"
],
"PRINTS": ["promotes",
"distributes",
"prints",
"installs ",
"analyzes",
"criticizes",
"fabricates",
"teaches",
"celebrate",
"sells"
],
"MONEY": ["money",
"storefront signs",
"smart homes",
"world peace",
"humility ",
"good manners",
"body extensions ",
"diversity",
"cultural impact",
"cyborgs"
],
"F": ["meshes",
"collects",
"seals",
"smears",
"projects",
"stamps",
"juxtaposes",
"transforms",
"electronically combines",
"chemically composes ",
"shreds",
"burns",
"reinterprets",
"mixes",
"blends",
"breaks"
],
"G": ["shock",
"entertain",
"expose",
"brainwash",
"intrigue",
"wow",
"delight",
"concern",
"disturb"
],
"E": ["invoke",
"inspire",
"elicit",
"spur",
"spark",
"prevent",
"cause",
"imply",
"trigger",
"influence",
"discourage"
],
"C": ["Json files",
"acrylic paint",
"microcontrollers",
"game controllers",
"fabric",
"EL wires",
"watercolor",
"oil paint",
"fungal molds",
"raspberry pis",
"motion sensors",
"disassembled toy parts",
"lasers",
"shaders",
"3D models",
"MIDI controllers",
"drone footage",
"Instagram’s API",
"semiconductives",
"LED matrices",
"neons",
"musical instruments ",
"bloody raw meat",
"computer-generated text",
"biodegradable glitter"
],
"D": ["reused",
"repurposed",
"stained",
"vintage",
"refurbished",
"original",
"bootlegged",
"classic",
"rare",
"handmade",
"readymade"
],
};