implement Open Sound Control

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kc
:warning: Old Version Published before Godot 3 was released.

edit 2020
the repo for gdosc as gdnative is

Assume that I have really poor general programming skills, but am capable of autodidacting the required skill set to perform specific tasks, how does one implement the above repo in a project

EDIT: 2018

it looks like Michal Seta has been working on a plugin which seems to be nearing general public usefulness.

:bust_in_silhouette: Reply From: Will Nations

Well, GDNative is basically built for integrating interactions with 3rd party code into the scripting engine.

You might first take a look at this OSC C# interface as C# was just recently added to Godot 3.0 as a first-party language (it’s still getting refined, but as long as the C# code is compatible, I don’t see a reason not to use it instead, aside from potential efficiency reasons).

If that doesn’t work out, then this OSC C++ interface sounds like it should be able to integrate into GDNative C++ pretty well.

thank you for the clear and helpful reply.
I will investigate and report.

kc | 2017-10-29 10:03

I wonder how hard would it be to convert an OpenFrameworks addon into GDNative… There’s hundreds of C++ addons here ofxaddons.com

The one for OSC is not listed there because it’s a core addon: https://github.com/openframeworks/openFrameworks/tree/master/addons

This might be a huge resource for augmenting Godot… I’ll take a look at how it could look like (but so far I only know OpenFrameworks, no Godot yet).

hamoid | 2018-02-15 14:42

:bust_in_silhouette: Reply From: hungrymonkey

May I ask what is your goal with OSC?

Are you trying to play sound in godot?

To create a proper audiostream that integrates with the editor, you cannot use gdnative. You must use C++ modules

I don’t care about this code in particular. This code example I wrote is an example of how you can queue a byte stream. This code assumes the input is mono 16 bit pcm. You can easily change it to accommodate 32 bit floats etc.

no i am not.

I want to have Godotengine receive instructions via OSC.

kc | 2020-04-13 10:22

:bust_in_silhouette: Reply From: Michal Seta

I am actually working on an OSC module that uses oscpack, linked by @Will Nations. It’s not ready yet for public consumption and right now I am only supporting a subset of data types (float, int32 and string) to satisfy my immediate needs. I am new to both Godot and C++ so I am not even set on architecture but once I got the basic functionality working I will worry about discussing how it should be integrated into the engine. Right now I have two dedicated modules, one for receiving OSC messages, another for sending. Stay tuned, I will go public once I get through some hurdles and it’s actually minimally useful.

Hi @Michal,
would you be kind and release you early work as it is ?
I am also in need of some basic OSC communication and would take ages to even have a start (was looking at liblo), but doing double work is not interesting
having some start would also help more advanced coders to look at and help it grow faster…

Olm-e | 2018-01-21 19:32

and I also see this code but dating from 2015 so not sure how it would need to be changed for 3.0…
GitHub - StraToN/godotosc: Plugin for Godot Engine enabling Godot to manage OSC packets over UDP. Based on OSCPkt library http://gruntthepeon.free.fr/oscpkt/

Olm-e | 2018-01-21 19:32

I could help on the implementation if not finished, do you have a repository somewhere?

frankiezafe | 2018-03-08 17:31

Sorry for the late reply, the notification about comments ended up in my spam folder and I just discovered them while looking for some other, potentially misplaced message :-/
In the meantime, I have actually gotten around to getting things done and this weekend is the time to publish the existing work! The repo for the module is here: GitHub - djiamnot/gdosc: OSC module for Godot game engine - it is now discontinued in favor of https://gitlab.com/frankiezafe/gdosc and there is an example of use here: GitHub - djiamnot/gdOscTest: A test Godot project for OSC module. There is some minimal documentation, feel free to nudge me if something is not clear. Merge requests are welcome, of course :wink:

Michal Seta | 2018-03-11 03:19

Hey, thanks a lot for the code! No problem for the response delay, it’s quite fast compared to me :slight_smile:

frankiezafe | 2018-03-12 16:59

hey great !
I’ll look and report, thanks for the update and publication !

Olm-e | 2018-03-14 14:45

I’m tuning the readme for the moment (https://github.com/frankiezafe/gdosc/commit/a576e319a3bacba42a9858c0a8b0339ba3ddf79f) - do you prefer me to make pull request at each commit or once in a while?

frankiezafe | 2018-03-14 19:11

Thanks @frankiezafe for chiming in. It now apparently compiles on a computer that is not owned by me, which is a good sign. The workflow at this point is a little clunky but I too will start using it for a real project so I will have better ideas for further development. If anyone else tries it, please report any issues and ideas directly in the repository.
Good luck :wink:

Michal Seta | 2018-03-14 19:27

OP here,
I have changed the original post to reflect my support for the gdosc direction.
I will be attempting to learn how to compile Godot and then implement the plugin.

kc | 2018-10-19 07:10

:bust_in_silhouette: Reply From: Michal Seta

(moved this from a comment to a real answer for clarity and easier access)

You can try this binary release: https://github.com/djiamnot/gdosc/releases/download/0.1.0/gdosc.tar.gz

tar zxvf gdosc.tar.gz will unpack into a directory called gdosc. Copy the directory into modules folder of your Godot installation. It’s a 64bit build, done on Ubuntu 18.04 but should work on any reasonably recent 64bit Linux.

Please note, that there no plans to maintain this module. Instead, I am planning to rewrite it as GDNative plugin.

Thanks for the link.

kc | 2018-10-19 15:52

This is all really excellent and much kudos for making it possible.
I have some questions regarding some documentation on how to actually make the

frankie / gdosc · GitLab

gdnative code actually work.
Would anybody be interested in helping me understand how to make it function?

kc | 2020-04-13 10:20

Have you tried the demo project that comes with it? What exactly is the issue?

Michal Seta | 2020-04-14 04:04

I think that the issue here is that I do not understand (the documentation for) gdNative generally.

I am going through the errors to try to make it work.

and…done. demo works.
I am using Godotengine3.1.1 so the scripts needed to be changed from

extends Object

to


extends Spatial

now it is working,
thanks for reminding me to look at the demo.
!!!

kc | 2020-04-16 12:53