Good day,
So I am having some issues with getting JUCE to pick up a float style OSC message. The receiver is receiving from an external device, which is making it through to my computer because I am seeing its data in a different application. For some reason the oscMessageReceived function is not working or properly initializing… The connect(‘port#’) check is returning that the application instance is connecting to the port, and I have added what I am certain to be the correct OSC path name, but the oscMessageReceived function isn’t really doing anything(yes, I am checking for message size and type), and i am not even quite sure how to run other checks on it.
Thank-you in advance for your help.
Did you attach the listener? Some apps (like Lemur) are sending osc bundles instead of osc messages. The JUCE osc listener has a separate method for those kind of OSC messages: oscBundleReceived, maybe that one is called?
I did initially add the listener, though I am using oscMessageReceived instead of the oscBundleReceived. Are there any examples for how oscBundleReceived can be used? I am really (at least for the time being), trying to access a defined string-path for OSC, although there are other paths being emitted through the port itself - is this possibly the root of the problem?
I simply use it this way:
void PluginAudioProcessor::oscBundleReceived (const OSCBundle &bundle)
{
for (int i = 0; i < bundle.size(); ++i)
{
auto elem = bundle[i];
if (elem.isMessage())
oscMessageReceived (elem.getMessage());
else if (elem.isBundle())
oscBundleReceived (elem.getBundle());
}
}
So it will get all the messages out of an OSC bundle and call the oscMessageReceived() method.
To be honest, I am not sure what exactly your problem is about, could you describe it in more detail? Do you receive any messages at all? Or is it about getting matching the OSCAddress?
Thank you, I will try this. I actually received signals on one of the OSC Monitor demos, but still having a bit of difficulty applying it into the app. I am running an Audio Application wherein (at least for now) trying to add an OSC listener to the “MainComponent” instance. the Sender is from an external source and is sending out a variety of OSC addresses over the port, of which I am just trying to get one (for now). When the app initializes, it does successfully connect to the port (I have a rough check on that), but with addListener(this, “/address…”) its not even triggering oscMessageReceived or oscBundleReceived. I even experimented with instantiating a separate OSCReceiver object, but it didn’t really seem to help much. I am initializing the addListener function in the MainConstructor Component (which is currently inheriting from the OSCReceiver and OSCReceiver::ListenerWithOSCAddress<>), but I think that somehow something is getting dropped.
I realize there is probably something really obvious that I am missing here, still new to JUCE and not highly adept with C++.
Hello sir, thank you for help with this. I figured it out. The solution was to use OSCReceiver::Listener as is, which is the only subclass that allows for Bundling, the clue should have been that oscBundleReceived was throwing an error when I added override to it. Thanks again!
Is it OK for the AudioProcessor to inherit from OSCReceiver? Did you have any issues @ToccataNos?
Cheers,
Paulo
