MIDI onstatechange counterpart in JZZ.js

MIDI library for Node.js and HTML
Post Reply
smrz2001
Posts: 13
Joined: Wed Nov 15, 2017 3:33 pm

MIDI onstatechange counterpart in JZZ.js

Post by smrz2001 » Thu Dec 21, 2017 6:21 am

Hi sema,

I'm wondering if JZZ.js has asynchronous device (dis)connection detection like Web MIDI API does via its onstatechange handler. I couldn't find anything in the JZZ.js documentation, code, or examples for this. I am trying to detect device (dis)connection automatically without having to call refresh().

Any suggestions?

Best regards.

sema
Site Admin
Posts: 375
Joined: Mon Oct 17, 2011 7:28 pm

Re: MIDI onstatechange counterpart in JZZ.js

Post by sema » Thu Dec 21, 2017 8:28 am

We don't have this feature in the current version, but it's a great idea to implement in the future.

What you can do now - is to periodically call the refresh() function.

And thank you for the idea!

smrz2001
Posts: 13
Joined: Wed Nov 15, 2017 3:33 pm

Re: MIDI onstatechange counterpart in JZZ.js

Post by smrz2001 » Thu Dec 21, 2017 8:33 am

Glad to provide useful input! Thank you for the great work and for the prompt replies!

sema
Site Admin
Posts: 375
Joined: Mon Oct 17, 2011 7:28 pm

Re: MIDI onstatechange counterpart in JZZ.js

Post by sema » Sun Feb 18, 2018 8:15 pm

JZZ().onChange() will be available in the next release, probably within a week.

sema
Site Admin
Posts: 375
Joined: Mon Oct 17, 2011 7:28 pm

Re: MIDI onstatechange counterpart in JZZ.js

Post by sema » Fri Mar 02, 2018 7:06 pm

Newly released JZZ v0.4.4 has an onChange() function.
Please see the details at https://jazz-soft.net/doc/JZZ/jzz.html#onChange

smrz2001
Posts: 13
Joined: Wed Nov 15, 2017 3:33 pm

Re: MIDI onstatechange counterpart in JZZ.js

Post by smrz2001 » Tue Jun 19, 2018 8:46 am

Awesome! Thank you.

Post Reply