Sounds From the Street.

Snapshot.

Generative art made with Processing.

Generative art made with Processing.


Example animation.



About this creative coding.

A creative coding animation made with Processing.

It's an applied version of Interstellar Overdrive.
Chessboard background is my magic wand in this work. ;)


Processing code example.

Please feel free to use this code.
To see other works based on my code is my pleasure. And my honor.





// Sounds From the Street.
// Processing 3.2.1
// created:2018.03.11
// updated:2019.05.01
// line -> ellipse

int   waveCnt;
int   frmCntMax;
float seedWaveInit;
float seedShape[];

void setup() {
  size(720, 720);
  colorMode(HSB, 360.0, 100.0, 100.0, 100.0);
  smooth();

  waveCnt      = 6;
  frmCntMax    = 24 * 9;
  seedWaveInit = random(100);
  seedShape    = new float[waveCnt];
  for (int i = 0; i < waveCnt; ++i) {
    seedShape[i] = random(0.0005, 0.05);
  }
}

void draw() {

  float sideLong = width / (waveCnt - 1);

  // background, chess board
  background(0, 0, 90, 100);
  noStroke();
  for (int x = 0; x <= width; x += sideLong) {
    for (int y = 0; y <= height; y += sideLong) {
      if ((x + y) % (sideLong * 2) == 0) {
        fill(0, 0, 90, 100);
      } else {
        fill(0, 0, 10, 100);
      }
      rect(x, y, 180, 180);
    }
  }

  // draw waves
  seedWaveInit += 0.0004;  // wave roll speed
  float seedWave  = seedWaveInit;
  int   lineIndex = 0;
    
  for (int x = 0; x <= width; x += sideLong) {
    float lastX = x;
    float lastY = -10; // out of screen
    for (int y = 0; y < height; ++y) {
      float currentY = y;
      
      for (int weightCnt = 1; weightCnt <= 12; ++weightCnt) {
        float currentX = x + map(customNoise(seedWave), -1.0, 1.0, -weightCnt * 6.0, weightCnt * 6.0);
        fill(0, 0, 90, 100);
        ellipse(currentX, currentY, 2.0, 2.0);
        fill(0, 0, 10, 100);
        ellipse(width - currentY, currentX, 2.0, 2.0);
        lastX = currentX;
      }
      
      lastY = currentY;
      seedWave += seedShape[lineIndex]; // wave shape

    }

    ++lineIndex;

  }

  saveFrame("frames/####.png");
  if (frameCount > frmCntMax) {
    exit ();
  }

}

float customNoise(float value) {
  // from -1 to 1
  return pow(sin(value), 3) * cos(pow(value, 2));
}


/*
Copyright (C) 2018 deconbatch

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see 
*/





No comments :

Post a Comment