OSC response time

Home Forums Control OSC response time

This topic contains 4 replies, has 2 voices, and was last updated by  rambo 5 years, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #93202

    rambo
    Member

    Good day,

     

    We’re trying to make a MIDI-controller of an iPhone by sending OSC messages from the iPhone to Pd, and MIDI from there on to wherever. At first we were sending MIDI from the iPhone to Pd as well, but for some reason OSC has been working better for us wirelessly so we switched to that. We’ve gotten a lot of our functionality to work but we have a problem with delay. It takes quite some time for the messages to reach Pd, and there’s even a delay between messages. If we want to use this for music creation then this is a big problem.

     

    Is there any way to improve performance? Can it work instantaneously? Or could MIDI via cable be our solution?

     

    And while I’m here: How, oh how, do I put labels on Multibuttons?

    #93203

    tretto
    Member

    Hey rambo,

    to get better performance you should create an ad-hoc wifi connection (direct connection) from PC to iphone. that should greatly improve performance.

    now for multibutton labels:

    at widget definition:

    add: “shouldLabel” : “true”,

    but then, all buttons comes with a number as a default label.

    so you might want to reset them, in that case add this to the widget: “oninit” : “control.reset_clips_labels()”,

    the function would be assuming your multibutton is named “multi”:

    function reset_clips_labels() {  for (var i = 0; i < multi.children.length; i++) {   multi.children[i].label.setValue(”);  } }

    and so, obviously, to modify a label, from an event or a function:

    multi.children[buttonNumber].label.setValue(‘rambo’);

    #93204

    rambo
    Member

    Thank you, Tretto!

     

    That Multibutton stuff did the trick. Although, is this stuff available in any documentation? Can’t seem to find any details about this.

     

    About the response time, I’ve tried four different setups when sending messages from my iPhone 4 to my MacBook:

    • Normally through a wireless router

    • Through a wireless router but with the computer connected by cable

    • Connecting the computer directly to the iPhone by creating a Personal Hotspot

    • Creating a wireless network on the computer (this one didn’t work at all)

     

    The difference I notice between the three top ones is not very significant. If I send a few messages at a time (which I redirect to Garageband in Pd) at the click of a button in Control, I can clearly hear a delay between each note, plus a delay before the first note starts. I’m using oscManager.sendOSC() to send all the data to my computer. I’ve minimised the amount of data I send because right now I’m almost only using roll value of the gyro. This improved responsiveness but it could still be a lot better.

     

    The code is available here: https://dl.dropbox.com/u/428775/prumba_if.js

     

    Is there a way to make it faster? Or should I try MIDI through cable?

    #93205

    tretto
    Member

    rambo:

    multibutton doc:

    http://charlie-roberts.com/Control/?page_id=64

    hardware midi connection in 1.4 announcement:

    http://charlie-roberts.com/Control/?p=319

    also remember to search the old forum, most questions have been asked & answered

    #93246

    rambo
    Member

    Thank you for that! Interface looks sweet now.

     

    We can’t seem to get our heads around this latency thing, however. The interface is performing differently on all our devices. We have two iPhone 4 running iOS 5 on which our interface runs perfectly with no latency. We have a third  iPhone 4 running iOS 6, on which the same interface runs very slowly, and not only sending the messages slowly, you can actually see that it takes time for a button to switch color as you touch it. We also have an iPad, and oddly enough the interface ran very smoothly on it, but after a while it was slow. Restarting or reinstalling doesn’t help.

     

    Any ideas? Grateful for any input. 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

This work is licensed under GPL - 2009 | Powered by Wordpress using a heavily modified version of the theme aav1