Skip to content

MIDI2Kit v1.0.17

Choose a tag to compare

@hakaru hakaru released this 13 Feb 06:14
· 54 commits to main since this release

MIDI2Kit v1.0.17

Added

  • High-Level Responder API: MIDI2ResponderClient actor for easy creation of MIDI-CI Responders
    • Automatic transport initialization and lifecycle management
    • Resource registration: addResource(_:data:), addResource(_:getter:setter:)
  • Advanced Connection Policy: MIDI2ConnectionPolicy with MatchRule-based filtering
    • Rules: .contains(), .exact(), .prefix(), .suffix()
    • Presets: .all, .midi2Only
    • Custom filter closure support
  • Notification Throttling: PEResponder.minNotifyInterval (default: 50ms)
    • Deferred send queue collapses rapid updates into single notification
    • Prevents BLE MIDI notification storms
  • ListResource auto-totalCount: Automatic totalCount header in list responses
    • Parses JSON array length from body, includes in response header
  • ComputedResource typed initializers: Type-safe Codable handlers
    • init<G: Encodable>(getTyped:) for GET-only resources
    • init<G: Encodable, S: Decodable>(getTyped:setTyped:) for GET+SET resources
  • Sequential Fallback Strategy: Improved PE send strategy for better compatibility

Fixed

  • P0 KORG Compatibility: Absorbed workaround for KORG legacy fields
  • P0 BLE Timeout: Implemented automatic timeout adjustment for BLE MIDI
  • Robust JSON Decoder: Improved handling of single-quoted strings
  • Duplicate Success Header: Resolved ambiguity in CIMessageBuilder
  • Rebase integration: Merged duplicate implementations from concurrent development (v1.0.16 fix)

Testing

  • 602 tests (100% pass rate, +38 from v1.0.15)

Usage Example

// Create responder
let responder = try MIDI2ResponderClient(name: "MyResponder")

// Add typed resource
await responder.addResource("Temperature") {
    ComputedResource(getTyped: { _ in
        TemperatureReading(celsius: getCurrentTemp())
    })
}

// Filter connections
var config = MIDI2ClientConfiguration()
config.connectionPolicy = MIDI2ConnectionPolicy(
    allowedNames: [.prefix("iPad"), .contains("Pro")]
)

// Start
try await responder.start()

Automated release from hakaru/MIDI2Kit v1.0.17