{"id":5167,"date":"2024-05-01T00:00:34","date_gmt":"2024-05-01T04:00:34","guid":{"rendered":"https:\/\/nickm.com\/post\/?p=5167"},"modified":"2024-05-05T13:13:10","modified_gmt":"2024-05-05T17:13:10","slug":"grams-fairy-tales-manual-grimoire","status":"publish","type":"post","link":"https:\/\/nickm.com\/post\/2024\/05\/grams-fairy-tales-manual-grimoire\/","title":{"rendered":"Gram\u2019s Fairy Tales: Manual &#038; Grimoire"},"content":{"rendered":"<p><a href=\"https:\/\/taper.badquar.to\/\"><em>Taper,<\/em><\/a> an online literary magazine published twice yearly, is now in its <a href=\"https:\/\/taper.badquar.to\/12\/\">12th issue.<\/a> An independent editorial collective (Kyle Booten, Angela Chang, Kavi Duvvoori, Leonardo Flores, Helen Shewolfe Tseng, and Andy Wallace, for this issue) makes all the decisions about selections, themes for forthcoming issues, and so on, and also handles all communication with authors. They do all the work! Editors are allowed to submit works, in which case they recuse themselves from the collective\u2019s discussion. I\u2019m proud to be publisher of this magazine \u2014 although it\u2019s really the editorial collective that makes it happen.<\/p>\n<p>My <a href=\"https:\/\/taper.badquar.to\/12\/grams_fairy_tales.html\">\u201cGram\u2019s Fairy Tales\u201d<\/a> was selected for this issue, with \u201cTools\u201d as its theme!<\/p>\n<p><a href=\"https:\/\/taper.badquar.to\/12\/grams_fairy_tales.html\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/nickm.com\/post\/wp-content\/stuff\/grams.png\" alt=\"A story grammar in a textarea (below) and a generated story about a heroic lily, a villainous droplet, and a chanterelle who helps the hero. \" width=\"853\" height=\"724\" class=\"alignnone size-full wp-image-5180\" srcset=\"https:\/\/nickm.com\/post\/wp-content\/stuff\/grams.png 853w, https:\/\/nickm.com\/post\/wp-content\/stuff\/grams-300x255.png 300w, https:\/\/nickm.com\/post\/wp-content\/stuff\/grams-768x652.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>For those who haven\u2019t visited <em>Taper,<\/em> when you do, you\u2019ll find that the poems are <em>computational<\/em> and are no more than 2KB (2048 bytes) in size. (Issue #1 hosted 1KB poems and issue #3 had ones that were 3KB, but Goldilocks found the ideal constraint in 2KB.) Issue #12 features a lot of general-purpose programs that are true tools, textual or otherwise, as well as dynamic text generators that speak to the theme. In fact, the issue is our largest yet, with 32 selections.<\/p>\n<p>To read what the author\/programmers say about their work, in their statements, you generally have to \u201cView Page Source\u201d (or choose the similar option in your browser) and look at a comment at the top of each page, which is licensed as free (libre) software so you can make use of it in any way you like. However, given the theme of this issue, I wrote \u201cGram\u2019s Fairy Tales\u201d to not only give access to the underlying HTML5, but also to let people write grammars that can be placed in a text area and used to generate stories. Given this, I\u2019m going to pull a bit from my \u201cauthor statement,\u201d found in complete form in the comments, and post it here. I\u2019ll also provide three novel story grammars written by others: Jhave Jhonston (author of <em>ReRites<\/em>), Kyle Booten (author of <em>Salon des Fant\u00f4mes<\/em>), and Kavi Duvvoori (author of <em>Common Is That They<\/em>).<\/p>\n<h3><a href=\"#inspired\">Inspirations, Instructions<\/a> &#8211; <a href=\"#jhave\">Jhave\u2019s<\/a> &#8211; <a href=\"#kyle\">Kyle\u2019s<\/a> &#8211; <a href=\"#kavi\">Kavi\u2019s<\/a><\/h3>\n<h2 id=\"inspired\">Two Inspiring Systems, and Instructions<\/h2>\n<p>As I developed \u201cGram\u2019s Fairy Tales,\u201d I was thinking about two remarkable story generation systems, very different ones, both quite simple.<\/p>\n<p>One is the mid-1980s <a href=\"https:\/\/forums.atariage.com\/blogs\/entry\/15028-story-machine-spinnaker-software\/\"><em>Story Machine,<\/em><\/a> which I\u2019ve known about for a while in its Commodore 64 incarnation. It is a strangely animistic system in which any entity can perform any transitive or intransitive action. While there are multimedia elements and some notion of state, it essentially develops narratives one independent sentence at a time.<\/p>\n<p>The other is a <a href=\"https:\/\/www.theregister.com\/2017\/08\/29\/ibm_1960s_story_writing_software\/\">system by Joseph Grimes,<\/a> operational in Mexico City in 1963. Only one text from this story generator is documented. It seems to have produced stories based on a story grammar, with formalist structures. So, a hero would be challenged in some way and overcome the challenge. The one-page magazine article about the system suggested that it could be called \u201cGrimes\u2019s Fairy Tales.\u201d<\/p>\n<p>\u201cGram\u2019s Fairy Tales\u201d uses a simple grammar to generate stories. There are special \u201chero\u201d and \u201cvillain\u201d tokens, which always refer to the same two entities, selected from the \u201centity\u201d rule. You don\u2019t have a pool of good guys and bad guys; any entities are equally likely to be heroes and villains.<\/p>\n<p>Beyond those special tokens, the other nonterminal tokens (the lowercase ones) expand according to rules, with each represented as one line in the text field.<\/p>\n<p>The \u201c|\u201d indicates alternatives; these are split apart first.<\/p>\n<p>The \u201c+\u201d indicates a conjunction of elements; all of those will appear.<\/p>\n<p>Tokens keep getting expanded until eventually there is a run of text which in my example grammars are in all caps. These are \u201cterminals,\u201d and ends up being presented as is, without any further transformation.<\/p>\n<p>Your grammar needs to begin with a \u201cstory\u201d rule, and it should have \u201cadj\u201d and \u201centity\u201d rules so a hero and villain can be determined. Anything else is up to you. Indeed, you don\u2019t actually have to refer to a hero or villain.<\/p>\n<p>My terminals are in all caps (making for an all-caps story) simply because it\u2019s tricky to get the capitalization of sentences right. It would make things harder for those who want to edit the grammar and create their own stories, and the grammar is already a bit tricky.<\/p>\n<p>Spaces have to be included properly at the beginning and ending of terminals, for instance, except for the terminals that come at the very end of stories.<\/p>\n<p>Also, if you have entities or adjectives that begin with a vowel sound, you\u2019ll end up with grammatical mistakes. The solution in this simple tool (or toy) \u2014 simply use adjectives and entities that all begin with consonant sounds!<\/p>\n<p>To get an idea of how to write your own grammar, you may want to start with an <em>extremely<\/em> simple one, such as:<\/p>\n<pre>story>hero+ FOUGHT +villain+.|hero+ TOOK A NAP.\nadj>CLEVER|STRONG\nentity>FOX|CHICKEN\n<\/pre>\n<h2 id=\"jhave\">Jhave\u2019s Grammar: A Harmonious Moment<\/h2>\n<p>Here\u2019s a striking project by <a href=\"https:\/\/en.wikipedia.org\/wiki\/David_Jhave_Johnston\">Jhave Johnston,<\/a> who is my colleague at the University of Bergen <a href=\"https:\/\/uib.no\/en\/cdn\/\">Center for Digital Narrative<\/a> and winner of the Robert Coover Award. You\u2019ll notice that Jhave wrote his grammar to enable proper capitalization, despite the difficulty of that. Although the right side of the text is hidden, you can select it all and paste it into \u201cGram\u2019s Fairy Tales\u201d to see how it works.<\/p>\n<pre>story>intro+conclusion\nintro>In the heart of +emotion+, +entities+ +verb+ in +concept+|Abiding as  +emotion+, +entities+ +verb+ in +concept+|Before +emotion+, +entities+ +verb+ in +concept+|Imperturbable in +emotion+, +entities+ +verb+ in +concept+|Serendipitous as +emotion+, +entities+ +verb+ in +concept+|Surrounded by  +emotion+, +entities+ +verb+ in +concept+|Amidst +emotion+, +entities+ +verb+ in +concept+|Beyond +emotion+, +entities+ +verb+ in +concept+\nemotion>serenity|peace|tranquility|joyousness|tenderness|compassion|love|radiance|integrity\nentities>entities_nature+ and +entities_tech\nentities_nature>brooks|forest|cascade|swamp|torrent|ravines|refugees|stars|orchards|plateaus|tendrils|alleyways|groves|mountains|rivers|fields|meadows|ridges|oceans|orchards|moons|blossoms|nebulae|subduction trenches\nentities_tech>LEDs|torrents|media|villains|dollar-stores|ditches|pop-ups|server-farms|antennae|antagonists|satellites|philosophies|trinkets|video-walls|entrails|exiles|synapses|heroes|plastics\nverb>merged|thrived|replenished|enjoyed|trembled|reveried|prospered\nconcept>precon+conce\nprecon>harmony, |wisdom's light, |exuberance, |cohesion, |unity, |solidarity, |changelessness, |insight, \nconce>seeking mutual actualization|observing mutual transcendence|flourishing with supple realization|witnessing collective discovery|imploding within perfect revelation|imploding within effortless actualization|observing ripe achievement|listening to shared success\nconclusion>.\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/nickm.com\/post\/wp-content\/stuff\/jhave.png\" alt=\"A custom grammar generates \u201cSurrounded by peace, blossoms and antennae merged in solidarity, listening to shared success.\u201d\" width=\"853\" height=\"683\" class=\"alignnone size-full wp-image-5183\" \/><\/p>\n<h2 id=\"kyle\">Kyle Booten\u2019s Grammar: How to Compose an Ode<\/h2>\n<p>Kyle is a <em>longtime<\/em> member of the <em>Taper<\/em> editorial collective \u2014 since issue #5 in fall 2020! \u2014 and has long been working to have computer text generation provoke his own (and others\u2019) writing. His grammar produces instructions for writing odes of different sorts, and is the most elaborate by far, clocking in at 70 lines, with several that are essentially comments or blank. Again, you can select all of these and paste them into \u201cGram\u2019s\u201d without trouble, although some of the text on the right side is obscured.<\/p>\n<pre>Pindar Horace Hordar \n(An Ode-Gym)\nKyle Booten\n\n\nstory>HOW TO WRITE AN ODE: +ode_type\node_type>pindaric|pindaric|pindaric|pindaric|horatian|horatian|horatian|horatian|blended\n\n\n\nPINDARIC\n\npindaric> (TURN) +strophe+ (COUNTERTURN) +antistrophe+ (STAND) +epode\nstrophe>IN A STANZA OF +p_lines+ +short_or_long+ +meter1+ LINES, ADOPTING A +style1+ TENOR, DESCRIBE +hero+, WITH PARTICULAR ATTENTION TO THE +p_feature+ OF +hero+.\nmeter1>DACTYLLIC|DACTYLLIC|DACTYLLIC|QUASI-AEOLIC|LOGAOEDIC\nmeter2>meter_adjust+ +meter1|TROCHAIC|IAMBIC\nmeter_adjust>NOT|ANYTHING BUT|ONLY IMPERFECTLY\np_lines>6|8|8|10|12\nshort_or_long>BRIEF|BRIEF|BRIEF|LENGTHY|LENGTHY|LENGTHY|ABSURDLY LONG\np_feature>LAUREL|ORDER|VIRTUE|LAW|DECREE|STRENGTH|CRIME|FATE\nstyle1>SOLEMN|MYSTICAL|GNOMIC|JAGGED|SUBLIME|MORALISTIC|GOVERNMENTAL|MUSCULAR|LAUDATORY|REVERENT|JUBILANT\nantistrophe>USING THE SAME STANZAIC STRUCTURE BUT NOW +style_or_mentioning+, CONTRAPOSE +hero+ WITH ITS INVERSE AND ENEMY, +villain+.\nstyle_or_mentioning>style2|MENTIONING +p_trait\nstyle2>ZANY|PIXELATED|EUPHORIC|REVERENT|BLOODTHIRSTY|STERN|RECURSIVE|VITUPERATIVE|BRUTALIST|PARANOID|ANGUISHED\np_trait>THE STATE|A GOD|A WAR|A SPORT|A MORAL|A VIRTUE|A CONQUEST|A VICTORY|A NATURAL DISASTER\nepode>NOW, WITH +subtract+ FEWER LINES, AND THESE +ep_style+, IMAGINE HOW +hero+ SHALL +do_to_villain+ +villain+.\nep_style>meter2|style1|style2|short_or_long|short_or_long+ AND +meter2|style1+ AND +style2|style2+ AND +meter2\nsubtract>2|2|2|3|3|3|4|4|5\ndo_to_villain>OVERCOME|OVERCOME|OVERCOME|REFORM|BANISH|DEMOTE|CENSURE|STEAL FROM|WED|WOUND|BECOME\n\n\nHORATIAN\n\nhoratian>IN +stanzas+ STANZAS, EACH OF 4 LINES, DESCRIBE +hero+, +gradient+.|IN +stanzas+ STANZAS, EACH OF 4 LINES, DESCRIBE +hero+, +gradient+. +extra+.\ngradient>PROGRESSING GENTLY FROM+ +concept_statement|PROGRESSING GENTLY FROM+ +concept_statement+ AND SIMULTANEOUSLY FROM +concept_statement2\nconcept_statement>concept+ TO +concept2\nconcept>THE +cognizing+ OF THE +abstraction+ OF +object|THE +cognizing2+ OF THE +abstraction2+ OF +object\nconcept2>THE +cognizing2+ OF THE +abstraction+ OF +object|THE +cognizing+ OF THE +abstraction2+ OF +object2\nconcept_statement2>GREEN TO BLUE|BLUE TO GREEN|WEALTH TO POVERTY|MORNING TO NIGHT|RAIN TO SLEEP|YOUTH TO OLD AGE|FALL TO SPRING|WINTER TO SUMMER\nabstraction>PAIN|SADNESS|LOSS|HUMOR|FRAILTY|YEARNING\nabstraction2>LOSS|GROWTH|MERCY|HISTORY|TIMELESSNESS|MORTALITY\ncognizing>AWARENESS|FORGIVENESS|HATRED|NON-AWARENESS|APPRECIATION|MISUNDERSTANDING|SYMPATHY\ncognizing2>ACCEPTANCE|PERCEPTION|REGRETTING|UNDERSTANDING\nobject>hero|hero|hero|hero|LIFE IN GENERAL\nobject2>hero|hero|hero|hero|villain|LIFE IN GENERAL\nstanzas>3|4|4|6|6|8|10\nextra>REMARK IN THE +count_line+ LINE UPON +extra_object|prosody\nextra_object>THE +h_feature+ OF +hero|WINE|WINE|WINE|A MORSEL|A MORSEL|A FRIEND\nh_feature>FLAVOR|SIZE|TEXTURE|FAMILY|POSITION|TEMPERATURE|ECHO|INTERIOR|FORM|TEMPERAMENT|HONOR|HUE\ncount_line>1ST|rel_num|rel_num+ TO LAST\nprosody>MIMIC +poet+'S METER\npoet>SAPPHO|ALCAEUS\nrel_num>2ND|3RD|4TH\n\n\nBLENDED\n\nblended>bl1|bl2|bl3|bl4|bl5|bl6\nbl1>[STANZA 1: +pindaric_bit+] [STANZA 2: +pindaric_bit+] [STANZA 3: +horatian_bit+]\nbl2>[STANZA 1: +pindaric_bit+] [STANZA 2: +horatian_bit+] [STANZA 3: +pindaric_bit+]\nbl3>[STANZA 1: +horatian_bit+] [STANZA 2: +pindaric_bit+] [STANZA 3: +pindaric_bit+]\nbl4>[STANZA 1: +pindaric_bit+] [STANZA 2: +horatian_bit+] [STANZA 3: +horatian_bit+]\nbl5>[STANZA 1: +horatian_bit+] [STANZA 2: +horatian_bit+] [STANZA 3: +pindaric_bit+]\nbl6>[STANZA 1: +horatian_bit+] [STANZA 2: +pindaric_bit+] [STANZA 3: +horatian_bit+]\npindaric_bit>meter1|meter2|short_or_long|style1|style1|style_or_mentioning|strophe|ep_style\nhoratian_bit>gradient|gradient|extra|extra_object|cognizing|cognizing2|concept_statement|concept|concept2|concept_statement2|prosody\n\n\nadj>VINTAGE|COMMON|CIVIC|BROKEN|HONEYED|PAINTED|SACRED|HUNGRY|VERNAL|FLEETING\nentity>VASE|FRIEND|DOVE|DEER|FRUIT|LAKE|HOUSE|GAME|TUNE|STORM|GLEN|KNOT|VEIL|WRIT\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/nickm.com\/post\/wp-content\/stuff\/Kyle.png\" alt=\"\" width=\"525\" height=\"203\" class=\"alignnone size-large wp-image-5197\" srcset=\"https:\/\/nickm.com\/post\/wp-content\/stuff\/Kyle.png 853w, https:\/\/nickm.com\/post\/wp-content\/stuff\/Kyle-300x116.png 300w, https:\/\/nickm.com\/post\/wp-content\/stuff\/Kyle-768x297.png 768w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/p>\n<h2 id=\"kavi\">Kavi Duvvoori\u2019s Most Grammatical Grammar<\/h2>\n<p>Kavi joined the editorial collective of <em>Taper<\/em> for this issue (#12) and has really put their shoulder to the wheel! They (like Jhave &amp; Kyle) have been producing serious computer-generated texts and adjacent projects, of course with particular twists. Their grammar uses story elements (hero, villain) and does tell a story \u2014 but one about grammars.<\/p>\n<pre>story>theory+.|theory+. +coda+.\ntheory>A +academic+ +critiqued+ +hero+, +noting+ +villain+ IS +really+ A +metaphor+|+villain+ WAS +endorsed+ BY A +academic+ WITH +hero+ USED AS A +vessel+ TO CATCH THE +metaphor|+villain+ IS ITSELF +really+ +surface+, ESPECIALLY +hero+|+hero+ BY A +academic+ IS +villain+ THAT DESCRIBES, FINALLY, THE +metaphor+\ncoda>+villain+ +ofthis+ IS THE +metaphor+ PUT IN A +vessel+ BY +hero+reversal+|+villain+ +ofthis+ IS +hero+reversal+\nofthis>OF THIS STORY|IN OUR TALE|FOR OUR PURPOSES HERE\nreversal> (OR DO I HAVE IT BACKWARDS?)| (WAS IT REALLY THAT +coda+?)|\nresponse>+critiqued+ THE +problem+ IN|+endorsed+\ncritiqued>FOUND A GAP IN|DISPUTED|ELABORATED TO APORIA\nendorsed>REINFORCED|ELABORATED ON|SHOWN TO NOT POSSESS THE ALLEGED +problem+\nacademic>linguist|+specialty+ +linguist+|SOCIOLOGIST OF THE +academic+\nspecialty>COMPUTATIONAL|CRITICAL|CREATIVE|HISTORICAL\nlinguist>POET|LINGUIST|PHILOLOGIST|LITERARY THEORIST\nproblem>LACK OF RIGOUR|IDEALISM|CONTRADICTIONS|PROBLEMS\nnoting>NOTING THAT|SHOWING HOW|FOR\nreally>REALLY|IN FACT|IN TRUTH\nmetaphor>image+ ON +surface|churn+ +metaphor\nimage>SHADOW|REFLECTION|PICTURE\nvessel>NET|SIEVE|DISPLAY CASE\nchurn>SHIFTING|FLOWING|CHURNING\nsurface>A BUILDING'S WALL|A PAGE|SKIN|+churn+ +flow\nflow>CURRENTS|WATER|LEAVES|WIND|MUD\nadj>CHOMSKYAN|PANINIAN|MOSTLY ADELE GOLDBERG-INSPIRED|PRIMARILY IRENE HEIM-DERIVED|MONTAGUE|LAKOFFIAN|CHARLES SANDERS PIERCE-ROOTED\nentity>GRAMMAR|MODEL|LOGIC|FORMALISM\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/nickm.com\/post\/wp-content\/stuff\/Kavi.png\" alt=\"\u201cA FORMALISM IS ITSELF IN TRUTH A PAGE, ESPECIALLY A LAKOFFIAN MODEL.\u201d Plus a grammar.\" width=\"853\" height=\"652\" class=\"alignnone size-full wp-image-5196\" srcset=\"https:\/\/nickm.com\/post\/wp-content\/stuff\/Kavi.png 853w, https:\/\/nickm.com\/post\/wp-content\/stuff\/Kavi-300x229.png 300w, https:\/\/nickm.com\/post\/wp-content\/stuff\/Kavi-768x587.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Taper, an online literary magazine published twice yearly, is now in its 12th issue. An independent editorial collective (Kyle Booten, Angela Chang, Kavi Duvvoori, Leonardo Flores, Helen Shewolfe Tseng, and Andy Wallace, for this issue) makes all the decisions about selections, themes for forthcoming issues, and so on, and also handles all communication with authors. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/nickm.com\/post\/2024\/05\/grams-fairy-tales-manual-grimoire\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Gram\u2019s Fairy Tales: Manual &#038; Grimoire&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[59,21,17,40,15,30,42,13],"class_list":["post-5167","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-computational-art","tag-constraint","tag-digital","tag-fiction","tag-programming","tag-story-generation","tag-web","tag-writing"],"_links":{"self":[{"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/posts\/5167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/comments?post=5167"}],"version-history":[{"count":36,"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/posts\/5167\/revisions"}],"predecessor-version":[{"id":5211,"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/posts\/5167\/revisions\/5211"}],"wp:attachment":[{"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/media?parent=5167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/categories?post=5167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/tags?post=5167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}