New version of Sonic PI 3 visualiser

I received a request on the youtube video to produce a visualiser that could be used side by side with Sonic Pi, rather than occupying the whole screen and using Sonic Pi in transparent mode. I have now altered the original processing file so that it works in a resizable window, so you can set it any size you wish, and even drag it to a second monitor if you wish. There is an article with code links here

9 Likes

One day something like this will be supported in the Sonic Pi app itself :slight_smile:

2 Likes

Iā€™ve been trying to get it to work on a Pi. Difficult to get loopback to work to feed in the audio. Found various articles on the subject, using alsa loopback, but not got it working yet.

Interesting - although personally just sending data to a visualiser via OSC has always been sufficient for me. What are you doing with the audio in processing? Anything fancy?

The audio is fed to a fast fourier transform using the processing minim library which produces a frequency component distributed amplitude to control the size of the shapes drawn. I also have osc messages control further aspects, rotation, shifting, shape selection etc.

1 Like

Iā€™m pretty sure we can do this all in Sonic Pi + OSC out. What kind of update frequency do you need? If itā€™s not much more than 10 times a second then it wonā€™t be a problemā€¦

Yes I think it probably can all be done in OSC. I used an existing audio driven processing patch as a basis to produce the shapes and modified this considerably. I might take a look at OSC only sometime, but got my eldest Son and Grandchild arriving from Switzerland to stay tomorrow, so not soon.

1 Like

Hi, I just found this thread after seeing the awesome VJ vid

image

Is this builtin visualizer available publicly ? on windows?

That option appears to be missing in v4 on windows 10 home laptopā€¦ wondering if thereā€™s a beta or a dev branch, or if thereā€™s much to getting this setupā€¦ or if setting up hydra to talk to (1+) clients is quite like OSC

AWESOME!
:pray:

The screenshot you show is produced by Olivia Jackā€™s Hydra which is built into the phoenix extension in the Sonic Pi code tree. It was in a version 5 Tech which is available to patreon supporters of Sam Aaron and is still available through that route. It is also in the current latest version of Source Code for Sonic Pi if you want to build it yourself (I built it yesterday on Debian 12 for example). However it was removed from the 4.4 release tag as the additional phoenix of which this is a sample use has further development and integration to be done before being made available mainstream in Sonic Pi.
You can of course use hydra in a web browser hydra.ojack.xyz already with SP 4.4 and indeed with that it is possible to control it with both midi and OSC with certain supporting bits of code which you canā€™t yet do on the Tech 5 version of SP.

Thanks so much Robin!

I was thinking about contributing via patreon (and other ways:) and also reading the build instructions as very interested in gleaning as much info as possible (and also overly ambitious with Endless ideas of feature requests)

Iā€™ll have a look at these, and contact if I get stumped

Out of curiosity, is it easy/simple to configure sonic pi to talk to hydra and visualise in a browser?

Not just what the requirements are, if you need to install libraries or applications, or if thereā€™s some good info for noobs interested in ā€˜visually mapping soundā€™ and other events/dataā€¦ You mention itā€™s already installed, is this a ruby library in sonic pi?

Thread links etc welcome!

There are quite a few published examples using hydra on in-thread. Search for hydra @robin.newman for example see here
At present controlling hydra from Sonic Pi is done in different ways depending upon whether you are using the built in tech 5 version, or an external hydra running on website hydra.ojack.xyz
For the former you canā€™t (yet ) interact with either midi or osc as they required bits arenā€™t built in.
You can however run a hydra sketch which you do with
hydra ā€œcode for hydra sketch in a stringā€ inside a loop, so that the sketch can be synced to rerun every time the loop starts. You can include variables in the hydra string which can be changed externally.

For the external browser version you can talk to the sketch using midi using a library which can be loaded in the sketch. see this example

To use OSC with it is a bit more involved. You need to need to get hydra-osc from github, download and compile it and also install npm so it is a bit trickier to get going. I would advise using midi initially which is much easier.

There are some quite good tutorials/help accessible from the https://hydra.ojack.xyz screen.

One possible point of confusion. The inbuilt version in Tech 5 can create an external browser display. However, this is generated from Tech 5 and is NOT the same as the version running in hydra.ojack.xyz so you cant add the midi or osc additions.