MIDI.js icon indicating copy to clipboard operation
MIDI.js copied to clipboard

Ways to prevent the browser from deprioritizing midiJS tasks in inactive tabs

Open akashagrahari opened this issue 8 years ago • 4 comments

I have an application which plays notes in sequence taking numeric cues using the MIDI.noteOn and MIDI.noteOff methods. The frequency in which the notes are played drops drastically when I move to another tab. Is there a workaround to this?

akashagrahari avatar Jul 17 '16 04:07 akashagrahari

Just to clarify. I am using the setTimeout method to create delays between sounds.

akashagrahari avatar Jul 17 '16 04:07 akashagrahari

You can do it by using a worker thread to do the scheduling. Check out the example application at https://github.com/cwilso/metronome. I have been experimenting with this to schedule midi.js events and it's working much better.

Hamish

Sent from my android device.

-----Original Message----- From: Akash Agrahari [email protected] To: "mudcube/MIDI.js" [email protected] Sent: Sun, 17 Jul 2016 14:56 Subject: Re: [mudcube/MIDI.js] Ways to prevent the browser from deprioritizing midiJS tasks in inactive tabs (#185)

Just to clarify. I am using the setTimeout method to create delays between sounds.


You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/mudcube/MIDI.js/issues/185#issuecomment-233165220

hmoffatt avatar Jul 17 '16 12:07 hmoffatt

@hmoffatt could you please post some code sample for implementation of web worker in MIDI.js

shivrajsa avatar Sep 04 '17 10:09 shivrajsa

I'm won't have a chance to share anything for a month at least.

I rewrote the whole scheduler. It depends on a web worker for accurate timing.

However I don't think it's compatible with the audio tag output method, which could be removed (only internet explorer needs it and I don't think it works very well anyway), or the scheduler could be moved into the output methods too.

I have no idea if it would work with webmidi. Does that output method actually work?

Sent from my android device.

-----Original Message----- From: shivrajsa [email protected] To: "mudcube/MIDI.js" [email protected] Cc: hmoffatt [email protected], Mention [email protected] Sent: Mon, 04 Sep 2017 10:06 Subject: Re: [mudcube/MIDI.js] Ways to prevent the browser from deprioritizing midiJS tasks in inactive tabs (#185)

@hmoffatt could you please post some code sample for implementation of web worker in MIDI.js

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/mudcube/MIDI.js/issues/185#issuecomment-326922901

hmoffatt avatar Sep 05 '17 20:09 hmoffatt