Tagged: OSC Toggle Comment Threads | Keyboard Shortcuts

  • frankiezafe 19:22 on 2016-10-19 Permalink | Reply
    Tags: , , , OSC   

    Long time no seen!

    After fixing tiny and absolutly not sexy issues in bullet code, programming went to an even less fancy topic: efficient temporary storage of udp packets.

    Indeed, OSC messages (basically udp messages) arrives asynchronously. The display thread is running at ~60fps, but messages can pop in at any time. To avoid a display thread interruption each time a message is received, they have to be stored until the main thread request them.

    The first approach was to push them in a std::vector. If the main thread never requested them, this vector might eventually become VERY long. To solve that, setting a maximum size seemed to be a good option. Each time a new message is received, if the vector is longer than maximum, the first element, witch is also the oldest, is deleted.

    There’s 2 important performance issues in this approach (fixed by the new one :)):

    • removing the first item ( =>resizing the vector) and push back an item at each reception ( =>resizing the vector once again) is not efficient at all;
    • read and write access to the same object, implying that you can not write while reading and reverse.

    Sooner in my life, someone told me about ring buffer. The name was nice and the idea behind was appealing!

    Here is what has been implemented in the class that receives and parses the OSC messages (readable text below the image, click to enlarge).


    oscreceiver-ring-buffers-01

    polymorph::POscReceiver – ring buffer logic

    POscReceiver uses ring buffer to store received messages temporarily.
    If its capacity is 10, it uses an array of 10 PMessageData.
    When the maximum number of messages is reached, the oldest message is overwritten.
    The position of the oldest one is shifted by one each time a new message is stored in an “overflowed” array.


    oscreceiver-ring-buffers-02

    polymorph::POscReceiver – read and write buffer

    POscReceiver uses 2 ring buffers.
    Reception and parsing are managed in a separated thread.
    Buffers are swapped when the main process request a read access.

     
  • frankiezafe 11:29 on 2016-09-16 Permalink | Reply
    Tags: , , OSC,   

    A bit of architecture

    Concerns sound sources located in the 3d environment.

    On the C++ side, sound::system manages all the sound sources and knowns about the location and orientation of the cam. It also contains the general configuration of the mix (gain, number of tracks, etc.).

    At each frame, the sound::system renders a serie of relations, representing the position of sources in the camera local coordinates (where are the sound sources in the user point of view, to be a bit simplier).

    The sound::system being aware of the number of tracks in the sound engine, it is able to manage efficiently wich source to send to witch track. For instance, if the number of active sound sources is higher than the number of tracks, sound::system will order the closer or the most important sources to send to the sound engine.

    On the #puredata side, the job is simplified. All tracks are similar and reacts to messages sent by sound::system.

    Each sound source knowns about the sound file to load. This info is sent onnce when the source becomes active : activated status.

    Sound::system is able to handle 2 types of communication.

    • In edition, it sends osc messages to puredata, the program with graphical interface. This allows musician to work live on the sound.
    • In production, it sends the messages to libpd internally.

    This 2 modes implies using custom objects in pd that are able to use both modes.

    sound-system-overview

    Thanks to @yacine_sebti for his expertise in pd.

    Currently in development in #peel.

     
  • frankiezafe 17:53 on 2016-08-18 Permalink | Reply
    Tags: , , , OSC   

    First Ogre addon for OSC.

    Repository: https://bitbucket.org/frankiezafe/ogreosc

    It was a hell with OgreBullet addon. A part of the reason was that I didn’t get the way CMake is dealing with the compilation, installation and so on. The OgreOsc addon was a good way to get it.

    The addon doesn’t do a lot for now: it just contains a simple sender. Other classes will as soon as I need them.

     
  • frankiezafe 16:44 on 2016-08-16 Permalink | Reply
    Tags: OSC, , , reverb,   

    Playing with reverb, linked to camera position.

    For peel, the reverb should increase a sensation of emptiness, and rotations around the tube will make the sound vary. Later this week, Daniel will make investigate this topics.

    patch-network.pd  - -home-frankiezafe-projects-peel-work_cpp-assets-pd_672

    PURE DATA: 33 Reverb and Delay on youtube

    By the way, the new way of puredata to manage addons via deken is great, even if searching is tricky until you know exactly the object’s name you are searching for.

    About freeverb~

     
  • frankiezafe 15:07 on 2016-08-16 Permalink | Reply
    Tags: , OSC,   

    Quick & dirty OSC in ogre.

    Thanks to the great library of Ross Bencina, OSC can now be used in Ogre. It has to be turned into a lib, clearly, but I need to remove tasks from todo list.

    To use it, got to polymorph-engine and copy the folder example.2.0/app/osc/.
    It contains the oscpack library and a sender wrapper for Ogre. Receiver will come very soon.

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel