Group Admins

  • Profile picture of Karim
  • Profile picture of Jean

OpenMusic

Public Group active 55 minutes ago

User group for OpenMusic and computer-aided composition. Visit the Forum for discussions.

Remote messaging in OM?

Author 4 Subscribed Users |
Profile photo of aliser
aliser

Hi!

I am making a patch with lot of subpaches. The subpatches should allow me to to control different stages of calculation. If a subpatch has inputs, it can”t be evaluated inside itself. (If I open a subpatch (that has inputs) any change inside the subpatch will be calculated only at its output, but the changes will not be displayed in OM-class-objects inside a subpatch.) Is it possible in OM to have some kind of remote messaging (like Max has)? In other words: is it possible to send certain data from a patch, and then to receive it inside a subpatch without making a direct cord connection, in order to enable the evaluation of OM-classes inside a subpatch?
(Perhaps the way to enable the evaluation of classes inside a subpatch is to temporarily store the information and then to retrieve it in a subpatch? Anyway, I don’t know how to do it.)
So my basic question is how to enable evaluation of classes inside a subpatch that receives data from the outside?

Can anybody help me here please?

All the best!

December 18, 2017 at 12:46 #24676
Profile photo of anders
anders

Hi Aliser

OM tends to suggest a purely functional paradigm while patching interactively. But, being Lisp, there are of course many ways to achieve what you prescribe. I’ve attached screenshots of two suggestions.

Currently both these approaches manipulate symbols in the :om package, and there’s no check whether you overwrite anything important…. [changed in the updated version of the Patterns library]

The ‘get/set-pval’ is from the ‘Patterns’ library (http://repmus.ircam.fr/openmusic/libraries). These will establish and look up named symbols which can store any value, and be retrieved anywhere later in the same heap. I’ll update the lib to use it’s own namespace under the hood when i get some time, to make sure nothing important get’s clobbered.

Another way is to build expressions and call ‘eval on them.

  • This reply was modified 7 months ago by Profile photo of anders anders.
  • This reply was modified 7 months ago by Profile photo of anders anders.
Attachments:
  1. Skjermdump-fra-2017-12-18-13-30-02

    Skjermdump-fra-2017-12-18-13-30-02.png

December 18, 2017 at 13:49 #24677
Profile photo of anders
anders

There’s an updated version of ‘Patterns’, v. 0.99.3, available at https://forge.ircam.fr/p/omlibraries/ which protects the names used in ‘pval’, ‘get-pval’, ‘set-pval’ from clobbering any built-in symbols.

-anders

December 18, 2017 at 15:38 #24683
Profile photo of fdsdb
fdsdb

Hi Anders,

Thank you for update. Patterns 0.99.3 have given me the same problem on OM 6.13 (OsX 10.8.5) and OM 6-12 (Linux Fedora 20): on loading the library the error message was “The variable |0.99.3| is unbound”.
I have resolved it modifying the utils.lisp file in sources folder. In second line of code there is not a quote before the version number. That is I have modified from

(defparameter *pattern-version* 0.99.3)

to

(defparameter *pattern-version* ‘0.99.3)

and library loads regularly (I have still not tested everything, but I think there should be no further errors). I hope this is useful.

Ciao

Fabio

December 18, 2017 at 16:37 #24687
Profile photo of aliser
aliser

Dear Anders,
Thank you very much for your answer! It is very useful library!
Also, thanks to Fabio for his intervention!

I wish you all the best!
AliĊĦer

December 18, 2017 at 21:41 #24692
Profile photo of Jean
Jean

ps. note: instead of using (eval (list setq aa 12)) in Anders’ example [which is necessary because setq is considered a ‘special’ function] you can probably just use the function SET.

set sets the value-cell of a given symbol, which probably works for what you want to do.

Another option is to use OM’s “global variables”, but it’s kind of more compicate…
http://support.ircam.fr/docs/om/om6-manual/co/GlobalVariables.html

December 19, 2017 at 00:38 #24694
Profile photo of anders
anders

Fabio, thanks for the bug-report! I’ve updated the lib at the download site with the quoted version number.

-anders

December 19, 2017 at 10:34 #24695
Profile photo of fdsdb
fdsdb

Hi Anders,

It has been a pleasure, thank you for your work!

Ciao

Fabio

December 19, 2017 at 22:23 #24722

You must be logged in to reply to this topic.

Log in now