Creative coding, making loops with Processing
bleuje.com
bleuje.com
BTW: Every January is month of creative coding (https://genuary.art/), so you can join hundreds of other artists in 'solving' daily prompts. I did last Genuary (well not all prompts), and I got some some results that I am proud of (https://github.com/ubavic/genuary2022). That was the first time I coded in Processing.
That's good advice for most things, except perhaps free climbing or fire eating.
> To learn to draw stuff with code, I suggest watching The Coding Train. https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw
The YouTube channel is created by Daniel Shiffman, the author of _Nature of Code: Simulating Natural Systems with Processing_. It's one of my all-time favorite books.
I love Processing. I actually used it to make a GUI and some data visualisation tools for my Comp Sci MSc. The bulk of the project was a Java program to do with time series analysis, but I'm not a graphics person and didn't want to learn Swing, JavaFX, HTML/JS or anything "serious". It was a joy to use.
> What makes Processing useful for such visualizations?
You have a bunch of useful primitives to draw stuff on screen immediately, without having to go through all the troubles that this entails with a normal programming language. It's really fun!
Regardless, the best thing about processing is that it makes getting the first pixels on the screen extremely easy. Like two lines of code. In normal Java that’s a highly nontrivial exercise with lots of incidental complexity and boilerplate.
For creative visual work, just getting something on the screen and then iterating quickly is the key. It keeps the ideas flowing.
Processing has a lot of useful primitives for drawing and animation as well, combining them into interesting patterns is very straightforward. On top of that the documentation is really well done, it’s written in a very accessible tone and it has tons of useful examples.
If I was writing production grade software, I wouldn't have used Processing for the client. But for the purposes of an academic project, where a backend-type like me wanted to draw some pixels without too much fuss, it was perfect.
FWIW, py5 makes it very easy to create animated GIFs. You can create a GIF from a running sketch with one line of code:
https://py5coding.org/reference/py5tools_animated_gif.html
py5 is a version of Processing for Python 3.8+ that is well integrated into the Python ecosystem. It connects the Processing Jars to Python using JPype. If you like Processing, please give it a try!
(I am the author of py5)
Py5 looks awesome! Will give it a try soon. Thanks for your work!
ps: I noticed you're using JPype to connect to the Java Processing libraries. Very smart.
Getting py5 off the ground started during pandemic lockdown and took many months. Managing the source code is best done computationally, with py5generator creating the actual py5 source code.
https://github.com/py5coding/py5generator https://github.com/py5coding/py5
> ps: I noticed you're using JPype to connect to the Java Processing libraries. Very smart.
JPype is a solid and well maintained library. With JPype, py5 is well positioned to work with numpy and the rest of python's scientific tools.
> Py5 looks awesome! Will give it a try soon. Thanks for your work!
You are welcome! I hope you enjoy it!
Definitely going to give py5 a try.
In case someone doesn't know, since Processing is written in Java it can be used as a library in any Java project instead of from inside the Processing IDE.
Looks like it it’s processing (not processings JavaScript cousin p5js).
There is a tutorials section where the workflow is discussed. And how to create the infinite style loops.
It’s processing then exported as gif to animated gif.
Here is a good list.
https://github.com/kosmos/awesome-generative-art
Also… Shaders ! Is a great way to start.
Thats my work. All realtime.
"Processing is a flexible software sketchbook and a language for learning how to code."
"The Processing software has always been free and open source and has always run on Mac OS, Windows, and Linux."
"The Processing community has written more than a hundred libraries for computer vision, data visualization, music composition, networking, 3D file exporting, and programming electronics."
A little while ago, for a university introductory course to programming we had to use Processing for generative art. I created a little 3D island generator using P3D:
https://github.com/ArjoNagelhout/3D_Island_Generator_In_Proc...
i find these works so interesting and mesmerizing. really jealous of the talented artists/programmers making these.
Mountains of work is what learning looks like as an adult.
The bigger the mountains look, the more you will learn.
If you know Python, learning another library looks like a bump in the road because you already have an adult level of proficiency that was built over a lifetime.
Learning to dance ballet looks like an impassible wall to most adults, because we know that competent ballet dancing requires years of training. And forget about virtuosity.
Adults tend to limit their learning to "new Python libraries."
Because one thing is for sure, most of learning to dance ballet will involve sucking at dancing ballet. And probably all of it unless you are lucky.
---
But, for me, there's a difference between wishing I was better at things like mathematics and wanting proficiency in things like mathematics.
The difference comes from my actual interest in mathematics. My equilibrium state is quenched curiosity regarding mathematics. I learn about mathematics in proportion to my current curiosity.
If I wanted to get good at making loops with Processing, I would just start trying to make loops and letting myself be bad at it. I wouldn't study mathematics. I would play.
2 weeks, to be precise, until my back stops hurting. My hand (yes I made a mistake) took over a year.
I'm biking now. No more falling. Thanks.
there is a level of abstraction that one needs to master: sets of variables, simple algebraic equations, functions etc. but climbing that mountain is harder that it needs be because in general education these core concepts are generally burried among many other (and less relevant for this type of task concepts).
ideally somebody would write a small textbook with the basic mathematical concepts involved in generative computer graphics. alternatively, work backwards from some examples. if you persist the path you need to travel, while longish, is doable.
also check out bonzomatic:
https://github.com/Gargaj/Bonzomatic
You can find some live bonzomatic shader coding vids on youtube too, it's even done competitively at demo parties these days:
This version of Processing uses the amazing JPype library to connect the Processing Jars (Java) to Python 3.8+.
(I am the creator of py5)