Extracting Full OSC Data from Millumin

Hi, I'm new to the forum and I'm just getting started with Millumin. I would like to know if it is possible to receive all the OSC messages coming out of Millumin when using motion capture effects like Blob Tracker, Skeleton Tracker and Person Detector.

So far I have only managed to get the OSC messages coming out of the Blob Tracker, and only the X and Y parameters (I would also need the Radius).

The best thing would be to be able to extract all the data from the Skeleton Tracker.

The aim is to use Millumin also to modulate sounds and parameters, for example with the Max/MSP software.

Thanks in advance to anyone who can answer me.

Kind regards, Manuel.

Comments

  • Hello @Manuel,

    In latest Millumin V5 beta, you could write a short script to redirect all skeleton tracker events as OSC messages.

    Best. Philippe

  • Hello Philippe, thank you very much for the answer.

    Unfortunately I tried without luck, I'm not a programmer so I'm surely missing something.

    This is the code I tried to insert in the script:


    // Configure the destination OSC IP address and port

    var oscDestination = "127.0.0.1:8000"; // IP address and port of the OSC recipient


    // Function to send a log as an OSC message

    function sendOSCLog(address, type, value) {

    // Build the OSC command

    var oscCommand = address + " " + value;


    // Send the OSC message

    Millumin.sendOSC(oscDestination, oscCommand);

    }


    // Main function that is called on every frame

    this.onFrame = function() {

    // Iterate through all logs

    logs.forEach(function(log) {

    // Send each log as an OSC message

    sendOSCLog(log.address, log.type, log.value);

    });

    };

    Maybe I'm overthinking :)

  • update:
    
    
    This seems to work, but when opening the camera it crashes almost immediately.
    function setup() {
      // Configure OSC sending on port 8000
      setOscDestination("127.0.0.1", 8000);
    }
    
    function onSkeletonTrackerEvent(event) {
      // Check if Skeleton Tracker data exists
      if (event && event.joints) {
        // Iterate over the joint data
        for (var joints in event.joints) {
          if (event.joints.hasOwnProperty(joint)) {
            var position = event.joints[joint]; // Get the joint position
            // Send the location via OSC with a specific path
            sendOscMessage("/skeleton/" + joint, [position.x, position.y, position.z]);
          }
        }
      }
    }
    


  • edited January 29

    Hello @Manuel ,


    Indeed, there was an issue between the skeleton-tracker and the scripts. It will be fixed in the next beta version.

    We are sorry for the inconvenience.


    Your code will not work. Try this instead :

    syncMachineAddress = "127.0.0.1:8000"
    
    function onSkeletonTrackerEvent(event)
    {
       if( event )
       {
           // Check if Skeleton Tracker data exists
           if( event["values"] && event["joint"] && event["component"] )
           {
               values = event["values"];
               joint = event["joint"];
               component = event["component"];
    
               order = "/skeleton/" + joint+"/"+component+" "+values;
               log(order);
    
               // Send the location via OSC with a specific path
               Millumin.sendOSC(syncMachineAddress, order);
           }
       }
    }
    
Sign In or Register to comment.