# Receive OSC by Processing: A little bit Help is needed

**URL:** <https://discourse.processing.org/t/receive-osc-by-processing-a-little-bit-help-is-needed/6512>\
**Category:** Libraries\
**Created:** [December 11, 2018, 5:49pm UTC](https://discourse.processing.org/t/receive-osc-by-processing-a-little-bit-help-is-needed/6512 "2018-12-11T17:49:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CreCo](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@CreCo](https://discourse.processing.org/u/CreCo)\
**Post date:** [December 11, 2018, 5:49pm UTC](https://discourse.processing.org/t/receive-osc-by-processing-a-little-bit-help-is-needed/6512/1 "2018-12-11T17:49:55Z")

</div>

Dear Community,  
I’m in the moment / to stupid to get a OSC Connection between Iannix and Processing.  
The Iannix will send on 127.0.1.1 on Port 57120 and with the Address /cursor.  
I need the First Parameter which will be send a Integer.  
So I need a little bit help

Thank’s on advance

CreCo  
Thomas Lahme

---

<div class="post-metadata">

**Author:** ![Architector\_4](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/architector_4/32/813_2.png) [@Architector\_4](https://discourse.processing.org/u/Architector_4)\
**Post date:** [December 11, 2018, 6:13pm UTC](https://discourse.processing.org/t/receive-osc-by-processing-a-little-bit-help-is-needed/6512/2 "2018-12-11T18:13:33Z")

</div>

I’m not sure how exactly Iannix works, but you could try executing

```auto
String[] data = loadStrings("127.0.1.1:57120");

```

and then print that to see what does it gives you. And if it gives you the right data, you could try working on that - chopping strings, converting to ints, etc etc…

---

<div class="post-metadata">

**Author:** ![CreCo](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@CreCo](https://discourse.processing.org/u/CreCo)\
**Post date:** [December 11, 2018, 6:38pm UTC](https://discourse.processing.org/t/receive-osc-by-processing-a-little-bit-help-is-needed/6512/3 "2018-12-11T18:38:22Z")

</div>

Ok, this will crash my Processing Script. So it must give another way. With Supercollider it would get. But Supercollider is for making music. And I will try to make modern Art with Processing too.

---

<div class="post-metadata">

**Author:** ![CreCo](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@CreCo](https://discourse.processing.org/u/CreCo)\
**Post date:** [December 11, 2018, 7:06pm UTC](https://discourse.processing.org/t/receive-osc-by-processing-a-little-bit-help-is-needed/6512/4 "2018-12-11T19:06:45Z")

</div>

Ok, I have found a solution for my problem.  
And I have reduce it to the minimal code I need.

It’s the following script:

```auto
import oscP5.*;
    import netP5.*;

    OscP5 oscP5;

    void setup() {
      frameRate(25);
      oscP5 = new OscP5(this,57120);
    }
    void draw() {
      background(0);  
    }
    
    void oscEvent(OscMessage theOscMessage) {
      if(theOscMessage.checkAddrPattern("/cursor") == true) {
          Float OSCvalue = theOscMessage.get(0).floatValue();
          println(" values: "+OSCvalue);
          return;
        }
    }

```

Now I can read the first parameter who would been Floats. But I can not read the second and behind Values. Please can anybody give me a tip.

So I have now tested this script and I knew the Parameters all easy to call. But what Type are this:  
cursor\_value\_y - y mapped coordinate of the running cursor  
Values.  
It’s seems it is not float, and it is not String, but what in the hell is it ???

---

<div class="post-metadata">

**Author:** ![Architector\_4](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/architector_4/32/813_2.png) [@Architector\_4](https://discourse.processing.org/u/Architector_4)\
**Post date:** [December 12, 2018, 5:01pm UTC](https://discourse.processing.org/t/receive-osc-by-processing-a-little-bit-help-is-needed/6512/5 "2018-12-12T17:01:01Z")

</div>

A simple way I know of finding out what type a variable is, is by comparing it to a number and seeing the resulting error message. Try adding this code:

```auto
println(cursor_value_y > "hi");

```

And it should give an error message that is something like `The operator > is undefined for the argument type(s) TypeThing, String` where `TypeThing` would be the type of `cursor_value_y`.
