OSC listener not responding to almost simultaneous messages

  • Hi all,

    I am receiving OSC messages with Isadora, messages are generated via a hardware I made with a PIC32 microcontroller, so they are accurate and precise. I am monitoring packets using Wireshark in the Apple computer which have Isadora, and packets are arriving fine. 
    The problem arises when two packets are received one after another, I connected the OSC listener to a particle system to trigger new particles, so when I receive two messages very fast, sometimes the particle system just triggers one particle, like if messages were lost. 
    I re-checked the hardware, and the receiver with Wireshark and packets are arriving fine. ¿any suggestions? ¿buffer sizes, etc?
    I am using Isadora Core 2.
    Thank you very much for your great software.
  • Beta Platinum

    It sounds amazing! I am not familiar with the PIC32, but have been putting together an Isadora project using OSC generated by iPod accelerometer to interact with 3D particles, 3D Player and Virtual Stage node actors. The OSC data stream for X,Y, Z accelerometer arrives at a channel as (0.982, -0.2491, -0.0642). For example, channel 1 is assigned in the communications drop down panel, however it requires an individual OSC Listener actor for each of the X, Y and Z streams - being assigned channel 1,2 and 3 respectively in separate OSC Listener actors. I have not had any issues of dropped OSC streams using this method to interact with the 3D actor nodes. Perhaps you are already aware of this and your issue is something else entirely. Good luck with your project.

  • @kappuz

    If you want a fast communication via OSC, use bundles instead of simple OSC message.
    From Isadora you must use OSC Multi transmit actor, I dont know how to do it with PIC32.
    Bundles are OSC messages including sequential values (integer, float, text). If you read the reception of OSC message in Show Monitor, you can see that the value is a little part of a very verbose UDP message. So, grouping message to reduce bandwidth is a good method.
    Have you tried to analyse reception with Show Monitor?

  • Hi, I have just checked in the input Monitor of Isadora. I am sending three messages from the microcontroller to Isadora, Three messages arrive and almost every time I see three particles flying in space. But sometimes, I only see two, I checked the case and the monitor receives three messages and just triggers two particles from time to time.

    I can not bundle messages because my microcontroller is translating midi notes to OSC messages, so if I play a chord, every note is one message and should be sent inmediatly, I am sending an integer to /midi/2/noteon/. Which corresponds to MIDI channel No. 2, so the integer value is the note byte of the MIDI protocol. If I bundle, I think I will have the same problem, how to trigger the particle system to send two particles almost at the same time.
    So, if the monitor is receiving three messages, and the OSC listener is sending only two triggers, where is the problem? in the speed of the input of the particle system? or in the speed of the output of the listener?.
    Thank you for your quick response.

  • Can you test the receiving without the particles? I would guess that the processing of the particles takes longer than the gap between the messages, they may well be coming in, but Isadora is busy drawing the frame reacting to message A when the message B comes and then C arrives in time to control the next frame. This would appear that message B is lost.

    Maybe a simple patch that just adds a number when a new message arrives. 
    If you can get all these messages you may be able to alter your target framerate to try and catch the messages in time, or create some kind of buffer to store the messages. 
    At any rate frames will be prepared and then drawn by Isadora at the framerate you set. Lets say this is 25 fps, which means 40ms for a frame. In music 40ms is a long time, at some point you will have to decide how to quantise or ignore messages that arrive more regularly than the frame interval.
  • Tech Staff

    I don't know how exactly you have your messages formatted, but I think it they are moving fast enough, and use the same addresses, it is possible for a set of messages to be missed, if another come in before the last was used.

    To speed up Isadora's processing of messages, you can increase the Cycle rate in the preferences.
    This is how many times per frame the data/messages are processed. This may help eliminate the possibility of a triggerable value being overwritten by a non-triggerable value.
    Again, I don't know if this will apply since I don't know how your messages/values are structured.. but it seems like a good place to start.

  • Thanks @DusX, It is a very simple OSC message: /something/ with an integer as paramter. That is.

    I will try to increase the Cycle rate, sounds reasonable. Greetings :)