Categories
Art Art Computing Free Software Generative Art Projects

Small Sensoria 1

The electronics

This is the test setup for “Small Sensoria”. It is several LEDs being (mis-used) as light sensors connected to an Arduino. The USB cable connects them to a computer running a Processing sketch that renders the light intensities.

The values can be plotted linearly:

linearOr radially:
radialNext I am going to make the Arduino unit more independent by adding a Bluetooth shield, battery power, and wiring the LEDs up to it.

You can get the Arduino and Processing source code here:

https://gitorious.org/robmyers/small-sensoria

Categories
Art Art History Art Open Data Free Culture Free Software Projects

Art Open Data – Government Art Collection Dataset

I have written a script to download a dataset containing collection information from the UK Government Art Collection site and save it in tab-seperated-value files and an sqlite database for easy access. As the data is from a UK government agency it’s under the OGL.

You don’t need to run the script, a downloaded dataset is included in the project archive:

https://gitorious.org/robmyers/government-art-collection/

https://gitorious.org/robmyers/government-art-collection/trees/master/2011-12-11

The dataset doesn’t feature as many collections as the GAC website claims to feature, but the script does omit many duplicates. This project was inspired by Kasabi‘s scraper, adding the ability to download code and data in an easy-to-use format.

Categories
Aesthetics Art Art Computing Art History Free Culture Free Software Generative Art Howto Projects Satire

Psychogeodata (3/3)

cemetary random walk

The examples of Psychogeodata given so far have used properties of the geodata graph and of street names to guide generation of Dérive. There are many more ways that Psychogeodata can be processed, some as simple as those already discussed, some much more complex.

General Strategies

There are some general strategies that most of the following techniques can be used as part of.

  • Joining the two highest or lowest examples of a particular measure.

  • Joining the longest run of the highest or lowest examples of a particular measure.

  • Joining a series of destination waypoints chosen using a particular measure.

The paths constructed using these strategies can also be forced to be non-intersecting, and/or the waypoints re-ordered to find the shortest journey between them.

Mathematics

Other mathematical properties of graphs can produce interesting walks. The length of edges or ways can be used to find sequences of long or short distances.

Machine learning techniques, such as clustering, can arrange nodes spatially or semantically.

Simple left/right choices and fixed or varying degrees can create zig-zag or spiral paths for set distances or until the path self-intersects.

Map Properties

Find long or short street names or street names with the most or fewest words or syllables and find runs of them or use them as waypoints.

Find all the street names on a particular theme (colours, saints’ names, trees) and use them as waypoints to be joined in a walk.

Streets that are particularly straight or crooked can be joined to create rough or smooth paths to follow.

If height information can be added to the geodata graph, node elevation can be used as a property for routing. Join high and low points, flow downhill like water, or find the longest runs of valleys or ridges.

Information about Named entities extracted from street, location and district names from services such as DBPedia or Freebase and used to connect them. Dates, historical locations, historical facts, biographical or scientific information and other properties are available from such services in a machine-readable form.

Routing between peaks and troughs in sociological information such as population, demographics, crime occurrence, ploitical affiliation, property prices can produce a journey through the social landscape.

Locations of Interest

Points of interest in OpenStreetMap’s data are represented by nodes tagged as “historic”, “amenity”, “leisure”, etc. . It is trivial to find these nodes to use as destinations for walks across the geodata graph. They can then be grouped and used as waypoints in a route that will visit every coffee shop in a town, or one of each kind of amenity in alphabetical order, in an open or closed path for example. Making a journey joining each location with a central base will produce a star shape.

Places of worship (or former Woolworth stores can be used to find https://en.wikipedia.org/wiki/Ley_line using linear regression or the techniques discussed below in “Geometry and Computer Graphics”.

Semantics

The words of poems or song lyrics (less stopwords), matched either directly or through hypernyms using Wordnet, can be searched for in street and location names to use as waypoints in a path. Likewise named entities extracted from stories, news items and historical accounts.

More abstract narratives can be constructed using concepts from The Hero’s Journey.

Nodes found using any other technique can be grouped or sequenced semantically as waypoints using Wordnet hypernym matching.

Isomorphism

Renamed Tube maps, and journeys through one city navigated using a map of another, are examples of using isomorphism in Psychogeography.

Entire city graphs are very unlikely to be isomorphic, and the routes between famous locations will contain only a few streets anyway, so sub-graphs are both easier and more useful for matching. Better geographic correlations between locations can be made by scoring possible matches using the lengths of ways and the angles of junctions. Match accuracy can be varied by changing the tolerances used when scoring.

Simple isomorphism checking can be performed using The NetworkX library’s functions . Projecting points from a subgraph onto a target graph then brute-force searching for matches by varying the matrix used in the projection and scoring each attempt based on how closely the points match . Or Isomorphisms can be bred using genetic algorithms, using degree of isomorphism as the fitness function and proposed subgraphs as the population.

The Social Graph

Another key contemporary application of graph theory is Social Network Analysis. The techniques and tools from both the social science and web 2.0 can be applied directly to geodata graphs.

Or the graphs of people’s social relationships from Facebook, Twitter and other services can mapped onto their local geodata graph using the techniques from “Isomorphism” above, projecting their social space onto their geographic space for them to explore and experience anew.

Geometry and Computer Graphics

Computer geometry and computer graphics or computer vision techniques can be used on the nodes and edges of geodata to find forms.

Shapes can be matched by using them to cull nodes using an insideness test or to find the nearest points to the lines of the shape. Or line/edge intersection can be used. Such matching can be made fuzzy or accurate using the matching techniques in “Isomorphism”.

Simple geometric forms can be found – triangles, squares and quadrilaterals, stars. Cycle bases may be a good source of these. Simple shapes can be found – smiley faces, house shapes, arrows, magical symbols. Sequences of such forms can be joined based on their mathematical properties or on semantics.

For more complex forms, face recognition, object recognition, or OCR algorithms can be used on nodes or edges to find shapes and sequences of shapes.

Classic computer graphics methods such as L-sytems, turtle graphics, Conway’s Game of Life, or Voronoi diagrams can be applied to the Geodata graph in order to produce paths to follow.

Geometric animations or tweens created on or mapped onto the geodata graph can be walked on successive days.

Lived Experience

GPS traces generated by an individual or group can be used to create new journeys relating to personal or shared history and experience. So can individual or shared checkins from social networking services. Passenger level information for mass transport services is the equivalent for stations or airports.

Data streams of personal behaviour such as scrobbles, purchase histories, and tweets can be fetched and processed semantically in order to map them onto geodata. This overlaps with “Isomorphism”, “Semantics”, and “The Social Graph” above.

Sensor Data

Temperature, brightness, sound level, radio wave, radiation, gravity and entropy levels can all be measured or logged and used as weights for pathfinding. Ths brings Psychogeodata into the realm of Psychogeophysics.

Conclusion

This series of posts has made the case for the concept, practicality, and future potential of Psychogeodata. The existing code produces interesting results, and there’s much more that can be added and experienced.

(Part one of this series can be found here, part two can be found here . The source code for the Psychogeodata library can be found here .)

Categories
Aesthetics Art Art Computing Art Open Data Free Culture Free Software Generative Art Howto Projects Satire

Psychogeodata (2/3)

derive_sem

Geodata represents maps as graphs of nodes joined by edges (…as points joined by lines). This is a convenient representation for processing by computer software. Other data can be represented in this way, including words and their relationships.

We can map the names of streets into the semantic graph of WordNet using NLTK. We can then establish how similar words are by searching the semantic graph to find how far apart they are. This semantic distance can be used instead of geographic distance when deciding which nodes to choose when pathfinding.

Mapping between these two spaces (or two graphs) is a conceptual mapping, and searching lexicographic space using hypernyms allows abstraction and conceptual slippage to be introduced into what would otherwise be simple pathfinding. This defamiliarizes and conceptually enriches the constructed landscape, two key elements of Psychogeography.

The example above was created by the script derive_sem, which creates random walks between semantically related nodes. It’s easy to see the relationship between the streets it has chosen. You can see the html version of the generated file here, and the script is included with the Psychogeodata project at https://gitorious.org/robmyers/psychogeodata .

(Part one of this series can be found here, part three will cover potential future directions for Psychogeodata.)

Categories
Art Art Computing Art History Free Culture Free Software

Source Code

The part of my review of “White Heat Cold Logic” that seems to have
caught people’s attention is:

“for preservation, criticism and artistic progress (and I do mean
progress) it is vital that as much code as possible is found and
published under a Free Software licence (the GPL). Students of art
computing can learn a lot from the history of their medium despite the
rate at which the hardware and software used to create it may change,
and code is an important part of that.”

http://www.furtherfield.org/features/reviews/white-heat-cold-logic

I have very specific reasons for saying this, informed by personal
experience.

When I was an art student at Kingston Polytechnic, I was given an
assignment to make a new artwork by combining two previous artworks: a
Jackson Pollock drip painting and a Boccioni cyclist. I could not “read”
the Boccioni cyclist: the forms did not make sense to me, and so I was
worried I would not be able to competently complete the assignment. As
luck would have it there was a book of Boccioni’s drawings in the
college library that included the preparatory sketches for the painting.
Studying them allowed me to understand the finished painting and to
re-render it in an action painting style.

When I was a child, a book on computers that I bought from my school
book club had a picture of Harold Cohen with a drawing by his program
AARON. The art of AARON has fascinated me to this day, but despite my
proficiency as a programmer and as an artist my ability to “read”
AARON’s drawings and to build on Cohen’s work artistically is limited by
the fact that I do not have access to their “preparatory work”, their
source code.

I have been told repeatedly that access to source code is less important
than understanding the concepts behind the work or experiencing the work
itself. But the concepts are expressed through the code, and the work
itself is a product of it. I can see a critical case being made for the
idea that “computer art” fails to the extent that the code rather than
the resultant artwork is of interest. But as an artist and critic I want
to understand as much of the work and its history as possible.

So my call for source code to be recovered (for historical work) and
released (for contemporary work) under a licence that allows everyone to
copy and modify it comes from my personal experience of understanding
and remaking an artwork thanks to access to its preparatory materials on
the one hand and the frustration of not having access to such materials
on the other. And I think that awareness of and access to source code
for prior art (in both senses of the term) will enable artists who use
computers to stop re-inventing the wheel.

If you are making software art please make the source code publicly
available under the GPL3+, and if you are making software-based net art
please make it available under the AGPL3+ .

Categories
Art Computing Art Open Data Free Software Projects

R Cultural Analytics Library Update

The R Cultural Analytics library has been updated to remove any dependency on EBImage (which in turn has a dependency on ImageMagick that complicates installation on many systems). In now uses raster images instead. This has also made the code faster.

You can find the new version and installation instructions here:

https://r-forge.r-project.org/R/?group_id=1249

Categories
Free Software Satire

artbollocks-mode update

artbollocks-mode now calculates various text metrics: word and sentence count and several readability scores. You can access these through the mode’s keymap.

Download artbollocks-mode.el here:

https://gitorious.org/robmyers/scripts/blobs/master/artbollocks-mode.el

Categories
Art Computing Art Open Data Free Software

Exploring Art Data 23

Having written a command-line interface (CLI), we will now write a graphical user interface (GUI). GUIs can be an effective way of managing the complexity of software, but their disadvantage is that they usually cannot be effectively scripted like CLI applications and that they usually cannot be extended or modified as simply or as deeply as code run from a REPL.

That said, if software is intended as a stand-alone tool for performing tasks that will not be repeated and do not require much setup, a GUI can be very useful. So we will write one for the code in image-properties.r

As with the CLI version, we will run this code using RScript. The script can be run from the command line, or an icon for it can be created in the operating system’s applications menu or dock.

#!/usr/bin/env Rscript
## -*- mode: R -*-


The GUI framework that we will use is the cross-platform gWidgets library. I have set it up to use Gtk here, but Qt and Tk versions are available as well. You can find out more about gWidgets at http://cran.r-project.org/web/packages/gWidgets/index.html.

## install.packages("gWidgetsRGtk2", dep = TRUE)
require(gWidgets)
options("guiToolkit"="RGtk2")


We source properties-plot.r to load the code that we will use to plot the image once we have gathered all the configuration information we need using the GUI

source('properties-plot.r')


The first part of the GUI that we define is the top level window and layout. The layout of the top level window is a tabbed pane of the kind used by preferences dialogs and web browsers. We use this to organise the large number of configuration options for the code and to present them to the user in easily understood groupings.
Notice the use of “layout” objects as matrices to arrange interface widgets such as buttons within the window and later within each page of the “notebook” tabbed view.

win


The first tab contains code to create and handle input from user interface elements for selecting the kind of plot, the data file and folder of images to use, and the file to save the plot as if required. It also allows the user to specify which properties from the data file to plot.

table


We use functions to allow the user to choose the data file, image folder, and save file. Using the GUI framework's built-in support for file choosing makes this code remarkably compact.

setDataFile


Often part of the GUI must be updated, enabled or disabled in response to changes in another part. When the user selects a "Display" plot we need not require the user to select a file to save the plot in, as the plot will be displayed in a window on the screen. The next functions implement this logic.

updateSaveFile


The second tab contains fields to allow the user to configure the basic visual properties of the plot, its height, width, and background colour.

table


The third tab allows the user to control the plotting of images, labels, points and lines.

table


The fourth (and final) tab allows the user to manage how the axes are plotted.

table4


Having created the contents of each tab, we set the initial tab that will be shown to the user and display the window on the screen.

svalue(nb)


Next we will write code to set the values of the global variables from the GUI, and perform a render. Until then, we can define a do-nothing renderImage function to allow us to run and test the GUI code.

renderImage


If we save this code in a file called propgui and make it executable using the shell command:

chmod +x propgui

We can call the script from the command line like this:

./propgui

We can enter values into the fields of the GUI, choose files, and press buttons (although pressing the Render button will of course have no effect yet).

Categories
Aesthetics Art Free Software Projects Satire

artbollocks-mode.el

I turned the scripts I use for avoiding various cardinal sins of art
writing into an Emacs minor mode. This means that you can run it in your Emacs session as you write.

What do you mean you don’t use Emacs? Don’t be silly. 😉

https://gitorious.org/robmyers/scripts/blobs/master/artbollocks-mode.el

Categories
Aesthetics Art Art Computing Free Software Politics Projects Satire

SendValues

SendValues is a network testing tool that sends mathematical, aesthetic and textual values using the properties of rather than the contents of network messages.

You can get the source code here: https://gitorious.org/robmyers/values-sender

Both a stand-alone command-line version and an IRC-client version are included.

SendValues uses a naive pulse-width-modulation scheme for encoding values. Any improvements to the code gratefully received.

Here is the README:

SendValues is a system for transmitting aesthetic expression and political speech using properties of network protocols.

There are two versions, a command-line client and an IRC client. They use the same code and concepts apart from their different interfaces.

* Concepts

** Senders

A sender is a way of sending information over the network using an IP-based protocol. SendValues has the following senders:

TCP – Sends messages as TCP/IP connections.
UDP – Sends messages as UDP packets.
SYN – Sends messages as SYN requests.
HTTP – Sends messages as HTTP requests.
PING – Sends messages as ICMP echo requests.

Senders may be specified to the command line or IRC clients by these names.

** Values

A value is a message to be sent to a host using a sender. Values are quantized by the sender and transmitted over the network as naive pulse width modulation values.

SINE – A sine wave (argument is number of steps).
SQUARE – A square wave (argument is number of steps).
SAWTOOTH – A sawtooth wave (argument is number of steps).
TRIANGLE – A triangle wave (argument is number of steps).
TEXT – A block of text (argument is text to send).
IMAGE – An image, to be sent as 1-bit pbm data  (argument is image URL).

* The Command Line Client

The command line client takes all of its arguments from the command line.

-h, –help       – Print the help and exit.
-o, –host      – The host address to send to.
-s, –sender     – The sender to use (from the list above).
-m, –method     – The values generation method to use (from the list above).
-a, –argument     – The argument to the values generation method.
-c, –cell     – How long each value takes to send (in milliseconds).
-d, –duration     – How long to send values to the host.

These all have default values, including host which defaults to localhost.

* The IRC Client

The IRC client takes its initial configuration from the command line. Once it has connected to an IRC channel it takes commands from messages on that channel.

Command line arguments:

-h, –help    – Print the help and exit.
-s, –server    – The IRC server to connect to.
-p, –port    – The port on the IRC server to use (defaults to 6667).
-c, –channel    – The channel on the server to take commands from (omit #).
-u, –user    – The user on the channel to take commands from.

Channel and user default to “artcommands”.

Commands to the IRC channel have the following formats:

START [sender:]host[:port] kind[:argument]

Start sending values of the given kind to host using sender.
Where only sender or port are specified, the clients will guess which.
Argument can be a number of steps for wave senders, a url for the image sender, or arbitrary text for the text sender.

STOP host

Stop sending to the host. The host must be specified exactly as it was in the START command

STOP

Stop sending to all hosts.