Made this OSC Visualizer in Unity

Hi guys,
just made this OSC visualizer in Unity, you can send OSC signals from SonicPi and it reacts in real time.

Right now it supports 2 OSC signals:
“/mainbeat/” : it makes the camera jump in a new position
“/t/” n,c : push one of the hexagons (the one specified with “n”), with “c” as color type (0,1,2 = white,red,purple)

Basically, you just open the app and send these commands via sonicPi (example)

use_osc “localhost”, 9000
osc “/t/”,3,1

if anyone wants to try it I can post the link (only for Mac at the moment)

3 Likes

I’d be interested in the link for this and taking a look at it on my Mac.

I second. Looks very impressive!

Ok, [https://www.dropbox.com/s/8cl82au6qnnxivr/hexagons.zip?dl=1](http://here it is)

Works on my iMac but haven’t tested on any other computers so let me know if it works :slight_smile:

First add this to send osc command on the port 9000:

use_osc “localhost”, 9000

then, to make the camera jump use

osc “/mainbeat”

to make the hexagons move

osc “/t/”, id, color

id = progressive id of the hexagon to move (starting from the center with 0)
color = color of the hexagon: 0 = white, 1=red, 2=purple

Thanks for the link. I downloaded it and gave it a whirl. Works nicely on my MBP although it is VERY resource hungry so I needed to keep away from the highest resolution and quality settings.

The only “gotcha” I had was that initially I didn’t notice the “/t” osc call was in fact to
“/t/” which seemed a bit strange, rather than just using “/t” Perhaps there was a reason at the Unity end why this was more appropriate.

I also had to play a bit to get reasonable sync between the sound and the visuals. I put a negative warp on the osc calls of about 0.4 and this worked.
Here is a test program that I used.

#Unity Visualizer test by Robin Newman, Aug 2019


use_osc "localhost", 9000
use_debug false
use_osc_logging false
use_synth :tb303
h=range(0,37) #list of hexagon numbers
h=h+h.reverse+h.shuffle #pointer to next hexagon for three ranges
live_loop :pattern do
  if tick%12==0 #give a mainbeat every 20 hexagons
    time_warp -0.4 do #send osc before sound to sync timings
      osc "/mainbeat"
    end
    sample :bd_haus,amp: 4
  end
  tick_set :col,look/37 #tikc(:col) will select colour
  time_warp -0.4 do #send osc before sound to sync timings
    n=h.look #select nect hexagon
    c=[0,1,2].look(:col) #select colour
    osc "/t/",n,c #bump next hexagon
  end
  #play tb403 note
  play scale(:e2,:minor_pentatonic,num_octaves: 3).choose,release: 0.2,cutoff: rrand(80,110)
  sleep 0.2
end

Great to hear that :slight_smile: .
Performance wise is running pretty well on my iMac with no need of time warping the osc calls. It’s probably all the post processing effects that are quite intensive though… didn’t really think about optimizations but if I have time I’ll add a key to disable or reduce them.

The “/t/“… it’s a typo :slight_smile: I can setup Unity to recognize any kind of signals.

This is another one I made today, this time I used two vector3 to apply deformations to spheres https://youtu.be/V9G07jHMnnE

second example is very nice. Are you building with the free version of Unity or do you have a paid for version?

It’s a rare day when I wish for a Mac. Today is one such day. Great work, loved it.