The Generative Design book describes this exercise as follows: ‘Which characters appear, and how often? The properties of an analyzed text can generate images. The number of appearances in a text is calculated for each character and determines its appearance. The color of the letters, for instance, corresponds to how often they appear. Ultimately we do not even need the letters anymore. A text is processed character by character, and each character’s corresponding counter is advanced. That results in a list of counters representing the frequency of each character. These values can now be used as parameters for displaying the text.’
I started with changing the global variable names of the original program. Made the size of the text 10. Changed the font to DINAlternate-Bold and selected the first paragraph from Thomas More’s ‘Utopia’ for the text.
Set the initialized DrawAlpha to false. Tried to connect the fill color of the typeface to the CharacterCounter[index]. The characters which are not used much in the text get a red color. They are getting yellow when used often. Made a println command for CharacterCounter. It gives me numbers ranging from 0 – 585. Maybe its better to change from RGB to HSB. In that way I can control the color better. Drawback is that the pdf-file gives weird color results.
Changed mouseInterpolation to mouseY because I think it supports the movements on the screen more naturally than the mouseX. Used CharacterCounter / 1.5 for the point size.
Added the zoom function from the earlier exercises. But it zooms only from the top left of the textblock. Tried to solve it with push- and popMatrix but that seems not to work. It should be possible to define an origin-point.
I wonder how long a text can be? Had the complete book text of Thomas More’s ‘Utopia loaded. This made my system a bit less responsive. So I reduced the total text until I had ony the first paragraph (again).
Changed the background, size, text and colors. The lines are now representing which character appears most often in the text.
I made a mistake. Instead of making stroke (25). I made it 250. There was still a previous zero in the line. And that gave me this image. StrokeWeight is now 10.
What happens if I make a very thick line. Lets say 100. That is pretty interesting.
What if I turn on strokeCap (SQUARE).
Did some swapping with the interX and interY variables.
When changing the global variable names I am aware that I am asking for lots of mistakes. From the other hand you get a better understanding about what the program does. I have solved all those problems now but it is extra work which you will not see from the outside. What I try to find out now is what does the variable tracking do. It has now a value of 29. I changed it to 50. It seems to increase the white space between the lines. But with a setting of 50 they are going to be displayed outside the display window. I change it to a 100. And change it to -100. I think tracking is responsible for the line spacing. So I change that global variable name to LineSpacing. Another thing in the previous exercises is the colorMode. I initialized colorMode in setup. That means that it is not possible to create a pdf-file with the right colors. In this exercise colorMode is called in draw. Lets see if that makes any difference. Yes! That solves the problem. So to make pdf’s which use the same colors as the png-files you have to start colorMode in draw. Not in setup.
Experimenting with line length, weight and angle. That lead to nothing special until I shifted the line and ellipse x, y positions about a 100 pixels to the right and 100 pixels down.
Still think this image is much too chaotic. I think I should shorten the lines and the movement of the letters.
Gave the letters a bit more space to move around. Linethicknes is now 10. StrokeCap Square.
I worked on this file two days ago. Luckey it seems to be a happy accident. Which is fine.
I found that there is one variable named charSize. And another one is charColor. These variables are not used. I don’t know why. So I commented them out. And as far as I can judge the program functions normal. Another thing is that when I changed the German Faust text into the English Utopia text I did not realize that I can skip certain characters from the WhichCharacters string. ÄÖÜ and ß are characters which are not used in the English language. I also removed the alpha from the colors and set saturation and brightness to a 100. Instead of one line representing a line of characters I used 5 lines.
Swapped the interX and interY positions. This makes the behaviour very slow but it gives an interesting image.
Removed the for loop that generated 5 lines instead of 1. Increased the strokeweight to 4.
Used PosX to increase every round it goes through the loop. Increased the strokeWeight to 100. Alpha is 2.
Rotated everything -90 degrees. Tweaked the line- and textwidth that fall’s in between the 0 – 800 display range. Text is colored using the index. Gray lines are also colored using that method. Everything is still not 100%. But this is a learning process (I keep telling myself).