The Code

Works of art are usually introduced with the medium used to create them.Computer code is the medium of Generative Arabic Letterism. The code used starts with generic coding constructs of programmed in JavaScript and builds higher order programming objects that are capable of generating art.

The programming objects are actually abstractions in themselves. Based on its visual characteristics, Generative Arabic Lettersim could be classified within the territory of Abstract Expressionism. It is also embodies abstractions in the alphanumeric dimension in the form of the programmatic objects used to create the visual abstractions.

An example of an object is listed in the following:

// Arabic Letterism
// Khalid M. Khalid
// October 2012

// Scattering letters about a straight line

#target illustrator
#include "./letterism-core(T).jsx"
#include "./DotMachine.jsx"

function clsLetterBandFlat (fitpath, frequency, amplitude, size, density, dstyle) {
	var point = fitpath.pathPoints[0];
	var p1 = new clsPoint(point.anchor[0], point.anchor[1]);
	point = fitpath.pathPoints[1];
	var p2 = new clsPoint(point.anchor[0], point.anchor[1]);
	var d = p1.distance(p2) / frequency;
	var h;
	var w;
	var lt;
	var dt;
	var rect;
	// Todo: solve setup drawing style from within vs from outside
	var ds = new clsDrawingStyle();
	ds.fillOpacity = 60;
	ds.stroked = false;
	ds.filled - true;
	var top = p1.y + amplitude;
	for(var i = 0; i < frequency; i++) {
		for (var j = 0; j < density; j++){
			if(flipCoin(0.75)) { // 75% characters, rest dots
				h = getRandomNumber(0.75,1.5) * size * amplitude;
				//Debug
				///var ln = new clsLine(point, point.polar(ang - hpi, amplitude - h));
				//ln.draw();
				lt = new clsShapeObject();
				w = h / lt.height * lt.width;
				rect = new clsRectangle(p1.x - d * i - w / 2, top - getRandomNumber(0, 1) * (amplitude - h), w, h);
				//Debug
				//rect.draw();
				ds.fillColor = gColorScheme.getIndexedColor(getRandomInt(0, gColorScheme.palette.length));
				lt.fit(rect, ds);
			}
			else { // draw some dots
				h = getRandomNumber(0.1, 0.2) * size * amplitude;
				w = getRandomInt(5,10) * h;
				rect = new clsRectangle(p1.x - d * i - w / 2, top - getRandomNumber(0, 1) * (amplitude - h), w, h);
				ds.fillColor = gColorScheme.getIndexedColor(getRandomInt(0, gColorScheme.palette.length));
				dt = new clsDotMachine(rect, ds);
			}

		}
	}
}

var gOrigin = Origin();
gShapeTree = readXMLFile();
gColorScheme = new clsColorScheme();
gColorScheme.getAiPalette("purple");
if(app.activeDocument.selection.length > 0) {
	var p = app.activeDocument.selection[0];
	var lb = new clsLetterBandFlat(p, 20, 150, 0.5, 5);
}
gOrigin.restore();

Numeric abstractions have long since fascinated me. It was in secondary school when I studied differentiation and integration that I came to realize the capabilities of mathematics in modelling reality. My delight was heightened when I discovered the capabilities of Object Oriented Programming, where physical reality could be abstracted in programmatic objects that had properties and behavior.

Computer coding is not entirely technical. In itself, whether used to generate art or in other mainstream applications, computer programming exhibits certain aesthetic characteristics. I find that there is a kind of abstract beauty in recursion, for example, while most of the pleasure I find in programming arises from creating programmatic objects that are abstractions of some process or a real life object. Once I am successful in building a self-contained robust programmatic, I then go crazy with it by passing it the parameters that would make it do all things I want it to do. The organization of code into neat structures that represent simple and replicable solutions is indeed an artistic process as much as it is scientific.

Building the Generative Arabic Letterism system went through two stages. In the first stage the focus was on building a library of primitive objects such as points, lines, circles, rectangles, and letter shapes. Once this infrastructure is there, higher level objects made would have names that are symbolic of the art they attempt to create. You would find objects such as LetterMosaics, Centrefuges, or LetterBands each with a specific usage and visual output.

I have been using computer programming for many personal projects in the past 20 years or so. My first coding experience was with BASIC, and even that primitive language appealed to me with an aesthetic sense. I expressed my fascination then in a poem written in pseudo-BASIC syntax. The aesthetic appeal increased with the migration to more powerful procedural programming language, and ultimately with Object Oriented Programming.

My poem in BASIC is listed below:

'C H I M P S   B Y T E
'BY KHALID M. KHALID
'BAGHDAD 1991

10 CLEAR
20 EASY, SLOWLY : CLEAR
30 AND FORGET
40 WHAT THEY SAY
50 COME
60 COME TO ME
70 YOU'VE GOT EYES
80 YOU CAN SEE
90 SO WHY NOT FOR ONE TIME
100 BE FREE
110 FOR TIME=MORNING TO NIGHT
120 DAY AFTER DAY
130 IN DELIGHT
140 WITH WORDS THEY PLAY
150 NIETZSCHE SAID:"GOD IS DEAD"
160 NEXT
170 NIETZSCHE IS DEAD
180 GOTO 300
190 IS IT TRUE:IS IT TRUE:IS IT TRUE:IS IT TRUE
200 THAT ME:THAT ME
210 AND YOU:AND YOU
220 LIVE ON A PLANET OF APES
230 YOU'VE GOT EYES
240 YOU CAN SEE
250 WHAT THE NATIONAL GEOGRAPHICAL SOCIETY
260 IS DOING
270 TO YOU:TO ME
280 X$=G$+U$+I$+C$+E$
290 X$="ROT THE WORLD"
300 HELL
310 END

Yet, despite my very high interest in programming, I have not really studied programming or software engineering systematically. My approach is pragmatic and I only researched what I need to get the ideas in my mind done. Being a professional programmer was not my objective. The trick here is to follow a balanced approach in how much one would invest in learning the programming techniques that would do the job.

In many ways, I consider the internet my teacher. In most of the times it would have the answer to my questions. Whatever programming technique I needed I could find on the internet, most of the times for free. I do not remember having to purchase code for any of my projects. The internet certainly has the potential to make a shift in the learning process for the coming generations. With minimal basic education the internet could provide for the knowledge needed in any discipline.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s