Casualty 14-18 ~ The making of a generative artwork by Richard Bolam – Part 10 #bolamat50 #casualty1418 #WW1

Untitled 3

This time I have added a similar routine to fill from the bottom-right to top-left. The next iteration might be to create a contiguous group in the middle that could have a ragged edge on the top and on the bottom (see below).

Code fragment:

UNITCOUNT=$[RANDOM % 340]

UNITROWS=$[$UNITCOUNT / 20]
UNITCOLUMNS=$[$UNITCOUNT % 20]
echo $”UNITCOUNT = “$UNITCOUNT#” – “$UNITROWS” rows, “$UNITCOLUMNS” columns”

UNITCOL1=”$[RANDOM % 255],$[RANDOM % 255],$[RANDOM % 255]”

# create top-left to bottom-right flow of figures using colourised blocks
echo “bottom “$[$UNITROWS * 38]
if [ $UNITROWS -ne 0 ] ; then
convert casualtytiled.png -region 400x$[$UNITROWS * 38]+0+0 -fill “rgba($UNITCOL1)” -colorize 30% casualtytiled.png
fi
if [ $UNITCOLUMNS -ne 0 ] ; then
convert casualtytiled.png -region $[$UNITCOLUMNS * 20]x38+0+$[$UNITROWS * 38] -fill “rgba($UNITCOL1)” -colorize 30% casualtytiled.png
fi

UNITCOUNT=$[RANDOM % 340]
UNITROWS=$[$UNITCOUNT / 20]
UNITCOLUMNS=$[$UNITCOUNT % 20]
echo $”UNITCOUNT = “$UNITCOUNT#” – “$UNITROWS” rows, “$UNITCOLUMNS” columns”

UNITCOL1=”$[RANDOM % 255],$[RANDOM % 255],$[RANDOM % 255]”

# create bottom-right to top-left flow of figures using colourised blocks
echo “rows from bottom “$[$UNITROWS * 38]
if [ $UNITROWS -ne 0 ] ; then
convert casualtytiled.png -region 400x$[$UNITROWS * 38]+0+$[646 – $[$UNITROWS * 38]] -fill “rgba($UNITCOL1)” -colorize 30% casualtytiled.png
fi
if [ $UNITCOLUMNS -ne 0 ] ; then
convert casualtytiled.png -region $[$UNITCOLUMNS * 20]x38+$[400 – $[$UNITCOLUMNS * 20]]+$[608 – $[$UNITROWS * 38]] -fill “rgba($UNITCOL1)” -colorize 30% casualtytiled.png
fi

Untitled 2

I have started to organise the routines into functions so that I can call them in a more structured way. More soon…

Advertisements

Casualty 14-18 ~ The making of a generative artwork by Richard Bolam – Part 9 #bolamat50 #casualty1418 #WW1

Screen shot 2014-08-10 at 18.49.00

In the parlance of modern coders:

BOOM!

I have implemented the batch creation of images and the automated posting of multiple, scheduled blog posts. It’s spam technology, basically, and I am rather pleased with myself.

I hasten to add that the code, although reliable, is quite klunky so far, with no error-checking, no error-correction, no subroutines or functions and no audit-logging. The software echoes some info to the console for me to keep an eye on it, but am still checking each blog individually post for errors.

However, it’s only a development version of the software, but it works! The important part of this is that what I have done so far is a successful proof of concept of the workflow; creating the images, batch emailing them and automatically scheduling the posts over consecutive days. I am just doing batches of three days initially, but when I have checked the software more I will extend the period as there is no way I can attend this project every day for more than four years.

http://casualty1418.net

As I have said before, I am not an expert programmer, but I have done a lot of programming over the years, all the way back to 1980. However, I must say Bash is very odd, although it can do, well pretty much anything although some achievements with it require an almost religious devotion and a huge leap of faith. It’s not for the faint-hearted or the easily diverted.

Fortunately my heart is not faint and I am rediscovering something of the evangelical excitement I remember from those early days of programming.

Anyway, I think I might also start printing these out on actual paper. I had not intended to print this version of the work at all, but it might make a interesting adjunct to the online version.

Code fragment:

#!/bin/bash
#casualty make script v14

for d in {1..3}
do
CURRENTDATE=$(date -v+$d’d’ +”%y_%m_%d”)
CURRENTLABELDATE=$(date -v+$d’d’ +”%d/%m/%y”)
SCHEDULEDATE=$(date -v+$d’d’ +”%Y-%m-%d”)
echo $CURRENTDATE
echo $SCHEDULEDATE

mkdir ‘Casualty1418-‘$CURRENTDATE
PATHNAME=’Casualty1418-‘$CURRENTDATE’/’
echo $PATHNAME

#image creation code here…

#email images to blog
cd $PATHNAME
FILENAMES=*.png
FILENAMES2=’-a ‘`echo $FILENAMES | sed ‘s/ / -a /g’`
echo $FILENAMES2

echo ‘[delay ‘$SCHEDULEDATE’ 07:00:00 GMT][tags #casualty1418,#bolamat50,#WW1,Casualty,Casualty 14-18,#firstworldwar,First World War,generative,algorithmic,computational,art,Richard Bolam,Bolam Retrospective,#bolamat50][nogallery]’ | mutt $FILENAMES2 -s ‘Casualty 14-18 ~ ‘$CURRENTLABELDATE’ #WW1 #casualty1418′ youruniqueemailaddress@post.wordpress.com
cd ..

done

The next stage of development might include rewriting the code to be a bit cleaner and structured. It would be better to attend to that now, rather than later when there is a lot more sauce on the spaghetti.

Stay tuned…