Marcus Aurelius Meditations

Published by Tim on Sunday April 2, 2023

Last modified on May 14th, 2023 at 9:39

Since the beginning of the Corona crisis, I have been more and more interested in the history of ancient philosophy. The topic has grabbed me directly and no longer let go. And so I often spend my Sundays collecting second-hand books, reading and painting in them to make this abstract world a little more tangible to me.

I used to be very interested in psychology. And an interesting intersection between psychology and philisophy is represented by the philosophical schools of Hellenism. Stoicism in particular is very interesting in times of crisis. Books like the Meditations of Marcus Aurelius I have read and worked through several times. And I’ve always wondered how the knowledge from such books could be made available digitally in a useful way.

Ancient texts are almost all in the public domain, even in their translations, and so you can download them and work with them creatively. I have taken the Meditations of Marcus Aurelius, prepared the data cleanly and built a boilerplate for experiments with this work.

JSONArray json;

ArrayList<Verse> verses;

color black = #000000;
color white = #f1f1f1;
color grey = #AAAAAA;
color blue = #2700A2 ;
color green = #000000;

color FG1 = #0000FF;
color BG1 = #AAAAAA;

color FG2 = #AAAAAA;
color BG2 = #0000FF;

color FG, BG;

float offsetY = 0;
float padding = 10;

PFont font;
float txtSize = 150;

String txt, book, verse;
int verseAmount;

int selector = 0;

void setup() {

  size(1200, 900);

  offsetY = height;

  strokeCap(RECT);

  json = loadJSONArray("meditations.json");
  font = createFont("sans.otf", 1000);

  verses = new ArrayList<Verse>();

  for (int i = 0; i < json.size(); i++) {
    JSONObject item = json.getJSONObject(i);

    String txt = item.getString("english");
    String book = item.getString("book");
    String verse = item.getString("verse");
    Verse v = new Verse(txt, book, verse);
    verses.add(v);
  }
}

void draw() {
  background(BG);
  noStroke();

  verseAmount = json.size();

  Verse v = verses.get(selector);

  if (int(v.book) % 2 == 0) {
    FG = FG1;
    BG = BG1;
  } else {
    FG = FG2;
    BG = BG2;
  }

  drawProgressBar(v);
  v.display();


  offsetY -= 10;

  if (keyPressed) {
    if (keyCode == 37) {
      selector = selector - 1;
    } else if (keyCode == 39) {
      selector = selector + 1;
    }
    offsetY = height;
  }
}

class Verse {

  String txt;
  int book;
  int verse;

  Verse(String _txt, String _book, String _verse) {
    txt = _txt;
    book = int(_book);
    verse = int(_verse);
  }

  void display() {


    push();
    translate(padding, padding + offsetY);
    fill(BG);
    rect(0, 0, width, height*100-50);
    textFont(font);
    textSize(txtSize);
    textLeading(txtSize);
    textAlign(LEFT, TOP);
    if (book % 2 != 0) {
      fill(#F1F1f1);
    } else {
      fill(#000000);
    }
    text(txt, 0, 0, width - padding*2, height * 10);
    pop();
  }
}

void drawProgressBar(Verse v) {
  fill(FG);
  textFont(font);
  textSize(txtSize);
  textLeading(txtSize);
  textAlign(LEFT, TOP);
  text("marcus aurelius\nmeditations\nbook " + v.book + "\n" + "verse " + v.verse, 10, 10);
  
  float posX = map(selector, 0, verseAmount, 0, width);
  
  push();
  noStroke();
  fill(FG);
  rect(0, height-20, posX, 20);
  pop();
}

Published by Tim on Sunday April 2, 2023

Last modified on May 14th, 2023 at 9:39


Related

Lowtech Painting Machine

Projects Prototypes

The prelude in C by Johann Sebastian Bach as an array of numbers

Digital Humanities Resources

Key visual for Slate + Ash’s new software instrument

Projects

Generative portraits for IBM

Projects

Form follows Music: The Bach-Project

Digital Humanities Projects Prototypes Resources

Llum Negra / La Luz Negra / Black Light

Projects

Creative Coding as a School of Thought

Projects Writings

Digital Reality: Livestream Marathon

Digital Humanities Prototypes Tutorials