Is there a NSM Load Session From Command Prompt

What other apps and distros do you use to round out your studio?

Moderators: MattKingUSA, khz

lasakro
Established Member
Posts: 16
Joined: Tue Mar 15, 2016 10:18 pm

Is there a NSM Load Session From Command Prompt

Postby lasakro » Mon Dec 03, 2018 3:55 am

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.

nilshi
Established Member
Posts: 253
Joined: Wed Oct 22, 2008 9:05 pm
Contact:

Re: Is there a NSM Load Session From Command Prompt

Postby nilshi » Mon Dec 03, 2018 4:33 pm

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"

lasakro
Established Member
Posts: 16
Joined: Tue Mar 15, 2016 10:18 pm

Re: Is there a NSM Load Session From Command Prompt

Postby lasakro » Mon Dec 03, 2018 11:41 pm

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.

nilshi
Established Member
Posts: 253
Joined: Wed Oct 22, 2008 9:05 pm
Contact:

Re: Is there a NSM Load Session From Command Prompt

Postby nilshi » Tue Dec 04, 2018 4:49 pm

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.. :)

nilshi
Established Member
Posts: 253
Joined: Wed Oct 22, 2008 9:05 pm
Contact:

Re: Is there a NSM Load Session From Command Prompt

Postby nilshi » Tue Dec 04, 2018 10:47 pm

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

lasakro
Established Member
Posts: 16
Joined: Tue Mar 15, 2016 10:18 pm

Re: Is there a NSM Load Session From Command Prompt

Postby lasakro » Wed Dec 05, 2018 2:25 am

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.

nilshi
Established Member
Posts: 253
Joined: Wed Oct 22, 2008 9:05 pm
Contact:

Re: Is there a NSM Load Session From Command Prompt

Postby nilshi » Sat Dec 08, 2018 10:29 pm

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.

lasakro
Established Member
Posts: 16
Joined: Tue Mar 15, 2016 10:18 pm

Re: Is there a NSM Load Session From Command Prompt

Postby lasakro » Sun Dec 09, 2018 2:18 am

I e-mailed Mr. Liles and see if I get a response.


Return to “Linux Distributions & Other Software”

Who is online

Users browsing this forum: No registered users and 3 guests