State widget not saving complete state

Hi, I am a new user, very happy to have discovered this software and am switching from Lemur. My primary use-case is to run o-s-c as a headless node app on a Raspberry Pi, where I am also running Csound, and this is working quite well. I’m using o-s-c to control parameters of a Csound app in real time.

I have started using the state widget and have a possible issue to report, but more likely I’m doing something wrong, having only used o-s-c for a few days. My Csound app has a concept of presets, where each preset is a collection of values for all settings. I specify a preset on the Csound command line, so when the apps starts up it uses the settings in the specified preset.

I want the o-s-c session to reflect these settings, so I send a bundle of OSC messages to o-s-c, one for each widget, and then I send a “save” message to a state widget. This way, I can change parameters during performance, but if I want to revert to the original settings, I can just click the Load button of the widget.

This is working very well – except for one fader, which happens to be the first addressable widget in the panel. When I click Load, all of the other widgets are reset to their saved values, but this particular fader always gets set to 0. Even if I manually set the fader value and click Save manually, it still resets to 0 when I click Load. I can’t see any difference between this fader’s configuration and the other faders in the panel, and it had a default value of 1.

Is this possibly a bug? More likely, it’s me, but I can’t figure out what’s wrong. Here’s what the fader looks like in JSON:

{
          "type": "fader",
          "top": 10,
          "left": 30,
          "id": "main",
          "linkId": "",
          "width": 60,
          "height": 390,
          "label": "MAIN",
          "color": "auto",
          "css": "",
          "horizontal": false,
          "alignRight": false,
          "pips": false,
          "input": true,
          "meter": false,
          "compact": true,
          "dashed": false,
          "snap": false,
          "spring": false,
          "doubleTap": false,
          "range": {
            "min": 0,
            "max": 1
          },
          "logScale": false,
          "sensitivity": 1,
          "steps": "",
          "unit": "",
          "origin": "auto",
          "default": 1,
          "value": "",
          "precision": 2,
          "address": "/implication_organ/master/main",
          "preArgs": "",
          "target": "",
          "bypass": false,
          "touchAddress": "",
          "meterAddress": ""
        }

By comparison, here’s the fader right next to it, which is properly restored by the state widget:

{
          "type": "fader",
          "top": 10,
          "left": 100,
          "id": "gen",
          "linkId": "",
          "width": 60,
          "height": 390,
          "label": "GEN",
          "color": "auto",
          "css": "",
          "horizontal": false,
          "alignRight": false,
          "pips": false,
          "input": true,
          "meter": false,
          "compact": true,
          "dashed": false,
          "snap": false,
          "spring": false,
          "doubleTap": false,
          "range": {
            "min": 0,
            "max": 1
          },
          "logScale": false,
          "sensitivity": 1,
          "steps": "",
          "unit": "",
          "origin": "auto",
          "default": 1,
          "value": "",
          "precision": 2,
          "address": "/implication_organ/master/generated",
          "preArgs": "",
          "target": "",
          "bypass": false,
          "touchAddress": "",
          "meterAddress": ""
        }

These two faders differ only in position, id, label, and address, and are otherwise identical, yet they behave differently with the state widget.

I would appreciate any help in figuring this out. Let me know if more info is needed.

Thanks!

The entire JSON for the o-s-c project can be seen here: https://github.com/DaveSeidel/music-src/blob/binaural/implication-organ/open-stage-control/implication_organ.json

Hi ! The problem is that you have two widgets with the same id (“main”) : the fader and the tab labeled “Implication Organ”. Since states are stored as id:value pairs, the two widgets are conflicting there.

1 Like

Merci, jean-emmamuel! That was the issue, of course. Thanks very much! I’m really enjoying learning and using this system, and I appreciate your work and your quick response.

A thought, maybe eventually the editor could indicate when the user has a duplicate id (for example, with an asterisk or a “link” glyph next to the edit field). I understand that it’s not necessarily an error, because of linking, but could be a helpful hint to the user either way. I’m guessing your framework likely has a good way to detect this condition at edit time. Sort of a linting-type feature.

I thought about that too after I replied, it could be nice indeed.

1 Like