Giter Club home page Giter Club logo

osccore's People

Contributors

segabor avatar umeruma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

osccore's Issues

Implement Equatable to OSC types

Support message equality check on both OSCMessage and OSCBundle types. There is also minor caveat. Int types are automatically converted to Int32 during serialization.

Based on this, the two following message won't be equal (but they should)

let msg1 = OSCMessage(address: "/s_new", args: "sine", 100, 1, 1 )
let msg2 = OSCMessage(address: "/s_new", args: "sine", Int32(100), Int32(1), Int32(1) )

So I think this issue should be addressed before implementing Equatable protocol.

Conform to Codables

Scope

So far OSCCore uses its own serialization technique. Swift 4 brings in Codables providing a standard way of doing it.

Transforming current implementation covers the following tasks.

  • High level transformation: make compound types conform to Codable. Affected types are OSCMessage, OSCMessageArgument and OSCBundle.
  • Low level transformation: provide own Encoder and Decoder - will be a quite hard task.
  • Revisit tests: testing type to binary stream serialization and serialization details should be broken down to two parts (now details are verified in the same test pass).

Utilize NIO ByteBuffer in serialization

NIO provides a useful type for serializing stuff into byte stream, ByteBuffer.
Actual implementation simply concatenates output into [UInt8]. ByteBuffer covers this function way better.

Affected types

  • OSCConvertible protocol that defines serialization, particularly
    • var oscValue: [Byte]? { get } - provides serialized value as bytes array
    • init?(data: [Byte]) and init?(data: ArraySlice<Byte>) constructors. They make up types from bytes stream
  • conversion module is where serialization stuff takes place
    • extract.swift the entry point of decoding OSC packets.
    • Constructors of OSCMessage and OSCBundle where all the decoding happens.
  • Tests/OSCCoreTests/ValueConversionTests test suite.

This ticket also affects #16

Give up on Zewo UDP package

OSC uses UDP package of Zewo for UDP communication. The package has been moved to attic, so we need to find an alternate solution either by finding another package or rewrite the communication layer from scratch.

Review README

Provide more examples, complement installation steps, etc.

Switch to SwiftNIO

Decommission BlueSocket and use SwiftNIO for communication. Additionally UDP protocol can be replaced with an abstract channel concept.

How do I receive data from server?

The SuperColliderClient example shows
// get and print out frequency number from SuperCollider let getFrqMessage = OSCMessage(address: "/s_get", args: [synthID, "freq"]) try channel.writeAndFlush(getFrqMessage, target: remoteAddr)

I don't see how to get and process the response. How is it done?

OSCListener not in net.swift?

I've just included OSCCore in my package description—tried "majorVersion: 0" and "majorVersion: 0, minor: 2"—but whatever I get checked out doesn't include OSCListener (and obviously doesn't work). I'll try pulling down the files manually, but maybe you have another suggestion?

TimeTag does not work with delay parameter

According to live test with SuperCollider, delay seems to set time tag to distant future making no effect of the bundle sent out.
Add automated test to make sure delay works as expected.

Write NIO Client

Revisit examples and make them more NIO friendly. Currently they work but they are too ugly to read. Particularly, requesting synth frequency part in SuperColliderExample should be revisited and make it more readable like channel.getFrequency().then { print(freq) }

Fix annoying warnings in matcher.swift

Swift compiler warns about the deprecation of substring(from:) method which is fine, I need to make it work another way.
But I cannot figure out, how. The suggested way is to wrap substring in a new String then pass it to the matcher. But I don't want to instantiate String just to fix it. Matcher is all about processing parts of the same string using subviews. And I feel betrayed if I need to use new and new String instances just because compiler suggests it.

Handle fail messages in SuperColliderExample

SuperCollider returns /fail message when it fails to process received message.

[segabor@csihuhu OSCCore]$ swift run SuperColliderExample
[message] Address: /fail; Arguments: [/s_new, SynthDef not found]
[message] Address: /fail; Arguments: [/n_set, Node 4 not found]
[message] Address: /fail; Arguments: [/n_set, Node 4 not found]
[message] Address: /fail; Arguments: [/s_get, Node 4 not found]

Let's extend SuperColliderExample to handle them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.