Manjaro, Sonic Pi, Open-Stage-Controller and OSC settings

Hello everyone! I am trying to get my settings correct, and I hope this is an easy one. But I’m currently baffled after quite a lot of googling and testing.

I’ve created a very very simple test.

My system:
uname -a : Linux 5.6.14-2-rt7-MANJARO #1 SMP PREEMPT_RT Wed May 27 15:48:47 UTC 2020 x86_64 GNU/Linux

Audio: jack (working in Reaper and other tools, and SP)
Open Stage Control: v1.0.0-beta5
SonicPi: v3.2.2

I’ve created two videos that should help explain the problem and why I’m currently baffled by it.

For all intents and purposes, Open Sound Control is set up to communicate properly.

This video shows proper OSC communication:

This video shows, straight from tutorial code basically, that it’s not working :frowning:

Many thanks in advance to anyone who can help!

Hi there,

if you’ve built Sonic Pi yourself, there’s a chance that the OSC infrastructure isn’t working. This requires the presence of Erlang and our Erlang router to be compiled and available.

A simple way of testing that this is all in place is to simply run the following code:

use_osc "localhost", 4560
osc "/foo"

If you see an incoming /foo message in the Cues log, then everything is looking fine from Sonic Pi’s perspective and it’s possibly something wrong with the system sending OSC to Sonic Pi.

If it’s not, then there’s one more thing to check and that’s the port that Sonic Pi is listening on. By default it’s 4560 but if that’s not available on your system for some reason, Sonic Pi will attempt to find an available port.

You can see which port Sonic Pi is listening on in the IO tab of the preferences. If that says 4560, and you didn’t get your loopback /foo OSC message - chances are your Erlang router isn’t working correctly. If it says something other than 4560, try sending to that other port to see if it works.

Finally, if things aren’t working, you can always take a look at the logfile for the Erlang router to see what’s happening. It’s found in ~/.sonic-pi/log/erlang.log. Feel free to post the contents in here so we can take a look for you :slight_smile:

Hi Keith
I’d never tried open stage, but it is a package that I’ve been meaning to take a look at for some time now, so your post spurred me on to have ago. Took a bit of time to work out how to get it going, but I have managed to get it communicating with my Sonic Pi running on a Raspberry Pi. I think one problem may be that if you use Protokol and set it to use port 4560 and subsequently open Sonic Pi it doesn’t use that port to listen on. If you have a look at the IO prefs you may find it has switched to a different port. If you quit them both and then start Sonic Pi it should go back to port 4560. the settings on your open stage are the same as mine. Attached is the .json file of the example I set up. You might like to try that if yours doesn’t work.

{
  "type": "root",
  "id": "root",
  "linkId": "",
  "color": "auto",
  "css": "",
  "default": "",
  "value": "",
  "precision": 2,
  "address": "/root",
  "preArgs": "",
  "target": "",
  "bypass": false,
  "traversing": false,
  "variables": {},
  "tabs": [
    {
      "type": "tab",
      "id": "tab_1",
      "linkId": "",
      "label": "auto",
      "color": "auto",
      "css": "",
      "detached": true,
      "default": "",
      "value": "",
      "precision": 2,
      "address": "/tab_1",
      "preArgs": "",
      "target": "",
      "bypass": false,
      "variables": "@{parent.variables}",
      "widgets": [
        {
          "type": "push",
          "top": 150,
          "left": 440,
          "id": "play",
          "linkId": "",
          "width": "auto",
          "height": "auto",
          "label": "auto",
          "color": "auto",
          "css": "",
          "doubleTap": false,
          "on": 1,
          "off": 0,
          "norelease": false,
          "value": "",
          "precision": 2,
          "address": "/play",
          "preArgs": "",
          "target": "",
          "bypass": false
        }
      ],
      "tabs": [],
      "scroll": true
    }
  ],
  "scroll": true,
  "label": false
}

As Sam suggested, check your osc is working on Sonic Pi using the example he gives. Best of luck!

Whelp. You nailed it @samaaron!

sh: line 0: exec: erl: not found

a quick sudo pacman -S erlang and we’re off to the races.

Thank you!!!

1 Like

Hi,

The real name is Open-Stage-Control :slight_smile: O-S-C

this is a little example to trigger the play of a scale. Parameters comes from O-S-C.

# Sonic Pi meets Open-Stage-Control
# By nlb - 20-06-2020
# sonic pi version : 3.2.2
# open-stage-control : 1 beta 7 (https://openstagecontrol.ammd.net/download/ Bravo To Jean-Emmanuel)
# external midi virtual instrument : UVI Workstation
# loopMIDI https://www.tobias-erichsen.de/software/loopmidi.html
# OS : Windows 10

use_bpm 60


live_loop :scaleTriggeredViaOpenStageControl do
  
 #  use_real_time 
  data = sync "/osc:127.0.0.1:7777/scale" # note no / at the end
  
  ##| puts data[0] root note passed via open-stage-control
  ##| puts data[1] scale name
  ##| play data[2] number of octaves
  ##| data[3]==1 # button pushed
  
  
  
  if (data[3]==1) then  # button pushed
    tick_reset_all
    riff = scale data[0], data[1], num_octaves: data[2]
    puts riff
    riff.length.times do
      midi riff.tick('n'), port: 'loopmidi01', channel:1
      sleep 1
    end
  end
end

# to check if the external virtual midi device is playing notes received from sonic pi
live_loop :bass, auto_cue: false do
  stop
  midi [60, 72].tick-12, channel: 1, port: 'loopmidi01'
  sleep 1
end

and the json file to load into O-S-C

{
  "session": {
    "type": "root",
    "id": "root",
    "interaction": true,
    "colorBg": "auto",
    "colorText": "auto",
    "colorWidget": "auto",
    "alphaFillOn": "auto",
    "padding": "auto",
    "css": "",
    "variables": "@{parent.variables}",
    "traversing": false,
    "layout": "default",
    "justify": "start",
    "gridTemplate": "",
    "scroll": true,
    "innerPadding": true,
    "verticalTabs": false,
    "value": "",
    "default": "",
    "linkId": "",
    "script": "",
    "address": "/msg",
    "preArgs": [
      5,
      3
    ],
    "typeTags": "",
    "decimals": 2,
    "target": "",
    "ignoreDefaults": false,
    "bypass": false,
    "widgets": [
      {
        "type": "button",
        "top": 280,
        "left": 30,
        "id": "button_2",
        "visible": true,
        "interaction": true,
        "width": 170,
        "height": 70,
        "expand": "false",
        "colorBg": "auto",
        "colorText": "auto",
        "colorWidget": "auto",
        "colorStroke": "auto",
        "colorFill": "auto",
        "alphaStroke": "auto",
        "alphaFillOff": "auto",
        "alphaFillOn": "auto",
        "padding": "auto",
        "css": "",
        "label": "c3 major 2 octaves",
        "on": 1,
        "off": 0,
        "mode": "push",
        "doubleTap": false,
        "colorTextOn": "auto",
        "value": "",
        "default": "",
        "linkId": "",
        "script": "",
        "address": "/scale",
        "preArgs": [
          "c3",
          "major",
          2
        ],
        "typeTags": "ssii",
        "decimals": 0,
        "target": [
          "127.0.0.1:4560",
          "127.0.0.1:8888"
        ],
        "ignoreDefaults": false,
        "bypass": false
      },
      {
        "type": "button",
        "top": 380,
        "left": 30,
        "id": "button_3",
        "visible": true,
        "interaction": true,
        "width": 170,
        "height": 60,
        "expand": "false",
        "colorBg": "auto",
        "colorText": "auto",
        "colorWidget": "auto",
        "colorStroke": "auto",
        "colorFill": "auto",
        "alphaStroke": "auto",
        "alphaFillOff": "auto",
        "alphaFillOn": "auto",
        "padding": "auto",
        "css": "",
        "label": "c2 minor 4 octaves",
        "on": 1,
        "off": 0,
        "mode": "push",
        "doubleTap": false,
        "colorTextOn": "auto",
        "value": "",
        "default": "",
        "linkId": "",
        "script": "",
        "address": "/scale",
        "preArgs": [
          "c2",
          "minor",
          4
        ],
        "typeTags": "ssii",
        "decimals": 0,
        "target": [
          "127.0.0.1:4560",
          "127.0.0.1:8888"
        ],
        "ignoreDefaults": false,
        "bypass": false
      }
    ],
    "tabs": []
  },
  "version": "1.0.0-beta7",
  "type": "Open Stage Control session"
}

Hope it helps to catch some syntax tips to begin with O-S-C