r/p5js • u/Upbeat_Work6930 • 2d ago
Is there a way to convert p5js into C#?
As you saw in the title i were looking for a way to convert my code in p5js into C#. Hopefully it’s possible.
r/p5js • u/Upbeat_Work6930 • 2d ago
As you saw in the title i were looking for a way to convert my code in p5js into C#. Hopefully it’s possible.
r/p5js • u/pretzeldealer • 5d ago
I am somwhat new to p5 and arduino, so please forgive me if this is a stupid question. I am trying to get serial data from my Arduino Uno to a js file I have on vs code, but each time I select the correct COM that my Arduino is connected to, and click 'open' on p5.serialcontol, I get an error that says "Error on COM7: Couldn't open port: undefined - Closing port"
Does anyone know why this is or how I can fix it? I have included screenshots of my p5.serialcontrol, index, js, arduino.ino, and html console log.
r/p5js • u/Muhammad-Essa • 10d ago
I've been inspired by Manim and wanted to create something similar in p5.js.
I've been experimenting with bringing LaTeX equations into p5.js and converting them into SVG paths so I can manipulate and animate mathematical expressions.
In this video, I used fewer points for each character to give the equations a more handwritten appearance. By increasing the number of points, the rendering can become much closer to the original, properly typeset LaTeX form.
I made this short Mahabharata sequence with p5.brush. Each scene is drawn from code, and the motion is also added through code.
Gemini 4 Argon generated the base drawing code. Argon and GPT Sol 6.1 added the animation, then Sol edited the scenes to music from Suno. I worked through the compositions and gave feedback when the story was hard to read.
I wanted to keep the motion small enough that the brush texture and composition could still carry each scene.
I would be interested in feedback on the motion and how the scenes work together. This is part 1.
I shared the process breakdown, intermediate frames and animation examples here:
r/p5js • u/Muhammad-Essa • 13d ago
I built Neural Canvas, an interactive neural network visualization project using p5.js, JavaScript, and Python.
The idea behind this project was to understand neural networks mathematically and visualize how they work. I trained neural networks in Python using NumPy and JAX, then exported their weights and biases as JSON files to perform inference directly in the browser using JavaScript and Math.js.
The frontend is built with p5.js, which handles the interactive drawing board, neuron visualization, connections, and animations. Users can draw digits and see how the neural network processes their input and makes predictions.
So far, I've trained four models. Two MNIST models using NumPy achieved 92% and 96% test accuracy. My Arabic Digits MNIST model using JAX achieved 96%, and my Persian Digits MNIST model also achieved 96% test accuracy.
I started by manually implementing forward propagation, backpropagation, and Gradient Descent using matrix algebra. Later, I explored JAX automatic differentiation and Mini-Batch Gradient Descent with Momentum.
My next goals are to implement RMSProp and Adam, followed by CNNs.
The project combines Python-based neural network training with JavaScript-based interactive visualization. I built it primarily as a learning project to understand neural networks from their mathematical foundations to browser-based inference.
r/p5js • u/Mrityunjay_Bhardwaj • 22d ago
Hi all! After 8 months of building, I finally feel confident enough to share the beta version of Stave. 😅 , and I'd love to know your thoughts on this . 🙏 👋
What is Stave?
Stave keeps your Strudel code as the source of truth and adds the views a producer expects: a Timeline, a step grid and piano roll, a Mixer, and visuals that follow the music.
What you might like:
- A full monaco editor with code completion, error handling etc.
- Your own audio-reactive visuals, inline. Write a p5, Hydra or GLSL sketch, then attach it with .viz("name"). It draws under that line, reacts to the kick, each track and the spectrum, and updates as you type.
// pulse.p5
function draw() { background(0, 40); circle(width/2, height/2, 80 + sig.kick * 300) }
// in strudel:
drums: s("bd*4, hh*8").viz("pulse")- Code and views in sync. Edit on the Timeline, grid or piano roll and Stave writes it back into your code. Edit the code and the views follow.
- Errors you can find. The Console names the file and line, the editor shows a squiggle, and misspellings get "Did you mean…?". That works in your visuals too.
- A Mixer and a song Timeline, with your Strudel code running as it does today. It runs in the browser and is open source (AGPL).
Try it: https://stave.live · Code: https://github.com/MrityunjayBhardwaj/Stave
Please let me know your feedback 🙏 :
- Does your existing code run as you expect?
- What would you want a visual to react to?
- What's missing?
r/p5js • u/ElectroBeast_ • 23d ago
My project has about 50 images so far and every time i try run my code, it comes up with failed to load image over and over. How do i fix this please help
r/p5js • u/rin_codes • 27d ago
Hey everyone!
I’m an indie creative coder, and for a long time I wanted a way to sketch with p5.js whenever inspiration struck on the train, in a café, or lying on the couch without needing to open up a laptop.
That led me to build Edit:RiN, a dedicated native mobile creative coding environment for Android. After months of refinement, I’ve just released v3 (v3.2.1), focusing entirely on making coding on a touchscreen feel natural, fluid, and fun rather than clunky.
Here are the biggest highlights in v3:
- Floating PiP Preview with Auto-Ghosting:
In portrait mode, your running canvas docks smoothly into any corner (S/M/L presets). The cool part: when your cursor lines move underneath the preview, it automatically drops to 25% opacity, and you can tap directly through the canvas to continue editing the code beneath.
- Comment-Driven Bidirectional Live Parameters:
Just write standard inline comments like:
```javascript
let speed = 1.5; // @slider(0.1, 5, 0.1)
let bg = "#1a1a1a"; // @color
```
Edit:RiN automatically generates interactive UI sliders and color pickers. Tweaking the controls updates the running sketch in real time AND updates the actual values in your source code (with clean grouped undo).
- #つぶやきProcessing & Smart Code Golf Mode:
For those of you who love micro-coding and tweet-sized generative art:
- Persistent 140 / 280-character HUD counter.
- Smart code compression tool that safely converts recursive functions to arrows, aliases repeated p5 calls, and strips redundant tokens while protecting strings and regex literals.
- Quick share sheet to post directly to social media.
- Mobile Ergonomics:
- 2-axis numeric velocity scrubbing (drag horizontally to change value, drag vertically to scale step magnitude).
- Dedicated mobile coding accessory bar above the keyboard (`{}`, `[]`, `()`, `;`, `=>`, quick indent).
- Piece Table text buffer & virtualized rendering for smooth scrolling even on complex sketches.
- Interactive 4-step practice sandbox tour to try all tools safely.
- 100% Free & Open-Source (GPLv3)
- Completely Offline-First: Bundled runtimes (p5.js 2.3.4 & 1.11.5). No internet required to sketch.
- Zero Ads, Zero Trackers, Zero Telemetry.
- Official Website: https://rin-code-dev.github.io/Edit-RiN/
- GitHub Releases (APK Download): https://github.com/rin-code-dev/Edit-RiN/releases
- Source Code: https://github.com/rin-code-dev/Edit-RiN
Edit:RiN requires Android 11+. I would love to hear your thoughts, feedback, feature requests, or see what sketches you create with it!
r/p5js • u/alex-codes-art • 29d ago
Been experimenting with contour lines and filling the spaces between them with color. I like how the shapes evolve and create these unexpected patterns.
What do you think? Any ideas for taking this in an interesting direction?
This is a set of 100 scenes made with JavaScript and p5.brush, then edited together with music. The idea was to show humanity to someone who had never seen Earth.
The code was generated with Gemini 4 Argon. ChatGPT helped coordinate the project, and Claude helped with the video edit.
Sharing the result here because the brush texture is a big part of how it looks. I would be interested in feedback on the visuals and how the scenes work together.
Original post: https://x.com/pbshgthm/status/2110725249134436752
r/p5js • u/Accomplished-Team725 • Oct 12 '26
SkyHand is a 3D drone simulator using p5.js + ml5.js hand tracking.
Control the drone directly with hand gestures.
Demo:
https://alzin.github.io/skyhand
GitHub:
r/p5js • u/ColdVolume6314 • Oct 09 '26
r/p5js • u/CodeSessionStudio • Oct 07 '26
Third engine in a small project where both the visuals and the sound for long focus sessions come from code.
Visuals ("circuito"): an abstract circuit board with orthogonal traces, 45° chamfers and two depth layers. Small signals travel along the traces and nodes light up when one arrives.
The sync: the sound engine plays a soft felt-hammer pulse at 72 BPM. At 30 fps that's exactly 25 frames per beat, so each signal steps one cell per beat, with a small push on the attack that eases out before the next one. The 150 s video loop is exactly 180 beats and the 10-min audio loop is 720, so picture and sound never drift. I measured it in the final 3-hour file: 0 frames off at every seam.
Stateless: like the previous engine, nothing is stored between frames. The network and a signal "timetable" are generated once from the seed, and each frame just reads the timetable at its phase.
Two questions:
Does the sync read as "steady" or does it pull your attention?
Has anyone here done audio-visual sync in p5 by sharing a clock instead of analysing the audio?
r/p5js • u/alex-codes-art • Oct 03 '26
Hey, creative people!
Been experimenting with contour lines and ended up with some pretty abstract results.
I like how changing a few parameters can completely change the character of the image. Still exploring this one, curious what you guys think.
r/p5js • u/CodeSessionStudio • Oct 03 '26
A few days ago I posted a domain-warped mist piece here and got some great feedback, so here's the next engine.
Visuals ("fluxo"):
Thin wavy lines drifting left to right, with brighter streaks travelling along them like packets.
Two layers: the back one is denser, dimmer and slower, which gives a bit of depth.
The loop trick: nothing is stored from frame to frame. The streak pattern repeats along each line, and in every 150 s loop each line advances a whole number of repeats, so frame 4500 is exactly frame 0.
Sound ("pulso"): a separate synth engine with a warm pad, a brown-noise bed and a soft felt-hammer pulse at 70 BPM. The 10-min audio loop is exactly 700 beats, so the pulse never skips at the seam.
Follow-up on the "muddy darks" question from last time: I tested 1080p H.264, 1080p with a ±1-level dither, and 1440p HEVC 10-bit. After YouTube's re-encode the 1440p upload won: it got VP9 right away, and it's about 5× smaller.
The first piece felt more "sleep" than "focus" to me, so this one was designed the other way around.
Two questions:
Does this read as "focus" to you, or still too calm?
If you've done stateless looping particles in p5, how did you approach it?
r/p5js • u/CodeSessionStudio • Sep 28 '26
Sharing a project where p5.js does the visuals for long focus/ambient videos.
A domain-warped noise field with two slow speed layers (0.090 / 0.084 noise units per second).
Rendered frame by frame from p5.js and piped to ffmpeg. The bottleneck turned out to be moving about 8 MB per frame from the browser to ffmpeg, which gave roughly 11 fps on render.
A seamless 150 s loop, checked by measuring the seam against neighbouring frames. It came out invisible.
The audio is a separate synth engine, seeded like the visuals.
Two questions for people who've done this:
How do you handle long renders from p5? Headless, or a faster way to get frames out?
Any tricks for keeping domain-warped noise from looking "muddy" on very dark palettes?