# Visuals AND music with Processing?

**URL:** https://discourse.processing.org/t/visuals-and-music-with-processing/3855
**Category:** Teaching
**Created:** [September 26, 2018, 12:10pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855 "2018-09-26T12:10:37Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![CrouchingPython](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/crouchingpython/32/1690_2.png) [@CrouchingPython](https://discourse.processing.org/u/CrouchingPython)
#### Post date: [September 26, 2018, 12:10pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/1 "2018-09-26T12:10:37Z")

</div>

Hi all. First time poster here. I teach MS computer science and am looking for a platform my classes can use to combine visuals and music to make multimedia performances, preferably live code. Since it’s middle school, it has to be not too onerous in terms of syntax, etc. I am already using Sonic Pi for live music coding, and I know that I can output OSC messages from SP into Processing. Just not exactly sure what to do on the Processing end.

I’m hoping some awesome educator has played with this a bit and can help me out. Even links to other stuff is welcome.

TIA!  
Bob Irving  
Porter-Gaud School  
Charleston, SC  
@birv2

---

<div class="post-metadata">

### Author: ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)
#### Post date: [September 26, 2018, 12:31pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/2 "2018-09-26T12:31:14Z")

</div>

Hi CrouchingPython,

You can probably have a look at [praxis live](https://www.praxislive.org/) for live coding performance.

It is made by @neilcsmith here on the forum.

---

<div class="post-metadata">

### Author: ![CrouchingPython](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/crouchingpython/32/1690_2.png) [@CrouchingPython](https://discourse.processing.org/u/CrouchingPython)
#### Post date: [September 26, 2018, 12:47pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/3 "2018-09-26T12:47:42Z")

</div>

Thanks! I’ve dl’ed PraxisLive, am following Neil and Praxis on Twitter and am researching starting points for learning it. Does it connect with Processing?

---

<div class="post-metadata">

### Author: ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)
#### Post date: [September 26, 2018, 1:00pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/4 "2018-09-26T13:00:02Z")

</div>

It is made using processing but I’ll let @neilcsmith tell you more 🙂

---

<div class="post-metadata">

### Author: ![CrouchingPython](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/crouchingpython/32/1690_2.png) [@CrouchingPython](https://discourse.processing.org/u/CrouchingPython)
#### Post date: [September 26, 2018, 3:38pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/5 "2018-09-26T15:38:36Z")

</div>

I’ve played a little bit (had a spare period this morning). It’s really amazing!

Having said that, it may not work for my situation exactly. I’ll keep exploring. I want my students to be able to write code. I’m sure they can handle Sonic Pi and Processing. Not so sure about Java! And using the gui means you don’t have to do text-based coding. Which is not something I’m looking for.

Or maybe I’m missing something?

---

<div class="post-metadata">

### Author: ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)
#### Post date: [September 26, 2018, 7:53pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/6 "2018-09-26T19:53:41Z")

</div>

Well, Processing is Java! 😉 PraxisLIVE is a code editor with nodes, built on top of Apache NetBeans, so you’ve got a much more powerful code editor than PDE and support for live coding. You can mostly ignore the node interface if you want. Connect a `video:gl:p2d` or `video:gl:p3d` node to the video output, right click and edit code, and you’ve effectively got a Processing sketch that updates every time you hit save.

There’s also built in OSC support that you can easily map to any field you expose.

Thanks @jb4x 😄

---

<div class="post-metadata">

### Author: ![CrouchingPython](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/crouchingpython/32/1690_2.png) [@CrouchingPython](https://discourse.processing.org/u/CrouchingPython)
#### Post date: [September 27, 2018, 12:35pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/7 "2018-09-27T12:35:27Z")

</div>

Yep, I know that Processing is Java, but maybe kinda Java Lite? Not too OO-crazy, which is where most middle schoolers would drop out… They can handle Processing.

What you say about hooking up Processing is what intrigues me, but we’ll chat more after your holiday. Thanks again!

---

<div class="post-metadata">

### Author: ![lqdev](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lqdev/32/29_2.png) [@lqdev](https://discourse.processing.org/u/lqdev)
#### Post date: [September 27, 2018, 12:45pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/8 "2018-09-27T12:45:47Z")

</div>

AFAIK there’s a REPL mode for Processing, but it’s Java-only, so that can be sufficient for live coding. As for something not too OOP-heavy, processing by itself isn’t like that! All of Java’s OOP elements are handled by the internal parser, but if you really want something easier, check out Python mode.

---

<div class="post-metadata">

### Author: ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)
#### Post date: [September 27, 2018, 12:45pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/9 "2018-09-27T12:45:48Z")

</div>

> [@CrouchingPython](#):
>
> Not too OO-crazy

It is up to you to use OOP concept or not. We have a saying in french: “Qui peut le plus, peut le moins” roughly meaning “He who can do the most can do the least”. And this way, student who feel comfy with progrmming will be able to play around with OOP concept and the other one won’t 🙂

---

<div class="post-metadata">

### Author: ![CrouchingPython](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/crouchingpython/32/1690_2.png) [@CrouchingPython](https://discourse.processing.org/u/CrouchingPython)
#### Post date: [September 27, 2018, 3:39pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/10 "2018-09-27T15:39:04Z")

</div>

I’ve never tried Python mode, but I’m definitely interested. Is that a library that I import?

---

<div class="post-metadata">

### Author: ![lqdev](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lqdev/32/29_2.png) [@lqdev](https://discourse.processing.org/u/lqdev)
#### Post date: [September 27, 2018, 5:50pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/11 "2018-09-27T17:50:38Z")

</div>

It’s not a library, it’s a mode. You can download modes by clicking on the mode selector (dropdown bow in the upper right corner) and “Install modes”. Here you can install Python mode as well as many others.

---

<div class="post-metadata">

### Author: ![CrouchingPython](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/crouchingpython/32/1690_2.png) [@CrouchingPython](https://discourse.processing.org/u/CrouchingPython)
#### Post date: [September 27, 2018, 6:14pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/12 "2018-09-27T18:14:00Z")

</div>

Looks pretty amazing. I’m a huge Python fan. However, I’m not seeing any audio stuff. Can it take MIDI or OSC and do something visually with that data?

---

<div class="post-metadata">

### Author: ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)
#### Post date: [September 27, 2018, 7:11pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/13 "2018-09-27T19:11:33Z")

</div>

> [@lqdev](#):
>
> AFAIK there’s a REPL mode for Processing

The [PraxisCORE](https://www.praxislive.org/core/) runtime is in some ways simpler, but a lot more powerful, than hacks like the REPL mode or anything using HotSwap. It’s also a runtime bringing elements of Smalltalk and Erlang to Java. Nothing wrong with real OOP, as opposed to the typical C++ / Java version! 😉 It’s sometimes said that the most OOP language on the JVM is Clojure. Which does bring to mind Quil for an alternative approach to live coding Processing.

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [September 28, 2018, 11:46pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/14 "2018-09-28T23:46:08Z")

</div>

Processing.py is extremely cool – and one of the cool things about it is that, in addition to importing pure Python libraries, many of the Processing(Java) libraries can simply be imported and used. This is because it uses Jython and runs on JVM. So you could just import the OSC library and see how it works. Or, for audio, import minim – there are examples of working with sound in the Processing.py example set that installs into PDE when you install the mode.

> <https://github.com/jdf/processing.py/blob/master/examples.py/Library/Minim%20(Sound)/LoadSample.py#L37-L44>

One downside is that it is Python 2.7 – so your students wouldn’t be learning Python 3. Another is that, due to running on JVM in emulation, only _pure_ Python libraries will work – anything relying on CPython won’t.

> **[jdf/processing.py](https://github.com/jdf/processing.py/wiki)**
>
> Write Processing sketches in Python. Contribute to jdf/processing.py development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![CrouchingPython](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/crouchingpython/32/1690_2.png) [@CrouchingPython](https://discourse.processing.org/u/CrouchingPython)
#### Post date: [October 4, 2018, 6:03pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/15 "2018-10-04T18:03:46Z")

</div>

Super cool stuff here!

I’m using Sonic Pi and doing live coding with that. It can output OSC messages. So what I’m trying to do it capture those messages in Processing and generate visuals. I’m happy to start super simple and have ANYTHING appear in response to beat, volume, pitch, etc. Once I get that down, I can start to build on it.

So rather than grab an mp3, I’m trying to get live messages. Can anyone point me in the right direction for this? TIA!!

Bob

---

<div class="post-metadata">

### Author: ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)
#### Post date: [October 4, 2018, 7:31pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/16 "2018-10-04T19:31:06Z")

</div>

@CrouchingPython I can certainly tell you how to connect OSC messages to a Processing node inside PraxisLIVE if that’s the way you want to do it?

What’s the format of the OSC messages from Sonic Pi, or is that up to you?

---

<div class="post-metadata">

### Author: ![CrouchingPython](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/crouchingpython/32/1690_2.png) [@CrouchingPython](https://discourse.processing.org/u/CrouchingPython)
#### Post date: [October 4, 2018, 7:48pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/17 "2018-10-04T19:48:35Z")

</div>

I’d love to do it in straight Processing, if I could. AFAIK, SonicPi sends messages in “regular” OSC, but maybe I shouldn’t talk about what I really don’t know for sure. Noob alert. Thanks!

---

<div class="post-metadata">

### Author: ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)
#### Post date: [October 4, 2018, 8:02pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/18 "2018-10-04T20:02:03Z")

</div>

Up to you. But PraxisLIVE makes this easy because it’s basically supported out of the box - annotate and map any field you want to control.

OSC messages have an address, like a url or path. Can Sonic Pi send any address, or does it send predefined ones?

---

<div class="post-metadata">

### Author: ![CrouchingPython](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/crouchingpython/32/1690_2.png) [@CrouchingPython](https://discourse.processing.org/u/CrouchingPython)
#### Post date: [October 4, 2018, 8:07pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/19 "2018-10-04T20:07:56Z")

</div>

Thanks again for the response. I do want to use Processing (or something like it) because my purpose is teaching students to code. PraxisLive is amazing, but it doesn’t have the code aspect that I need for middle school students. Processing (yes, I know it’s Java) is still way more accessible than straight Java for the great majority of 13-year-olds.

As for how Sonic Pi sends OSC messages, here’s a link to the docs: [https://github.com/samaaron/sonic-pi/blob/master/etc/doc/tutorial/12.2-Sending-OSC.md](https://github.com/samaaron/sonic-pi/blob/master/etc/doc/tutorial/12.2-Sending-OSC.md)

Hope that helps!  
Bob

---

<div class="post-metadata">

### Author: ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)
#### Post date: [October 4, 2018, 8:21pm UTC](https://discourse.processing.org/t/visuals-and-music-with-processing/3855/20 "2018-10-04T20:21:45Z")

</div>

> [@CrouchingPython](#):
>
> but it doesn’t have the code aspect that I need for middle school students

er, yes it does! It’s still primarily a code-based IDE. I’m currently teaching a course on creative coding with Processing using it.

I’ll have a look through those docs, and see if I can tell, or if not I’ll ask the developer.

[Next page](https://discourse.processing.org/t/visuals-and-music-with-processing/3855.md?page=2)
