# Processing

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

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

**Page:** 366

---

## [How to restrict how far an object can decrease size?](https://discourse.processing.org/t/how-to-restrict-how-far-an-object-can-decrease-size/3600)

<div class="topic-metadata">

**Author:** [@MartinM](https://discourse.processing.org/u/MartinM)\
**Replies:** 4\
**Last updated:** [September 17, 2018, 5:31pm UTC](https://discourse.processing.org/t/how-to-restrict-how-far-an-object-can-decrease-size/3600 "2018-09-17T17:31:16Z")

</div>

I currently have a rectangle shrinking its size upon impact with a ball, is there any way I can make sure that once it shrinks to a certain size it stops shrinking and just remains that size? void paddle(PVector pad){; …

---

## [Incorrect results when doing division with variables](https://discourse.processing.org/t/incorrect-results-when-doing-division-with-variables/3606)

<div class="topic-metadata">

**Author:** [@Cam](https://discourse.processing.org/u/Cam)\
**Replies:** 1\
**Last updated:** [September 17, 2018, 4:39pm UTC](https://discourse.processing.org/t/incorrect-results-when-doing-division-with-variables/3606 "2018-09-17T16:39:26Z")

</div>

This code ^^ Returns this vv width = 1000 selImg.width = 255 height = 1000 selImg.height = 255 ((width / selImg.width) \* selImg.height) = 900 ((height / selImg.height) \* selImg.width) = 900 Obviously somethings…

---

## [How to make different sizes for one renderer](https://discourse.processing.org/t/how-to-make-different-sizes-for-one-renderer/3323)

<div class="topic-metadata">

**Author:** [@mloiz](https://discourse.processing.org/u/mloiz)\
**Replies:** 5\
**Last updated:** [September 17, 2018, 4:30pm UTC](https://discourse.processing.org/t/how-to-make-different-sizes-for-one-renderer/3323 "2018-09-17T16:30:11Z")

</div>

Hi, I have to make one image at three different sizes : A3 for printing at 300 DPI, would need 3508 x 4961 pix A5 for printing at 300 DPI, would need 1748 \* 2480 pix and a banner for the web at 960 × 334 pixels how w…

---

## [Processing.serial in BlueJ doesn't work](https://discourse.processing.org/t/processing-serial-in-bluej-doesnt-work/3351)

<div class="topic-metadata">

**Author:** [@Paul94](https://discourse.processing.org/u/Paul94)\
**Replies:** 15\
**Last updated:** [September 17, 2018, 5:35am UTC](https://discourse.processing.org/t/processing-serial-in-bluej-doesnt-work/3351 "2018-09-17T05:35:32Z")

</div>

Hello, Currently I am trying to use Processing in BlueJ. So far this works quite well - except for the serial interface to the Arduino. For this I have written the following code in Processing, which also works: import…

---

## [Detecting mouse click on circle](https://discourse.processing.org/t/detecting-mouse-click-on-circle/3599)

<div class="topic-metadata">

**Author:** [@Tristan](https://discourse.processing.org/u/Tristan)\
**Replies:** 9\
**Last updated:** [September 17, 2018, 1:40pm UTC](https://discourse.processing.org/t/detecting-mouse-click-on-circle/3599 "2018-09-17T13:40:40Z")

</div>

I am trying to detect a mouse press on a circle. I know how to do so with a square and am using that for the hitbox right now. I would like to know what is supposed to go into my IF statement to detect MouseX and mouseY …

---

## [Enhanced For Loops and selecting every nth](https://discourse.processing.org/t/enhanced-for-loops-and-selecting-every-nth/3593)

<div class="topic-metadata">

**Author:** [@omerpekin](https://discourse.processing.org/u/omerpekin)\
**Replies:** 4\
**Last updated:** [September 17, 2018, 8:15am UTC](https://discourse.processing.org/t/enhanced-for-loops-and-selecting-every-nth/3593 "2018-09-17T08:15:01Z")

</div>

Hi, I have a simple question about enhanced for loops. I created a new arraylist and filled them with objects. and now I am trying to select every nth object. I tried to use: if(arraylist.size() % 2 == 0) {} but it d…

---

## [How do I import an "idx3-ubyte" file?](https://discourse.processing.org/t/how-do-i-import-an-idx3-ubyte-file/3577)

<div class="topic-metadata">

**Author:** [@Tsskyx](https://discourse.processing.org/u/Tsskyx)\
**Replies:** 2\
**Last updated:** [September 16, 2018, 5:56pm UTC](https://discourse.processing.org/t/how-do-i-import-an-idx3-ubyte-file/3577 "2018-09-16T17:56:01Z")

</div>

I am wondering how to import the files found on this website into Processing: http://yann.lecun.com/exdb/mnist/ They’re supposed to contain thousands of 28x28 byte arrangements, each with its own “grayscale” value. In e…

---

## [Flip along the x-axis](https://discourse.processing.org/t/flip-along-the-x-axis/3543)

<div class="topic-metadata">

**Author:** [@rsomani95](https://discourse.processing.org/u/rsomani95)\
**Replies:** 4\
**Last updated:** [September 16, 2018, 2:46pm UTC](https://discourse.processing.org/t/flip-along-the-x-axis/3543 "2018-09-16T14:46:54Z")

</div>

Here’s some code I’m using to generate a color wheel (you can copy-paste this into your PDE and it should run just fine): void setup() { size(500, 500); noStroke(); background(255); colorMode(HSB, 360, 100, 100…

---

## [Use saveStrings to add timestamp INTO the text File](https://discourse.processing.org/t/use-savestrings-to-add-timestamp-into-the-text-file/3573)

<div class="topic-metadata">

**Author:** [@losferatos](https://discourse.processing.org/u/losferatos)\
**Replies:** 3\
**Last updated:** [September 16, 2018, 2:15pm UTC](https://discourse.processing.org/t/use-savestrings-to-add-timestamp-into-the-text-file/3573 "2018-09-16T14:15:08Z")

</div>

Hi guys! I’m trying to create a certain code generator and it works quite well. Cliffs: It generates a number of codes and saves them into a .txt file. Now I also want to add a specific string to the end of that file …

---

## [PVector transformation](https://discourse.processing.org/t/pvector-transformation/3575)

<div class="topic-metadata">

**Author:** [@Ben1](https://discourse.processing.org/u/Ben1)\
**Replies:** 3\
**Last updated:** [September 16, 2018, 1:46pm UTC](https://discourse.processing.org/t/pvector-transformation/3575 "2018-09-16T13:46:53Z")

</div>

Hello there, in a recent tutorial of “the coding train” with Daniel Shiffman I was learning about PVector. In the video (https://www.youtube.com/watch?v=7nTLzLf7jUg) he transforms a simple bouncing ball sketch with vari…

---

## [Need help; String\[\] and Methods](https://discourse.processing.org/t/need-help-string-and-methods/3564)

<div class="topic-metadata">

**Author:** [@SolDrakibane](https://discourse.processing.org/u/SolDrakibane)\
**Replies:** 2\
**Last updated:** [September 16, 2018, 12:01pm UTC](https://discourse.processing.org/t/need-help-string-and-methods/3564 "2018-09-16T12:01:38Z")

</div>

Hi, for my study i had a task which i have already completed (code below) i needed to draw four different names using a method. What i’ve made below works however how can i improve the method? Code below doesn’t work it…

---

## [Sound Code in void draw makes me problem](https://discourse.processing.org/t/sound-code-in-void-draw-makes-me-problem/3538)

<div class="topic-metadata">

**Author:** [@TheKillerHD](https://discourse.processing.org/u/TheKillerHD)\
**Replies:** 18\
**Last updated:** [September 16, 2018, 8:23am UTC](https://discourse.processing.org/t/sound-code-in-void-draw-makes-me-problem/3538 "2018-09-16T08:23:58Z")

</div>

I want the sound to be played when the ball touches the player. At the moment I have the sound in void draw and that makes me problems because messages appear in the console and then the game blocks. Can I somehow write…

---

## [Unable to create a new sketch after upgrading to Processing 3.4 on OSX 10.13.6](https://discourse.processing.org/t/unable-to-create-a-new-sketch-after-upgrading-to-processing-3-4-on-osx-10-13-6/3562)

<div class="topic-metadata">

**Author:** [@dubwalla](https://discourse.processing.org/u/dubwalla)\
**Replies:** 2\
**Last updated:** [September 16, 2018, 3:45am UTC](https://discourse.processing.org/t/unable-to-create-a-new-sketch-after-upgrading-to-processing-3-4-on-osx-10-13-6/3562 "2018-09-16T03:45:29Z")

</div>

I had previously used Processing on my Macbook about a year ago with no issues. I believe I was on version 2.7 or so. I didn’t use the software for quite a while so am not sure during which OSX update, but at some point,…

---

## [How to integrate a .css file into a p5.js sketch into Processing IDE?](https://discourse.processing.org/t/how-to-integrate-a-css-file-into-a-p5-js-sketch-into-processing-ide/2804)

<div class="topic-metadata">

**Author:** [@Laurent](https://discourse.processing.org/u/Laurent)\
**Replies:** 6\
**Last updated:** [September 16, 2018, 1:21am UTC](https://discourse.processing.org/t/how-to-integrate-a-css-file-into-a-p5-js-sketch-into-processing-ide/2804 "2018-09-16T01:21:43Z")

</div>

Hi everyone. I’d like to format the index.html page of a p5.js sketch into Processng IDE with CSS external file. I’ve add a new tab in the IDE and I’ve named it ‘styles.css’. This file was created by Processing into root…

---

## [Framerate starting slow](https://discourse.processing.org/t/framerate-starting-slow/3549)

<div class="topic-metadata">

**Author:** [@Sarah](https://discourse.processing.org/u/Sarah)\
**Replies:** 4\
**Last updated:** [September 15, 2018, 12:18pm UTC](https://discourse.processing.org/t/framerate-starting-slow/3549 "2018-09-15T12:18:51Z")

</div>

Hi, I’ve been testing the frameRate on some of my programs lately, but I’ve noticed that when I first start the program, the frameRate always starts off around 15, then gradually goes up. I’m using a MacBook Air and won…

---

## [Udp problem sending byte (-127)](https://discourse.processing.org/t/udp-problem-sending-byte-127/3545)

<div class="topic-metadata">

**Author:** [@tuxilus](https://discourse.processing.org/u/tuxilus)\
**Replies:** 2\
**Last updated:** [September 15, 2018, 6:41am UTC](https://discourse.processing.org/t/udp-problem-sending-byte-127/3545 "2018-09-15T06:41:32Z")

</div>

Hello, I am trying to send visca commands over udp. To send a command to camera 1 you have to send byte (0x81). Unfortunately udp.send sends the value 63! I discovered this by sending from processing 3 on windows and…

---

## [Neural style transfer in processing](https://discourse.processing.org/t/neural-style-transfer-in-processing/3497)

<div class="topic-metadata">

**Author:** [@molo32](https://discourse.processing.org/u/molo32)\
**Replies:** 2\
**Last updated:** [September 15, 2018, 12:23am UTC](https://discourse.processing.org/t/neural-style-transfer-in-processing/3497 "2018-09-15T00:23:43Z")

</div>

Does anyone know if it can be done in processing or are there similar examples?

---

## [Right-to-left text](https://discourse.processing.org/t/right-to-left-text/3527)

<div class="topic-metadata">

**Author:** [@Miguel](https://discourse.processing.org/u/Miguel)\
**Replies:** 9\
**Last updated:** [September 14, 2018, 3:37pm UTC](https://discourse.processing.org/t/right-to-left-text/3527 "2018-09-14T15:37:15Z")

</div>

Hey folks, long time no see. I’ve been away from processing for a while but now I’ve opened it again for a small project: I am trying to render some Persian text within processing. The text looks fine when the result is …

---

## [Having trouble getting triangle to speed up?](https://discourse.processing.org/t/having-trouble-getting-triangle-to-speed-up/3532)

<div class="topic-metadata">

**Author:** [@ant](https://discourse.processing.org/u/ant)\
**Replies:** 9\
**Last updated:** [September 14, 2018, 2:17pm UTC](https://discourse.processing.org/t/having-trouble-getting-triangle-to-speed-up/3532 "2018-09-14T14:17:08Z")

</div>

I’m trying to get the triangle to speed up after it hits the wall, but I’m unsure how to do that. //variables float xa=30;float ya=75;float xb=58;float yb=20; float xc=86;float yc=75;float xSpeed=10;float ySpeed=10; vo…

---

## [How to change chance of heads or tails in a coin flip](https://discourse.processing.org/t/how-to-change-chance-of-heads-or-tails-in-a-coin-flip/3531)

<div class="topic-metadata">

**Author:** [@ant](https://discourse.processing.org/u/ant)\
**Replies:** 2\
**Last updated:** [September 14, 2018, 12:46pm UTC](https://discourse.processing.org/t/how-to-change-chance-of-heads-or-tails-in-a-coin-flip/3531 "2018-09-14T12:46:20Z")

</div>

I know this is the code for getting twice the number of heads and I’m trying different things out to rig a coin flip. if (random(1)\< (1/3)) { image (tail, mouseX, mouseY); } else { image (head,mouseX,mouseY); …

---

## [Code generated pattern wrap on 3D](https://discourse.processing.org/t/code-generated-pattern-wrap-on-3d/3385)

<div class="topic-metadata">

**Author:** [@vallu](https://discourse.processing.org/u/vallu)\
**Replies:** 13\
**Last updated:** [September 13, 2018, 6:40pm UTC](https://discourse.processing.org/t/code-generated-pattern-wrap-on-3d/3385 "2018-09-13T18:40:46Z")

</div>

Hello, I have been to trying to program a cuboid with surfaces rendered in code generated patterns (image attached). While there is a texture function for wrapping images, I couldn’t find anything for SVG’s or code gener…

---

## [Having multiple moving objects collide detection issues](https://discourse.processing.org/t/having-multiple-moving-objects-collide-detection-issues/3463)

<div class="topic-metadata">

**Author:** [@MartinM](https://discourse.processing.org/u/MartinM)\
**Replies:** 6\
**Last updated:** [September 13, 2018, 5:26pm UTC](https://discourse.processing.org/t/having-multiple-moving-objects-collide-detection-issues/3463 "2018-09-13T17:26:52Z")

</div>

Recently I have been playing with the Arduino and I have been using processing for the coding. Before I go any further the program does run without the specific need for an Arduino and the issue I am having also does not…

---

## [Adding a function to the "Processing Animation Thread"](https://discourse.processing.org/t/adding-a-function-to-the-processing-animation-thread/3429)

<div class="topic-metadata">

**Author:** [@aframires](https://discourse.processing.org/u/aframires)\
**Replies:** 6\
**Last updated:** [September 13, 2018, 2:23pm UTC](https://discourse.processing.org/t/adding-a-function-to-the-processing-animation-thread/3429 "2018-09-13T14:23:27Z")

</div>

Hello everyone. I have a question regarding adding a function to be ran in the Processing Animation Thread or, in other words, to be ran after draw() in a similar fashion as the keyPressed() and mousePressed() function. …

---

## [Sound library update not working](https://discourse.processing.org/t/sound-library-update-not-working/3473)

<div class="topic-metadata">

**Author:** [@RockyHawk](https://discourse.processing.org/u/RockyHawk)\
**Replies:** 6\
**Last updated:** [September 13, 2018, 1:06pm UTC](https://discourse.processing.org/t/sound-library-update-not-working/3473 "2018-09-13T13:06:32Z")

</div>

So processing was working with my code perfectly before this sound library update (2.0.1). When the code gets to this section (it’s just the first one there so that’s probably why it does the specific section): menus = …

---

## [KinectPV2: get and import obj files](https://discourse.processing.org/t/kinectpv2-get-and-import-obj-files/3424)

<div class="topic-metadata">

**Author:** [@elyon](https://discourse.processing.org/u/elyon)\
**Replies:** 20\
**Last updated:** [September 13, 2018, 9:56am UTC](https://discourse.processing.org/t/kinectpv2-get-and-import-obj-files/3424 "2018-09-13T09:56:02Z")

</div>

Hi all! I’m a beginner in Processing and my boss asked me to interface Kinect for XBOX ONE (or Kinect V2) to PC for record pointclouds’ videos (nothing easier…) and to record some coloured frames of a moving arm of a pe…

---

## [How to remove array object when mouse pressed](https://discourse.processing.org/t/how-to-remove-array-object-when-mouse-pressed/3406)

<div class="topic-metadata">

**Author:** [@tefa](https://discourse.processing.org/u/tefa)\
**Replies:** 17\
**Last updated:** [September 13, 2018, 7:19am UTC](https://discourse.processing.org/t/how-to-remove-array-object-when-mouse-pressed/3406 "2018-09-13T07:19:43Z")

</div>

Hello Dear Processors, thank you for your time. So I am trying to remove images from an array when mouseX and mouseY is directly in top of the image. how do i do that. So fare I have the code that detects when the mouse …

---

## [Saving data coming in quicker that draw() can run](https://discourse.processing.org/t/saving-data-coming-in-quicker-that-draw-can-run/3353)

<div class="topic-metadata">

**Author:** [@Tglaser92](https://discourse.processing.org/u/Tglaser92)\
**Replies:** 3\
**Last updated:** [September 12, 2018, 5:43pm UTC](https://discourse.processing.org/t/saving-data-coming-in-quicker-that-draw-can-run/3353 "2018-09-12T17:43:58Z")

</div>

Hello all, I’ve got data coming into a serial port at 250Hz and I’d like to save it all to a .csv file. Of course draw() is not going to be able to keep up with that rate of data. Is there a way to save all incoming da…

---

## [Making multiple lines move](https://discourse.processing.org/t/making-multiple-lines-move/3447)

<div class="topic-metadata">

**Author:** [@klutchie](https://discourse.processing.org/u/klutchie)\
**Replies:** 4\
**Last updated:** [September 12, 2018, 5:02pm UTC](https://discourse.processing.org/t/making-multiple-lines-move/3447 "2018-09-12T17:02:03Z")

</div>

Hello there! (First time poster) Im currently on my second week of a programming course and as one of our first assignment we were supposed to write our name/gamertag on Processing with different lines and shapes. Easy …

---

## [Platform game: take away a life](https://discourse.processing.org/t/platform-game-take-away-a-life/3478)

<div class="topic-metadata">

**Author:** [@Processingn00b](https://discourse.processing.org/u/Processingn00b)\
**Replies:** 5\
**Last updated:** [September 12, 2018, 4:40pm UTC](https://discourse.processing.org/t/platform-game-take-away-a-life/3478 "2018-09-12T16:40:10Z")

</div>

Hello, me again. i am still making my game and was wondering if someone could help me. i am trying to make it when the bottom platform touches the falling rectangles it will take away a life (three lives) but i don’t kno…

---

## [Project with midi files](https://discourse.processing.org/t/project-with-midi-files/3350)

<div class="topic-metadata">

**Author:** [@arufer720](https://discourse.processing.org/u/arufer720)\
**Replies:** 10\
**Last updated:** [September 12, 2018, 2:38pm UTC](https://discourse.processing.org/t/project-with-midi-files/3350 "2018-09-12T14:38:55Z")

</div>

Hey! Im trying to make a program that reads a midi file, extracts the signature and tempo data to make a programable metronome. But I dont find the way, becase the Midibus library doesn’t reads midi files, and also I do…

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

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