segabor / osccore Goto Github PK
View Code? Open in Web Editor NEWA tiny OSC module implementation in Swift
License: MIT License
A tiny OSC module implementation in Swift
License: MIT License
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.
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.
Codable
. Affected types are OSCMessage
, OSCMessageArgument
and OSCBundle
.Encoder
and Decoder
- will be a quite hard task.Review Travis CI config, make auto build work again.
Reference: https://travis-ci.org/segabor/OSCCore/jobs/232588763
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.
OSCConvertible
protocol that defines serialization, particularly
var oscValue: [Byte]? { get }
- provides serialized value as bytes arrayinit?(data: [Byte])
and init?(data: ArraySlice<Byte>)
constructors. They make up types from bytes streamextract.swift
the entry point of decoding OSC packets.OSCMessage
and OSCBundle
where all the decoding happens.Tests/OSCCoreTests/ValueConversionTests
test suite.This ticket also affects #16
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.
Provide more examples, complement installation steps, etc.
Method signature in Swift NIO was renamed but the example did not follow the change.
Signature change in NIO: apple/swift-nio#842
Issue is discovered in #24
Fix codecov integration as it does not work with swift package manager.
Follow IBM's solution to make it work: Kitura/Kitura#137
Refactor OSCMessage to be able to serialize / deserialize the common way, as OSCBundle and basic types can be. The new OSConvertible protocol describes this, so let's adopt it.
Decommission BlueSocket and use SwiftNIO for communication. Additionally UDP protocol can be replaced with an abstract channel concept.
Generated variable name __allTests
violates swiftlint.
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?
Fix code to be able to swap int32 and float32 values to big endian and back on Linux.
Move it into a separate repository along with its tickets.
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?
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.
Amend GH Actions
Include aarch64 platform as wel
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) }
Essential step that will follow #7
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.
All that's really necessary is to decide on a license for the project.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.