# Processing

**URL:** https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=119

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 120

---

## [Trying to store the previous value of a variable](https://discourse.processing.org/t/trying-to-store-the-previous-value-of-a-variable/31606)

<div class="topic-metadata">

**Author:** [@G03TH3](https://discourse.processing.org/u/G03TH3)\
**Replies:** 6\
**Last updated:** [August 10, 2021, 8:45am UTC](https://discourse.processing.org/t/trying-to-store-the-previous-value-of-a-variable/31606 "2021-08-10T08:45:22Z")

</div>

I’m attempting to create a ball that is moved through the x-axis reading data from an ultrasonic sensor connected to an Arduino, since the ultrasonic sensor sometimes does not gets the wished value for a second(given to …

---

## [Happy Anniversary](https://discourse.processing.org/t/happy-anniversary/31648)

<div class="topic-metadata">

**Author:** [@saberkhan](https://discourse.processing.org/u/saberkhan)\
**Replies:** 0\
**Last updated:** [August 9, 2021, 4:24pm UTC](https://discourse.processing.org/t/happy-anniversary/31648 "2021-08-09T16:24:08Z")

</div>

Happy anniversary @REAS @shiffman @fry :birthday:

---

## [Do i need to upgrade Sketch?](https://discourse.processing.org/t/do-i-need-to-upgrade-sketch/31645)

<div class="topic-metadata">

**Author:** [@sjriga](https://discourse.processing.org/u/sjriga)\
**Replies:** 1\
**Last updated:** [August 9, 2021, 2:31pm UTC](https://discourse.processing.org/t/do-i-need-to-upgrade-sketch/31645 "2021-08-09T14:31:47Z")

</div>

Hi, I’m unable to render 3D in my current version of Sketch, where/how do I upgrade?

---

## [How to make my rects bigger based on proximity (bigger the closer to my mouse) pjs](https://discourse.processing.org/t/how-to-make-my-rects-bigger-based-on-proximity-bigger-the-closer-to-my-mouse-pjs/31637)

<div class="topic-metadata">

**Author:** [@Kenga123456](https://discourse.processing.org/u/Kenga123456)\
**Replies:** 15\
**Last updated:** [August 9, 2021, 10:50am UTC](https://discourse.processing.org/t/how-to-make-my-rects-bigger-based-on-proximity-bigger-the-closer-to-my-mouse-pjs/31637 "2021-08-09T10:50:22Z")

</div>

void setup() { frameRate(60); size(1020, 510); } void draw() { background(0); int spacing\_x = 45; int spacing\_y = 45; for (int x = 0; x \< width + spacing\_x; x = x + spacing\_x) { for (int y = 0; y \< …

---

## [Processing to read Arduino](https://discourse.processing.org/t/processing-to-read-arduino/31614)

<div class="topic-metadata">

**Author:** [@Kanuta](https://discourse.processing.org/u/Kanuta)\
**Replies:** 7\
**Last updated:** [August 9, 2021, 10:32am UTC](https://discourse.processing.org/t/processing-to-read-arduino/31614 "2021-08-09T10:32:12Z")

</div>

Hello! I am trying to get Processing to read LDR sensor values from Arduino to create moving images but it doesn’t seem to work. Arduino reads the changes fine but Processing keeps showing 0’s and constant numbers. I am…

---

## [Loops using arrays](https://discourse.processing.org/t/loops-using-arrays/30253)

<div class="topic-metadata">

**Author:** [@Kenga123456](https://discourse.processing.org/u/Kenga123456)\
**Replies:** 8\
**Last updated:** [August 9, 2021, 10:13am UTC](https://discourse.processing.org/t/loops-using-arrays/30253 "2021-08-09T10:13:05Z")

</div>

what is wrong with this code? Why does not the ellipses change colors? \< color c\[\]; int x = 0; void setup() { size(400,400); c\[0\]=color(255, 0, 0); // first color c\[1\]=color(0, 255, 0); // second c\[2\]=color(0, 0,…

---

## [Processing online game](https://discourse.processing.org/t/processing-online-game/31639)

<div class="topic-metadata">

**Author:** [@Arsenii237](https://discourse.processing.org/u/Arsenii237)\
**Replies:** 1\
**Last updated:** [August 9, 2021, 8:18am UTC](https://discourse.processing.org/t/processing-online-game/31639 "2021-08-09T08:18:33Z")

</div>

How to make a local game for phones.

---

## [Processing bug - setting A (object) to B (object) and modifying A, it will change B too!](https://discourse.processing.org/t/processing-bug-setting-a-object-to-b-object-and-modifying-a-it-will-change-b-too/31627)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 3\
**Last updated:** [August 8, 2021, 9:07pm UTC](https://discourse.processing.org/t/processing-bug-setting-a-object-to-b-object-and-modifying-a-it-will-change-b-too/31627 "2021-08-08T21:07:31Z")

</div>

Hello everyone! There is an issue with PVectors and objects. If you do this: PVector a = new PVector(0,0); PVector b = new PVector(100,100); PVector c = a; c.lerp(b,0.5); println(a,c); //prints \[ 50.0, 50.0, 0.0 \] \[ 5…

---

## [Editing PShape vertices vs drawing immediate mode](https://discourse.processing.org/t/editing-pshape-vertices-vs-drawing-immediate-mode/31626)

<div class="topic-metadata">

**Author:** [@micuat](https://discourse.processing.org/u/micuat)\
**Replies:** 0\
**Last updated:** [August 8, 2021, 3:59pm UTC](https://discourse.processing.org/t/editing-pshape-vertices-vs-drawing-immediate-mode/31626 "2021-08-08T15:59:31Z")

</div>

I knew that PShape is generally faster than immediate mode (begin/endShape), but I didn’t know if editing PShape vertices before drawing ends up slower or faster than the immediate mode. So I tested it with the following…

---

## [The get() function with width and height not working](https://discourse.processing.org/t/the-get-function-with-width-and-height-not-working/31613)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 10\
**Last updated:** [August 8, 2021, 9:28am UTC](https://discourse.processing.org/t/the-get-function-with-width-and-height-not-working/31613 "2021-08-08T09:28:50Z")

</div>

The code is very simple and I am referring to \<https://processing.org/reference/get\_.html\> But when I try to use get(100, 100, 5, 5) I get the error “cannot convert from PImage to int”. Is it me, or the code? PImage im…

---

## [Faster Rendering Techniques in P3D?](https://discourse.processing.org/t/faster-rendering-techniques-in-p3d/31465)

<div class="topic-metadata">

**Author:** [@CosmicCrowMC](https://discourse.processing.org/u/CosmicCrowMC)\
**Replies:** 16\
**Last updated:** [August 7, 2021, 2:37pm UTC](https://discourse.processing.org/t/faster-rendering-techniques-in-p3d/31465 "2021-08-07T14:37:41Z")

</div>

I’ve made a very large 3D game with Processing, and for the past few months, I’ve dealt with pretty shotty performance, considering only 2,000 or so quads are being drawn at any given time. With enough workarounds, I’ve …

---

## [How to add to an ArrayList every x seconds?](https://discourse.processing.org/t/how-to-add-to-an-arraylist-every-x-seconds/31609)

<div class="topic-metadata">

**Author:** [@chaotic.rabbit](https://discourse.processing.org/u/chaotic.rabbit)\
**Replies:** 1\
**Last updated:** [August 7, 2021, 11:29am UTC](https://discourse.processing.org/t/how-to-add-to-an-arraylist-every-x-seconds/31609 "2021-08-07T11:29:14Z")

</div>

void setup(){ jellies = new ArrayList(); for(int i=0; i\<=5; i++){ jellies.add(new Jellyfish(random(0, 800), random(height), random(-40, 40), random(0.05, 0.35))); } for(int i = jellies.size()-1; i\>=0; i–){ Jellyfis…

---

## [Variable inside a string](https://discourse.processing.org/t/variable-inside-a-string/31532)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 5\
**Last updated:** [August 4, 2021, 10:50pm UTC](https://discourse.processing.org/t/variable-inside-a-string/31532 "2021-08-04T22:50:02Z")

</div>

I want to make a string that changes depending on the variable so in my example hello and the number would have to touch, so no spaces and the x should be the number that x is Float x; Void draw(){ X=random(30); Print(H…

---

## [For loop matrix index](https://discourse.processing.org/t/for-loop-matrix-index/31508)

<div class="topic-metadata">

**Author:** [@niuuin](https://discourse.processing.org/u/niuuin)\
**Replies:** 14\
**Last updated:** [August 4, 2021, 12:52pm UTC](https://discourse.processing.org/t/for-loop-matrix-index/31508 "2021-08-04T12:52:19Z")

</div>

int total; float itemSize; void setup() { size(800, 800); pixelDensity(2); smooth(); rectMode(CENTER); total = 4; itemSize = width/total; } void draw() { clear(); for (int i = 0; i \< sq(total); i ++) …

---

## [Arithmetic Order of Operation and Calculation](https://discourse.processing.org/t/arithmetic-order-of-operation-and-calculation/31559)

<div class="topic-metadata">

**Author:** [@Peace](https://discourse.processing.org/u/Peace)\
**Replies:** 2\
**Last updated:** [August 4, 2021, 11:11am UTC](https://discourse.processing.org/t/arithmetic-order-of-operation-and-calculation/31559 "2021-08-04T11:11:22Z")

</div>

Hello guys, I am looking for a complete list of how Arithmetic Order of Operation and Calculation operates in Procession. Can anybody please direct me where can I find that information ? Cheers guys :clinking\_glasses:

---

## [GStreamer for recording live video](https://discourse.processing.org/t/gstreamer-for-recording-live-video/31573)

<div class="topic-metadata">

**Author:** [@StainlessHolz](https://discourse.processing.org/u/StainlessHolz)\
**Replies:** 0\
**Last updated:** [August 4, 2021, 9:59am UTC](https://discourse.processing.org/t/gstreamer-for-recording-live-video/31573 "2021-08-04T09:59:34Z")

</div>

Hi everyone, Ive made a sketch witch decodes a full HD h.264 camera livestream, displays it and puts a overlay on it. To this point everything works fine and fast using the P2D renderer. Now i need to record this vide…

---

## [P2D, P3D only show grey screen -- until java window is closed](https://discourse.processing.org/t/p2d-p3d-only-show-grey-screen-until-java-window-is-closed/29370)

<div class="topic-metadata">

**Author:** [@willowisp](https://discourse.processing.org/u/willowisp)\
**Replies:** 8\
**Last updated:** [August 3, 2021, 9:59pm UTC](https://discourse.processing.org/t/p2d-p3d-only-show-grey-screen-until-java-window-is-closed/29370 "2021-08-03T21:59:43Z")

</div>

When I’m trying to use P2D or P3D rendering, only a blank, grey screen is shown. This is the simplest code I could come up with to illustrate the problem: size(200, 200, P2D); background(0); Expected output is a black…

---

## [Null Pointer Exception with Arduino Communication](https://discourse.processing.org/t/null-pointer-exception-with-arduino-communication/31500)

<div class="topic-metadata">

**Author:** [@PapiAli](https://discourse.processing.org/u/PapiAli)\
**Replies:** 19\
**Last updated:** [August 3, 2021, 4:58pm UTC](https://discourse.processing.org/t/null-pointer-exception-with-arduino-communication/31500 "2021-08-03T16:58:40Z")

</div>

So I am running into this issue with my Processing code where I am getting null pointer exceptions whenever it runs over the port.write() line. Just for some background, what I am trying to do is have the Processing cod…

---

## [Zig Zag or Wavy or Spiral or Dotted lines 👀](https://discourse.processing.org/t/zig-zag-or-wavy-or-spiral-or-dotted-lines/31547)

<div class="topic-metadata">

**Author:** [@Peace](https://discourse.processing.org/u/Peace)\
**Replies:** 7\
**Last updated:** [August 3, 2021, 1:38pm UTC](https://discourse.processing.org/t/zig-zag-or-wavy-or-spiral-or-dotted-lines/31547 "2021-08-03T13:38:30Z")

</div>

Hi guys, I am a newbie to Processing ( by the way, I really liked this name, Processing :ok\_hand: ) and I have just learnt to draw vertical, horizons line, rect mode. Just wondering what will be the code for drawing Zig …

---

## [Convert HTML table to JSON](https://discourse.processing.org/t/convert-html-table-to-json/31555)

<div class="topic-metadata">

**Author:** [@Mattyjak](https://discourse.processing.org/u/Mattyjak)\
**Replies:** 1\
**Last updated:** [August 2, 2021, 10:24pm UTC](https://discourse.processing.org/t/convert-html-table-to-json/31555 "2021-08-02T22:24:22Z")

</div>

Hello everybody! Today I’ve been messing around with APIs and one of the few I’ve tried (Pastebin) returns data in the form of an HTML table. I want to convert this table into a JSON object but I’m having some trouble. …

---

## [Trying to make my own version of the "quick draw" game to build a library and teach an AI as a BEGINNER](https://discourse.processing.org/t/trying-to-make-my-own-version-of-the-quick-draw-game-to-build-a-library-and-teach-an-ai-as-a-beginner/30518)

<div class="topic-metadata">

**Author:** [@anntie](https://discourse.processing.org/u/anntie)\
**Replies:** 36\
**Last updated:** [August 2, 2021, 5:29pm UTC](https://discourse.processing.org/t/trying-to-make-my-own-version-of-the-quick-draw-game-to-build-a-library-and-teach-an-ai-as-a-beginner/30518 "2021-08-02T17:29:06Z")

</div>

Hello! I am working on a design project about emotive writing. I would like to teach an AI to detect “emotions” from simple hand-drawn lines, and maybe use a GAN to generate lines according to specified emotional categor…

---

## [Serial Communication / Simulink](https://discourse.processing.org/t/serial-communication-simulink/31516)

<div class="topic-metadata">

**Author:** [@MJAhmadi](https://discourse.processing.org/u/MJAhmadi)\
**Replies:** 2\
**Last updated:** [August 2, 2021, 4:03pm UTC](https://discourse.processing.org/t/serial-communication-simulink/31516 "2021-08-02T16:03:17Z")

</div>

Hi, I want to send some binary data through processing serial to Matlab Simulink Software(serial receive block); I defined header and terminator in Simulink, but i dont know how to define this in processing? my code is…

---

## [Pd4P3 - A new real-time audio synthesis library for Processing](https://discourse.processing.org/t/pd4p3-a-new-real-time-audio-synthesis-library-for-processing/31345)

<div class="topic-metadata">

**Author:** [@robertesler](https://discourse.processing.org/u/robertesler)\
**Replies:** 2\
**Last updated:** [August 2, 2021, 1:58pm UTC](https://discourse.processing.org/t/pd4p3-a-new-real-time-audio-synthesis-library-for-processing/31345 "2021-08-02T13:58:01Z")

</div>

I hope this is a good place to make an announcement like this. I have just recently released a real-time audio synthesis library called “Pd4P3” which stands for “Pd++ for Processing 3”. It is a library based on Pure Da…

---

## [Daylight robbery](https://discourse.processing.org/t/daylight-robbery/26886)

<div class="topic-metadata">

**Author:** [@ekaggrat](https://discourse.processing.org/u/ekaggrat)\
**Replies:** 5\
**Last updated:** [August 2, 2021, 1:14pm UTC](https://discourse.processing.org/t/daylight-robbery/26886 "2021-08-02T13:14:56Z")

</div>

i tried downloading processing 2.2.1 as i need it for my older projects. It just wont allow me to go anywhere without giving a donation. after a lot of tries i finally gave up and gave a 5 dollar minimum donation. inspit…

---

## [Avoiding clicks when changing sinOsc amplitude realtime](https://discourse.processing.org/t/avoiding-clicks-when-changing-sinosc-amplitude-realtime/31520)

<div class="topic-metadata">

**Author:** [@eltrem](https://discourse.processing.org/u/eltrem)\
**Replies:** 5\
**Last updated:** [August 2, 2021, 12:23pm UTC](https://discourse.processing.org/t/avoiding-clicks-when-changing-sinosc-amplitude-realtime/31520 "2021-08-02T12:23:27Z")

</div>

I’m finding some annoying audio glitches when changing a processing.sound sinOsc oscillator amplitude in realtime, for example with the mouse. While moving the mouse, the amplitude step difference is big enough to be he…

---

## [Serial Communication / Arduino to Processing](https://discourse.processing.org/t/serial-communication-arduino-to-processing/31528)

<div class="topic-metadata">

**Author:** [@MJAhmadi](https://discourse.processing.org/u/MJAhmadi)\
**Replies:** 1\
**Last updated:** [August 1, 2021, 8:35pm UTC](https://discourse.processing.org/t/serial-communication-arduino-to-processing/31528 "2021-08-01T20:35:10Z")

</div>

Below is a part of my code : Serial.write(‘A’); // Print float data for (int i=0; i\<4; i++){ Serial.write(myValue1.bytes\[i\]); delay(10); } // Print terminator Serial.print(’\\n’); 3 value have been sent to serial…

---

## [Exporting processing sketch to application](https://discourse.processing.org/t/exporting-processing-sketch-to-application/31515)

<div class="topic-metadata">

**Author:** [@Avani11](https://discourse.processing.org/u/Avani11)\
**Replies:** 5\
**Last updated:** [August 1, 2021, 5:34pm UTC](https://discourse.processing.org/t/exporting-processing-sketch-to-application/31515 "2021-08-01T17:34:11Z")

</div>

Hey, I am making a project with processing. The sketch is a game with three stages, and works with mic threshold. When the user’s voice crosses a certain range of threshold, it reaches another level of the game. This sk…

---

## [Union type in Processing programming](https://discourse.processing.org/t/union-type-in-processing-programming/31534)

<div class="topic-metadata">

**Author:** [@MJAhmadi](https://discourse.processing.org/u/MJAhmadi)\
**Replies:** 1\
**Last updated:** [August 1, 2021, 2:28pm UTC](https://discourse.processing.org/t/union-type-in-processing-programming/31534 "2021-08-01T14:28:01Z")

</div>

hi , below code is for c++ typedef union{ float number; uint8\_t bytes\[4\]; } FLOATUNION\_t; FLOATUNION\_t myValue; how can i write it in processing ?

---

## [Using a Midi Keyboard to create coloured shapes](https://discourse.processing.org/t/using-a-midi-keyboard-to-create-coloured-shapes/9685)

<div class="topic-metadata">

**Author:** [@djspoonzay](https://discourse.processing.org/u/djspoonzay)\
**Replies:** 2\
**Last updated:** [August 1, 2021, 11:10am UTC](https://discourse.processing.org/t/using-a-midi-keyboard-to-create-coloured-shapes/9685 "2021-08-01T11:10:20Z")

</div>

Hello, I am trying to use a MIDI keyboard to create a red ellipse to start with. I keep getting the same response of cannot convert void to boolean. Any help would be appreciated. import themidibus.\*; MidiBus myBus; in…

---

## [Running on Homepage](https://discourse.processing.org/t/running-on-homepage/31526)

<div class="topic-metadata">

**Author:** [@Pauls](https://discourse.processing.org/u/Pauls)\
**Replies:** 1\
**Last updated:** [August 1, 2021, 7:20am UTC](https://discourse.processing.org/t/running-on-homepage/31526 "2021-08-01T07:20:57Z")

</div>

I tried to write two lessons in my language learning. Can I run them on my homepage? with thanks Pauls

[Previous page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=118)

[Next page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=120)
