Rangarajan Posted March 13, 2019 Share Posted March 13, 2019 Hi, I am getting back to Opusmodus after a long time. I am excited about the support for OSC in this new release. I have two questions: 1) Normally when we use OSC to send to a destination, we use an "address" like "/a/b/c". A device that has this destination "address" is expected to receive the message and act on it. How and where do we specify that address in "osc-thread" function. Just to give an example, a couple of years ago, I had written an article on how to control Reaktor using OSC. If I want to do something similar using OM, what is the procedure? 2) There could be occasions where I want to ping the destination at regular intervals. How do I do that in OM? A detailed example will be quite useful. Regards, Rangarajan Quote Link to comment Share on other sites More sharing options...
opmo Posted March 13, 2019 Share Posted March 13, 2019 Good to see Rangarajan. This example should help. In this example I use the Reaktor "Drive.ens" from the Reaktor Blocks. OSC Threads.opmo To hear the OSC messages in action you need to create a score and send the midi messages to the Reaktor possibly on :port 0 and :channel 1. Best wishes, Janusz Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted March 13, 2019 Share Posted March 13, 2019 I am really very happy to see you back Rangarajan ! Stéphane lviklund 1 Quote Link to comment Share on other sites More sharing options...
Rangarajan Posted March 13, 2019 Author Share Posted March 13, 2019 Thanks Janusz and Stephane! Let me work through the example and understand OSC support. Regards, Rangarajan Quote Link to comment Share on other sites More sharing options...
Rangarajan Posted March 14, 2019 Author Share Posted March 14, 2019 Thanks again for the example code. To test this example, I started Reaktor 6, and loaded the "Drive.ens" as you had suggested. Then enabled "OSC Activate" under "OSC Settings". To see if any OSC message was being received, I watched the "Incoming OSC Monitor" pane. I was able to run the example after making one minor correction - the variable "seed" had to be defined first (a minor issue). Also changed the IP address to what my Reaktor displayed under "OSC Settings". When I ran the example, nothing happened, but of course, there was no error message as well. "Incoming OSC Monitor" pane in Reaktor did not display anything, indicating it did not receive any message from outside. What is supposed to happen when the example program runs? 1) "osc-thread"function takes an ID as its second argument. Can you explain how this ID is mapped to a control on Reaktor? I believe this is crucial. Don't we also have to configure this appropriately in Reaktor? 2) What does "osc-thread" really do? Does it not send the data given to it to the controller at the other end? Would it be possible for you to include any additional code that is needed to actually make Reaktor play something (need not be interesting)? Right now I don't hear anything at all, so it is difficult to understand what is going on. Since OSC is a great addition to the current release of OM, it would be nice to include detailed documentation on the correct use of the feature. Regards, Rangarajan Quote Link to comment Share on other sites More sharing options...
opmo Posted March 14, 2019 Share Posted March 14, 2019 First you need to define and link the thread IDs with the Reaktor controllers. Each Drive.ens controller (button or slider) should receive one ID thread message. In the Reaktor you can assign a OSC thread ID with a right mouse click on the controller selecting "MIDi & OSC Learn": You should send only one thread at a time. Stop the thread and trigger next one etc... The new function END-ALL-OSC-THREADS will destroy all OSC threads. Please note, you need to update your app first (1.3.24667) before you can use the new function. To do that simply select 'Check for Updates..." from Opusmodus menu. Tomorrow I will create a Drive.ens - for Reaktor 6 - with ID controllers already linked, as well a simple score for LCI to play with. Quote Link to comment Share on other sites More sharing options...
opmo Posted March 15, 2019 Share Posted March 15, 2019 Dear Rangarajan, Here it is. OSC threads and Reaktor 6: 1. Expand the Reaktor-Drive.ens.zip file first. Reaktor-Drive.ens.zip 2. Move the Reaktor-Drive.ens file into the '~/Opusmodus/Instruments' directory, this will allow you to star the Reaktor form the Opusmodus app. 3. Add the 'OSC Threads.opmo' file into the Opusmodus Navigator. OSC Threads.opmo 4. Evaluate the DATA parameters. 5. Evaluate the SCORE. 6. Press START button in the Live Coding Instrument - you should hear a sound coming from your Reaktor instrument. 7. Now you are ready to run the OSC threads. You can end any thread at any time with END-OSC-THREADS or all threads with END-ALL-OSC-THREADS. On 3/14/2019 at 3:15 AM, Rangarajan said: 2) What does "osc-thread" really do? Does it not send the data given to it to the controller at the other end? Yes, the OSC-THREAD send the data to the given controller at the other end. Each message has two values, example: (0.04198588 4). The first value is the controller value, the second value is the time (interval - second or ratio). Best wishes, Janusz lviklund 1 Quote Link to comment Share on other sites More sharing options...
lviklund Posted March 15, 2019 Share Posted March 15, 2019 I am sorry but I have still the same problem as Rangarajan. The OSC-messages does not make it out from OM. I have tested the same messages from MAX, Kyma and Reaper. No problem. Weird. Maybe Mojave is the problem. There is sometimes problems with the security thingies that Apple have put in there. Let me know if I can assist in tracking down this. /Lasse Quote Link to comment Share on other sites More sharing options...
opmo Posted March 15, 2019 Share Posted March 15, 2019 I am on Mojave and all works fine here. You need to set the correct remote-host and remote-port for your Reaktor: (defparameter reaktor '(127.0.0.1 10000)) Make sure the OSC is Active: Do you see the Control IDs and Targets in your Reaktor-Drive.ens file: Please drop this file into your '~/Opusmodus/Extensions' folder and restart OM, without it the OSC will not work. OSC Remote Setup.opmo This should fix the problem. Best, Janusz Quote Link to comment Share on other sites More sharing options...
opmo Posted March 15, 2019 Share Posted March 15, 2019 On 3/13/2019 at 3:00 PM, Rangarajan said: 1) Normally when we use OSC to send to a destination, we use an "address" like "/a/b/c". A device that has this destination "address" is expected to receive the message and act on it. How and where do we specify that address in "osc-thread" function. The ID is the address. The form like "/a" is made internally. All you need to do is to give the id (address) "a" only. On 3/13/2019 at 3:00 PM, Rangarajan said: 2) There could be occasions where I want to ping the destination at regular intervals. How do I do that in OM? The data has two values one for the controller and the second one is the time (interval). I have explained this in my previous post (see above). Quote Link to comment Share on other sites More sharing options...
lviklund Posted March 15, 2019 Share Posted March 15, 2019 1 hour ago, lviklund said: I have tested the same messages from MAX, Kyma and Reaper. I did that by sending the same messages to the included .ens. Works well in the ensemble. Forget it. If you are on Mojave I will figure out the problem my self. /Lasse Quote Link to comment Share on other sites More sharing options...
opmo Posted March 15, 2019 Share Posted March 15, 2019 Thank you Lasse for your report. Anyway, this file will fix it: Quote Link to comment Share on other sites More sharing options...
lviklund Posted March 15, 2019 Share Posted March 15, 2019 Thx Janusz. Works now. Quote Link to comment Share on other sites More sharing options...
Rangarajan Posted March 16, 2019 Author Share Posted March 16, 2019 Great! The example works now. Thanks for the help Janusz. I am trying to understand the finer details of this. 1) The third argument to "osc-thread" is a list of lists with two elements <controller-value, time>. What is the time unit assumed here? For example if a list element is '(0.5 1/2), what does "1/2" in this indicate? Is it 1/2 second, or something else? 2) Suppose the third argument to this function has 5 elements like this: '((a b) (c d) (e f) (g h) (I j)), what happens to the thread after it sends the last pair to the controller device? Does it get destroyed by itself? 3) Is there a way to check the status of any of these threads at any time after they have started? 4) Is there a way to destroy a thread and release its resource back to the runtime? Is that what (stop-osc-thread...) does? 5) Is it possible to re-start/re-use a thread? Regards, Rangarajan Quote Link to comment Share on other sites More sharing options...
Rangarajan Posted March 16, 2019 Author Share Posted March 16, 2019 Likewise, I would also like to know the meaning of the first argument to "gen-osc-data". The documentation uses the term "span", but I don't understand it fully. Sorry if I am giving too much trouble! Regards, Rangarajan Quote Link to comment Share on other sites More sharing options...
opmo Posted March 19, 2019 Share Posted March 19, 2019 I will comeback on that in a few days. Quote Link to comment Share on other sites More sharing options...
Rangarajan Posted March 28, 2019 Author Share Posted March 28, 2019 Janusz, While I am waiting for your reply to my earlier queries, I want to ask one more doubt. The "osc-thread" function takes a finite list of data to be transmitted to the receiving controller. What if I want to send data continuously in a loop (like - forever)? Regards, Rangarajan Quote Link to comment Share on other sites More sharing options...
opmo Posted April 2, 2019 Share Posted April 2, 2019 On 3/16/2019 at 8:52 AM, Rangarajan said: 1) The third argument to "osc-thread" is a list of lists with two elements <controller-value, time>. What is the time unit assumed here? For example if a list element is '(0.5 1/2), what does "1/2" in this indicate? Is it 1/2 second, or something else? Yes, 1/2 equal 1/2 second. On 3/16/2019 at 8:52 AM, Rangarajan said: 2) Suppose the third argument to this function has 5 elements like this: '((a b) (c d) (e f) (g h) (I j)), what happens to the thread after it sends the last pair to the controller device? Does it get destroyed by itself? Yes, after the last thread pair is send the thread will destroy by itself. On 3/16/2019 at 8:52 AM, Rangarajan said: 3) Is there a way to check the status of any of these threads at any time after they have started? Yes, this function will display all running threads: (bt:all-threads) On 3/16/2019 at 8:52 AM, Rangarajan said: 4) Is there a way to destroy a thread and release its resource back to the runtime? Is that what (stop-osc-thread...) does? The function: (stop-osc-threads a-thread) will destroy the given OSC thread. The function: (stop-all-osc-threads) will destroy all OSC threads. On 3/16/2019 at 8:52 AM, Rangarajan said: 5) Is it possible to re-start/re-use a thread? No, In order to restart a thread again you need to evaluate the expression again, example: (sets thread1 (osc-thread reaktor "osc1" '((0.18450676 5/2))) On 3/28/2019 at 4:59 AM, Rangarajan said: What if I want to send data continuously in a loop (like - forever)? No, but you could create a loop with repeat function for a given count. Best wishes, Janusz Quote Link to comment Share on other sites More sharing options...
Rangarajan Posted April 2, 2019 Author Share Posted April 2, 2019 Dear Janusz, Thanks a lot for your answers! Regards, Rangarajan Quote Link to comment Share on other sites More sharing options...
opmo Posted April 14, 2019 Share Posted April 14, 2019 PLEASE NOTE! The changes to OSC implementation - see below - are thanks to Rangarajan Krishnamoorthy. If you use OSC threads please revise your OSC files and make the necessary adjustments. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.