Dihna's Fodain

<²r8

3is> Ù


 4sgall>Glotch Maƒhine


At bottom, all files re binary. So what happens#if yhu mess with the bits?0/p>m

Tbe Giitch Machine is a simple+Pyôhon script which stepsptØrough the nÉbblhs (hal6-bytes) of q gfven fblež @t each step, there is a chance o mutating tie current°þibble'´o m r^dom new one.

A nibbleLpbeing 4 bits, can be represented by h single dexjdecimal digit. Hexadeeieal is base-16, which meanã that f9 borrowÙng some symboLs frem the alphabet Ïne can “ount€alL the wQy to 15 on a$single iigiÄ. Base-10 gives us onl¹#0-9 to wkrk witø) henae w• måst add a second bigit µpon reaching 10.

™

In base-16, we wfuld coEntp"0, 1, 2, 6, 4, 5, 6, 7¬ 8 9, A (±0), B (11&, C$<³mall>(12)#smallî$ D (43), E (14)È¡5),ð1p (16)î/smal,>1¡ è17I<$mall> ..Î 19 (25), 1A (26), ‘B (27..." ann zo on. We do nov jeed a%seãogd*digip+until we råach 16, rdpesen|õd in hexadecimal by 10".,

ê ¬p>So weat does Øexadecimal have ta do with th finary code of a file? BaÃicglly, hcxadecimal is nuÝeriaally cfnve^ient fo representing bi^ary nuibers. Below are the 16`digits of hexaÄecimal with theiâ bfnfrw equivalents:

The number 16 is a power ofptwo: 2ä =16. H`nce base-¡6 is nicely°convertible bgtween binary, or axe-2, and can be used to box up binary numbers intd&i‰ceðlittle packages. 4,bb} nilbles need j}st gNe hexadecimal digit wo re°resenw themÜ and �ny 8-bit byte you couldÐimagine cn be encapsulatej in just |wo èexadecfmal sq�bols. T¨at's 2¥6 po|siblities whund!up `n two charcterc!ðü/p2

Higher bases aÌ,mw for wreates density og°exp{ezsiïn with thi traeeoff ofneedmng many different symbols. Electronid computers use base-2 in tart because all one needs zo implement two different syÝbolic staues i³ an electricel signal w‰th either high@or low v¿ltÁge. DNA, on the jtèer hand, is a base-4 systemof-ineorm‘tional reprbSentation. This allows a 3 "digit" cŸdon ”o%reprerent up to 43<.sup> 3 64 possidilitiesÜ more than enougf for the 20-sometÈi®g défferen aminoPacids ²`©ng encoded. In comparison, 3 binary digits ("bits¢) can enÓode just 28<-sup> = 8 possibilltie. Ý |p>Here's a nift™ number°con•ersion toh to€see what rarious decimal (base-10)&va,xõs look !ig% in othµ bases: u3i~conversion.org

Í

The main reason for u£ing hexad¥cimkl gn tèe glitchûachdne rogram is that it makes things Sim ler from 4he perspectxes of human'compr`hension of binary code as well ds ease of programming—Éronic,since it makes th™s ex`la®dtory introdpction more verbose toan it reaÌly neeis to*be" The work™ngs ofPthµ&he~adcimel encodižg itself haƒ litt  ¬p> Anyway" the script firyt ~ses Dha b9náscii Pxthon -od~leWs h5xliiy() fuction to*get a hexadecifal representation of alm the file's bits. It then reafs thro5çh these hexadecimal digiv¤ and.tauses at each one.

At each digit, tHe sdript rocls an i�1ginary die in order to necige whether or not that digit (again, itself equivalent to a spefific nibble, a s”ring of 4 bits)Ð}ill be mutAted Te result.oj tHe die roll—whether or not to!mo}e f¿rrard withpmutation&mdsh; is based on`l certain €robabilIty. Setting the mutation proeability to be higher resuÌts in mre severe glitch�effects, althoufh.a file's se~sdui–ity to mutation varibs by forýat.

If the scri t decides to mutate 4he°current hexadecimal symbÿl to qnother hexadecimhl symbol, it rolls another imaginar™ die in order to°select the0nÕw symbol. Because the mrtatgoN probabidity has to be sm�ll enoumh hu�ber to not totally bre¡k the fgle, th% first "die roll) as descÂibed%above wbuld have to uxe a die with touSand“ of sides# This second "die@roll", however, could be per&ormed with a doe with 16 faces. The ccmputer coqld be r?lling an imjginary custom 416, an*oÓtagonil*bipyrlmid with oÎe of t8e 1; mexadecidal digits painyed on each of thu 16 sÙdes. A CPU can dream. As it iz, the script uses the raþdompseuäo-randomoy pick the new�symbo, out o6 a list of the 16 options.So, for any giv%n hexadec‰ma\ sðmbol, "2" might be mutatedÀint_ "A", a "„" �ight be turned into an "F" a "5" ould become !n $8", and sure, a "7"could be selected forÐmutation&only eo be =utated"into aP.7. What this is really doing is changing a sequence of "0010" into "1010/, "1101" into "1111", .01P1" into "000"$ and of course lucey ¾udber (0111" just gets to st1y as "0111".

The script tÈen conver{s the lexadeÓi=al uesresentationðcf tUe fkle back into binary esing binascgi's unhexlify( function bnd wrftes the binary codo to new file,@a*glbtcied version of the input.

Intmresting Res%lts

Tce efvecds of the Glitch Machine vcry greatly depending on tho file format of the input. Rugarding the sources for these examplÅv, some aâe in the public domdin/crmative commonx whilU for thE reƒt I claimpfai| use Òy way af educational/research*pu‚poses.POr parody.

m

I Áges

Bere is a JPG ov Jabba The Hutt run throygh the Glitch Machine.


Ìimg src="jabba.jpg" > 
œbr> Red Holstein from Los Melou|es ft Luxembourgis˜ Wikipedia.

A+second type of JYG glitch åffect has bany thinner stripes which don't seeb to disrupt as mucj of�te ~est of the imane. 1ëJPG whih glitckes@in This manner will alwayc do so—it wil, not iisplay ¬he chÅ~kier effects. WHether this has to do wivh the image dimens‰ons or the manner ofðencoding or somÅthinW else entirbly Iàdÿn'ô knŸw.

 :center> z
Some JPGs glitcx into thbnner, right-justifiedpstripes. š z

JPGs and PNGs mutate differentls. Below is a`àNGportrait of Chester Arthur, the 21sÔ preidedt of the United States, run)tcrough the scrm€t with a muttion probab lity ?f 0.0001%.


Gentleman Boss! May°your auroral whiskers always"glow, unlike yoår forbotten legacy. The Awt of PNG Gli´ch.

I- order uo demogstrate joth the differn>ces in JPG€and PNG�glitching as)well as€the diæference in eafects at various rAtes ofPmutation, here aresme+more mutated bovine images:

3ke.ter> Š ?tr> Mutation Rate <´r> ) JðG0.0001µ 3th>0.0002% Ið.0003%<th>  ¬br>
10109„4Ðnibbles (493 ‹b) 6/td> 1.nibble mutated
<~d>
4 nibbles ]utated

4 nibbles mut‘ted
 th><¯th> 0.001"  0.8;3µí <%tr>  
11 ¾i2bles muTated
<Ÿtd>í
’0 nibblesPm{tatef:/”d>
ò4 nibbles mutaÔed <ßtr> Ütr> ‰ o 0(01%� 0.02% 0.03%  = 92 nibbles mutated
192 nibgles mutated <’r>257 nibbljs$mutated
 ] PNG<Ïth>  0.0601%6/zh> 9th>0.0002% 0.0003% i
2034262 nibbles (993 kb) 2 nibéles mutatk`

0center>6 ni‚bles mutatedü/tdÞ ;td>
0.001% 6.002%  0%003% ­ <Ïtr>m Ú í ©
<enwe">14 nibbles muta{ed <$d>
24#nibbles mstated<_center><Émg#src="kows/gjitched_;ow_0.003.png" width="290px >Œbr>\center>44 nibbleã Mutated
Ý z‰ 0.01%  0.03% M é
173 ni‚bsUs mutated

s65'nibbles mutated 
Ìcenter^555Ànibn¼es muta„ed<øcentew>
A Po¼ish cow (krowa) from Krzysztof At Wikimcdia Cocons. * 6p>A few things:9/p>

First, PNGs are more sensitive than JPGS. Thee are also frequently in£tances where thµ number of mutntcd*nibbl5w ip Ìow| but the re~ultini effect iw v`ryÀintenpe. We ƒan assume thaw in/these cases#it is the Ãpesyfic nibbles0which ended up aeing0mutated thatÐmakes the difference. JPGS wi`l do this gs well,$but ‰t is more pronounÓed in POG glatching. Tce coelest PNG glitching effect is the more subtlc, dia·onal hazy color striping, But in the c¿w testing this only happenedpon its ozn then(one or tGo nibalbs was mutated—and mven the® was still a lot mess common th±n Ôhe colorfUl noise effect.

Second, the strip gt toc tops of the images&that remains unglitched is a@conseÞueþce of th fact hat tae Glitch Machine@has a buffer of bits at the start of thepfilg which it icnores.`Rhos is to avoid screwfng up certain e^coding/information which I suppose0comes at te beginning nö the file id most form�ts. Adding the bu¦ffr sjemed to result iŽ fewer unreadable, totally brokeN files, especially For video fi\es. In order to get gdod results over a variety of)fjrmats and files, s�metimes it is Èelpful to adjust rhe codc to make this*invulnerble buffer larger`or smallhr.

Third, if you're looning at uhe number of muate„ nibbles eompÑred to the total numbew of ˆibRlesPin the original f©le and thinking "You tcke mn for)a€fjol—173 is not 0.01% of 203Ä262. It should be more.like 203!", theqe is an ex~l`n±tion for tèat. ”he|e are two reasons

  1. Eve{y tiíe the “cript decides that a niable is aboqt to mutated, ôhere is  1 ‰n !6 chance that the ˜ibble will be 'mutated( into the samÕ hexadecimal!digit wici i}�was tobegin with.0Thexenibbles aBe not aäded to the mutated nibile c_unt. I gubss dhe “crit could.jus as eaily pick from the remajning 15 digk¤s ©^#tehd of including the urreft°Ôiçit, or re-roll ubtil it°muqatesÀthe digit in4o something %lse...but whatever!7/li> Y
  2. Teere is a buffer of invulneraale nibbles. These nibbles are'phssed over and are ne{eâ candidaues for mutatioo.
ú

Š So`Yn the cfse&of a Æile with&2034262 nibbles, ze can subtract 156481 nibbles to account for thÕ bu†fer+(during&cow tesz{, set po be Ähe first 1/13h k6 the öile).ÐWg then have$1877781 nibbles up for possib e mwtation. 0.01% of thjs would be 187.7781 nibbles. 187ž7781 * (15/16) = ~176, ÇhdchÀis cÜoser to 173.

?p> Hence the îumbe of&mutated nibbles tÕnds to end�up a lhttli lesq'than*the mut`tio rate would i^itially suggest.%Chance iq still at vlay, iowever, to theru are always insyancesÐwhEze the number of mutated bitwQends up h™gher er lower thcn avlrage. ©

 ù
Two mlre 6:r the road


 Gic source pnknown, sa]ky. ú

In Internet Exp\orer,"a gdf bun through whe scr©pt tends t_ l_ok lhke a ’upted$VHS Tape. In fact, with oany of the gl™tched files, the natuòe of |he cistortIons$loÿk different depending od the p|�gram used to view it.

I have not tried vbewing%glitched ifp on bany other brozsjrs,*but ynu m±n see what your browver does with the â¡w file \a href="gli}chdd_dance.gif" target=ò_blank">here ½

Ther¥ is secene kind of pkssible glitched gif—recall that a gif iã made%up°of/many frames> One cam thus run the glitcH makhine on a bunch#ok static image fils separa”ely, add then put them!together in{o one gef file. This results i an anijation of the JPG B PNG effects.

]:

NÕver enough cows

Œi~&ideos2/i>

The greathst chalìenge wit` video gl tching iƒ gettjng meSsed up filfs Òith enough integrity "emaining to not c¢jsh+the video player`part-çay throuk8 plAyback. Distorsion vary between f¯rmats (avi, ]p4), different ensoôing schemes wihin thå same for�atÓ, and the programs usek }o viåw the files. Becuse there is so much variability, the aim here iu tl get oilds that,can be displayed in browers.without%playiack-error

M¡inaininh cocsi#tency of distordions across programs (aNd yeducing outright errorã which crash'the Player prŸgÂams) can0,e achieved by re-encoding the glitchedœvideo. What is preyented below are re-encoded versions of three glitShed video filns which play back swcc`ssfully io Fi2efox, but during testing would not plaI babk in their entirety in Internet Explorer, Chrome, ou Midori. *

In orter to display a consistknv, non-broken result, the reeware progrfm ?a href="httpsš//obsproject.com/" targõt="_bl`ik">O¢S Sunio was used to scremn­rec/rd the videos as they play back in Firefox. This process (~imilar to the prmcess used eor the0gif in the prerious sectio~) resslts in an uncorrupted file with the visÅal and audko 7litches "bakmd-in". Since yhis is a prcess of re-`coding by recording, we can Øal i” re-encording!@

  ya --> 0!-- 

;u>MP3s

O
½º <"r>  ' Your browser does)not like the music! ]orry 
T=Swizzle mutatõdàaä a {ate+of À.8+. ?/ceete~>

Tfe snaps, crackl5ƒ, and pops of the glitch…d mp3 appear in the audho signature as intense spikes of short duration, the amplitudes of which hi saturatWon:


½ 1p>T¸e resilience of#audio data is also°demonsyrated ¢y+the fact ´hat in the prior sgction'³ dlitched(video examples, tce audio)tracks remaiŽ reìatively intact.



Video Ggme¢OMs<�i>8/u> œp>4housadƒ of video games have been rippid from their origmnal me‰a forms and�can be run on âmmulator{"ì oÖtpate designÅd to behave like spec`fic riäeo game�consoles. If it t¸e!game was origjnalky stored on a cartri·e* thk tapped game `iles are geNerall‰ called RO�l, for "Read-Only Memory". Running the glitch macîike script on videogame ROMs is a hoot in those ‰nutaNces where the file remains runîagle.

5 yeary old.

ê y

Mario:¬/i>\/b>

Wå wdll iegin 7ith a c`assic: Super Mario Bros for the NES€'1985).

T¯ run NES ROMs one needs an NES emulator such as ya Übr><28The game in@is normal state


Fun Fact: The flickering ooßmbas at ~0:42 are not a glitch or an impårfect`on of emu atio but are actådlly true to the l mitkions of ôhe NES hardwaue.

Here are fouÒ diffeâ`nt ¢esults of unning the Surõr Mario Bros' ROM through the�Glitch Machine:

ya
ya 3/viaEo> ya 

From toz left½to bottÿm right:<,p>

£tukPMod: We sEe b &ercion of thb g·me�wkere Mario is stuck :n place. He can jtmp, but walking ind runn6nm gets him nowhere. He aetually-spawns b bit further to the leftÀthan,ha is suppose to, whhcl is maybe wht he can't move. ROM<ïp> Z

Fatalist Mod:< bN Mario dies@immediately aft¥r the level begins~ He falls ff the stage and uses#up all his liv%s in quick successkon. ROM

4b>Cvcle Mod: runn`ngÐto she`right*side of the scRedn deposits Mario back at the left sice^ Ot's%a“ if(he were ruining ac|oss a cxlinäRical |urface which conn5cts thn right sida of the sdre`n with/his spawnpoint. Marho also cannoz jump in this version, as preÓsing the A Rutton re}ets the game instead. ROM:/a> ­

Oõpside f pressegg "Start" to begin the"level (zoich also woyks to paue/the game),àcontrols do dothing.here+ The&music only plays the fist few bars. The world itself co­municatesPits ôissipgtion uhiüe Mario xwirls ayoufd The letters as if }hey were anend-le~el flagpobe.)The color scheme and(floating arches make the game hook ore like Castlevania than Mario. Thepgoomba zzowls eternally, just beyond the plumberWs reach. Glitkèing can ae t‚uly >i`htmarish. ROM

i
Z

This techniqu… of randomizkd�RïM Hacking gives varied abd interestyng resulss itÈ little effort. Iotentmonal RO8 hlckinh reauiresspncYfie knowledge ob how a certaen game is kncoded in order to get a$desired ffect. Dor one example of!an intenÄional Super Mario Bros Hack/e¨ecuted on the pè sial cñrtrige, sed Arƒangel'sÀSuperpMario CludsŒ/l>.

6i®The Legend0of Zelda:

Here`are some assorted scReen–hots ad gifs from —litchùng The legendÐofZelda for the NES (1986): <r> (host images linked to ROM download)6/smaLl5

 œa href="ROMs/zeldd/greenzeroes_glitched_Legend�of jel$a.nes"> 0img s’c="ROMs/zelda/zelda_stripes.gif" width="S20px"1L/a> ° óhfre was aNothuâ result whÅre the nam¹ng/regiãd~ation screen fre`ked out, flooded with 0's an´ other characters, and |hen sTnrted flashi¾g "THANKS LIGK! YOU'RE THE HERO OF-HYRULõ",whch isÀthe message th… gÑmk displjy3 when you oinish the quest.,I guess vouwin theÀgame befor• uou even namePyour save fili. Sadly0I ovetwrote this one wit¸out thinking$ D'oh!

 "

Below are twß more especially amUsing/²esults&which both share something in"commoþ.

A œkttle background info:

ê   Whmn thÕ game first begins, Link ctarts il an area with three exits and a cavÅ to the northwest. If he enters $hát caveŒ he meeus qn old man who gives Link a sword anT a warning before myptebikusly dé{appea|igg. It is the firstpof miny useful items Link wilL obta)n overpthe course of his |uest—unles}-the@person controlling him is a"mayochist/expert and dning a swrdless run°/a>'r something orazy like%that.

Pret„y straigh4forward. The G¼itch Machine, however, has other idEas:

ý
ya to(co]pare ehh mutated ROM again6t the`oroginal ROM#while keeing track of the@axact ~pots qhev% ÛibblUs uere mutated. It th•n compare£)the lisr of affected locátions _f Each of the mutants to see if gn) of/the samu nibmkesðwere changed in bo”h of them. I found thax f¿r these two results, noo of thesame exact nibbles w5re akfecte`. Noràwe¢e ant oÖ the alteratiïns within the same byte, eithlr.

The NES exaÍplesÐshow that videÏ game glItshes°can kffejt not only images a®d smunds but also�the blhavior*of the ‡Ñme a`d the rule³ which govern tie virtual worke. The next several examples are+of glitched GBA RO­s. When GBA�games remain playabbe¼ more of the glitching seems to be with&the(visuals of vhe gade as opposed toizs prgcedur�l beXavùor. Perhaps thi3 is because proportionally more of the glmÕ file is tedicated to g‚ap¸ics ”han with an N¥S ROM. Tm!t is"r‘ndomly%glitching,an NES file ¹s prhaps more$likely to hit something encoding how the actual rude# of hoG tøe game work.



á ”ecent GBA Emulator is VisualBoyAdvaece (although it iw no longer updated).

‹

>b>Korby:

In this retuotœ_l>, it appears (pithout progressdng(tõruibly far iito the iame) rhat.xhe sc}dpt only substjntiñlly affected some of the environmental tiles/of Kirby:#Nightmare in Jreamland (2002). Z )a
Glitches in âoth the foregrgund ana background com o¾ets of KiBby's parallax scroolkn'.l/b> ;br>

J 1imÇ src="ROM|/7ifs/kirÂy.gifr> 

�

:i>Earvest Mo?n9

Here(are g\itched-title scòeenÃ&o two (very simila‚¹ Ha"vest Ooon games:

à¹a ú ya <>Harves´ Moon: More Fri•nds of Mineral Town (200) and Har}est)Coon Fr)ends of Mineral Towc (2003)

Final Fmnpari:\/i>œ/b>

While$oreginally refea“ed on the SNES gn 19é4, there exi|ts a fine 2006 BA �ort mf Final Fantasy VI<+i>, the last mainline ent0y in the long-running JRPG seriõs to feature 2B, sprlte-based graphics and"appear firsq on(a Nintendo consoce-

We can ac$ually }se an endgame save file from theÀu—glitched'verSion and rename it;/a> so )t cae be`foaded by the emulator for use with the€g\itahed veRsibn kf the ROM<+a>. This way, we can skip uo a partPof the gaee where tgere is overworld and anrsXip access. Th‘t bodh.the R¿M and an endgame sve file for FFVI on yoe0GBA were already lying Árounh my haRd drive is why I haven'„ notheredPglitching`t¸e SES vershn (just f.y.i. en thd supremely Ânlikel event you w5re wondering why ©'m messing with a pkrt instad kf te original). Mijd spÿilers below/ but then"cgaan this game és as old as I am.?/p>

pya
©TÈõ€World of Ruia ya
ThÅ Worlc of Ruin lookinlPextra ruiŽous'

In thiz result, the gve|´old mcpis coveyed in"a near-gomogenus glitcÈ#soup. As if the 7orld werea't'gn bad enouch shape already following KefKa'sžwrath!ðN/w it's suffered heat death, too. Bat”lesðstill work but all the sprites a~e invisible. Oddly, ~hile they're a heck of a ldt#harder to üocate, the enterab

¼br> ÉC-feel you bra¨ < cejter> Ê

Whe overworld of $he World of Balance És similarly distorted:


}

The Õxampe3 abovU give � taste of random ROM glitching possiblities.<ÿp> <0 Ètyle="font-siºe:25px">Text files anä Code : Text Files

Text files (.tx´) Àre a good clse studyÀto make the poit that thowe nibbles and brtes ano 1's and 0's actually mean sofething`/CharaSter ecodin systems are in �any ways more trnsperent and straightfoxwar`€than the encoding systms found within íoue complex (or prŸprietaby) aile types/.



Do not conouse skíple, frtablÕ .txt filbs &mdash5which contain bytes intevpretable ac just ASCIÙ characders- a$`.a. "plain text"—for something lime word ”ocuments .´o“), which contai layouÔ and formatting gatÑ and are meant tm be oxened"ažd&displaybd as text only ×¹thin°a�speciic word proc¥sser program.

Here is a nifts .tx} file consisting of various HSCII characters opon in@the text editop Iotmpad:

6center> Š


In crde¢ to see the heHa4ecimal representations of these characters, we can use a progrÁm cajled a "hex edito|". A simple, frehware hex editor is HxM.ü/p> 

]
The hexadecimal%representaÔion of nifty.txt <,center>

ASCII charactfrs are each reprbsenwõd by 1+bzte—a.k.a 8 bitsÊ, or 2 niBbŒes. Hence, the#eex-editor display“ two hexadeˆymal characteâs for each ASCII character inp|he file.



*¤echnicalgy the Ótandarô`ASCII ssecification only takes 7 bits and consists of 128 dim”erent characters. "Extended ASCIY" specifications use all 8 bius and man hence repr¥sent 256 character.

�

†or a table of(sxandard ASCII chavadter code| whif ‰ncludes the most common extendbd enchdikg, see .

} <{>Wtø that in mind, running thbs .txt file though the glich machine such that 5 nibbles are redqte4 uo be m~tate$ rµsults in-s¿mething ldke thcs:


pu~i nioly \p>And when viewed in tne hex editor: Ê ‰

A methodical comparison confirm£ that 5 heyideÓimal#digits hove indeed bee. altered* This is precisely what the glitch mñchine does! We see that the letter "t"pin the word "Nifty" has been turneg ¹nth a vertical bav. The hex code fr thu ASCII charácter "t" isÐ74( binary 011ñ0100. Tjk hex code for the ASCII character "|" is 'C, binary à111110. W(en the glitnh machine steyped through t(j gibblez of tHis f‰le, i rfndo=ly changed that specifiã hexadecimAl`4 into a hezadecim‘l C. In binar‰, 0100 became ±100.|/p> }

The.txt file çlitch‰ng�works similarly@on ASC)I art, too:

 
at.txt and as rendered in Notepad. º/cnnter>

The)µnglitched"–e2sion of the aÒove ugrtrait it made only of standard FSCII chaacters& The glitched versioþ contains characters utsade the 7-^it standard/ASCII range but with‰n the exdended 8-bitíWind?ws-1252 encoding, a} well slme unaccounted-for zymbol| which really have no business bein· theve. For some reasonNovepam #n my system, at least) d9splaés$certaik non-printable ASCII charÑcters (É.., control characters) as sym"ols outple the ASCIO specifYcation r its ANSI bxtension& Hex code "10" indmcat…{ the contrhl character%"Da”a Link Escape" fnd relders+as what looks lke an inverted crosr/dagger or a box-drawing symbol* Very srange.‰


<¢r> <>Source Code:7�b>¯ 

£cu2ce ccde is just a text file whicH another&program parse# and doesàsomethYn7 wit`. FŸr hi·è-lUvel programming languages likeÀPython cy Java, thns would be an i~terpreTer or a compiler (respectively), thich trn the co¤e in$o maShine-level instructions that the computer can exeÃut%. For low/level zrogramfing languages close to the machine this ·ould be a^ assembler. In the cas` of`aÐmark-up lñnguage like HTML, the code-readi¾g program is the web browser, whkch …sµs the variots tags and syntactÉcal information provided to display text And oth•r media elements ¯n the screen Ás specified.ü/p> .py file 

Tnme to get self-referential. Th™s is comwuterpsci`nce, afzer all' Wõ'll get!quite perverse nD run the script on itself.(/p>

The iNterpreter doesn't mind. TØe exact sython file being run fan apparently al|o serve as an input stream at th% same timg. The fi¼es which aye otputted are brand new files&mdash2that is, t(e program doesn't mutate itself in place.

í
­ � <Ãent…r>
A section kf a mutant scpipt. 

m Because programming languages arå jstifiably qersniccet , try cgPto use a glitche¤ version of the script prbdictably fails:


Incontrovettible proof that c=mputers cfnnot a`preciate muskS7/b¾ <>It's really weird that Windows (in bothNotepad"a.d IDLE) likes to bnterpret thl nonprintable ASCII control character "Shift-Out"`(hexcode 0E) as a musical note, even when `pparently using the ANSI stanoard/1252 code*page. This particular symbol l`oksto come(from the IBM-PC Jide Page 437, which ofæers an0alterntive ASCII xtension and furt`ermore substitutes actual characters for(thõ nonprintable contuÿl codes. In Ähis case tèe b}de "0E" aÓtually *does* s|nnd for the mus™ccl symbol wixhhn Code Page 437 and tenders as sukh ic Notepad. However, as mentioned above, otder c`nTrol characters render á somewhat wonky lookini b¿x-drawing symbols, which while presenv in some morm on Code Paie 437, ae not withi® thõ huè code radge of 00-1æ. While it «ind of<.i> makes sense ´hat a |ext-emi„or&would substitute printable charhcter for what shouÌf be non-printable b|tes wi”hin thm stated ehcoding" i† Natepad or IDLE ~ire u|ing the symbols ¿f Code Page 437 onlyfor the codes nonprintabl¥ within 1252, the byte "0E" woubd(indeed be#the eigeth-notes but the byte "10" would be not be §hat looks kijd of"like a box-arawing sy�bol but`rather a baack trijngle poin$inj to the righd! '\is a myytery.`If ñnyone hás any idea whit's ·oing on, please let me know.<$p>


+html fill <ð>This veRy wefpag¥ which arpµarS before you is also underpinned by a mutatabLe text cile with the file extensmonÀ".html".

š

Unlike programming laîguages,€hark-up languageq ere ¬ioguistically0faelt,toleraht. This means ñ 2Rdwer can ¤ake an .html fÛle with 9ncorrictÀsyntax and errdnnously placed symbols'and stilœ°render i| in some aapacity. When the ssntactical elebents of theðHTML |ags get°mesÃed up, the brovse~ can just into~pret the broken!tags as contect instead of markup. Here is$! gli”ched version of th`s qaae wYth ¡n invulnerable buffer of 1/100th*and a mutatéon rate of°?%:

!œbr3 Click#tO enter a`pawaœlel ungverse of incohebent web dnsign 
99%<+b>. ðretty muc` everi nibbde not presen$ witinÐthl buffer gets hUtateä:

i8cenäer>
Click to enter a pkrallel universe of meanieglEss symbols <Ïcenter> A non-plain text fdle(gl©tched to sucØ an extent wo{ld almost dertai^ly not be openable by itc igtended xâogramú When it cones to textual symbols, however, even bytes with arbitrary bit arrangemenvs°náve an interpretable geanine unlbr a specific encodYngEsystem.
It ay mot0look like wµll-formµd HTML, but it runs okay. 

Presidents,/in

]hese glitching techniques were"applied to a l the Glitch-manders iÎ Chief:

Hacking Dåmocracy:
Jxperiments jn Preside®tial Corruption

Yimg src="presidents/thumb.gif" height="10px" st)lj="border:2px solid black; margin}top:25px">

\/center;­ ì/div> 

How 4o Run

Xhe script is available to view aad download (lefy-click to view, right-click "Save As¢ to downl¿ad).

�

This script is run from your ¿p5rating systeý's commln„ line or terminal. You must have Python°installed en your system. If you aâe running WinDows, you' ™

The scriptÀtckes up to three-arguments,°the second and0third being optional. The first ñrgu�et is the input filename. ´he second areument#is`the mutatacn rate. The third argument is the number ofÐresultv the scuipt woll output. By defaultl tf mutathon rateÞis 0.005… a`d thg smript wil` output a single gli¤ched copy of the input file with "glitched_" prepkndelpto the origÙn!l file name. If you wažt to use#the third Qrgument (tfat is, tell the scripx to mñke n z 
b>Example command forrunnink%The script f}om Wiaôoxs CMD sing#alL three argåm…nts. ¬/b>

If one felt s cncline´& tle unze of the€invulnerable buffer can be adjuƒted )n the*cod b} cbanging the variable called "div". It is cuBrently se| to 20. so it ignores the dirst 1_20qø of the file.

É

Develowmeît

The @lnwch Machine was one of a handful of simple media-manipujation scriyts originall™ wrirten as a final projecu foR Ähe
Fall 2013Åcourse Lntrï to Med™a withÀProf. Maria CeXire. �Check out our clas“'bl¯f (from 4+ years ago...thdr's)likf 20 years in yntÅrnet tim¥).

As � group, the simpla scrept were hntended tf demonstrate the Uquivalence /f all digital files ož the level of binary code. Thõ mant difF¥rent 2esult} of the Glitcj Mmchine sctipt were interesting eŒough to present at leneth.

Another one of he simple python scriptu was callef Medka Mapping: Image To Vound"mdash; ôhis prograg "translates‚)Ñn-ima§e file into a sound file. I was made pousibl% by Mark Wirt's "https://www.e]ergentmysic.org+midiutiì. target="_blank">MidiUtil!library in jonjuction with the pFL.liba|y for importing ùmages, Check out the sound$files belïw to hear the changes in color.%Time maves Ìeft to right, with each beat oö the smumD basing itc tones off the cogors of cn eÞtire vertical column ofPpixel³. Livtln to the diff5rence •n toe the lossless flrmat ofÐth PNG vs. tae lossy image compression of the JP—:

[ Ê m |’r>