Indian Ink Splashes : Learning how to make a custom noise.



Custom noise function generated by chance.

This video was made with Processing and Kdenlive.

I drew still images with Processing code and converted to a movie with the Kdenlive. I wrote this code to lean how to make custom noise function.
I thought this custom noise function was not so good, but it brought me a very nice result for my creative coding later.

Thanks to nice music:

This Is Where We Go Our Separate Ways by Steve Combs
2017/01/17
http://freemusicarchive.org/music/Steve_Combs/The_Green_Album/07_This_Is_Where_We_Go_Our_Seperate_Ways
This Is Where We Go Our Separate Ways by Steve Combs is licensed under a Attribution License.

クリエイティブ・コモンズ・ライセンス

Processing code example.


// Indian ink splashes
// 2016.11.12

void setup() {
  size(1280, 720);
  background(245);
  strokeWeight(0.5);
  frameRate(0.7);
  smooth();
}

void draw() {

  if (frameCount % 3 == 1) {
    background(245);
  }
  stroke(255, 0);

  int centx = width / 2;
  int centy = height / 2;
  float radius = min(centx, centy) / 2;

  for (int i = 0; i < 80; i++) {
    float cx, cy, lastx, lasty, alpha;
    float cxnoise = random(5);
    float cynoise = random(5);
    float crnoise = random(5);
    float dangle = random(360);

    lastx = centx;
    lasty = centy;

    alpha = 15 + customNoise(crnoise) * 20;
    fill(20, 50, 70, alpha);

    for (float iangle = 0; iangle <= 360 * 1; iangle += 3) {
      float ang = iangle + dangle;
      radius -= (pow(sin(radians(ang + customNoise(cxnoise) * 200)), 3) * 4) * (customNoise(cynoise) * 4);
      cx = centx + (radius * cos(radians(ang + customNoise(cxnoise) * 20)));
      cy = centy + (radius * sin(radians(ang + customNoise(cynoise) * 20)));

      ellipse(cx, cy, 5 + customNoise(cxnoise) * 10, 5 + customNoise(cxnoise) * 10);
    
      lastx = cx;
      lasty = cy;
      cxnoise += 0.05;
      cynoise += 0.05;
    }
    crnoise += 0.05;
  }
  
  /*
  saveFrame("frames/####.png");
  if ( frameCount >= 60) {
    exit ();
  }
  */

}

float customNoise(float value) {
  return pow(sin(value), 3) * cos(pow(value, 2));
}


/*
Copyright (C) 2016- 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 
*/



Yet another example images.



Next Post
No Comment
Add Comment
comment url