# Processing

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

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

**Page:** 288

---

## [The SimpleML library](https://discourse.processing.org/t/the-simpleml-library/12347)

<div class="topic-metadata">

**Author:** [@JLHAtienza](https://discourse.processing.org/u/JLHAtienza)\
**Replies:** 3\
**Last updated:** [June 30, 2019, 3:08am UTC](https://discourse.processing.org/t/the-simpleml-library/12347 "2019-06-30T03:08:18Z")

</div>

So I’m dealing right now with Asynchronous Request thing and I heard that Simple ML Library is terminated since 2010 for some reason, is there any library that I can use for an alternative to SimpleML, if none, how can w…

---

## [Problem with keyPressed when drawing a square](https://discourse.processing.org/t/problem-with-keypressed-when-drawing-a-square/12389)

<div class="topic-metadata">

**Author:** [@karan26](https://discourse.processing.org/u/karan26)\
**Replies:** 1\
**Last updated:** [June 29, 2019, 10:06pm UTC](https://discourse.processing.org/t/problem-with-keypressed-when-drawing-a-square/12389 "2019-06-29T22:06:17Z")

</div>

hiii,i am trying to add a square to the canvas when a key is pressed and i want it to remain on the canvas when the key is released . but it disappears when is released the key .can anybody help me?? here is my code i…

---

## [Why is it that when I zoom in the frameRate drops massively?](https://discourse.processing.org/t/why-is-it-that-when-i-zoom-in-the-framerate-drops-massively/12349)

<div class="topic-metadata">

**Author:** [@LoliProcessor](https://discourse.processing.org/u/LoliProcessor)\
**Replies:** 9\
**Last updated:** [June 29, 2019, 1:21pm UTC](https://discourse.processing.org/t/why-is-it-that-when-i-zoom-in-the-framerate-drops-massively/12349 "2019-06-29T13:21:58Z")

</div>

I wrote a game where when you increase the zoom factor by even the slightest, the frameRate drops massively until it barely renders the next frame anymore; weirdly, that doesn’t occur when zooming out. reversely, zoomin…

---

## [Odd behaviour when using copy()](https://discourse.processing.org/t/odd-behaviour-when-using-copy/12375)

<div class="topic-metadata">

**Author:** [@lsk](https://discourse.processing.org/u/lsk)\
**Replies:** 2\
**Last updated:** [June 29, 2019, 1:26pm UTC](https://discourse.processing.org/t/odd-behaviour-when-using-copy/12375 "2019-06-29T13:26:54Z")

</div>

I create a PGraphics object pg1 and set its color to blue. Then I want to copy a tile from pg1 to a PImage object the size of 1 tile. I use pImg.copy(src, sx, sy, sw, sh, dx, dy, dw, dh); This should - if I understood …

---

## [Pixel to String length](https://discourse.processing.org/t/pixel-to-string-length/12330)

<div class="topic-metadata">

**Author:** [@The\_nish](https://discourse.processing.org/u/The_nish)\
**Replies:** 4\
**Last updated:** [June 27, 2019, 11:25am UTC](https://discourse.processing.org/t/pixel-to-string-length/12330 "2019-06-27T11:25:50Z")

</div>

i am converting my image pixel as a string and print of its length then i get output is given in example image. what is wrong with it. void function() { for(int x=0; x\<img.height;x++) { for(int y=0; y…

---

## [I want to count the number of occurrences of a name of "sato"](https://discourse.processing.org/t/i-want-to-count-the-number-of-occurrences-of-a-name-of-sato/12257)

<div class="topic-metadata">

**Author:** [@henry](https://discourse.processing.org/u/henry)\
**Replies:** 17\
**Last updated:** [June 29, 2019, 10:16am UTC](https://discourse.processing.org/t/i-want-to-count-the-number-of-occurrences-of-a-name-of-sato/12257 "2019-06-29T10:16:02Z")

</div>

what’s wrong with my code? It should be print out “4” for “sato”'s appearance times String\[\]lines= loadStrings("data.txt"); String\[\]sato= loadStrings("keyword.txt"); int count=0; for (int i=0; i\<lines.length; i++) { …

---

## [How to save console output as a .txt file](https://discourse.processing.org/t/how-to-save-console-output-as-a-txt-file/12353)

<div class="topic-metadata">

**Author:** [@The\_nish](https://discourse.processing.org/u/The_nish)\
**Replies:** 14\
**Last updated:** [June 28, 2019, 7:52pm UTC](https://discourse.processing.org/t/how-to-save-console-output-as-a-txt-file/12353 "2019-06-28T19:52:20Z")

</div>

i am printing an image of binary and i want to print exactly this Image of String in .txt file. is this possible to take ouput of console print data to save as .txt file

---

## [How to make grid of image pixels in nested loop](https://discourse.processing.org/t/how-to-make-grid-of-image-pixels-in-nested-loop/12356)

<div class="topic-metadata">

**Author:** [@The\_nish](https://discourse.processing.org/u/The_nish)\
**Replies:** 2\
**Last updated:** [June 28, 2019, 7:57pm UTC](https://discourse.processing.org/t/how-to-make-grid-of-image-pixels-in-nested-loop/12356 "2019-06-28T19:57:32Z")

</div>

i have image pixel length from 0 to 10000 . i want to make a grid of 100\*100 in nested loop. please tell me how can i do that… for (int y=0; y\<img.height; y++) { for (int x=0; x\<img.width; x++) { int…

---

## [How shall I make get(mouseX, mouseY)) return RGB triplets](https://discourse.processing.org/t/how-shall-i-make-get-mousex-mousey-return-rgb-triplets/12364)

<div class="topic-metadata">

**Author:** [@andre](https://discourse.processing.org/u/andre)\
**Replies:** 2\
**Last updated:** [June 28, 2019, 6:03pm UTC](https://discourse.processing.org/t/how-shall-i-make-get-mousex-mousey-return-rgb-triplets/12364 "2019-06-28T18:03:03Z")

</div>

Tried to see pixels color using void mousePressed() { println(get(mouseX, mouseY));} It returns -1 for white spots, close to -16581375 on black spots and in between for the rest. How shall I get it as RGB triplets?

---

## [How to start an animation again from the beginning at specific point](https://discourse.processing.org/t/how-to-start-an-animation-again-from-the-beginning-at-specific-point/12232)

<div class="topic-metadata">

**Author:** [@TurboUrpo](https://discourse.processing.org/u/TurboUrpo)\
**Replies:** 6\
**Last updated:** [June 28, 2019, 3:27pm UTC](https://discourse.processing.org/t/how-to-start-an-animation-again-from-the-beginning-at-specific-point/12232 "2019-06-28T15:27:44Z")

</div>

Yep, that’s the thing where I need some help and advice. How to set it the way that it runs the animation from beginning, and at the specific point the animation starts again from the beginning and runs again at the same…

---

## [Type + Code (Caligraft Sketch)](https://discourse.processing.org/t/type-code-caligraft-sketch/12237)

<div class="topic-metadata">

**Author:** [@PixelMx](https://discourse.processing.org/u/PixelMx)\
**Replies:** 6\
**Last updated:** [June 28, 2019, 3:24pm UTC](https://discourse.processing.org/t/type-code-caligraft-sketch/12237 "2019-06-28T15:24:26Z")

</div>

I was trying to replicate some code from the book Type + Code (page 68) I was surprised to see that the size function is called with variables, as I expected I’m getting an error. I changed the values with 800, 600, P3D…

---

## [String not converted Properly from int](https://discourse.processing.org/t/string-not-converted-properly-from-int/12295)

<div class="topic-metadata">

**Author:** [@The\_nish](https://discourse.processing.org/u/The_nish)\
**Replies:** 15\
**Last updated:** [June 28, 2019, 5:25am UTC](https://discourse.processing.org/t/string-not-converted-properly-from-int/12295 "2019-06-28T05:25:54Z")

</div>

post is deleted…

---

## [Code for artDCGAN?](https://discourse.processing.org/t/code-for-artdcgan/287)

<div class="topic-metadata">

**Author:** [@ezyryder](https://discourse.processing.org/u/ezyryder)\
**Replies:** 6\
**Last updated:** [June 28, 2019, 1:01am UTC](https://discourse.processing.org/t/code-for-artdcgan/287 "2019-06-28T01:01:19Z")

</div>

Hello! I am a complete newbie to coding and Processing and I need some help with my art project. So I was wondering if I can make one generative digital painting based on few of my paintings (something like this, nude…

---

## [G4P: GTextField text modification](https://discourse.processing.org/t/g4p-gtextfield-text-modification/12292)

<div class="topic-metadata">

**Author:** [@graysonh](https://discourse.processing.org/u/graysonh)\
**Replies:** 8\
**Last updated:** [June 27, 2019, 11:42am UTC](https://discourse.processing.org/t/g4p-gtextfield-text-modification/12292 "2019-06-27T11:42:40Z")

</div>

Hi all, I am using a GTextField to allow the user to specify values being used in other processes. In the event handler for the GTextField I want to check what’s being typed and make sure that it is a valid value for my…

---

## [Issue when using loadShape()](https://discourse.processing.org/t/issue-when-using-loadshape/12216)

<div class="topic-metadata">

**Author:** [@macbrayne](https://discourse.processing.org/u/macbrayne)\
**Replies:** 4\
**Last updated:** [June 26, 2019, 9:49pm UTC](https://discourse.processing.org/t/issue-when-using-loadshape/12216 "2019-06-26T21:49:05Z")

</div>

Hello there! I’m currently migrating a game I’m currently writing from .png to .svg for better scaling however I’m having issues with using a certain icon from material.io (Settings icon).Processing throws an error when…

---

## [Downloading CSV from web server](https://discourse.processing.org/t/downloading-csv-from-web-server/12286)

<div class="topic-metadata">

**Author:** [@pablogott](https://discourse.processing.org/u/pablogott)\
**Replies:** 5\
**Last updated:** [June 26, 2019, 8:20pm UTC](https://discourse.processing.org/t/downloading-csv-from-web-server/12286 "2019-06-26T20:20:38Z")

</div>

I have a CSV that constantly gets updated on a web server. How can I download the data? I already have code for processing if the data exists locally, but I’d rather not have to store it locally and just read it from the…

---

## [Problem with displaying a PShape](https://discourse.processing.org/t/problem-with-displaying-a-pshape/12267)

<div class="topic-metadata">

**Author:** [@elijb](https://discourse.processing.org/u/elijb)\
**Replies:** 2\
**Last updated:** [June 26, 2019, 6:56pm UTC](https://discourse.processing.org/t/problem-with-displaying-a-pshape/12267 "2019-06-26T18:56:12Z")

</div>

ShapeMaker sm; void setup() { size(600, 600, P3D); sm = new ShapeMaker(); sm.makeCylinder(100, 100, 200, 40); //sm.makeEllipse(200); } void draw() { background(0); translate(width/2, height/2); sm.displayS…

---

## [Sharing objects between multiple PApplets - Processing in Eclipse - runSketch()](https://discourse.processing.org/t/sharing-objects-between-multiple-papplets-processing-in-eclipse-runsketch/9427)

<div class="topic-metadata">

**Author:** [@rgthings](https://discourse.processing.org/u/rgthings)\
**Replies:** 7\
**Last updated:** [June 26, 2019, 6:11pm UTC](https://discourse.processing.org/t/sharing-objects-between-multiple-papplets-processing-in-eclipse-runsketch/9427 "2019-06-26T18:11:40Z")

</div>

hello, I am using Processing (3.2.3) in Eclipse and I have managed to produce a second PApplet window using using runSketch(). I would like to use the second window to control what goes on in the first (and vice versa a…

---

## [Error: cannot convert from float to int,, when I use map()](https://discourse.processing.org/t/error-cannot-convert-from-float-to-int-when-i-use-map/12315)

<div class="topic-metadata">

**Author:** [@bu.aus](https://discourse.processing.org/u/bu.aus)\
**Replies:** 2\
**Last updated:** [June 26, 2019, 6:09pm UTC](https://discourse.processing.org/t/error-cannot-convert-from-float-to-int-when-i-use-map/12315 "2019-06-26T18:09:42Z")

</div>

Hello, I am a beginner and finding a problem. I wrote the following code and had error message “cannot convert from float to int”. void serialEvent (Serial Port) { brightness = float(port.readStringUntil('\\n')); n=i…

---

## [Shader code for show selected part of image - OpenTk](https://discourse.processing.org/t/shader-code-for-show-selected-part-of-image-opentk/12316)

<div class="topic-metadata">

**Author:** [@NSDS](https://discourse.processing.org/u/NSDS)\
**Replies:** 0\
**Last updated:** [June 26, 2019, 6:09pm UTC](https://discourse.processing.org/t/shader-code-for-show-selected-part-of-image-opentk/12316 "2019-06-26T18:09:22Z")

</div>

I want to show second half portion of an image in my glcontrol, in a condition that only 0.7 to 0. 9 of second half is want to see in glControl. For that I have done like below. But it shows portion of first half of imag…

---

## [Playing random sounds from folder as an Urn (no repeat untill all the files are done)](https://discourse.processing.org/t/playing-random-sounds-from-folder-as-an-urn-no-repeat-untill-all-the-files-are-done/10391)

<div class="topic-metadata">

**Author:** [@o\_b](https://discourse.processing.org/u/o_b)\
**Replies:** 4\
**Last updated:** [June 26, 2019, 5:05pm UTC](https://discourse.processing.org/t/playing-random-sounds-from-folder-as-an-urn-no-repeat-untill-all-the-files-are-done/10391 "2019-06-26T17:05:38Z")

</div>

Hi there, I’m pretty new to processing. For an audio installation, I need a processing sketch to play random sounds from the data folder every 5 seconds, indefinitely. For this example I have 10 mp3 files, but I’ll ne…

---

## [Turn X,Y, Z mouse tracker into 3D CAD file?](https://discourse.processing.org/t/turn-x-y-z-mouse-tracker-into-3d-cad-file/12275)

<div class="topic-metadata">

**Author:** [@sdotjo](https://discourse.processing.org/u/sdotjo)\
**Replies:** 10\
**Last updated:** [June 26, 2019, 1:18pm UTC](https://discourse.processing.org/t/turn-x-y-z-mouse-tracker-into-3d-cad-file/12275 "2019-06-26T13:18:14Z")

</div>

Hello! I am working on a project to be able to “draw” with a 3D clay printer. Right now I have a sketch that draws X,Y with mouse movement and Z with time elapsed. I want to be able to export this line as a CAD file so…

---

## [Random Word Picker](https://discourse.processing.org/t/random-word-picker/10619)

<div class="topic-metadata">

**Author:** [@mariamalz](https://discourse.processing.org/u/mariamalz)\
**Replies:** 7\
**Last updated:** [June 26, 2019, 12:53pm UTC](https://discourse.processing.org/t/random-word-picker/10619 "2019-06-26T12:53:37Z")

</div>

So I just want to create a simple random word picker that can display one word every time the program is run. So far I have this code but it keeps generating words after the first one has popped up, and currently there …

---

## [\[SOLVED\] Arduino button press should only spawn single object](https://discourse.processing.org/t/solved-arduino-button-press-should-only-spawn-single-object/12281)

<div class="topic-metadata">

**Author:** [@RealDwayneJ](https://discourse.processing.org/u/RealDwayneJ)\
**Replies:** 5\
**Last updated:** [June 26, 2019, 11:55am UTC](https://discourse.processing.org/t/solved-arduino-button-press-should-only-spawn-single-object/12281 "2019-06-26T11:55:15Z")

</div>

I linked my code to my Arduino and replaced the “keyPressed” buttons for the “arduino.HIGH” However, currently when I press a button, it registers as multiple presses at once. I realize this could be very well the cause…

---

## [Java Mode: How to import external code?](https://discourse.processing.org/t/java-mode-how-to-import-external-code/12258)

<div class="topic-metadata">

**Author:** [@LoliProcessor](https://discourse.processing.org/u/LoliProcessor)\
**Replies:** 6\
**Last updated:** [June 25, 2019, 10:53pm UTC](https://discourse.processing.org/t/java-mode-how-to-import-external-code/12258 "2019-06-25T22:53:40Z")

</div>

I have never imported a library in my life before. Google says compile it including it to the classpath. So how do include external java code that I want to use in my sketch but isnt in the sketch’s directory? And wha…

---

## [I cant create a new Object when the old one hits a certain x value](https://discourse.processing.org/t/i-cant-create-a-new-object-when-the-old-one-hits-a-certain-x-value/11820)

<div class="topic-metadata">

**Author:** [@sc4p3g0a7](https://discourse.processing.org/u/sc4p3g0a7)\
**Replies:** 4\
**Last updated:** [June 25, 2019, 8:19pm UTC](https://discourse.processing.org/t/i-cant-create-a-new-object-when-the-old-one-hits-a-certain-x-value/11820 "2019-06-25T20:19:20Z")

</div>

Hello, so i am making a game, and there are two main objects, there is you, and the obstacle. i want to crate a new obstacle, when the previous one gets to a certain space, Here is the code for the obstacle PVector lo…

---

## [PVector array filled with static data](https://discourse.processing.org/t/pvector-array-filled-with-static-data/12282)

<div class="topic-metadata">

**Author:** [@TTG](https://discourse.processing.org/u/TTG)\
**Replies:** 4\
**Last updated:** [June 25, 2019, 3:32pm UTC](https://discourse.processing.org/t/pvector-array-filled-with-static-data/12282 "2019-06-25T15:32:54Z")

</div>

Hi team, I have an issue regarding the correct way to assign PVector data in an array. the data is derived from earlier task (see image and code below), i only want to us the output as a PVector in an array (static co…

---

## [Mouse position is tracked beyond sketch window while dragging](https://discourse.processing.org/t/mouse-position-is-tracked-beyond-sketch-window-while-dragging/12283)

<div class="topic-metadata">

**Author:** [@gyula](https://discourse.processing.org/u/gyula)\
**Replies:** 0\
**Last updated:** [June 25, 2019, 1:23pm UTC](https://discourse.processing.org/t/mouse-position-is-tracked-beyond-sketch-window-while-dragging/12283 "2019-06-25T13:23:21Z")

</div>

This is not a question but a statement. According to the reference, Processing can only track mouseX and mouseY when the pointer is over the current window. Once the mouse moves away from the window, mouseX and mouseY w…

---

## [How do I add score to my game?](https://discourse.processing.org/t/how-do-i-add-score-to-my-game/12246)

<div class="topic-metadata">

**Author:** [@rahul321](https://discourse.processing.org/u/rahul321)\
**Replies:** 7\
**Last updated:** [June 25, 2019, 10:28am UTC](https://discourse.processing.org/t/how-do-i-add-score-to-my-game/12246 "2019-06-25T10:28:53Z")

</div>

I’m new to processing and have been trying to make a game in which the character moves to the coordinates of mouse click and then stays there until it is called again. I have a “food” which moves to a random location whe…

---

## [Display SVG file missing text elements](https://discourse.processing.org/t/display-svg-file-missing-text-elements/11969)

<div class="topic-metadata">

**Author:** [@Jen](https://discourse.processing.org/u/Jen)\
**Replies:** 6\
**Last updated:** [June 25, 2019, 1:43am UTC](https://discourse.processing.org/t/display-svg-file-missing-text-elements/11969 "2019-06-25T01:43:12Z")

</div>

I am using processing 3 and when I was displaying a svg file, all the text tags are missing. Here is a example of text tag in the svg file \<g id="g4408" transform="matrix(0.41926233,0,0,0.41926233,358.69347,78.772123)"\>…

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

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