Page 1 of 1

Is there a NSM Load Session From Command Prompt

Posted: Mon Dec 03, 2018 3:55 am
by lasakro
Running non-session-manager --h returns:

Code: Select all

Usage: non-session-manager [--nsm-url...] [-- server options ]
The manual states the purpose is to only specify a different path from the default. Has anyone found a way to load a session as NSM starts? I've tried many combinations with no luck.

Re: Is there a NSM Load Session From Command Prompt

Posted: Mon Dec 03, 2018 4:33 pm
by nils
I wrote you a starter script in bash. No extra dependencies.
Just type nsmopen.sh project-name . You can rename the sh file of course.

Code: Select all

#!/bin/sh
#Invoke with  nsmopen.sh projectname
PROJECT=$1  #for better readability

eval $(nsmd --detach) #command returns a line to set the NSM_URL which we use to actually set it.

{
  #keep in brackets so that PID and nsm are in the same group. otherwise wait below will complain
  non-session-manager --nsm-url $NSM_URL  &
  PID=$! #Remember to check when the GUI closes	
}
sleep 1 #leave NSM time to start up. Otherwise you will see some glitched session display

#oscsend is part of liblo, which nsm depends on. So no extra program to install
oscsend $NSM_URL "/nsm/server/open" s $PROJECT
wait $PID
echo "GUI closed. Closing detached nsdm server"
oscsend $NSM_URL "/nsm/server/quit"

Re: Is there a NSM Load Session From Command Prompt

Posted: Mon Dec 03, 2018 11:41 pm
by lasakro
I didn't think it would be that complex but thank you very much. Will give it a try, take it apart and probably will learn something.

Re: Is there a NSM Load Session From Command Prompt

Posted: Tue Dec 04, 2018 4:49 pm
by nils
I didn't think it would be that complex but thank you very much.
It really is a workaround. One could write a patch to non-session-manager to load a session after start. But this took me already over an hour, in an environment I am familiar with. So let's leave it for now.. :)

Re: Is there a NSM Load Session From Command Prompt

Posted: Tue Dec 04, 2018 10:47 pm
by nils
Just in case:
The code above needs to be put into a file, e.g. nsmstart.sh with a text editor of your choice.

Then mark the script as executable with your file manager or via the command line:

Code: Select all

chmod +x nsmstart.sh
Finally put the file into your users PATH. /home/user/bin if you have that configured or systemwide with

Code: Select all

sudo cp nsmstart.sh /usr/bin/nsmstart.sh

Re: Is there a NSM Load Session From Command Prompt

Posted: Wed Dec 05, 2018 2:25 am
by lasakro
nilshi wrote:I wrote you a starter script in bash.
My test session is labeled session and consists of 3 clients: Carla, JACKPatch and Non-Mixer. Within Carla I have a mixture of addon's. After installing liblo-tools I run your script with the following results:

Code: Select all

bob@UbuntuStudioSSD:~/.local/share/scripts$ ./nsmopen.sh session
[nsmd] Session root is: /home/bob/NSM Sessions
[nsmd] Detaching from console
X_ChangeProperty: BadValue (integer parameter out of range for operation) 0x0
NSM starts then only Carla with an empty rack and empty patch panel. No other clients. I've increased and decreased the sleep with poor results. I even corrupted the non-mixer at one point where it wouldn't stay running. Reinstall fixed that. Maybe this weekend I'll have time to start reading up on the liblo-tools. One thing for sure is that the ladish_control pload Room command for Claudia is much simpler but from what I see with non-mixer alone NSM will be well worth the effort. If you haven't notice I know squat about code.

Edit: Saw your latest post after I made my post. Copied it to /usr/bin, no change.

Re: Is there a NSM Load Session From Command Prompt

Posted: Sat Dec 08, 2018 10:29 pm
by nils
Yeah, I can confirm this doesn't work at all :)
Strange.
I guess it would be best if *someone* would implement that as official non-session-manager GUI command line parameter.

Re: Is there a NSM Load Session From Command Prompt

Posted: Sun Dec 09, 2018 2:18 am
by lasakro
I e-mailed Mr. Liles and see if I get a response.

Re: Is there a NSM Load Session From Command Prompt

Posted: Tue Dec 18, 2018 9:33 pm
by milkii
RaySession, the NSM replacement, now has this feature.