Processing vs p5.js

I asked Mr Bomb about this, but can someone weigh in on which is better for interfacing with Sonic Pi. I’m especially interesting in creating generative art with processing/p5.js based on midi/osc received from SP.

Extra caveat – I’m planning on teaching this in 8th grade classes, so what might work for us as adults may not work for students.

Bob Irving
Charleson, SC

I’m not an expert on either if these, but I have tried both of them with some success.
My impression is that processing is easier to set up and get going with SP.
p5.js was trickier to get going but did give good results. I think because of the trickier setup that processing would be a better place to start with your students.

two links to my experiments below

1 Like

Just to weigh in publicly and speak more specifically to your caveat:

Since Processing is a standalone program, I assume it doesn’t require additional libraries beyond an OSC library to get SPi communicating with it. p5.js is meant to work within a browser, so you need to install node.js, do some command line stuff to set it all up and run it in the browser. (point - Processing)

With that said, you would need to install Processing on every computer you intend to use it on, whereas p5.js has a web editor ( that is easily accessible with an internet connection. This would also allow students to access their work outside of the classroom if they wanted as well as share projects that they have made by simply sending a link to someone… (point - p5.js)

I think the choice really depends on your classroom setup, the amount of time you have and how receptive your students are to the initial setup process prior to actual creating something.

1 Like

Thanks for weighing in. I’m also looking at my familiarity with the language(s) as an important consideration. I’ve spent some time in the last week doing some tutorials in both Processing and p5.js and the former makes more sense to me at this point.

That translates into me being able to help the students more, which is kinda the point! I’m sure that I can learn p5.js and so perhaps that’s something to integrate further down the road.

My setup in my classroom is pretty flexible. 22 Win10 machines and 22 Raspberry Pi’s. I can install whatever I need on either platform, so the web-basedness of p5.js isn’t a plus for me.

Thanks to you and Robin for weighing in and all the thoughtful advice!

1 Like

Do let us know how it goes! :slight_smile:

1 Like

Will do!

Right now I’m developing my skills in both tracks: visuals(Processing) and music(SonicPi). My ultimate goal is to integrate the two and have the music generate visuals live. From there… well, I just snagged a Kinect camera and I hope to someday have the code(s) respond to visual input. Very ambitious (probably too ambitious!), but I love the challenge and feel that this whole art/music/code thing is where I feel most comfortable. Thanks to Sam for his inspiration!

An update:

As the OP on this, I’m reporting back to say that this year I’ve transitioned over to p5js. The browser-basedness, accessible-anywhere features won out. Perhaps the biggest cool feature, especially for middle schoolers, is the auto-refresh. They can see the results of their changes immediately, and that’s a huge win.

So I’m learning the differences between Processing and p5 as I go.

Next in line is to keep working on the OSC/Sonic Pi connection. I don’t mind installing node.js if that’s what it takes. Will report back!

1 Like

Hi Bob! Let me know if I can help with p5.js. I have loads of experience with it, and have made a ton of videos.

I’ll follow your progress on the OSC connection. I would naively serve the p5.js script from a Python Django application and use a Python OSC package. I look forward to learning an easier way.

Others may be interested in the Processing (with Kotlin)->OSC->Sonic Pi project I made recently.

1 Like

Thanks for the suggestions! I’m looking forward to digging into those resources, and good on you for doing them. I will definitely be picking your brain as I stumble along!