

A MelonLoader plugin that provides Open Sound Control (OSC) networking capabilities for other mods. This plugin allows mods to send and receive OSC messages over UDP for real-time communication with external applications like TouchOSC, VRChat OSC, audio software, and other OSC-compatible tools.
The OSC plugin provides a complete OSC implementation including:
To use this OSC plugin as a dependency in your mod, follow these steps:
Add a reference to the OSC plugin in your mod project and ensure it loads before your mod.
using OSC;
// Check if OSC is available
if (OSCAPI.IsAvailable)
{
// Send a simple OSC message
OSCAPI.Send("/avatar/parameter/MyParameter", 1.0f);
// Send a message with multiple arguments
OSCAPI.Send("/game/player/position", 10.5f, 25.0f, 5.2f);
}
// Register a handler for specific address patterns
OSCAPI.RegisterHandler("/input/button/*", (message) => {
MelonLogger.Msg($"Button input: {message.Address} with {message.Arguments.Count} arguments");
});
// Register a global handler for all messages
OSCAPI.RegisterGlobalHandler((message) => {
MelonLogger.Msg($"Received: {message}");
});
// Configure where to send OSC messages
OSCAPI.ConfigureSender("192.168.1.100", 9000);
// Configure which port to listen on
OSCAPI.ConfigureReceiver(9001);
// Start/stop receiving messages
OSCAPI.StartReceiving();
OSCAPI.StopReceiving();
// Create custom OSC messages
var message = new OSCMessage("/custom/address");
message.AddArgument("Hello");
message.AddArgument(42);
message.AddArgument(3.14f);
OSCAPI.Send(message);
// Get OSC system statistics
var stats = OSCAPI.GetStats();
MelonLogger.Msg($"Sender connected: {stats.IsSenderConnected}");
MelonLogger.Msg($"Receiver listening: {stats.IsReceiverListening}");
// Clean up handlers when your mod unloads
OSCAPI.UnregisterHandler("/input/button/*", myHandler);
OSCAPI.UnregisterGlobalHandler(myGlobalHandler);
127.0.0.1:9000 (localhost)9001trueAll OSCAPI methods include built-in error handling and will log errors to the MelonLoader console. Your mod won't crash if the OSC plugin is unavailable or if network errors occur.
This plugin is is under the MIT License. See the LICENSE file for details.