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

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

Is there a NSM Load Session From Command Prompt

Post 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.
nils
Established Member
Posts: 537
Joined: Wed Oct 22, 2008 9:05 pm
Has thanked: 35 times
Been thanked: 94 times
Contact:

Re: Is there a NSM Load Session From Command Prompt

Post 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"
lasakro
Established Member
Posts: 16
Joined: Tue Mar 15, 2016 10:18 pm

Re: Is there a NSM Load Session From Command Prompt

Post 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.
nils
Established Member
Posts: 537
Joined: Wed Oct 22, 2008 9:05 pm
Has thanked: 35 times
Been thanked: 94 times
Contact:

Re: Is there a NSM Load Session From Command Prompt

Post 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.. :)
nils
Established Member
Posts: 537
Joined: Wed Oct 22, 2008 9:05 pm
Has thanked: 35 times
Been thanked: 94 times
Contact:

Re: Is there a NSM Load Session From Command Prompt

Post 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
lasakro
Established Member
Posts: 16
Joined: Tue Mar 15, 2016 10:18 pm

Re: Is there a NSM Load Session From Command Prompt

Post 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.
nils
Established Member
Posts: 537
Joined: Wed Oct 22, 2008 9:05 pm
Has thanked: 35 times
Been thanked: 94 times
Contact:

Re: Is there a NSM Load Session From Command Prompt

Post 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.
lasakro
Established Member
Posts: 16
Joined: Tue Mar 15, 2016 10:18 pm

Re: Is there a NSM Load Session From Command Prompt

Post by lasakro »

I e-mailed Mr. Liles and see if I get a response.
User avatar
milkii
Established Member
Posts: 477
Joined: Tue Jan 05, 2016 9:08 am
Location: Edinburgh
Has thanked: 92 times
Been thanked: 91 times
Contact:

Re: Is there a NSM Load Session From Command Prompt

Post by milkii »

RaySession, the NSM replacement, now has this feature.

they/them ta / libreav.org / wiki.thingsandstuff.org/Audio and related pages / gh

Post Reply