# Latest

**URL:** https://discourse.processing.org/latest.md?page=425

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

**Page:** 426

---

## [Bidirectional communication between a web page and Processing using websockets](https://discourse.processing.org/t/bidirectional-communication-between-a-web-page-and-processing-using-websockets/15515)

<div class="topic-metadata">

**Author:** [@hamoid](https://discourse.processing.org/u/hamoid)\
**Replies:** 0\
**Last updated:** [November 15, 2019, 7:27pm UTC](https://discourse.processing.org/t/bidirectional-communication-between-a-web-page-and-processing-using-websockets/15515 "2019-11-15T19:27:59Z")

</div>

I made a simple example of communicating a web page and a Processing sketch using websockets. It requires the Processing library called Websockets. Why would you want to do this? There’s many possible reasons, but one o…

---

## [Acos() not giving angles between PI/2-3PI/2](https://discourse.processing.org/t/acos-not-giving-angles-between-pi-2-3pi-2/15513)

<div class="topic-metadata">

**Author:** [@F53](https://discourse.processing.org/u/F53)\
**Replies:** 2\
**Last updated:** [November 15, 2019, 5:51pm UTC](https://discourse.processing.org/t/acos-not-giving-angles-between-pi-2-3pi-2/15513 "2019-11-15T17:51:17Z")

</div>

I am making a tank game, using the following to determine the angle from the tank to the cursor rotate(atan(((mouseY-height/2)\*scalar)/((mouseX-width/2)\*scalar))); then drawing my cannon within it (for shortening purpo…

---

## [Teaching to Code VS teaching to Adobe](https://discourse.processing.org/t/teaching-to-code-vs-teaching-to-adobe/15126)

<div class="topic-metadata">

**Author:** [@r8th](https://discourse.processing.org/u/r8th)\
**Replies:** 21\
**Last updated:** [November 15, 2019, 5:27pm UTC](https://discourse.processing.org/t/teaching-to-code-vs-teaching-to-adobe/15126 "2019-11-15T17:27:06Z")

</div>

Hi, My question is for teachers who teach coding to artists / non-coders at a university level. I am very curious about what arguments you make to encourage students who are new to coding, to choose to code over other …

---

## [Making a Palette using for loops and arrays \[COMPLICATED\]](https://discourse.processing.org/t/making-a-palette-using-for-loops-and-arrays-complicated/15475)

<div class="topic-metadata">

**Author:** [@IsaiahZ](https://discourse.processing.org/u/IsaiahZ)\
**Replies:** 15\
**Last updated:** [November 15, 2019, 11:24am UTC](https://discourse.processing.org/t/making-a-palette-using-for-loops-and-arrays-complicated/15475 "2019-11-15T11:24:25Z")

</div>

So I am making a palette and am trying to learn for loops(nested loops) and arrays. I am having difficulty understanding the mechanics of them as well as how I am to implement them to this project. I will explain first …

---

## [Can you help me repair it?](https://discourse.processing.org/t/can-you-help-me-repair-it/15502)

<div class="topic-metadata">

**Author:** [@Soloh](https://discourse.processing.org/u/Soloh)\
**Replies:** 1\
**Last updated:** [November 15, 2019, 9:27am UTC](https://discourse.processing.org/t/can-you-help-me-repair-it/15502 "2019-11-15T09:27:23Z")

</div>

int x=500; int o=600; void setup() { size(1000,1000); strokeWeight(2); } void draw() { background(100,150,200); line(500,200,x,700); ellipse(x,700,200,200); ellipse(x,700,170,170); ellipse(x,700,140,140); ellipse(x,70…

---

## [How to input static dataset in this code?](https://discourse.processing.org/t/how-to-input-static-dataset-in-this-code/14917)

<div class="topic-metadata">

**Author:** [@cadidutta](https://discourse.processing.org/u/cadidutta)\
**Replies:** 8\
**Last updated:** [November 15, 2019, 5:46am UTC](https://discourse.processing.org/t/how-to-input-static-dataset-in-this-code/14917 "2019-11-15T05:46:36Z")

</div>

'm a undergraduate Biomedical Engineering , only a beginner in coding. I was trying to understand this BCI code written in processing and wanted to input an EEG eye movement dataset rather than the microphone jack input …

---

## [Square an arraylist (new to coding)](https://discourse.processing.org/t/square-an-arraylist-new-to-coding/15489)

<div class="topic-metadata">

**Author:** [@NoSmoke11](https://discourse.processing.org/u/NoSmoke11)\
**Replies:** 5\
**Last updated:** [November 14, 2019, 10:16pm UTC](https://discourse.processing.org/t/square-an-arraylist-new-to-coding/15489 "2019-11-14T22:16:54Z")

</div>

Hello guys how do i square all the numbers in an arrayList? i want to square each number with itself, is this possible?

---

## [Way to use a method as parameter](https://discourse.processing.org/t/way-to-use-a-method-as-parameter/15494)

<div class="topic-metadata">

**Author:** [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Replies:** 4\
**Last updated:** [November 14, 2019, 9:00pm UTC](https://discourse.processing.org/t/way-to-use-a-method-as-parameter/15494 "2019-11-14T21:00:08Z")

</div>

Hi I’ve been Looking for a way to create a method wich uses an other method for calculating stuff. As I surfed I found that there are methods in specific classes wich can do this for Example in the Library java.awt.event…

---

## [Giant LED Display Memory Leak?](https://discourse.processing.org/t/giant-led-display-memory-leak/140)

<div class="topic-metadata">

**Author:** [@Brick](https://discourse.processing.org/u/Brick)\
**Replies:** 16\
**Last updated:** [November 14, 2019, 8:07pm UTC](https://discourse.processing.org/t/giant-led-display-memory-leak/140 "2019-11-14T20:07:49Z")

</div>

Hi, Using instructions online I built a giant LED video screen. It’s very cool, but I ran into a big problem: the screen runs for about ~8-12 minutes (depending on the video) then freezes. I can reset and re-run as ma…

---

## [Fade Animation of character arrays](https://discourse.processing.org/t/fade-animation-of-character-arrays/15409)

<div class="topic-metadata">

**Author:** [@byxx](https://discourse.processing.org/u/byxx)\
**Replies:** 2\
**Last updated:** [November 14, 2019, 6:14pm UTC](https://discourse.processing.org/t/fade-animation-of-character-arrays/15409 "2019-11-14T18:14:54Z")

</div>

Dear p5 community, I build some character arrays as two shapes (shape1 and shape2) I would like to blend over with a fade animation (1 sec) from shape 1 into shape2, after having been displayed for 10 secs. During the…

---

## [Any idea how to fix this? Quiz](https://discourse.processing.org/t/any-idea-how-to-fix-this-quiz/15418)

<div class="topic-metadata">

**Author:** [@CyberDodo](https://discourse.processing.org/u/CyberDodo)\
**Replies:** 7\
**Last updated:** [November 14, 2019, 4:52pm UTC](https://discourse.processing.org/t/any-idea-how-to-fix-this-quiz/15418 "2019-11-14T16:52:05Z")

</div>

int flag = 0; void setup() { size( 1366, 768); background(255); } void draw() { if(flag == 0){ push(); background(255); fill(255, 0, 0); rect (700, 300, 300, 300); fill(0, 255, 0); …

---

## [How about a GCloud Text-to-Speech & Speech-to-Text wrapper for Processing with a \<10 liner?](https://discourse.processing.org/t/how-about-a-gcloud-text-to-speech-speech-to-text-wrapper-for-processing-with-a-10-liner/15467)

<div class="topic-metadata">

**Author:** [@advancecoder](https://discourse.processing.org/u/advancecoder)\
**Replies:** 6\
**Last updated:** [November 14, 2019, 4:36pm UTC](https://discourse.processing.org/t/how-about-a-gcloud-text-to-speech-speech-to-text-wrapper-for-processing-with-a-10-liner/15467 "2019-11-14T16:36:44Z")

</div>

How about a GCloud Text-to-Speech & Speech-to-Text wrapper for Processing with a \<10 liner?

---

## [serialEvent(Serial port) realtime](https://discourse.processing.org/t/serialevent-serial-port-realtime/15485)

<div class="topic-metadata">

**Author:** [@kb12592](https://discourse.processing.org/u/kb12592)\
**Replies:** 1\
**Last updated:** [November 14, 2019, 4:35pm UTC](https://discourse.processing.org/t/serialevent-serial-port-realtime/15485 "2019-11-14T16:35:12Z")

</div>

Hi all, I was wondering if anyone could tell me how void serialEvent function works - I know it is called when data is available from the serial port - but does it wait until it has run through the whole function before…

---

## [FFT within a Object](https://discourse.processing.org/t/fft-within-a-object/15408)

<div class="topic-metadata">

**Author:** [@alexandr56](https://discourse.processing.org/u/alexandr56)\
**Replies:** 1\
**Last updated:** [November 14, 2019, 4:00pm UTC](https://discourse.processing.org/t/fft-within-a-object/15408 "2019-11-14T16:00:42Z")

</div>

I’m working on a project and i have my audio files being put into an audio object in order for it to be played and created but when I try to analyze the frequency using FFT it doesn’t pick anything up here’s the code for…

---

## [Can't add elements to an arraylist?](https://discourse.processing.org/t/cant-add-elements-to-an-arraylist/15461)

<div class="topic-metadata">

**Author:** [@Althos](https://discourse.processing.org/u/Althos)\
**Replies:** 10\
**Last updated:** [November 14, 2019, 2:57pm UTC](https://discourse.processing.org/t/cant-add-elements-to-an-arraylist/15461 "2019-11-14T14:57:18Z")

</div>

Hi, Although I wouldn’t say I’m a complete novice, I’ve been unsucessfully trying to do something quite simple : add objects to an ArrayList Code is somethin like this : ArrayList\<Object\> objects = new ArrayList\<Objec…

---

## [Having trouble with my grid](https://discourse.processing.org/t/having-trouble-with-my-grid/15466)

<div class="topic-metadata">

**Author:** [@IsaiahZ](https://discourse.processing.org/u/IsaiahZ)\
**Replies:** 7\
**Last updated:** [November 14, 2019, 1:34pm UTC](https://discourse.processing.org/t/having-trouble-with-my-grid/15466 "2019-11-14T13:34:10Z")

</div>

Having trouble with the for loops. I need to keep the grid but get rid of the excess lines. If anyone could help. I’m very new to all this. size(500,500); final int N = 25; for(int i=0; i\<N; i++){ float xPosition …

---

## [How do I read windows accelerometer?](https://discourse.processing.org/t/how-do-i-read-windows-accelerometer/15318)

<div class="topic-metadata">

**Author:** [@irmantas](https://discourse.processing.org/u/irmantas)\
**Replies:** 37\
**Last updated:** [November 14, 2019, 1:24pm UTC](https://discourse.processing.org/t/how-do-i-read-windows-accelerometer/15318 "2019-11-14T13:24:12Z")

</div>

how do I read windows accelerometer?

---

## [Professional website with p5](https://discourse.processing.org/t/professional-website-with-p5/15433)

<div class="topic-metadata">

**Author:** [@byxx](https://discourse.processing.org/u/byxx)\
**Replies:** 6\
**Last updated:** [November 13, 2019, 1:25pm UTC](https://discourse.processing.org/t/professional-website-with-p5/15433 "2019-11-13T13:25:18Z")

</div>

Hi, a typical website contains multiple pages besides the index.html. (i.e. home, bio, shop, dates, contact etc.), Do you develop pro websites in p5 or is it a mere code learning platform? Thx BX

---

## [Path around a perimeter](https://discourse.processing.org/t/path-around-a-perimeter/15059)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 19\
**Last updated:** [November 14, 2019, 8:12am UTC](https://discourse.processing.org/t/path-around-a-perimeter/15059 "2019-11-14T08:12:14Z")

</div>

Background (skip if you just want to get to the problem): I’m still trying to implement the voronoi project, having run into some issues with my initial method. Initially, i was incrementing the radius around a point, …

---

## [Caesar Cipher Text](https://discourse.processing.org/t/caesar-cipher-text/15477)

<div class="topic-metadata">

**Author:** [@Adrian1998](https://discourse.processing.org/u/Adrian1998)\
**Replies:** 1\
**Last updated:** [November 14, 2019, 5:32am UTC](https://discourse.processing.org/t/caesar-cipher-text/15477 "2019-11-14T05:32:29Z")

</div>

Hello I am currently struggling very hard on this program. I have to make a caesar cipher program and I can not figure out how to make the program cipher once. String Alpha = "abcdefghijklmnopqrstuvwxyz"; int i = 0; vo…

---

## [Color - changing RGB values when in HSB colorMode](https://discourse.processing.org/t/color-changing-rgb-values-when-in-hsb-colormode/15277)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 34\
**Last updated:** [November 14, 2019, 3:39am UTC](https://discourse.processing.org/t/color-changing-rgb-values-when-in-hsb-colormode/15277 "2019-11-14T03:39:05Z")

</div>

I have produced this crude and simple sketch to get and change a RGB value when I am in HSB colorMode. Later I will use bit shifting instead of green() and so on. But before I build on this, is this the best way to do t…

---

## [Needle sweep. I have needle going to 180 degrees, but I need it to sweep back to 0](https://discourse.processing.org/t/needle-sweep-i-have-needle-going-to-180-degrees-but-i-need-it-to-sweep-back-to-0/15473)

<div class="topic-metadata">

**Author:** [@DonnieBrasco](https://discourse.processing.org/u/DonnieBrasco)\
**Replies:** 3\
**Last updated:** [November 14, 2019, 1:47am UTC](https://discourse.processing.org/t/needle-sweep-i-have-needle-going-to-180-degrees-but-i-need-it-to-sweep-back-to-0/15473 "2019-11-14T01:47:20Z")

</div>

//Define Global Variables float x, y; //updating coordinates float a = 0; //find theta angle float r = 200; //radius void setup(){ size(640,480); } void draw(){ background(#6E96A7); //bluish background drawC…

---

## [Removing and respawning sprites](https://discourse.processing.org/t/removing-and-respawning-sprites/15387)

<div class="topic-metadata">

**Author:** [@jakobfree](https://discourse.processing.org/u/jakobfree)\
**Replies:** 2\
**Last updated:** [November 13, 2019, 10:29pm UTC](https://discourse.processing.org/t/removing-and-respawning-sprites/15387 "2019-11-13T22:29:18Z")

</div>

Hi all, Programming uber-beginner here. Having a bit of trouble figuring out one (of many) problem(s) with a current small-scale game project: https://editor.p5js.org/jakobfree/sketches/B09u80zKh I’m trying to create a…

---

## [Cant find solution for restart](https://discourse.processing.org/t/cant-find-solution-for-restart/15462)

<div class="topic-metadata">

**Author:** [@actuallyagod](https://discourse.processing.org/u/actuallyagod)\
**Replies:** 1\
**Last updated:** [November 13, 2019, 7:51pm UTC](https://discourse.processing.org/t/cant-find-solution-for-restart/15462 "2019-11-13T19:51:19Z")

</div>

Hi All! I have been trying to add a restart button to this code but variables dont seem to work for me or maybe im doing it wrong. As of now i have tried to add: void keyPressed() { if(key == 'r') { restart(); } } …

---

## [Problem with Library Methods](https://discourse.processing.org/t/problem-with-library-methods/15455)

<div class="topic-metadata">

**Author:** [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Replies:** 8\
**Last updated:** [November 13, 2019, 5:10pm UTC](https://discourse.processing.org/t/problem-with-library-methods/15455 "2019-11-13T17:10:14Z")

</div>

Hi I’m trying to create a processing library using eclipse, everything Looks fine so far but if I use following Code for a class package test; import processing.core.\*; public class Testclass{ PAppplet parent; Testc…

---

## [Java SE and installing for 64-bit OSX](https://discourse.processing.org/t/java-se-and-installing-for-64-bit-osx/15038)

<div class="topic-metadata">

**Author:** [@neari](https://discourse.processing.org/u/neari)\
**Replies:** 5\
**Last updated:** [November 13, 2019, 4:56pm UTC](https://discourse.processing.org/t/java-se-and-installing-for-64-bit-osx/15038 "2019-11-13T16:56:33Z")

</div>

Hi, I am a newbie to the forum but have some working experiences with processing™ I just wanted to know what Apple Mac is using to replace Java virtual machine, I was asked to install latest version of Java SE 15.0 but …

---

## [Png loses alpha when use rotate function,](https://discourse.processing.org/t/png-loses-alpha-when-use-rotate-function/15450)

<div class="topic-metadata">

**Author:** [@juju](https://discourse.processing.org/u/juju)\
**Replies:** 18\
**Last updated:** [November 13, 2019, 4:37pm UTC](https://discourse.processing.org/t/png-loses-alpha-when-use-rotate-function/15450 "2019-11-13T16:37:53Z")

</div>

How come the png alpha doesn’t work when rotating in P3D? .png files included below PImage img1, img2; int x = 1; void setup() { size(900, 600, P3D); img1 = loadImage("circle.png"); img2 =loadImage("square.png"…

---

## [How do you make a function run the same way as draw()?](https://discourse.processing.org/t/how-do-you-make-a-function-run-the-same-way-as-draw/15373)

<div class="topic-metadata">

**Author:** [@24stevek](https://discourse.processing.org/u/24stevek)\
**Replies:** 13\
**Last updated:** [November 13, 2019, 12:42pm UTC](https://discourse.processing.org/t/how-do-you-make-a-function-run-the-same-way-as-draw/15373 "2019-11-13T12:42:44Z")

</div>

Hi, guys, I’m a Korean student who just started learning processing. My English might be awkward but please don’t be mad at it. So, I am making this project that shows the moving of electrons. I made an animation of an …

---

## [Alpha animation start with delay](https://discourse.processing.org/t/alpha-animation-start-with-delay/15427)

<div class="topic-metadata">

**Author:** [@byxx](https://discourse.processing.org/u/byxx)\
**Replies:** 6\
**Last updated:** [November 13, 2019, 11:11am UTC](https://discourse.processing.org/t/alpha-animation-start-with-delay/15427 "2019-11-13T11:11:08Z")

</div>

Hey there, Here´s a alpha animation I work on as a beginner, starting immediately to fade out the shape containing a character array. That is okay. var f = 255; //alpha variable var speed = 0.1; // decreasing alpha mu…

---

## [My sound file wont play or work and I don't know why](https://discourse.processing.org/t/my-sound-file-wont-play-or-work-and-i-dont-know-why/15445)

<div class="topic-metadata">

**Author:** [@DudVudAura](https://discourse.processing.org/u/DudVudAura)\
**Replies:** 6\
**Last updated:** [November 13, 2019, 5:48am UTC](https://discourse.processing.org/t/my-sound-file-wont-play-or-work-and-i-dont-know-why/15445 "2019-11-13T05:48:23Z")

</div>

import processing.sound.\*; SoundFile file; String audioName = "tank shot.wav"; String path; void setup() { frameRate(60); background(0); size(1500,1500); file = new SoundFile(this, "Sleigh Ride.mp3"); file…

[Previous page](https://discourse.processing.org/latest.md?page=424)

[Next page](https://discourse.processing.org/latest.md?page=426)
