+
Compliant clients MUST accept the client control messages described in this section. All client
+control messages REQUIRE a response. Responses MUST be delivered back to the sender (nsmd
) from the
+same socket used by the client in its announce
message (by using lo_send_from
) AFTER the action has
been completed or if an error is encountered. The required response is described in the subsection
-for each message.
-
-If there is an error and the action cannot be completed, then `error_code` MUST be set to a valid
-error code (see <<Error Code Definitions>>) and `message` to a string describing the problem
-(suitable for display to the user).
-
-The reply can take one of the following two forms, where path MUST be the `path` of the message being
-replied to (e.g. "nsm/client/save":
-
-[source%nowrap,OSC]
-----
-/reply s:path s:message
-----
-
-[source%nowrap,OSC]
-----
-/error s:path i:error_code s:message
-----
-
-
-==== Quit
-
-There is no message for this. Clients will receive the Unix SIGTERM signal and MUST close cleanly
+for each message.
+
+
2.2.2. Open
+
+
+
/nsm/client/open s:path_to_instance_specific_project s:display_name s:client_id
+
+
+
+
path_to_instance_specific_project
is a path name in the form client_name.ID, assigned to the
client for storing its project data. The client MUST choose one of the four strategies below to
save, so that every file in the session can be traced back to a client and, vice versa, a client
-name.ID can be used to look up all its files. (For example to clean up the session dir)
-
-* The client has no state and does not save at all
- ** and it MUST NOT misuse e.g. ~/.config to save session specific information e.g. synth-instrument settings
-* The client may use the path client_name.ID directly, resulting in a file client_name.ID in the session directory
-* The client may append its native file extension (e.g. `.json`) to the path client_name.ID
-* The client may use the path as directory, creating arbitrary files below, for example recorded .wav.
- ** and it MUST NOT use the client ID below this point. This way the data stays transferable by hand to another client instance (in another session).
- ** best case practice is to always use the same file names, for example `client_name.ID/savefile.json`
-
-If a project exists at the path, the client MUST immediately open it.
-
-If a project does not exist at the path, then the client MUST immediately create and open a new one
+name.ID can be used to look up all its files. (For example to clean up the session dir)
+
+
+
+-
+
The client has no state and does not save at all
+
+
+-
+
The client may use the path client_name.ID directly, resulting in a file client_name.ID in the session directory
+
+-
+
The client may append its native file extension (e.g. .json
) to the path client_name.ID
+
+-
+
The client may use the path as directory, creating arbitrary files below, for example recorded .wav.
+
+
+-
+
and it MUST NOT use the client ID below this point. This way the data stays transferable by hand to another client instance (in another session).
+
+-
+
best case practice is to always use the same file names, for example client_name.ID/savefile.json
+
+
+
+
+
+
+
+
If a project exists at the path, the client MUST immediately open it.
+
+
+
If a project does not exist at the path, then the client MUST immediately create and open a new one
at the specified path or, for clients which hold all their state in memory, store the path for
-later use when responding to the `save` message.
-
-No file or directory will be created at the specified path by the server. It is up to the client to
-create what it needs.
-
-For clients which HAVE NOT specified the `:switch:` capability, the `open` message will only be
-delivered once, immediately following the `announce` response.
-
-For clients which HAVE specified the `:switch:` capability, the client MUST immediately switch to the
-specified project or create a new one if it doesn't exist.
-
-Clients which are incapable of switching projects or are prone to crashing upon switching MUST NOT
-include `:switch:` in their capability string.
-
-If the user the is allowed to run two or more instances of the application simultaneously
-then such an application MUST PRE-PEND the provided `client_id` string, followed by "/", to any
+later use when responding to the save
message.
+
+
+
No file or directory will be created at the specified path by the server. It is up to the client to
+create what it needs.
+
+
+
For clients which HAVE NOT specified the :switch:
capability, the open
message will only be
+delivered once, immediately following the announce
response.
+
+
+
For clients which HAVE specified the :switch:
capability, the client MUST immediately switch to the
+specified project or create a new one if it doesn’t exist.
+
+
+
Clients which are incapable of switching projects or are prone to crashing upon switching MUST NOT
+include :switch:
in their capability string.
+
+
+
If the user the is allowed to run two or more instances of the application simultaneously
+then such an application MUST PRE-PEND the provided client_id
string, followed by "/", to any
names it registers with common subsystems (e.g. JACK client names). This ensures that multiple
instances of the same application can be restored in any order without scrambling the JACK
-connections or causing other conflicts.
-
-The provided `client_id` will be a concatenation of the value of `application_name` sent by the
-client in its `announce` message and a unique identifier.
-
-Therefore, applications which create single JACK clients can use the value of `client_id` directly
-as their JACK client name.
-
-Applications which register multiple JACK clients (e.g. Carla or Non-Mixer) MUST PRE-PEND
-`client_id` value, followed by "/", to the client names they register with JACK and the application
-determined part MUST be unique for that (JACK) client.
-
-For example, Carla is a plugin-host that loads each plugin as JACK client.
-Suitable JACK client names are: `carla-jack-multi.nBAF/ZynAddSubFx` or `carla-jack-multi.nBAF/Helm`
-Please note that ZynAddSubFx and Helm are *not ports* but clients. Each of them can have any number
-of audio and midi ports below them.
-
-Note that this means that the application MUST NOT register with JACK (or any
-other subsystem requiring unique names) until it receives an `open` message from NSM. Likewise,
-applications with the `:switch:` capability should close their JACK clients and re-create them with
-using the new `client_id` (renaming JACK-clients is not possible, only ports).
-
-A response is REQUIRED as soon as the open operation has been completed. Ongoing progress MAY be
-indicated by sending messages to `/nsm/client/progress`.
-
-
-===== Response
-
-The client MUST respond to the 'open' message with:
-
-[source%nowrap,OSC]
-----
-/reply "/nsm/client/open" s:message
-----
-
-Or
-
-[source%nowrap,OSC]
-----
-/error "/nsm/client/open" i:error_code s:message
-----
-
-
-.Response codes
-[options="header", stripes=even]
-|===
-
-|Code | Meaning
-
-|ERR | General Error
-|ERR_BAD_PROJECT | An existing project file was found to be corrupt
-|ERR_CREATE_FAILED | A new project could not be created
-|ERR_UNSAVED_CHANGES | Unsaved changes would be lost
-|ERR_NOT_NOW | Operation cannot be completed at this time
-
-|===
-
-
-==== Save
-
-[source%nowrap,OSC]
-----
-/nsm/client/save
-----
-
-This message will only be delivered after a previous `open` message, and may be sent any number of
-times within the course of a session (including zero, if the user aborts the session).
-
-===== Response
-
-[source%nowrap,OSC]
-----
-/reply "/nsm/client/save" s:message
-----
-
-Or
-
-[source%nowrap,OSC]
-----
-/error "/nsm/client/save" i:error_code s:message
-----
-
-
-.Response codes
-[options="header", stripes=even]
-|===
-
-|Code | Meaning
-
-|ERR | General Error
-|ERR_SAVE_FAILED | Project could not be saved
-|ERR_NOT_NOW | Operation cannot be completed at this time
-
-|===
-
-
-=== Server to Client Informational Messages
-
-==== Session is Loaded
-
-Accepting this message is optional. The intent is to signal to clients which may have some
+connections or causing other conflicts.
+
+
+
The provided client_id
will be a concatenation of the value of application_name
sent by the
+client in its announce
message and a unique identifier.
+
+
+
Therefore, applications which create single JACK clients can use the value of client_id
directly
+as their JACK client name.
+
+
+
Applications which register multiple JACK clients (e.g. Carla or Non-Mixer) MUST PRE-PEND
+client_id
value, followed by "/", to the client names they register with JACK and the application
+determined part MUST be unique for that (JACK) client.
+
+
+
For example, Carla is a plugin-host that loads each plugin as JACK client.
+Suitable JACK client names are: carla-jack-multi.nBAF/ZynAddSubFx
or carla-jack-multi.nBAF/Helm
+Please note that ZynAddSubFx and Helm are not ports but clients. Each of them can have any number
+of audio and midi ports below them.
+
+
+
Note that this means that the application MUST NOT register with JACK (or any
+other subsystem requiring unique names) until it receives an open
message from NSM. Likewise,
+applications with the :switch:
capability should close their JACK clients and re-create them with
+using the new client_id
(renaming JACK-clients is not possible, only ports).
+
+
+
A response is REQUIRED as soon as the open operation has been completed. Ongoing progress MAY be
+indicated by sending messages to /nsm/client/progress
.
+
+
+
2.2.2.1. Response
+
+
The client MUST respond to the 'open' message with:
+
+
+
+
/reply "/nsm/client/open" s:message
+
+
+
+
+
+
/error "/nsm/client/open" i:error_code s:message
+
+
+
+Table 4. Response codes
+
+
+
+
+
+
+Code |
+Meaning |
+
+
+
+
+ERR |
+General Error |
+
+
+ERR_BAD_PROJECT |
+An existing project file was found to be corrupt |
+
+
+ERR_CREATE_FAILED |
+A new project could not be created |
+
+
+ERR_UNSAVED_CHANGES |
+Unsaved changes would be lost |
+
+
+ERR_NOT_NOW |
+Operation cannot be completed at this time |
+
+
+
+
+