Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

MIDIPort open() and close() functions #24

Open
notator opened this issue Dec 15, 2015 · 1 comment
Open

MIDIPort open() and close() functions #24

notator opened this issue Dec 15, 2015 · 1 comment

Comments

@notator
Copy link
Owner

notator commented Dec 15, 2015

MIDIPort open() and close() are defined for MIDIPort in Web MIDI API §4.6.
I have defined these as empty stubs in both synths, so that the code for selecting synths in my Assistant Performer does not have to be changed. This solution is probably too simple. Possibly my init() functions should be renamed open().

I'm not sure if open() and close() really MUST be defined for soft synths. Software synths have constructors, and can be set to null. The situation is different for hardware synths...

Question: Why do software synths have to be opened asynchronously? I suspect that the current version of the Web MIDI API stipulates that open() must be done asynchronously because that makes sense for hardware synths.

notator added a commit that referenced this issue Dec 15, 2015
Web MIDI API §4.6 stipulates that output devices
should have open() and close() functions. I've
added these to all the synths as empty stubs.
See issues #23 and #24.
@notator
Copy link
Owner Author

notator commented Dec 14, 2018

14 Dec 2018:
To comply with Chrome's autoplay policy [1] (December 2018), in which the audioContext object has to be created after the user has interacted with the site, I have now moved all the synths' initialisation code into their open() functions, and called them when the corresponding synth is selected in the main synth selector.

But I'm still not sure about the questions raised above.

[1] For Chrome's policy, see:
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant