
/g,">").replace(/"/g,""").replace(/'/g,"'")}let l={},c=[];function s(e,t,n){l={...l,dynamic:e,core:t,leinProject:n}}function m(){c=["wh","with-style"]}window.onload=()=>{let{dynamic:e,core:n,leinProject:i}=l;if(e&&(document.getElementById("code-dynamic").innerHTML=a(e)),n&&(document.getElementById("code-core").innerHTML=a(n)),i&&(document.getElementById("code-lein-project").innerHTML=a(i)),c){let e={wh:';; Copyright (c) 2016 Tyler Hobbs\n;; MIT License\n;; https://github.com/thobbs/genartlib/\n(defn h\n "Returns a given percentage of the height Quil-specific."\n ([] (h 1.0))\n ([percentage] (* (height) percentage)))\n\n;; Copyright (c) 2016 Tyler Hobbs\n;; MIT License\n;; https://github.com/thobbs/genartlib/\n(defn w\n "Returns a given percentage of the width. Quil-specific."\n ([] (w 1.0))\n ([percentage] (* (width) percentage)))\n',"with-style":"(defmacro with-style [& body]\n `(do\n (q/push-style)\n (try\n ~@body\n (finally (q/pop-style)))))\n"},t=c.map(t=>e[t]).join("\n");document.getElementById("code-helpers").innerHTML=a(t)}t(r).addPlugin((0,p.number)()),t(r).highlightAll()}}),o("d3dEA");var a=o("erCPG"),l=o("2tEiH"),c=o("gUHNU");window.onload=()=>{document.getElementById("code").innerHTML=(0,c.escapeHtml)('#! /usr/bin/env bash\nset -eo pipefail\n\ntmp_dir=$(mktemp -d)\n\n# This is the function that does the actual work. It first converts the supplied file to a bmp\n# format, which allows for manipulation of the image as raw data. Then some audio and viusual\n# effects are applied, storing the intermediate images. Finally, the image is converted to a\n# JPEG.\n#\n# The SoX commands and this technique was taken from the following blog by Mary Knize,\n# https://mary.codes/blog/art/glitch_art_with_sox_imagemagick_and_vim/\nprocess_one () {\n echo "Processing ${1}"\n convert "${1}" "${tmp_dir}/00.bmp"\n\n sox -t ul -c 1 -r 48k "${tmp_dir}/00.bmp" -t ul "${tmp_dir}/01.bmp" trim 0 100s : echo 0.4 0.8 "${i}" 0.9\n sox -t ul -c 1 -r 48k "${tmp_dir}/01.bmp" -t ul "${tmp_dir}/02.bmp" trim 0 100s : phaser 0.3 0.9 1 0.7 0.5 -t\n convert "${tmp_dir}/04.bmp" -posterize 17 "${tmp_dir}/05.bmp"\n sox -t ul -c 1 -r 48k "${tmp_dir}/00.bmp" -t ul "${tmp_dir}/01.bmp" trim 0 100s : echo 0.4 0.8 "${i}" 0.9\n sox -t ul -c 1 -r 48k "${tmp_dir}/03.bmp" -t ul "${tmp_dir}/04.bmp" trim 0 100s : flanger 0 2 0 $($i / 4)\n convert "${tmp_dir}/05.bmp" "${tmp_dir}/output.jpg"\n}\n\nmkdir -p output/tmp\n\n# Iterate over the image sequence in the supplied directory. This is because I will datamosh\n# each frame in one of my previous artworks, which are always numbered "1.png" to "300.png".\nfor i in {1..300}\ndo\n fpath="${1}/${i}.png"\n process_one "${fpath}" $i\n mv "${tmp_dir}/output.jpg" "output/tmp/${i}.jpg"\ndone\n\n# Finally, stitch together an output video.\nffmpeg -i "output/tmp/%d.jpg" -vcodec libx264 -crf 24 -s 720x720 -pix_fmt yuv420p temp.mp4\n'),t(a).addPlugin((0,l.number)()),t(a).highlightAll()};
script.sh