Newbie: how to map 2nd (of array of) arguments to a fader?

At risk of incurring moderator irritation with me, separating a question bundled with my question yesterday , how do I assign arguments to a fader?

In my case I’m still working with my phone accelerometer via Syntien ios app, and pitch, roll, and yaw are arriving as arguments rather than separate messages.

If I can sync that with a widget then I’m good to go.

Any help gratefully received.

Hi,
The best way to handle this is using a custom module which you separate the arguments and send them to the interface:

module.exports = {

    oscInFilter: function(data) {

        var {address, args, host, port} = data

        // filter incoming message with specific address
        if (address === '/accelerometer/address') {

            // get values
            var pitch = args[0].value // first argument
            var roll = args[1].value // second argument
            var yaw = args[2].value // etc

            // send values to OSC client
            receive('/pitch', pitch)
            receive('/roll', roll)
            receive('/yaw', yaw)

            return // bypass original message
        }


        return {address, args, host, port}
    
    }
    
}

Reference:

1 Like

got it thank you so much! i will amend the example code, and hopefully any errors along the way i can work out