From db4eac1d003b0db9c9c8da580edf791aeb23f7af Mon Sep 17 00:00:00 2001 From: ugrnm Date: Tue, 21 Mar 2017 19:32:35 +0000 Subject: [PATCH 01/61] gitignore + hostname --- .gitignore | 6 ++++++ etc/hostname | 1 + 2 files changed, 7 insertions(+) create mode 100644 .gitignore create mode 100644 etc/hostname diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2950916 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/* +!/etc +/etc/* +!/etc/hostname +!/etc/nginx/sites-available/ +!.gitignore diff --git a/etc/hostname b/etc/hostname new file mode 100644 index 0000000..72cc4b7 --- /dev/null +++ b/etc/hostname @@ -0,0 +1 @@ +TGC3 From 0c71b4be556181e7b05b8204ca8cf64d0f463c4b Mon Sep 17 00:00:00 2001 From: root Date: Tue, 21 Mar 2017 20:42:19 +0100 Subject: [PATCH 02/61] externals and so on and so on --- sbin/thewhispererindarkness.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/thewhispererindarkness.sh b/sbin/thewhispererindarkness.sh index 7b32bd4..40f56bb 100755 --- a/sbin/thewhispererindarkness.sh +++ b/sbin/thewhispererindarkness.sh @@ -6,7 +6,7 @@ FLOPPY="/media/floppy" MAINPY="${FLOPPY}/main.py" PYRUN="python ${MAINPY}" MAINPD="${FLOPPY}/main.pd" -PDRUN="pd -oss -r 48000 -rt -nogui ${MAINPD}" +PDRUN="pd -lib import -path /usr/local/lib/pd-externals/net/ -path /usr/local/lib/pd-externals/osc/ -oss -r 48000 -rt -nogui ${MAINPD}" stdbuf -oL -- udevadm monitor --udev -p ${FD} | while read -r -- STATE _ _ _ _ do From 9f839073dd8a9aef2870a079f69626bf04592bfb Mon Sep 17 00:00:00 2001 From: Michael Murtaugh Date: Tue, 21 Mar 2017 20:46:29 +0100 Subject: [PATCH 03/61] fixed some bugs in picamera conversion --- floppies/franc/main.py | 45 ++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/floppies/franc/main.py b/floppies/franc/main.py index 8102d45..265222f 100644 --- a/floppies/franc/main.py +++ b/floppies/franc/main.py @@ -57,37 +57,32 @@ def send_flow0(img, flow, step=4): # size grid # client.send_message("/franc", m) - flines = np.int32(flines) - cv2.polylines(vis, flines, 0, (0, 40, 255)) # BGR - for (x1, y1), (x2, y2) in flines: - cv2.circle(vis, (x1, y1), 1, (0, 255, 0), -1) - return vis - - flines = np.int32(flines) - cv2.polylines(vis, flines, 0, (0, 40, 255)) # BGR - for (x1, y1), (x2, y2) in flines: - cv2.circle(vis, (x1, y1), 1, (0, 255, 0), -1) - return vis + # flines = np.int32(flines) + # cv2.polylines(vis, flines, 0, (0, 40, 255)) # BGR + # for (x1, y1), (x2, y2) in flines: + # cv2.circle(vis, (x1, y1), 1, (0, 255, 0), -1) + # return vis + + # flines = np.int32(flines) + # cv2.polylines(vis, flines, 0, (0, 40, 255)) # BGR + # for (x1, y1), (x2, y2) in flines: + # cv2.circle(vis, (x1, y1), 1, (0, 255, 0), -1) + # return vis # cv2.rectangle(img, pt1, pt2, color[, thickness[, lineType[, shift]]]) if __name__ == '__main__': - import sys - print help_message - try: fn = sys.argv[1] - except: fn = 0 - - + #data="hello" # client = udp_client.SimpleUDPClient("127.0.0.1", 9001) # connect camera # cam = video.create_capture("0:size=160x120") #canvas size in pixels cam = PiCamera() - framesize = (160, 120) - camera.resolution = framesize - camera.framerate = 32 - rawCapture = PiRGBArray(camera, size=framesize) + framesize = (160, 128) + cam.resolution = framesize + cam.framerate = 32 + rawCapture = PiRGBArray(cam, size=framesize) # allow the camera to warmup time.sleep(0.25) @@ -97,18 +92,20 @@ if __name__ == '__main__': client.connect(('127.0.0.1', 9001)) # first argument is the IP of the host, second argument is the port to use prevgray = None - for frame in camera.capture_continuous(rawCapture, format="bgr", use_video_port=True): + for frame in cam.capture_continuous(rawCapture, format="bgr", use_video_port=True): # while True: # print "GRAB FRAME" img = frame.array # ret, img = cam.read() gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) - flow = cv2.calcOpticalFlowFarneback(prevgray, gray, 0.5, 3, 15, 3, 5, 1.2, 0) + if prevgray != None: + flow = cv2.calcOpticalFlowFarneback(prevgray, gray, 0.5, 3, 15, 3, 5, 1.2, 0) + send_flow0(gray, flow) prevgray = gray # clear the stream in preparation for the next frame rawCapture.truncate(0) - # cv2.imshow('flow', send_flow0(gray, flow)) + # cv2.imshow('flow', ) #ch = 0xFF & cv2.waitKey(5) #if ch == 27: From 152cac68013c109404663b8a078327c45c1d2137 Mon Sep 17 00:00:00 2001 From: ugrnm Date: Tue, 21 Mar 2017 19:46:37 +0000 Subject: [PATCH 04/61] do not ignore the floppies --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2950916..fd801eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,10 @@ /* +!.gitignore + !/etc /etc/* !/etc/hostname !/etc/nginx/sites-available/ -!.gitignore + +!/floppies/ +/floppies/*/ From 4eee12ea6a9786f113e481c3615bcaf841f2024a Mon Sep 17 00:00:00 2001 From: ugrnm Date: Tue, 21 Mar 2017 20:02:15 +0000 Subject: [PATCH 05/61] moving the main script --- .gitignore | 7 +++++++ {sbin => usr/local/sbin}/thewhispererindarkness.sh | 0 2 files changed, 7 insertions(+) rename {sbin => usr/local/sbin}/thewhispererindarkness.sh (100%) diff --git a/.gitignore b/.gitignore index fd801eb..b60c736 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,10 @@ !/floppies/ /floppies/*/ + +!/usr/ +/usr/* +!/usr/local/ +/usr/local/* +!/usr/local/sbin/ +/usr/local/sbin/*/ diff --git a/sbin/thewhispererindarkness.sh b/usr/local/sbin/thewhispererindarkness.sh similarity index 100% rename from sbin/thewhispererindarkness.sh rename to usr/local/sbin/thewhispererindarkness.sh From c42cfe6aef570c3c9fd2ea36d71ee0224b59bfa9 Mon Sep 17 00:00:00 2001 From: Michael Murtaugh Date: Tue, 21 Mar 2017 21:24:12 +0100 Subject: [PATCH 06/61] python msgs to stderr --- floppies/franc/main.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/floppies/franc/main.py b/floppies/franc/main.py index 265222f..9d6f0da 100644 --- a/floppies/franc/main.py +++ b/floppies/franc/main.py @@ -1,7 +1,8 @@ #!/usr/bin/env python +from __future__ import print_function import numpy as np -import cv2, math +import cv2, math, sys # import video from picamera.array import PiRGBArray from picamera import PiCamera @@ -10,7 +11,8 @@ import OSC # from pythonosc import udp_client import time - +# MESSAGES NEED TO GO TO STDERR +print ("1.HELLO FROM PYTHON stderr", file=sys.stderr) # def draw_flow(img, flow, step=4): # size grid # h, w = img.shape[:2] # y, x = np.mgrid[step/2:h:step, step/2:w:step].reshape(2,-1) @@ -45,7 +47,7 @@ def send_flow0(img, flow, step=4): # size grid dy = y2 - y1 m = int(math.sqrt( (dx*dx) + (dy*dy) )) if m>2: - print ("dot", (normx, normy)) + print ("dot", (normx, normy), file=sys.stderr) msg = OSC.OSCMessage() msg.setAddress("/dot") #msg.append(dx) @@ -53,7 +55,11 @@ def send_flow0(img, flow, step=4): # size grid #msg.append(m) msg.append(normx) msg.append(normy) - client.send(msg) + try: + client.send(msg) + except OSC.OSCClientError: + print ("Unable to send OSC", file=sys.stderr) + # client.send_message("/franc", m) @@ -72,12 +78,13 @@ def send_flow0(img, flow, step=4): # size grid # cv2.rectangle(img, pt1, pt2, color[, thickness[, lineType[, shift]]]) if __name__ == '__main__': - + #data="hello" # client = udp_client.SimpleUDPClient("127.0.0.1", 9001) # connect camera # cam = video.create_capture("0:size=160x120") #canvas size in pixels + print ("Starting camera", file=sys.stderr) cam = PiCamera() framesize = (160, 128) cam.resolution = framesize @@ -86,10 +93,17 @@ if __name__ == '__main__': # allow the camera to warmup time.sleep(0.25) + print ("Starting main camera loop", file=sys.stderr) # connect to pd # Init OSC - client = OSC.OSCClient() - client.connect(('127.0.0.1', 9001)) # first argument is the IP of the host, second argument is the port to use + while True: + try: + client = OSC.OSCClient() + client.connect(('127.0.0.1', 9001)) # first argument is the IP of the host, second argument is the port to use + break + except OSC.OSCClientError: + print ("Unable to connect via OSC to pd, trying again in 5", file=sys.stderr) + time.sleep(5) prevgray = None for frame in cam.capture_continuous(rawCapture, format="bgr", use_video_port=True): From 8f467d688892b7aff223030b3c936ef4c8ea8aee Mon Sep 17 00:00:00 2001 From: Michael Murtaugh Date: Tue, 21 Mar 2017 21:30:45 +0100 Subject: [PATCH 07/61] empty canvas at init --- floppies/franc/main.pd | 85 +++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/floppies/franc/main.pd b/floppies/franc/main.pd index 63b9ed9..e9864f9 100644 --- a/floppies/franc/main.pd +++ b/floppies/franc/main.pd @@ -1,16 +1,9 @@ -#N canvas 136 23 897 545 10; -#X floatatom 166 153 5 0 0 0 - - -; -#X floatatom 282 159 5 0 0 0 - - -; -#X obj 54 -92 tgl 15 0 empty empty empty 17 7 0 10 -262130 -1 -1 1 -1; -#X msg 54 -54 \; pd dsp \$1; -#X obj 267 -7 OSC/unpackOSC; -#X obj 267 -46 iemnet/udpreceive 9001; -#X obj 267 33 OSC/routeOSC /dot; +#N canvas 145 161 897 545 10; +#X floatatom 166 153 5 0 0 0 - - -, f 5; +#X floatatom 282 159 5 0 0 0 - - -, f 5; #X obj 190 121 unpack f f; -#N canvas 0 22 450 278 (subpatch) 0; -#X array waveform 11 float 1; -#A 0 -1 -1 -1 -1 -1 -1 -1 -0.333333 0 0.333333 -1; +#N canvas 0 50 450 278 (subpatch) 0; +#X array waveform 11 float 0; #X coords 0 1 10 -1 200 140 1 0 0; #X restore 494 188 graph; #X obj 224 247 tabwrite waveform; @@ -21,11 +14,11 @@ #X obj 488 116 tabread waveform; #X obj 543 23 + 1; #X obj 505 21 i; -#X obj 504 -39 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 +#X obj 504 -39 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X msg 534 78 0; -#X floatatom 483 72 5 0 0 0 - - -; -#X floatatom 424 254 5 0 0 0 - - -; +#X floatatom 483 72 5 0 0 0 - - -, f 5; +#X floatatom 424 254 5 0 0 0 - - -, f 5; #X obj 535 54 select 10; #X obj 204 325 *~ 10; #X obj 416 207 + 1; @@ -34,33 +27,39 @@ #X obj 364 370 line~; #X msg 364 342 \$1 10; #X obj 337 295 expr 100 + (100 * $f1); -#X connect 2 0 3 0; -#X connect 4 0 6 0; -#X connect 5 0 4 0; -#X connect 6 0 7 0; -#X connect 7 0 0 0; -#X connect 7 0 10 0; -#X connect 7 1 1 0; -#X connect 7 1 11 1; -#X connect 10 0 11 0; -#X connect 10 1 9 1; +#X obj 267 -45 udpreceive 9001; +#X obj 267 -6 unpackOSC; +#X obj 267 33 routeOSC /dot; +#X obj 111 -112 loadbang; +#X msg 54 -54 \; pd dsp 1; +#X connect 2 0 0 0; +#X connect 2 0 5 0; +#X connect 2 1 1 0; +#X connect 2 1 6 1; +#X connect 5 0 6 0; +#X connect 5 1 4 1; +#X connect 6 0 4 0; +#X connect 7 0 8 0; +#X connect 7 0 8 1; +#X connect 9 0 18 0; +#X connect 10 0 11 1; +#X connect 11 0 10 0; +#X connect 11 0 14 0; #X connect 11 0 9 0; -#X connect 12 0 13 0; -#X connect 12 0 13 1; -#X connect 14 0 23 0; -#X connect 15 0 16 1; -#X connect 16 0 15 0; -#X connect 16 0 19 0; -#X connect 16 0 14 0; -#X connect 16 0 21 0; -#X connect 17 0 24 0; -#X connect 18 0 16 1; -#X connect 21 0 18 0; -#X connect 22 0 12 0; +#X connect 11 0 16 0; +#X connect 12 0 19 0; +#X connect 13 0 11 1; +#X connect 16 0 13 0; +#X connect 17 0 7 0; +#X connect 18 0 15 0; +#X connect 18 0 23 0; +#X connect 19 0 11 0; +#X connect 20 0 17 0; +#X connect 22 0 21 0; +#X connect 23 0 22 0; #X connect 23 0 20 0; -#X connect 23 0 28 0; -#X connect 24 0 16 0; -#X connect 25 0 22 0; -#X connect 27 0 26 0; -#X connect 28 0 27 0; -#X connect 28 0 25 0; +#X connect 24 0 25 0; +#X connect 25 0 26 0; +#X connect 26 0 2 0; +#X connect 27 0 28 0; +#X connect 27 0 19 0; From d137862d23888ed53b57dbc7fb2a6d5ce4b5a7e5 Mon Sep 17 00:00:00 2001 From: Nadine Rotem-Stibbe Date: Tue, 21 Mar 2017 23:23:58 +0100 Subject: [PATCH 08/61] all websites updated --- floppies/giulia/cgi-bin/index.cgi | 2 +- floppies/nadine1/noweb/img/drone1.svg | 63 ++- floppies/nadine1/noweb/img/drone2.svg | 31 +- floppies/nadine1/noweb/img/drone3.svg | 31 +- floppies/nadine1/noweb/index.html | 27 +- floppies/nadine1/noweb/style.css | 120 +++--- floppies/nadine1/noweb/txt/watchlist.txt | 383 ------------------ floppies/nadine2/readnew.py | 8 +- floppies/nadine2/transcripts-drone-attack.txt | 11 +- 9 files changed, 172 insertions(+), 504 deletions(-) delete mode 100644 floppies/nadine1/noweb/txt/watchlist.txt diff --git a/floppies/giulia/cgi-bin/index.cgi b/floppies/giulia/cgi-bin/index.cgi index 0cde9e9..a06606f 100755 --- a/floppies/giulia/cgi-bin/index.cgi +++ b/floppies/giulia/cgi-bin/index.cgi @@ -46,7 +46,7 @@ div.movie img { - +
{% for i in items %}
diff --git a/floppies/nadine1/noweb/img/drone1.svg b/floppies/nadine1/noweb/img/drone1.svg index 5acf5e6..6424fa4 100644 --- a/floppies/nadine1/noweb/img/drone1.svg +++ b/floppies/nadine1/noweb/img/drone1.svg @@ -1,27 +1,50 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/floppies/nadine1/noweb/img/drone2.svg b/floppies/nadine1/noweb/img/drone2.svg index c3c6618..1f86069 100644 --- a/floppies/nadine1/noweb/img/drone2.svg +++ b/floppies/nadine1/noweb/img/drone2.svg @@ -1,20 +1,21 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/floppies/nadine1/noweb/img/drone3.svg b/floppies/nadine1/noweb/img/drone3.svg index 2b314de..9af0b6e 100644 --- a/floppies/nadine1/noweb/img/drone3.svg +++ b/floppies/nadine1/noweb/img/drone3.svg @@ -2,25 +2,18 @@ - + + + + + + - - - - - - - - - - - - + + + diff --git a/floppies/nadine1/noweb/index.html b/floppies/nadine1/noweb/index.html index bf9596f..cc4f892 100644 --- a/floppies/nadine1/noweb/index.html +++ b/floppies/nadine1/noweb/index.html @@ -1,28 +1,20 @@ - - - + Drone
-
Table of contents from the
National Couterterrorism Center's (NCC)
'Watchlisting Guidance'
-
- -

- Please remove your shoes, put your head back and enjoy the sound of drones! -

- +
Drone Oddity
#1
+

Please remove your shoes, put your head back and enjoy the sound of drones!

-
- +
Buy war rugs here...
@@ -31,8 +23,15 @@ - diff --git a/floppies/nadine1/noweb/style.css b/floppies/nadine1/noweb/style.css index 51efc91..80dc726 100644 --- a/floppies/nadine1/noweb/style.css +++ b/floppies/nadine1/noweb/style.css @@ -5,58 +5,59 @@ background-position: center; background-size: 100%; font-family: 'Roboto Mono', monospace; + margin: 0 !important; } - header{} - .title {text-align: center; - font-size: 45px; - margin-top: 50px; - color: black; - font-weight: 700; - margin-left: 20px; - margin-right:20px; - } - .title a {color:black; - text-decoration: underline;} - a{text-decoration: none; - } - .title span{ - background-color: rgba(255,255,255,.9); - } - .subtitle{font-size: 50px; + + @font-face { + font-family: 'Roboto Mono', monospace; + src: url(RobotoMono-Regular.ttf); +} +header{ + height: 400px; + background: black; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(black, transparent); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(black, transparent); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(black, transparent); /* For Firefox 3.6 to 15 */ + background: linear-gradient(black, transparent); /* Standard syntax (must be last) */ + margin:-10px; + padding-top: 60px; +} + + .title { + padding-top: 40px; text-align: center; - font-weight: 100; - color: black; + font-size: 70px; + color: white; + margin:auto; + font-weight: 700;; + padding: 6px; } - .shoes{font-size: 20px; - font-style: normal;} - .subtitle span{ - background-color: rgba(255,255,255,.8); - } - .instructions span{background-color: rgba(0,0,20,.85)} + + .title a { + color:black; + text-decoration: underline;} + + a{ text-decoration: none;} .instructions{ - max-width: 300px; - line-height: 22px - font-size: 30px; - margin-bottom: 20px; - font-weight: 100; + text-align: center; + max-width: 39%; + line-height: 26px; + font-size: 20px; + padding: 10px; + margin: auto; + font-weight: 500; color: white; - font-style: italic;} - - audio{ - width: 100%; - margin-bottom: -5px;} + } .wrap{width: 100%; } - .transcript{ width:40%; margin:auto; height:5500px; overflow: hidden; - border: 4px solid; - } + .title-transcript{ margin-top: 0; margin-bottom: 0; @@ -75,11 +76,31 @@ height:5500px; width: 100%; } + footer{ + height: 400px; + background: black; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(transparent, black); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(transparent, black); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(transparent, black); /* For Firefox 3.6 to 15 */ + background: linear-gradient(transparent, black); /* Standard syntax (must be last) */ + margin:-10px; + padding: 20px; + } + .subtitle{ + text-align: center; + font-size: 40px; + color: white; + font-weight: 700;; + } + + .subtitle a{ + text-decoration: none; + color: white; + } embed::-webkit-scrollbar-track { - /*border: 1px solid black; -*/ background-color: #F5F5F5; + background-color: #F5F5F5; } embed::-webkit-scrollbar @@ -95,12 +116,19 @@ embed::-webkit-scrollbar-thumb /*////////mobile///////*/ @media screen and (max-width:767px) { -.title{font-size: 35px;} - .transcript{ - +.title{font-size: 30 px; + max-width: 90%;} +.instructions{max-width: 90%;} + + .transcript{ + margin-top: 50px; width:90%; - height: 500px; + height: 6555px; } - - +.transcript embed{height: 6555px;} +.header{margin-bottom: 20px;} +.footer{height: 600px;} +.subtitle{ + margin-top: 40px; + font-size: 26px;} }/*end of 767*/ diff --git a/floppies/nadine1/noweb/txt/watchlist.txt b/floppies/nadine1/noweb/txt/watchlist.txt deleted file mode 100644 index 907375f..0000000 --- a/floppies/nadine1/noweb/txt/watchlist.txt +++ /dev/null @@ -1,383 +0,0 @@ -Chapter 1 - section 1 - sub 1 - foot 1 - sub 2 - foot 1 - foot 2 - sub 3 - sub 4 - section 2 - sub 1 - foot 1 - sub 2 - foot 1 - foot 2 - sub 3 - foot 1 - sub 4 - sub 5 - foot 1 - foot 2 - subsub 1 - sub 6 - sub 7 - foot 1 - sub 8 - sub 9 - sub 10 - foot 1 - subsub 1 - subsub 2 - subsubsub 1 - subsubsub 2 - subsubsub 3 - sub 11 - sub 12 - sub 13 - foot 1 - foot 2 - sub 14 - foot 1 - section 3 - sub 1 - foot 1 - subsub 1 - subsub 2 - subsub 3 - subsub 4 - sub 2 - section 4 - sub 1 - foot 1 - sub 2 - foot 1 - sub 3 - section 5 - sub 1 - subsub 1 - subsub 2 - foot 1 - section 6 - sub 1 - sub 2 - sub 3 - sub 4 - sub 5 - foot 1 - sub 6 - foot 1 - sub 7 - sub 8 - sub 9 - foot 1 - - section 7 - sub 1 - sub 2 - foot 1 - sub 3 - sub 4 - section 8 - sub 1 - sub 2 - sub 3 - subsub 1 - subsub 2 - subsub 3 - foot 1 - sub 4 - sub 5 - foot 1 - sub 6 - subsub 1 - subsub 2 - subsub 3 - subsub 4 - foot 1 - subsub 5 - subsub 6 - subsub 7 - subsub 8 - subsub 9 - sub 7 - sub 8 - sub 9 - section 9 - sub 1 - foot 1 - sub 2 - subsub 1 - subsub 2 - subsub 3 - foot 1 - subsub 4 - sub 3 - sub 4 - sub 5 - sub 6 - subsub 1 - subsub 2 - sub 7 - subsub 1 - subsub 2 - foot 1 - subsubsub 1 - foot 1 - subsubsub 2 - subsubsub 3 - subsubsub 4 - subsubsub 5 - sub 8 - sub 9 - foot 1 - sub 10 - foot 1 - subsub 1 - foot 1 - subsub 2 - subsubsub 1 - subsubsubsub 1 - subsubsubsub 2 - subsubsubsub 3 - subsubsubsub 4 - subsubsubsub 5 - subsubsubsub 6 - subsubsubsub 7 - subsubsub 2 - sub 11 - sub 12 - subsub 1 - censored 2 - subsub 2 - subsub 3 - subsub 4 - sub 13 - subsub 1 - subsubsub 1 - subsubsub 2 - subsubsub 3 - subsubsub 4 - subsub 2 - subsub 3 - subsub 4 - subsub 5 - subsub 6 - sub 14 - sub 15 - sub 16 - section 10 - sub 1 - sub 2 - sub 3 - subsub 1 - subsub 2 - subsub 3 - foot 1 - sub 4 - sub 5 - section 11 - sub 1 - sub 2 - foot 1 - sub 3 - sub 4 - sub 5 - section 12 - sub 1 - -Chapter 2 - section 1 - sub 1 - section 2 - sub 1 - subsub1 - sub 2 - sub 3 - sub 4 - subsub 1 - subsub 2 - subsubsub 1 - subsubsub 2 - subsubsub 3 - subsubsub 4 - foot 1 - subsubsub 5 - foot 1 - subsubsub 6 - subsub 3 - foot 1 - subsubsub 1 - subsubsub 2 - subsubsub 3 - subsubsub 4 - subsubsub 5 - subsubsub 6 - subsubsub 7 - subsubsub 8 - subsubsub 9 - subsubsub 10 - section 3 - sub 1 - sub 2 - subsub 1 - subsub 2 - subsub 3 - subsub 4 - subsub 5 - subsub 6 - subsub 7 -Chapter 3 - section 1 - sub 1 - sub 2 - section 2 - sub 1 - sub 2 - sub 3 - sub 4 - sub 5 - sub 6 - sub 7 - subsub 1 - subsub 2 - subsub 3 - subsub 4 - section 3 - sub 1 - subsub 1 - subsub 2 - sub 2 - subsub 1 - subsub 2 - subsub 3 - subsub 4 - section 4 - sub 1 - subsub 1 - sub 2 - subsub 1 - subsub 2 - subsub 3 - subsub 4 - subsubsub 1 - subsubsubsub 1 - subsubsubsub 2 - subsubsubsub 3 - subsubsubsub 4 - subsub 5 - subsubsub 1 - subsub 6 - subsub 7 - subsub 8 - subsubsub 1 - subsub 9 - subsubsub 1 - subsub 10 - subsub 11 - subsub 12 - subsub 13 - section 5 - sub 1 - subsub 1 - subsubsub 1 - subsubsubsub 1 - subsubsubsub 2 - subsubsub 2 - subsubsub 3 - subsub 2 - subsub 3 - subsub 4 - subsub 5 - subsub 6 - subsubsub 1 - subsubsub 2 - subsubsub 3 - subsubsub 4 - subsubsub 5 - subsub 7 - section 6 - sub 1 - subsub 1 - subsubsub 1 - subsubsub 2 - subsubsub 3 - subsubsub 4 - subsub 2 - subsub 3 - sub 2 - subsub 1 - sub 3 - subsub 1 - subsubsub 1 - subsubsub 2 - subsub 2 - section 7 - sub 1 - subsub 1 - subsub 2 - subsub 3 - subsub 4 - subsub 5 - subsub 6 - subsub 7 - subsub 8 - subsub 9 - subsub 10 - subsub 11 - subsub 12 - subsub 13 - subsub 15 - subsub 16 - subsub 17 - subsub 18 - subsub 19 - subsub 20 - subsub 21 - subsub 22 - subsub 23 - subsub 24 - subsub 25 - subsub 26 - subsub 27 - subsub 28 - subsub 29 - subsub 30 - subsub 31 - subsub 32 - subsub 33 - subsub 34 - subsub 35 - subsub 36 - subsub 37 - subsub 38 - subsub 39 - subsub 40 - subsub 41 - subsub 42 - subsub 43 - subsub 44 - subsub 45 - subsub 46 -Chapter 4 - - - - - - - - - - - - - - - - - - - - - diff --git a/floppies/nadine2/readnew.py b/floppies/nadine2/readnew.py index 7f7fed0..ccfd630 100755 --- a/floppies/nadine2/readnew.py +++ b/floppies/nadine2/readnew.py @@ -6,10 +6,10 @@ from time import sleep dic={ "narrator": "en-us", -"Pilot": "klatt", -"Sensor": "whisper", -"MC": "pt", -"Jag25": "mb-us2", +"Pilot": "m4", +"Sensor": "m7", +"MC": "m2", +"Jag25": "m6", "Unknown": "f1" } diff --git a/floppies/nadine2/transcripts-drone-attack.txt b/floppies/nadine2/transcripts-drone-attack.txt index 26ac92f..047b4c1 100644 --- a/floppies/nadine2/transcripts-drone-attack.txt +++ b/floppies/nadine2/transcripts-drone-attack.txt @@ -1,5 +1,5 @@ -00:59 (Pilot): Can you zoom in a little bit man, *expletive* let em take a look -00:59 (Sensor): at least 4 in *expletive* the back of the pickup +00:59 (Pilot): Can you zoom in a little bit man, let em take a look +00:59 (Sensor): at least 4 in the back of the pickup 00:59 (Pilot): what about the guy under the north arrow, does it look like he is hold'n something across his chest 00:59 (Sensor): yea it's kind of weird how they all have a cold spot on their chest 00:59 (Pilot): It's what they've been doing here lately, they wrap their *expletive* up in their man dresses so you can't PID it @@ -84,3 +84,10 @@ CLASSIFIED CLASSIFIED CLASSIFIED + +04:07 (Sensor) : We're gonna look like we're gonna be looking at 421. +04:07 (Pilot) : Yeah +04:07 (Sensor) : For a hostile intent and... initial plan without seeing how they break up, follow the largest group. +04:07 (Pilot) : Yeah, sounds good. When it all comes down, if everybody is running in their separate direction, I don't care if you just follow one guy, you know like whatever you decide to do I'm with you on it. + + From b9829c92b1e565a48037b61abc36e1e25c2dfdad Mon Sep 17 00:00:00 2001 From: karina Date: Wed, 22 Mar 2017 14:34:26 +0100 Subject: [PATCH 09/61] svg files for buttons --- floppies/karina/images/choreology1-BasicTurn.svg | 1 + floppies/karina/images/choreology10-ChickenWalks.svg | 1 + floppies/karina/images/choreology2-Follow.svg | 1 + floppies/karina/images/choreology3-AmericanSpin.svg | 1 + floppies/karina/images/choreology4-Bump.svg | 1 + floppies/karina/images/choreology5-StopAndGo.svg | 1 + floppies/karina/images/choreology6-Windmill.svg | 1 + floppies/karina/images/choreology7-SpanishArms.svg | 1 + floppies/karina/images/choreology8-Hucklebuck.svg | 1 + floppies/karina/images/choreology9-Whip.svg | 1 + 10 files changed, 10 insertions(+) create mode 100644 floppies/karina/images/choreology1-BasicTurn.svg create mode 100644 floppies/karina/images/choreology10-ChickenWalks.svg create mode 100644 floppies/karina/images/choreology2-Follow.svg create mode 100644 floppies/karina/images/choreology3-AmericanSpin.svg create mode 100644 floppies/karina/images/choreology4-Bump.svg create mode 100644 floppies/karina/images/choreology5-StopAndGo.svg create mode 100644 floppies/karina/images/choreology6-Windmill.svg create mode 100644 floppies/karina/images/choreology7-SpanishArms.svg create mode 100644 floppies/karina/images/choreology8-Hucklebuck.svg create mode 100644 floppies/karina/images/choreology9-Whip.svg diff --git a/floppies/karina/images/choreology1-BasicTurn.svg b/floppies/karina/images/choreology1-BasicTurn.svg new file mode 100644 index 0000000..b8a969e --- /dev/null +++ b/floppies/karina/images/choreology1-BasicTurn.svg @@ -0,0 +1 @@ +choreology-Bump \ No newline at end of file diff --git a/floppies/karina/images/choreology10-ChickenWalks.svg b/floppies/karina/images/choreology10-ChickenWalks.svg new file mode 100644 index 0000000..75fcc16 --- /dev/null +++ b/floppies/karina/images/choreology10-ChickenWalks.svg @@ -0,0 +1 @@ +choreology-Bump \ No newline at end of file diff --git a/floppies/karina/images/choreology2-Follow.svg b/floppies/karina/images/choreology2-Follow.svg new file mode 100644 index 0000000..fc7b298 --- /dev/null +++ b/floppies/karina/images/choreology2-Follow.svg @@ -0,0 +1 @@ +choreology-Bump \ No newline at end of file diff --git a/floppies/karina/images/choreology3-AmericanSpin.svg b/floppies/karina/images/choreology3-AmericanSpin.svg new file mode 100644 index 0000000..5701079 --- /dev/null +++ b/floppies/karina/images/choreology3-AmericanSpin.svg @@ -0,0 +1 @@ +choreology-Bump \ No newline at end of file diff --git a/floppies/karina/images/choreology4-Bump.svg b/floppies/karina/images/choreology4-Bump.svg new file mode 100644 index 0000000..881a144 --- /dev/null +++ b/floppies/karina/images/choreology4-Bump.svg @@ -0,0 +1 @@ +choreology-Bump \ No newline at end of file diff --git a/floppies/karina/images/choreology5-StopAndGo.svg b/floppies/karina/images/choreology5-StopAndGo.svg new file mode 100644 index 0000000..c596403 --- /dev/null +++ b/floppies/karina/images/choreology5-StopAndGo.svg @@ -0,0 +1 @@ +choreology-Bump \ No newline at end of file diff --git a/floppies/karina/images/choreology6-Windmill.svg b/floppies/karina/images/choreology6-Windmill.svg new file mode 100644 index 0000000..27e7904 --- /dev/null +++ b/floppies/karina/images/choreology6-Windmill.svg @@ -0,0 +1 @@ +choreology-Bump \ No newline at end of file diff --git a/floppies/karina/images/choreology7-SpanishArms.svg b/floppies/karina/images/choreology7-SpanishArms.svg new file mode 100644 index 0000000..69706a1 --- /dev/null +++ b/floppies/karina/images/choreology7-SpanishArms.svg @@ -0,0 +1 @@ +choreology-Bump \ No newline at end of file diff --git a/floppies/karina/images/choreology8-Hucklebuck.svg b/floppies/karina/images/choreology8-Hucklebuck.svg new file mode 100644 index 0000000..ec1bf45 --- /dev/null +++ b/floppies/karina/images/choreology8-Hucklebuck.svg @@ -0,0 +1 @@ +choreology-Bump \ No newline at end of file diff --git a/floppies/karina/images/choreology9-Whip.svg b/floppies/karina/images/choreology9-Whip.svg new file mode 100644 index 0000000..b058a5b --- /dev/null +++ b/floppies/karina/images/choreology9-Whip.svg @@ -0,0 +1 @@ +choreology-Bump \ No newline at end of file From e44a4e8267e05d94dd571596604c627017850897 Mon Sep 17 00:00:00 2001 From: kspreeuw Date: Wed, 22 Mar 2017 14:50:28 +0100 Subject: [PATCH 10/61] new main --- floppies/Kimmy_Rest/main.pd | 185 ++++++++++++++++++------------------ 1 file changed, 93 insertions(+), 92 deletions(-) diff --git a/floppies/Kimmy_Rest/main.pd b/floppies/Kimmy_Rest/main.pd index 74152ab..26690e4 100644 --- a/floppies/Kimmy_Rest/main.pd +++ b/floppies/Kimmy_Rest/main.pd @@ -1,8 +1,7 @@ -#N canvas 280 23 912 793 10; +#N canvas 166 23 912 793 10; #X obj 98 109 adc~; #X obj 167 267 tabwrite~ noise; #X obj 98 131 +~; -#X obj 143 205 /~ 2; #X msg 209 208 bang; #X obj 214 136 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; @@ -15,10 +14,10 @@ #X coords 0 1 88200 -1 200 140 1 0 0; #X restore 428 114 graph; #X obj 313 193 env~; -#X floatatom 325 233 5 0 0 0 - - -, f 5; +#X floatatom 369 228 5 0 0 0 - - -, f 5; #X obj 161 302 phasor~ 0.5; -#X obj 172 564 +~; -#X floatatom 291 263 5 0 0 0 - - -, f 5; +#X obj 175 525 +~; +#X floatatom 306 267 5 0 0 0 - - -, f 5; #X obj 132 240 *~; #X obj 274 322 line~; #X obj 393 306 env~; @@ -38,97 +37,99 @@ #X obj 742 417 sel 1; #X obj 211 658 delwrite~ fd 4000; #X msg 379 442 1800; -#X obj 580 368 > 60; -#X obj 534 370 <= 60; -#X obj 500 368 > 55; -#X obj 454 370 <= 55; #X obj 420 368 > 50; #X obj 379 369 <= 50; -#X obj 742 369 > 75; -#X obj 698 370 <= 75; -#X obj 663 370 > 65; -#X obj 614 370 <= 65; -#X obj 318 523 vd~ fd 100; #X obj 299 39 loadbang; #X msg 299 68 \; pd dsp 1; -#X obj 98 176 *~ 1; -#X obj 98 151 lop~ 1000; -#X msg 274 300 \$1 40; -#X obj 660 623 pack f f; -#X obj 649 658 print; -#X obj 284 238 >= 80; +#X obj 173 564 /~ 2; +#X obj 98 151 lop~ 2500; +#X msg 422 442 1830; #X msg 744 442 1900; -#X msg 502 442 1830; -#X msg 582 442 1850; -#X msg 422 442 1810; -#X msg 664 442 1880; -#X obj 318 549 *~ 0.7; +#X msg 664 442 1875; +#X msg 582 442 1865; +#X msg 502 442 1850; +#X obj 742 369 > 90; +#X obj 698 370 <= 90; +#X obj 663 370 > 80; +#X obj 614 370 <= 80; +#X obj 580 368 > 70; +#X obj 534 370 <= 70; +#X obj 500 368 > 60; +#X obj 454 370 <= 60; +#X obj 273 269 &&; +#X msg 274 300 \$1 40; +#X obj 271 238 > 60; +#X obj 98 176 *~ 20; +#X obj 324 238 <= 80; +#X obj 318 523 vd~ fd 200; +#X obj 288 552 *~ 0.95; #X connect 0 0 2 0; -#X connect 0 1 2 1; -#X connect 2 0 48 0; -#X connect 4 0 1 0; -#X connect 5 0 9 0; -#X connect 6 0 14 0; -#X connect 8 0 6 0; -#X connect 9 0 1 0; -#X connect 11 0 12 0; -#X connect 11 0 51 0; -#X connect 11 0 53 0; -#X connect 13 0 8 0; -#X connect 14 0 33 0; -#X connect 14 0 7 0; -#X connect 14 0 7 1; -#X connect 14 0 18 0; -#X connect 16 0 1 0; -#X connect 17 0 16 1; -#X connect 18 0 20 0; -#X connect 18 0 35 0; -#X connect 18 0 36 0; -#X connect 18 0 37 0; -#X connect 18 0 38 0; -#X connect 18 0 39 0; -#X connect 18 0 40 0; -#X connect 18 0 41 0; -#X connect 18 0 42 0; -#X connect 18 0 43 0; -#X connect 18 0 44 0; -#X connect 18 0 51 1; -#X connect 19 0 45 0; -#X connect 21 0 31 0; -#X connect 22 0 34 0; -#X connect 23 0 57 0; -#X connect 24 0 23 0; -#X connect 25 0 55 0; -#X connect 26 0 25 0; -#X connect 27 0 56 0; -#X connect 28 0 27 0; -#X connect 29 0 58 0; -#X connect 30 0 29 0; -#X connect 31 0 19 0; -#X connect 32 0 54 0; -#X connect 34 0 31 0; -#X connect 35 0 28 0; -#X connect 36 0 26 1; -#X connect 37 0 26 0; -#X connect 38 0 24 1; -#X connect 39 0 24 0; -#X connect 40 0 22 0; -#X connect 41 0 32 0; -#X connect 42 0 30 1; +#X connect 2 0 39 0; +#X connect 3 0 1 0; +#X connect 4 0 8 0; +#X connect 5 0 13 0; +#X connect 7 0 5 0; +#X connect 8 0 1 0; +#X connect 10 0 11 0; +#X connect 10 0 55 0; +#X connect 10 0 57 0; +#X connect 12 0 7 0; +#X connect 13 0 38 0; +#X connect 15 0 1 0; +#X connect 16 0 15 1; +#X connect 17 0 19 0; +#X connect 17 0 34 0; +#X connect 17 0 35 0; +#X connect 17 0 45 0; +#X connect 17 0 46 0; +#X connect 17 0 47 0; +#X connect 17 0 48 0; +#X connect 17 0 49 0; +#X connect 17 0 50 0; +#X connect 17 0 51 0; +#X connect 17 0 52 0; +#X connect 18 0 58 0; +#X connect 20 0 30 0; +#X connect 21 0 33 0; +#X connect 22 0 40 0; +#X connect 23 0 22 0; +#X connect 24 0 44 0; +#X connect 25 0 24 0; +#X connect 26 0 43 0; +#X connect 27 0 26 0; +#X connect 28 0 42 0; +#X connect 29 0 28 0; +#X connect 30 0 18 0; +#X connect 31 0 41 0; +#X connect 33 0 30 0; +#X connect 34 0 23 0; +#X connect 35 0 21 0; +#X connect 36 0 37 0; +#X connect 36 0 8 0; +#X connect 38 0 6 0; +#X connect 38 0 6 1; +#X connect 38 0 32 0; +#X connect 38 0 17 0; +#X connect 39 0 56 0; +#X connect 40 0 30 0; +#X connect 41 0 30 0; +#X connect 42 0 30 0; #X connect 43 0 30 0; -#X connect 44 0 28 1; -#X connect 45 0 59 0; -#X connect 46 0 47 0; -#X connect 46 0 9 0; -#X connect 48 0 11 0; -#X connect 48 0 16 0; -#X connect 50 0 17 0; -#X connect 51 0 52 0; -#X connect 53 0 15 0; -#X connect 53 0 50 0; -#X connect 54 0 31 0; -#X connect 55 0 31 0; -#X connect 56 0 31 0; -#X connect 57 0 31 0; -#X connect 58 0 31 0; -#X connect 59 0 14 1; +#X connect 44 0 30 0; +#X connect 45 0 31 0; +#X connect 46 0 29 1; +#X connect 47 0 29 0; +#X connect 48 0 27 1; +#X connect 49 0 27 0; +#X connect 50 0 25 1; +#X connect 51 0 25 0; +#X connect 52 0 23 1; +#X connect 53 0 54 0; +#X connect 54 0 16 0; +#X connect 55 0 14 0; +#X connect 55 0 53 0; +#X connect 56 0 10 0; +#X connect 56 0 15 0; +#X connect 57 0 53 1; +#X connect 58 0 59 0; +#X connect 59 0 13 1; From acb12e7151f571c4d34d09a0e9a680e56bb6063a Mon Sep 17 00:00:00 2001 From: kspreeuw Date: Wed, 22 Mar 2017 15:27:24 +0100 Subject: [PATCH 11/61] add license readme and index --- floppies/Kimmy_Rest/.DS_Store | Bin 0 -> 6148 bytes floppies/Kimmy_Rest/LICENSE | 1 + floppies/Kimmy_Rest/README | 11 + floppies/Kimmy_Rest/noweb/index.html | 3193 ++++++++++++++++++++++++++ 4 files changed, 3205 insertions(+) create mode 100644 floppies/Kimmy_Rest/.DS_Store create mode 100644 floppies/Kimmy_Rest/LICENSE create mode 100644 floppies/Kimmy_Rest/README create mode 100644 floppies/Kimmy_Rest/noweb/index.html diff --git a/floppies/Kimmy_Rest/.DS_Store b/floppies/Kimmy_Rest/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..57c3d4f062a9913dfaf9117e2a5225a2023134d2 GIT binary patch literal 6148 zcmeHKJ5Iwu5S@V_1<|BLRC|ToU=^7YAcvvk%?A|A7>Nc6^hTO_ zyYtz#U*YkHh^`LpQe+__bEu)bm>G-3O-FK)o*7X6jN8Zi<$BX?cca`Xht;0RlXUVd zck)&JQFPliO?%jHL|)&n&i%+iwEZT!d-&m#O+7LFWPl8i0Wv@a{x$>X*(URgKw2_D z2FSoC1NMC=P{W$o2l}T2#zz34{l>ds?Xv{1m;+c7`#^Xg8l}J})f_Q2%Hc1WR}=fd zC>PD)L-S_M2}S*OoL@X$v;Ko#iTQt6#2pzR1OJKvoi*!bg;&bn zI(j+lwFP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 31f110c4554bda6a553f5d280114b6704a5f84e0 Mon Sep 17 00:00:00 2001 From: kspreeuw Date: Wed, 22 Mar 2017 15:29:31 +0100 Subject: [PATCH 12/61] one extra patch to test tomorrow --- floppies/Kimmy_Rest/main_200line.pd | 135 ++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 floppies/Kimmy_Rest/main_200line.pd diff --git a/floppies/Kimmy_Rest/main_200line.pd b/floppies/Kimmy_Rest/main_200line.pd new file mode 100644 index 0000000..8b1615c --- /dev/null +++ b/floppies/Kimmy_Rest/main_200line.pd @@ -0,0 +1,135 @@ +#N canvas 166 23 912 793 10; +#X obj 98 109 adc~; +#X obj 167 267 tabwrite~ noise; +#X obj 98 131 +~; +#X msg 209 208 bang; +#X obj 214 136 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X obj 161 361 tabread4~ noise; +#X obj 154 696 dac~; +#X obj 161 334 *~ 88200; +#X obj 198 170 metro 2000; +#N canvas 0 22 450 278 (subpatch) 0; +#X array noise 88200 float 2; +#X coords 0 1 88200 -1 200 140 1 0 0; +#X restore 428 114 graph; +#X obj 313 193 env~; +#X floatatom 369 228 5 0 0 0 - - -, f 5; +#X obj 161 302 phasor~ 0.5; +#X obj 175 525 +~; +#X floatatom 306 267 5 0 0 0 - - -, f 5; +#X obj 132 240 *~; +#X obj 274 322 line~; +#X obj 393 306 env~; +#X obj 318 499 line~; +#X floatatom 497 321 5 0 0 0 - - -, f 5; +#X floatatom 280 453 5 0 0 0 - - -, f 5; +#X obj 379 419 sel 1; +#X obj 420 417 sel 1; +#X obj 421 395 &&; +#X obj 500 417 sel 1; +#X obj 501 395 &&; +#X obj 580 417 sel 1; +#X obj 581 395 &&; +#X obj 662 417 sel 1; +#X obj 663 395 &&; +#X msg 318 477 \$1 2000; +#X obj 742 417 sel 1; +#X obj 211 658 delwrite~ fd 4000; +#X msg 379 442 1800; +#X obj 420 368 > 50; +#X obj 379 369 <= 50; +#X obj 299 39 loadbang; +#X msg 299 68 \; pd dsp 1; +#X obj 173 564 /~ 2; +#X obj 98 151 lop~ 2500; +#X msg 422 442 1830; +#X msg 744 442 1900; +#X msg 664 442 1875; +#X msg 582 442 1865; +#X msg 502 442 1850; +#X obj 742 369 > 90; +#X obj 698 370 <= 90; +#X obj 663 370 > 80; +#X obj 614 370 <= 80; +#X obj 580 368 > 70; +#X obj 534 370 <= 70; +#X obj 500 368 > 60; +#X obj 454 370 <= 60; +#X obj 273 269 &&; +#X obj 271 238 > 60; +#X obj 98 176 *~ 20; +#X obj 324 238 <= 80; +#X obj 318 523 vd~ fd 200; +#X obj 288 552 *~ 0.95; +#X msg 274 300 \$1 200; +#X connect 0 0 2 0; +#X connect 2 0 39 0; +#X connect 3 0 1 0; +#X connect 4 0 8 0; +#X connect 5 0 13 0; +#X connect 7 0 5 0; +#X connect 8 0 1 0; +#X connect 10 0 11 0; +#X connect 10 0 54 0; +#X connect 10 0 56 0; +#X connect 12 0 7 0; +#X connect 13 0 38 0; +#X connect 15 0 1 0; +#X connect 16 0 15 1; +#X connect 17 0 19 0; +#X connect 17 0 34 0; +#X connect 17 0 35 0; +#X connect 17 0 45 0; +#X connect 17 0 46 0; +#X connect 17 0 47 0; +#X connect 17 0 48 0; +#X connect 17 0 49 0; +#X connect 17 0 50 0; +#X connect 17 0 51 0; +#X connect 17 0 52 0; +#X connect 18 0 57 0; +#X connect 20 0 30 0; +#X connect 21 0 33 0; +#X connect 22 0 40 0; +#X connect 23 0 22 0; +#X connect 24 0 44 0; +#X connect 25 0 24 0; +#X connect 26 0 43 0; +#X connect 27 0 26 0; +#X connect 28 0 42 0; +#X connect 29 0 28 0; +#X connect 30 0 18 0; +#X connect 31 0 41 0; +#X connect 33 0 30 0; +#X connect 34 0 23 0; +#X connect 35 0 21 0; +#X connect 36 0 37 0; +#X connect 36 0 8 0; +#X connect 38 0 6 0; +#X connect 38 0 6 1; +#X connect 38 0 32 0; +#X connect 38 0 17 0; +#X connect 39 0 55 0; +#X connect 40 0 30 0; +#X connect 41 0 30 0; +#X connect 42 0 30 0; +#X connect 43 0 30 0; +#X connect 44 0 30 0; +#X connect 45 0 31 0; +#X connect 46 0 29 1; +#X connect 47 0 29 0; +#X connect 48 0 27 1; +#X connect 49 0 27 0; +#X connect 50 0 25 1; +#X connect 51 0 25 0; +#X connect 52 0 23 1; +#X connect 53 0 59 0; +#X connect 54 0 14 0; +#X connect 54 0 53 0; +#X connect 55 0 10 0; +#X connect 55 0 15 0; +#X connect 56 0 53 1; +#X connect 57 0 58 0; +#X connect 58 0 13 1; +#X connect 59 0 16 0; From ea1320c19ff37fb195ae431cef7b5b031549833d Mon Sep 17 00:00:00 2001 From: Michael Murtaugh Date: Wed, 22 Mar 2017 15:53:37 +0100 Subject: [PATCH 13/61] fixed patch? --- floppies/franc/main.pd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/floppies/franc/main.pd b/floppies/franc/main.pd index e9864f9..1b2fe18 100644 --- a/floppies/franc/main.pd +++ b/floppies/franc/main.pd @@ -1,4 +1,4 @@ -#N canvas 145 161 897 545 10; +#N canvas 143 176 897 545 10; #X floatatom 166 153 5 0 0 0 - - -, f 5; #X floatatom 282 159 5 0 0 0 - - -, f 5; #X obj 190 121 unpack f f; From b6585db1c57c106ae80d4f8387f5612a1c15e86e Mon Sep 17 00:00:00 2001 From: UDI-ME-TA Date: Wed, 22 Mar 2017 18:58:46 +0100 Subject: [PATCH 14/61] libraries .min.js to decrease size. now it should be about 500KB --- floppies/claudia/fine-line/.DS_Store | Bin 6148 -> 6148 bytes floppies/claudia/fine-line/index.html | 6 +- .../claudia/fine-line/libraries/p5.dom.js | 2193 -- floppies/claudia/fine-line/libraries/p5.js | 32582 ---------------- .../claudia/fine-line/libraries/p5.sound.js | 9337 ----- floppies/claudia/noweb/.DS_Store | Bin 6148 -> 6148 bytes floppies/claudia/noweb/index.html | 12 +- floppies/claudia/noweb/libraries/.DS_Store | Bin 6148 -> 0 bytes floppies/claudia/noweb/libraries/p5.dom.js | 2193 -- floppies/claudia/noweb/libraries/p5.js | 32582 ---------------- floppies/claudia/noweb/libraries/p5.sound.js | 9337 ----- floppies/claudia/noweb/style.css | 8 + 12 files changed, 17 insertions(+), 88233 deletions(-) delete mode 100644 floppies/claudia/fine-line/libraries/p5.dom.js delete mode 100644 floppies/claudia/fine-line/libraries/p5.js delete mode 100644 floppies/claudia/fine-line/libraries/p5.sound.js delete mode 100644 floppies/claudia/noweb/libraries/.DS_Store delete mode 100644 floppies/claudia/noweb/libraries/p5.dom.js delete mode 100644 floppies/claudia/noweb/libraries/p5.js delete mode 100644 floppies/claudia/noweb/libraries/p5.sound.js diff --git a/floppies/claudia/fine-line/.DS_Store b/floppies/claudia/fine-line/.DS_Store index 42efedead930b29ba40efb81677e9efd2b6556d3..cf5da4be64d59468a80c61369eaec58001139e19 100644 GIT binary patch delta 86 zcmZoMXffEJ#l*-sIgm+AASc~0I5|JJfB^*9Y{Y?r3T#(?WVtXf0GSe#`FnKSt + - - + + diff --git a/floppies/claudia/fine-line/libraries/p5.dom.js b/floppies/claudia/fine-line/libraries/p5.dom.js deleted file mode 100644 index d339e8d..0000000 --- a/floppies/claudia/fine-line/libraries/p5.dom.js +++ /dev/null @@ -1,2193 +0,0 @@ -/*! p5.dom.js v0.3.1 Jan 3, 2017 */ -/** - *

The web is much more than just canvas and p5.dom makes it easy to interact - * with other HTML5 objects, including text, hyperlink, image, input, video, - * audio, and webcam.

- *

There is a set of creation methods, DOM manipulation methods, and - * an extended p5.Element that supports a range of HTML elements. See the - * - * beyond the canvas tutorial for a full overview of how this addon works. - * - *

Methods and properties shown in black are part of the p5.js core, items in - * blue are part of the p5.dom library. You will need to include an extra file - * in order to access the blue functions. See the - * using a library - * section for information on how to include this library. p5.dom comes with - * p5 complete or you can download the single file - * - * here.

- *

See tutorial: beyond the canvas - * for more info on how to use this libary. - * - * @module p5.dom - * @submodule p5.dom - * @for p5.dom - * @main - */ - -(function (root, factory) { - if (typeof define === 'function' && define.amd) - define('p5.dom', ['p5'], function (p5) { (factory(p5));}); - else if (typeof exports === 'object') - factory(require('../p5')); - else - factory(root['p5']); -}(this, function (p5) { - -// ============================================================================= -// p5 additions -// ============================================================================= - - /** - * Searches the page for an element with the given ID, class, or tag name (using the '#' or '.' - * prefixes to specify an ID or class respectively, and none for a tag) and returns it as - * a p5.Element. If a class or tag name is given with more than 1 element, - * only the first element will be returned. - * The DOM node itself can be accessed with .elt. - * Returns null if none found. You can also specify a container to search within. - * - * @method select - * @param {String} name id, class, or tag name of element to search for - * @param {String} [container] id, p5.Element, or HTML element to search within - * @return {Object/p5.Element|Null} p5.Element containing node found - * @example - *

- * function setup() { - * createCanvas(100,100); - * //translates canvas 50px down - * select('canvas').position(100, 100); - * } - *
- *
- * // these are all valid calls to select() - * var a = select('#moo'); - * var b = select('#blah', '#myContainer'); - * var c = select('#foo', b); - * var d = document.getElementById('beep'); - * var e = select('p', d); - *
- * - */ - p5.prototype.select = function (e, p) { - var res = null; - var container = getContainer(p); - if (e[0] === '.'){ - e = e.slice(1); - res = container.getElementsByClassName(e); - if (res.length) { - res = res[0]; - } else { - res = null; - } - }else if (e[0] === '#'){ - e = e.slice(1); - res = container.getElementById(e); - }else { - res = container.getElementsByTagName(e); - if (res.length) { - res = res[0]; - } else { - res = null; - } - } - if (res) { - return wrapElement(res); - } else { - return null; - } - }; - - /** - * Searches the page for elements with the given class or tag name (using the '.' prefix - * to specify a class and no prefix for a tag) and returns them as p5.Elements - * in an array. - * The DOM node itself can be accessed with .elt. - * Returns an empty array if none found. - * You can also specify a container to search within. - * - * @method selectAll - * @param {String} name class or tag name of elements to search for - * @param {String} [container] id, p5.Element, or HTML element to search within - * @return {Array} Array of p5.Elements containing nodes found - * @example - *
- * function setup() { - * createButton('btn'); - * createButton('2nd btn'); - * createButton('3rd btn'); - * var buttons = selectAll('button'); - * - * for (var i = 0; i < buttons.length; i++){ - * buttons[i].size(100,100); - * } - * } - *
- *
- * // these are all valid calls to selectAll() - * var a = selectAll('.moo'); - * var b = selectAll('div'); - * var c = selectAll('button', '#myContainer'); - * var d = select('#container'); - * var e = selectAll('p', d); - * var f = document.getElementById('beep'); - * var g = select('.blah', f); - *
- * - */ - p5.prototype.selectAll = function (e, p) { - var arr = []; - var res; - var container = getContainer(p); - if (e[0] === '.'){ - e = e.slice(1); - res = container.getElementsByClassName(e); - } else { - res = container.getElementsByTagName(e); - } - if (res) { - for (var j = 0; j < res.length; j++) { - var obj = wrapElement(res[j]); - arr.push(obj); - } - } - return arr; - }; - - /** - * Helper function for select and selectAll - */ - function getContainer(p) { - var container = document; - if (typeof p === 'string' && p[0] === '#'){ - p = p.slice(1); - container = document.getElementById(p) || document; - } else if (p instanceof p5.Element){ - container = p.elt; - } else if (p instanceof HTMLElement){ - container = p; - } - return container; - } - - /** - * Helper function for getElement and getElements. - */ - function wrapElement(elt) { - if(elt.tagName === "INPUT" && elt.type === "checkbox") { - var converted = new p5.Element(elt); - converted.checked = function(){ - if (arguments.length === 0){ - return this.elt.checked; - } else if(arguments[0]) { - this.elt.checked = true; - } else { - this.elt.checked = false; - } - return this; - }; - return converted; - } else if (elt.tagName === "VIDEO" || elt.tagName === "AUDIO") { - return new p5.MediaElement(elt); - } else { - return new p5.Element(elt); - } - } - - /** - * Removes all elements created by p5, except any canvas / graphics - * elements created by createCanvas or createGraphics. - * Event handlers are removed, and element is removed from the DOM. - * @method removeElements - * @example - *
- * function setup() { - * createCanvas(100, 100); - * createDiv('this is some text'); - * createP('this is a paragraph'); - * } - * function mousePressed() { - * removeElements(); // this will remove the div and p, not canvas - * } - *
- * - */ - p5.prototype.removeElements = function (e) { - for (var i=0; i - * var myDiv; - * function setup() { - * myDiv = createDiv('this is some text'); - * } - * - */ - - /** - * Creates a <p></p> element in the DOM with given inner HTML. Used - * for paragraph length text. - * Appends to the container node if one is specified, otherwise - * appends to body. - * - * @method createP - * @param {String} html inner HTML for element created - * @return {Object/p5.Element} pointer to p5.Element holding created node - * @example - *
- * var myP; - * function setup() { - * myP = createP('this is some text'); - * } - *
- */ - - /** - * Creates a <span></span> element in the DOM with given inner HTML. - * Appends to the container node if one is specified, otherwise - * appends to body. - * - * @method createSpan - * @param {String} html inner HTML for element created - * @return {Object/p5.Element} pointer to p5.Element holding created node - * @example - *
- * var mySpan; - * function setup() { - * mySpan = createSpan('this is some text'); - * } - *
- */ - var tags = ['div', 'p', 'span']; - tags.forEach(function(tag) { - var method = 'create' + tag.charAt(0).toUpperCase() + tag.slice(1); - p5.prototype[method] = function(html) { - var elt = document.createElement(tag); - elt.innerHTML = typeof html === undefined ? "" : html; - return addElement(elt, this); - } - }); - - /** - * Creates an <img> element in the DOM with given src and - * alternate text. - * Appends to the container node if one is specified, otherwise - * appends to body. - * - * @method createImg - * @param {String} src src path or url for image - * @param {String} [alt] alternate text to be used if image does not load - * @param {Function} [successCallback] callback to be called once image data is loaded - * @return {Object/p5.Element} pointer to p5.Element holding created node - * @example - *
- * var img; - * function setup() { - * img = createImg('http://p5js.org/img/asterisk-01.png'); - * } - *
- */ - p5.prototype.createImg = function() { - var elt = document.createElement('img'); - var args = arguments; - var self; - var setAttrs = function(){ - self.width = elt.offsetWidth || elt.width; - self.height = elt.offsetHeight || elt.height; - if (args.length > 1 && typeof args[1] === 'function'){ - self.fn = args[1]; - self.fn(); - }else if (args.length > 1 && typeof args[2] === 'function'){ - self.fn = args[2]; - self.fn(); - } - }; - elt.src = args[0]; - if (args.length > 1 && typeof args[1] === 'string'){ - elt.alt = args[1]; - } - elt.onload = function(){ - setAttrs(); - } - self = addElement(elt, this); - return self; - }; - - /** - * Creates an <a></a> element in the DOM for including a hyperlink. - * Appends to the container node if one is specified, otherwise - * appends to body. - * - * @method createA - * @param {String} href url of page to link to - * @param {String} html inner html of link element to display - * @param {String} [target] target where new link should open, - * could be _blank, _self, _parent, _top. - * @return {Object/p5.Element} pointer to p5.Element holding created node - * @example - *
- * var myLink; - * function setup() { - * myLink = createA('http://p5js.org/', 'this is a link'); - * } - *
- */ - p5.prototype.createA = function(href, html, target) { - var elt = document.createElement('a'); - elt.href = href; - elt.innerHTML = html; - if (target) elt.target = target; - return addElement(elt, this); - }; - - /** INPUT **/ - - - /** - * Creates a slider <input></input> element in the DOM. - * Use .size() to set the display length of the slider. - * Appends to the container node if one is specified, otherwise - * appends to body. - * - * @method createSlider - * @param {Number} min minimum value of the slider - * @param {Number} max maximum value of the slider - * @param {Number} [value] default value of the slider - * @param {Number} [step] step size for each tick of the slider (if step is set to 0, the slider will move continuously from the minimum to the maximum value) - * @return {Object/p5.Element} pointer to p5.Element holding created node - * @example - *
- * var slider; - * function setup() { - * slider = createSlider(0, 255, 100); - * slider.position(10, 10); - * slider.style('width', '80px'); - * } - * - * function draw() { - * var val = slider.value(); - * background(val); - * } - *
- * - *
- * var slider; - * function setup() { - * colorMode(HSB); - * slider = createSlider(0, 360, 60, 40); - * slider.position(10, 10); - * slider.style('width', '80px'); - * } - * - * function draw() { - * var val = slider.value(); - * background(val, 100, 100, 1); - * } - *
- */ - p5.prototype.createSlider = function(min, max, value, step) { - var elt = document.createElement('input'); - elt.type = 'range'; - elt.min = min; - elt.max = max; - if (step === 0) { - elt.step = .000000000000000001; // smallest valid step - } else if (step) { - elt.step = step; - } - if (typeof(value) === "number") elt.value = value; - return addElement(elt, this); - }; - - /** - * Creates a <button></button> element in the DOM. - * Use .size() to set the display size of the button. - * Use .mousePressed() to specify behavior on press. - * Appends to the container node if one is specified, otherwise - * appends to body. - * - * @method createButton - * @param {String} label label displayed on the button - * @param {String} [value] value of the button - * @return {Object/p5.Element} pointer to p5.Element holding created node - * @example - *
- * var button; - * function setup() { - * createCanvas(100, 100); - * background(0); - * button = createButton('click me'); - * button.position(19, 19); - * button.mousePressed(changeBG); - * } - * - * function changeBG() { - * var val = random(255); - * background(val); - * } - *
- */ - p5.prototype.createButton = function(label, value) { - var elt = document.createElement('button'); - elt.innerHTML = label; - elt.value = value; - if (value) elt.value = value; - return addElement(elt, this); - }; - - /** - * Creates a checkbox <input></input> element in the DOM. - * Calling .checked() on a checkbox returns if it is checked or not - * - * @method createCheckbox - * @param {String} [label] label displayed after checkbox - * @param {boolean} [value] value of the checkbox; checked is true, unchecked is false.Unchecked if no value given - * @return {Object/p5.Element} pointer to p5.Element holding created node - * @example - *
- * var checkbox; - * - * function setup() { - * checkbox = createCheckbox('label', false); - * checkbox.changed(myCheckedEvent); - * } - * - * function myCheckedEvent() { - * if (this.checked()) { - * console.log("Checking!"); - * } else { - * console.log("Unchecking!"); - * } - * } - *
- */ - p5.prototype.createCheckbox = function() { - var elt = document.createElement('div'); - var checkbox = document.createElement('input'); - checkbox.type = 'checkbox'; - elt.appendChild(checkbox); - //checkbox must be wrapped in p5.Element before label so that label appears after - var self = addElement(elt, this); - self.checked = function(){ - var cb = self.elt.getElementsByTagName('input')[0]; - if (cb) { - if (arguments.length === 0){ - return cb.checked; - }else if(arguments[0]){ - cb.checked = true; - }else{ - cb.checked = false; - } - } - return self; - }; - this.value = function(val){ - self.value = val; - return this; - }; - if (arguments[0]){ - var ran = Math.random().toString(36).slice(2); - var label = document.createElement('label'); - checkbox.setAttribute('id', ran); - label.htmlFor = ran; - self.value(arguments[0]); - label.appendChild(document.createTextNode(arguments[0])); - elt.appendChild(label); - } - if (arguments[1]){ - checkbox.checked = true; - } - return self; - }; - - /** - * Creates a dropdown menu <select></select> element in the DOM. - * @method createSelect - * @param {boolean} [multiple] [true if dropdown should support multiple selections] - * @return {Object/p5.Element} pointer to p5.Element holding created node - * @example - *
- * var sel; - * - * function setup() { - * textAlign(CENTER); - * background(200); - * sel = createSelect(); - * sel.position(10, 10); - * sel.option('pear'); - * sel.option('kiwi'); - * sel.option('grape'); - * sel.changed(mySelectEvent); - * } - * - * function mySelectEvent() { - * var item = sel.value(); - * background(200); - * text("it's a "+item+"!", 50, 50); - * } - *
- */ - p5.prototype.createSelect = function(mult) { - var elt = document.createElement('select'); - if (mult){ - elt.setAttribute('multiple', 'true'); - } - var self = addElement(elt, this); - self.option = function(name, value){ - var opt = document.createElement('option'); - opt.innerHTML = name; - if (arguments.length > 1) - opt.value = value; - else - opt.value = name; - elt.appendChild(opt); - }; - self.selected = function(value){ - var arr = []; - if (arguments.length > 0){ - for (var i = 0; i < this.elt.length; i++){ - if (value.toString() === this.elt[i].value){ - this.elt.selectedIndex = i; - } - } - return this; - }else{ - if (mult){ - for (var i = 0; i < this.elt.selectedOptions.length; i++){ - arr.push(this.elt.selectedOptions[i].value); - } - return arr; - }else{ - return this.elt.value; - } - } - }; - return self; - }; - - /** - * Creates a radio button <input></input> element in the DOM. - * The .option() method can be used to set options for the radio after it is - * created. The .value() method will return the currently selected option. - * - * @method createRadio - * @param {String} [divId] the id and name of the created div and input field respectively - * @return {Object/p5.Element} pointer to p5.Element holding created node - * @example - *
- * var radio; - * - * function setup() { - * radio = createRadio(); - * radio.option("black"); - * radio.option("white"); - * radio.option("gray"); - * radio.style('width', '60px'); - * textAlign(CENTER); - * fill(255, 0, 0); - * } - * - * function draw() { - * var val = radio.value(); - * background(val); - * text(val, width/2, height/2); - * } - *
- *
- * var radio; - * - * function setup() { - * radio = createRadio(); - * radio.option('apple', 1); - * radio.option('bread', 2); - * radio.option('juice', 3); - * radio.style('width', '60px'); - * textAlign(CENTER); - * } - * - * function draw() { - * background(200); - * var val = radio.value(); - * if (val) { - * text('item cost is $'+val, width/2, height/2); - * } - * } - *
- */ - p5.prototype.createRadio = function() { - var radios = document.querySelectorAll("input[type=radio]"); - var count = 0; - if(radios.length > 1){ - var length = radios.length; - var prev=radios[0].name; - var current = radios[1].name; - count = 1; - for(var i = 1; i < length; i++) { - current = radios[i].name; - if(prev != current){ - count++; - } - prev = current; - } - } - else if (radios.length == 1){ - count = 1; - } - var elt = document.createElement('div'); - var self = addElement(elt, this); - var times = -1; - self.option = function(name, value){ - var opt = document.createElement('input'); - opt.type = 'radio'; - opt.innerHTML = name; - if (arguments.length > 1) - opt.value = value; - else - opt.value = name; - opt.setAttribute('name',"defaultradio"+count); - elt.appendChild(opt); - if (name){ - times++; - var ran = Math.random().toString(36).slice(2); - var label = document.createElement('label'); - opt.setAttribute('id', "defaultradio"+count+"-"+times); - label.htmlFor = "defaultradio"+count+"-"+times; - label.appendChild(document.createTextNode(name)); - elt.appendChild(label); - } - return opt; - }; - self.selected = function(){ - var length = this.elt.childNodes.length; - if(arguments.length == 1) { - for (var i = 0; i < length; i+=2){ - if(this.elt.childNodes[i].value == arguments[0]) - this.elt.childNodes[i].checked = true; - } - return this; - } else { - for (var i = 0; i < length; i+=2){ - if(this.elt.childNodes[i].checked == true) - return this.elt.childNodes[i].value; - } - } - }; - self.value = function(){ - var length = this.elt.childNodes.length; - if(arguments.length == 1) { - for (var i = 0; i < length; i+=2){ - if(this.elt.childNodes[i].value == arguments[0]) - this.elt.childNodes[i].checked = true; - } - return this; - } else { - for (var i = 0; i < length; i+=2){ - if(this.elt.childNodes[i].checked == true) - return this.elt.childNodes[i].value; - } - return ""; - } - }; - return self - }; - - /** - * Creates an <input></input> element in the DOM for text input. - * Use .size() to set the display length of the box. - * Appends to the container node if one is specified, otherwise - * appends to body. - * - * @method createInput - * @param {Number} [value] default value of the input box - * @param {String} [type] type of text, ie text, password etc. Defaults to text - * @return {Object/p5.Element} pointer to p5.Element holding created node - * @example - *
- * function setup(){ - * var inp = createInput(''); - * inp.input(myInputEvent); - * } - * - * function myInputEvent(){ - * console.log('you are typing: ', this.value()); - * } - * - *
- */ - p5.prototype.createInput = function(value, type) { - var elt = document.createElement('input'); - elt.type = type ? type : 'text'; - if (value) elt.value = value; - return addElement(elt, this); - }; - - /** - * Creates an <input></input> element in the DOM of type 'file'. - * This allows users to select local files for use in a sketch. - * - * @method createFileInput - * @param {Function} [callback] callback function for when a file loaded - * @param {String} [multiple] optional to allow multiple files selected - * @return {Object/p5.Element} pointer to p5.Element holding created DOM element - * @example - * var input; - * var img; - * - * function setup() { - * input = createFileInput(handleFile); - * input.position(0, 0); - * } - * - * function draw() { - * if (img) { - * image(img, 0, 0, width, height); - * } - * } - * - * function handleFile(file) { - * print(file); - * if (file.type === 'image') { - * img = createImg(file.data); - * img.hide(); - * } - * } - */ - p5.prototype.createFileInput = function(callback, multiple) { - - // Is the file stuff supported? - if (window.File && window.FileReader && window.FileList && window.Blob) { - // Yup, we're ok and make an input file selector - var elt = document.createElement('input'); - elt.type = 'file'; - - // If we get a second argument that evaluates to true - // then we are looking for multiple files - if (multiple) { - // Anything gets the job done - elt.multiple = 'multiple'; - } - - // Function to handle when a file is selected - // We're simplifying life and assuming that we always - // want to load every selected file - function handleFileSelect(evt) { - // These are the files - var files = evt.target.files; - // Load each one and trigger a callback - for (var i = 0; i < files.length; i++) { - var f = files[i]; - var reader = new FileReader(); - function makeLoader(theFile) { - // Making a p5.File object - var p5file = new p5.File(theFile); - return function(e) { - p5file.data = e.target.result; - callback(p5file); - }; - }; - reader.onload = makeLoader(f); - - // Text or data? - // This should likely be improved - if (f.type.indexOf('text') > -1) { - reader.readAsText(f); - } else { - reader.readAsDataURL(f); - } - } - } - - // Now let's handle when a file was selected - elt.addEventListener('change', handleFileSelect, false); - return addElement(elt, this); - } else { - console.log('The File APIs are not fully supported in this browser. Cannot create element.'); - } - }; - - - /** VIDEO STUFF **/ - - function createMedia(pInst, type, src, callback) { - var elt = document.createElement(type); - - // allow src to be empty - var src = src || ''; - if (typeof src === 'string') { - src = [src]; - } - for (var i=0; i