javascripts and osc receiver

Hi everyone,

I’m new to Millumin, so please excuse me if I’m misunderstanding some of its dynamics.

I’m trying to create a script that receives a score number via OSC.

I’ve created a score.js script.

I know that this exact flow could be achieved by directly calling the Layer/media /text via OSC, but I’m trying to add a score incrementation logic.

With my current script, it triggers only every two messages received (I can see all the messages correctly arriving in the logs).

I’ve tried several approaches.

Right now I’m using the Interaction Panel, setting /score as the address and triggering the script from there.

It works, but only every other time.

I’d also love some suggestions on how to animate it.

I tried using a counter with setInterval, but it seems to stop after the first loop.

Here is the script.

Let me know what you think —

feel free to insult me 🙂


Comments

  • edited January 29

    Hello @recipient,

    You could create an interaction reacting to /score OSC address :

    And performing this script :

    var targetLayer = "Score";
    value = Millumin.getInteractionValue()
    Millumin.setLayerMediaText(targetLayer, "" + value)
    


    Best. Philippe

    PS : however, the easiest way would be to have a TXT file storing your score, see this tutorial.

  • thanks Philippe!


    i've made a workaround and make it work yesterday night

    here my solution that now works, it's a bit more confused but stable

    i'll give a try as you suggest

    thanks

    Martino


Sign In or Register to comment.