Receiving OSC Array from Reaktor

Hi there,

I've just discovered this cool app some days ago. I would love to use it with NI Reaktor, but I am getting some troubles to understand how I can implement some of my stuff.

I am using a matrix object with 8 faders, in the widget "onValue" script I type send('/myArray', ...value) Reaktor receives the 8 sliders values within a single osc message (it works fine)

My problem now is sending the array from reaktor to O-S-C Matrix object (reaktor sends with the same format /oscaddress value[0], value[2], value[3], etc), I am totally lost in there. Any hints about how to archive make the widget responds to the incoming OSC array? Sorry if this is a very basic question, I have not any experience with JS.

Thanks a lot in advance

Hi guys,

Any kind soul can help me with this basic question ? I am trying to figure this myself, but no luck so far. I am pretty sure this can't be something very complex, here a screenshot to explain what I am trying to get working.

I am receiving an array using OSC{/myArray} , theres 8 values in there, I would like my matrix sliders will follow the incoming array values, for example "matrix_1/0" = myArray[0], "matrix1/1" = myArray[1] and so on.

I've tried already lots of combinations, but can't find a solution. Please, any idea how I could do this in O-S-C?
Massive thanks in advance

Hi,

I don't know Reaktor very well, so I couldn't make it send an array, but working with a basic fader I could manage to send its information to OSC (and from OSC to Reaktor).
Here is a GIF showing how it works, hopefully you can get the info from the images. If not, let me know what you need.
Cheers,
osc - reactor
P.S: you can open the animated GIF in another tab to see it at 100%

Hi CielsonLopes,

Many thanks for trying! Yes, that is correct way when you want to control a single element. Unfortunately using single reaktor OSC Send modules would be really lot of work with big projects, so I normally use the OSC Send array reaktor module instead . You can see the incoming array here:

My problem is, how I assign each value from that array to each separate slider in the matrix?
myArray[0] > matrix_1/0
myArray[1] > matrix_1/1
myArray[2] > matrix_1/2
etc

I've tried using a for loop and other stuff, but I have not experience with javascript syntax yet, basically looking for something like set(Matrix_1[index], /myArray[index])

Thanks a lot in advance!

The issue is that the matrix' value is just a convenience to retreive its children's values in a single array but it is unidirectional (you can't set the value of a matrix widget to change its children's values in one row). The most simple way to go would be to create a script widget and use it to receive and dispatch the values from Reactor to the matrix' childrens:

// onValue property
// assuming osc properties are set so that the
// script widget receives /myArray v1 v2 v3 ...
if (Array.isArray(value)) {
  for (var i in value) {
    set('matrix_1/' + i, value[i])
  }
}

Hi

OSC Send Module info.

This module can send the signal values of up to 40 inputs as parameters of an OSC message. A message is sent at the moment, when an event arrives at the first (top) input. The address pattern of the message is the label of this module and the number of parameters is equal to the number of inputs. On the connection page of the Properties you can select by OSC Target one or more computers to which this module sends its messages.

Hi jean-emmanuel,

Many thanks! That really helps a lot. I've archived something very similar to your solution using the custom variable.. But both options seems to create a small problem because I am using the matrix script field to send the osc message in the same format:

This create a loop doing the matrix sliders to jump a bit, maybe could I send the osc message only when "I touch the matrix"? Not sure if that is possible.

Thanks once more again, you guys rules!

Widgets already send messages only when touched, could it simply be due to a number rounding difference (in the feedback message from reaktor) ?

Hi Sync!

Thanks! Sending from reaktor is not problem, I got this part working , I use this a lot with Lemur. however I prefer the OSC Send Array module where array size max is 128, it is quite more flexible than OSC Send multi-port, also event ordering is less tricky.
image

thanks again!

definitely possible, I will double check this. Thanks once more again!

The last touched fader jumps a little even without Reaktor !

Can you upload a minimal session file to help reproduce this ? Please include the server's config as well.

Interesting, I haven't noticed this behavior, will check here too.

// Sever config

{"debug":true,"osc-port":1025,"send":["127.0.0.1:1024"]}

// json

{
  "createdWith": "Open Stage Control",
  "version": "1.17.0",
  "type": "session",
  "content": {
    "type": "root",
    "id": "root",
    "visible": true,
    "interaction": true,
    "comments": "",
    "width": "auto",
    "height": "auto",
    "colorText": "auto",
    "colorWidget": "auto",
    "alphaFillOn": "auto",
    "padding": "auto",
    "html": "",
    "css": "",
    "colorBg": "auto",
    "layout": "default",
    "justify": "start",
    "gridTemplate": "",
    "contain": true,
    "scroll": true,
    "innerPadding": true,
    "verticalTabs": false,
    "variables": "@{parent.variables}",
    "traversing": false,
    "value": "",
    "default": "",
    "linkId": "",
    "address": "auto",
    "preArgs": "",
    "typeTags": "",
    "decimals": 2,
    "target": "",
    "ignoreDefaults": false,
    "bypass": false,
    "widgets": [
      {
        "type": "matrix",
        "top": 60,
        "left": 20,
        "id": "matrix_1",
        "visible": true,
        "interaction": true,
        "comments": "",
        "width": 670,
        "height": 390,
        "expand": "false",
        "colorText": "auto",
        "colorWidget": "auto",
        "colorStroke": "auto",
        "colorFill": "auto",
        "alphaStroke": "auto",
        "alphaFillOff": "auto",
        "alphaFillOn": "auto",
        "lineWidth": "auto",
        "padding": 0,
        "html": "",
        "css": "",
        "colorBg": "auto",
        "layout": "horizontal",
        "justify": "start",
        "gridTemplate": "",
        "contain": true,
        "scroll": true,
        "innerPadding": false,
        "variables": "@{parent.variables}",
        "traversing": true,
        "widgetType": "fader",
        "quantity": 8,
        "props": "JS{\nvar props = {}\nprops.design = \"compact\"\nprops.snap = \"true\"\nprops.knobSize = \"0.5\"\nprops.padding = \"1.5\"\nreturn props\n}",
        "value": "",
        "default": "",
        "linkId": "",
        "address": "auto",
        "preArgs": "",
        "typeTags": "",
        "decimals": 2,
        "target": "",
        "ignoreDefaults": false,
        "bypass": true,
        "widgets": [],
        "tabs": [],
        "onValue": "send('/matrix', ...value) ",
        "lock": false,
        "onCreate": ""
      }
    ],
    "tabs": [],
    "hideMenu": false,
    "onValue": "",
    "lock": false,
    "onCreate": ""
  }
}

I don't see any "jump" here with this session, maybe I'm missing something (particular device ? a specific sequence of actions that triggers it ?)

Move the faders a little bit. You should see it in server debug.

I don't understand, what do refer to as a "jump" exactly ?

For example, if you move every third fader
the value in the previously moved one changes.

System: Windows 64-bit

1 Like

I managed to reproduce it, I don't have time to get to the bottom of it right now but you can circumvent the problem by writing

setTimeout(()=>{
   send('/array', ...value)
})
1 Like

Hi guys, I got this working smoothly, however today I've noticed there is not an interpolate option for the matrix object, right? This would be very useful option, specially to control sequencers, wavetables, etc. Please let me know if that already exists and didn't catch it yet.

I've made a short video to illustrate this using reaktor, as you can see when I use my mouse and drag super fast using the mouse area it doesn't skip data , O-S-C receives it well. But if I do the same from the matrix object, it skips a few values.
Vide - Reaktor Mouse Area & Matrix Fader

Thanks in advance :raised_hands: