Skip to content

colombod/eDrive.OSC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

53 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

eDrive.OSC

License: MIT .NET Ask DeepWiki

A comprehensive, high-performance Open Sound Control (OSC) 1.1 implementation for .NET with full binary and JSON serialization support.

πŸš€ Features

  • Full OSC 1.1 compliance with comprehensive type support
  • Dual serialization: Binary OSC protocol and JSON serialization
  • Multiple transport protocols: UDP, TCP, HTTP, and Named Pipes
  • Reactive Extensions integration for event-driven applications
  • Thread-safe and performance-optimized
  • Comprehensive test coverage (193 tests, 100% coverage)
  • Edge case handling: NaN, Infinity, large data sets
  • Cross-platform compatibility (.NET 6.0+)

πŸ“¦ NuGet Packages

Package Description NuGet
eDrive.OSC Core OSC library with message handling and serialization NuGet
eDrive.OSC.Interfaces Core interfaces for OSC stream implementations NuGet
eDrive.OSC.Network Network transport implementations (UDP, TCP, HTTP) NuGet
eDrive.OSC.Network.NamedPipes Windows Named Pipes transport implementation NuGet
eDrive.OSC.Reactive Reactive Extensions (Rx.NET) integration NuGet

⚑ Quick Start

Installation

# Core library (required)
dotnet add package eDrive.OSC

# Network transport (for UDP, TCP, HTTP)
dotnet add package eDrive.OSC.Network

# Optional: Named Pipes (Windows)
dotnet add package eDrive.OSC.Network.NamedPipes

# Optional: Reactive Extensions
dotnet add package eDrive.OSC.Reactive

Basic Usage

using eDrive.OSC;
using eDrive.OSC.Network.Upd;

// Create and send an OSC message
var message = new OscMessage("/synth/freq", 440.0f);
var bytes = message.ToByteArray();

// UDP Transport
using var sender = new OscOutboundUpdStream("127.0.0.1", 9000);
await sender.SendAsync(message);

// Receive messages
using var receiver = new OscInboundUdpStream(9001);
receiver.PacketReceived += (sender, packet) => {
    if (packet is OscMessage msg)
        Console.WriteLine($"Received: {msg.Address} with {msg.Arguments.Count} args");
};
receiver.Start();

JSON Serialization

// Serialize to JSON
var message = new OscMessage("/test", 42, "hello", true);
string json = message.ToJson();

// Deserialize from JSON
var restored = OscPacket.FromJson(json);

Bundle Support

// Create a bundle with multiple messages
var bundle = new OscBundle(OscTimeTag.Now)
{
    new OscMessage("/synth/freq", 440.0f),
    new OscMessage("/synth/amp", 0.8f),
    new OscMessage("/synth/gate", true)
};

await sender.SendAsync(bundle);

πŸ—οΈ Architecture

graph TD
    A[eDrive OSC] --> B[Core OSC Implementation]
    A --> C[Binary Serialization]
    A --> D[JSON Serialization]
    
    E[eDrive OSC Interfaces] --> F[IOscInboundStream]
    E --> G[IOscOutboundStream]
    
    H[eDrive OSC Network] --> I[UDP Transport]
    H --> J[TCP Transport]
    H --> K[HTTP Transport]
    
    L[eDrive OSC Network NamedPipes] --> M[Named Pipes Transport]
    
    N[eDrive OSC Reactive] --> O[Rx NET Integration]
    
    A --> E
    H --> E
    L --> E
    N --> A
Loading

πŸ“š Documentation

πŸ”§ Supported OSC Types

OSC Type .NET Type Tag Binary JSON
int32 int i βœ… βœ…
float32 float f βœ… βœ…
string string s βœ… βœ…
blob byte[] b βœ… βœ…
int64 long h βœ… βœ…
double double d βœ… βœ…
timetag OscTimeTag t βœ… βœ…
char char c βœ… βœ…
color OscColour r βœ… βœ…
midi OscMidiMessage m βœ… βœ…
symbol OscSymbol S βœ… βœ…
true bool T βœ… βœ…
false bool F βœ… βœ…
nil null N βœ… βœ…
infinitum float.PositiveInfinity I βœ… βœ…

🏁 Performance & Quality

  • 100% test coverage with 193 comprehensive tests
  • Thread-safe implementations across all components
  • Memory efficient with minimal allocations
  • Edge case handling for NaN, Infinity, and large datasets
  • Cross-platform compatibility (.NET 6.0, 7.0, 8.0)

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

πŸ”— Related Projects


eDrive.OSC - High-performance Open Sound Control for .NET

About

OSC protocol for .NET languages

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages