Skip to content

Feature Request: Register MessagePort directly instead of onmidimessage #215

@wrongbad

Description

@wrongbad

Currently, to send midi to a worker or AudioWorklet, you have to register a midi callback in the main js context, which receives messages and then forwards again to worker or AudioWorklet. For example:

midiInput.onmidimessage = msg=>audioNode.port.postMessage(msg)

A simple improvement would allow direct message port hook up to establish direct communication between high priority contexts. Like this:

midiInput.registerPort(audioNode.port)

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: enhancementhttps://www.w3.org/policies/process/#class-3

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions