Is it practical in Sonic Pi to add graphical widgets to control variables I might want to use in live performances?
I don’t think this would be practical in Sonic Pi itself, but you can interact using OSC calls between sonic-pi and TouchOSC and I have used this combination many times when using Sonic Pi. You can have touch buttons or sliders used to control variables in a sonic -pi program using this mechanism. The TouchOSC interface can run on a separate tablet or phone iOS or Android, or on the same desktop running Sonic Pi whether Windows, Mac or Linux.
This is very helpful! Based on your suggestion, I found the thread “extensive osc tutorial”. It sounds like you have done some interesting things with Sonic Pi and OSC. Do you have any full working OSC-based toys you can share? Maybe something that has lots of sliders and dials like a Rebirth RB-338, lol.
Are the Sonic Pi features also available as a library that can be incorporated into other Ruby and/or Python programs? I understand that Sonic Pi is open source, but I was wondering if this was (or will be) an intended use-model. (I do see that the source leverages some nice libraries that could be leveraged directly.)
I do not really have a plan yet of anything specific I’m trying to do. I just enjoy coding and wanted to learn something fun like Sonic Pi.
Maybe a fun first project might be taking the progression chart here:
and creating a click interface that would produce rings of some sort.
Maybe later, I could build an OSC interface that passes real-time chord progressions and voicings to live loops that can then use them in interesting ways. (No great thoughts yet on what would constitute interesting, lol.)
I have several projects using TouchOSC This one allows you to select a range of live loops and start and stop them at will There are references back to In Thread and a video of it in operation. I have just updated it to run on Sonic Pi 3.31 and 4 or later.
The second one is a midi file player allowing you to choose and different Sonic Pi synths
The third one is a sequencer which lets you record and playback.
A fourth is a Record/Player with its own note input interface together with synth selection.
However the published software for this needs updating for latest Sonic Pi versions. I have done the upgrade but haven’t had time to update it online yet. The video of the project is here
Fully agreed that graphical widgets will be very useful. It’s part of what I’m working on with the new Elixir based stuff. I’m hoping to have some very early experimental examples that people can play with in the next month or so which I’ll release as a Patreon-only beta.
Nice projects. I also watched your video on the recorder and very much enjoyed it. Perhaps I’ll give it a go on Windows as you requested at the end of the video. I like the Ableton-inspired key layout, which gives me an idea of maybe using the same matrix-type layout to facilitate other types of transitions. Maybe as a first step I will try adding the other modes to the selector for major/minor.
Interesting. Will it be implemented on top of Qt Widgets? Or does Elixir already have a viable widget library of some sort that can be leveraged? Is Elixir going to replace Ruby as the basis of the Sonic Pi language?
It will be via Phoenix Live View which will be rendered within a webview Qt widget - but also optionally available to any other machine/iPad/phone on the local network via a standard web browser.
Elixir is going to replace Ruby as the underlying foundation of the system and I’m likely to implement a similar DSL on top of the new foundation that looks and behaves similar to the existing language. I’ll take it slowly though to make sure things are rock solid as I transition.
I gave it a go, and got the Player/Recorder to work in Windows.
To get it to work, I changed the sync lines from:
b= sync "/osc/sprp/multipush1/*/*"
b= sync "/osc:127.0.0.1:9000/sprp/multipush1/*/*"
Yup that is the main change required in all my early OSC projects. I usually change lines of the form
b = sync"/osc/sprp/multiplsu1/*/*"
b = sync"/osc*/sprp/multiplsu1/*/*"
That way you don’t have to worry about ipaddress or port which are contained in the newer form received osc cues in Sonic Pi, as the * wild card will match any IP address/port combination.
The change occurred around Feb 2020 see this post I did. I have updated many of my published programs but not all yet.