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

Commit

Permalink
Added open() and close() functions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
notator committed Dec 15, 2015
1 parent 26f4353 commit e65aaa5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
18 changes: 17 additions & 1 deletion cwMIDISynth/cwMIDISynth.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ WebMIDI.cwMIDISynth = (function()
return new CWMIDISynth();
}

/** WebMIDIAPI §10 -- MIDIPort interface **/
// WebMIDIAPI §4.6 -- MIDIPort interface
// See https://github.com/notator/WebMIDISynthHost/issues/23
// and https://github.com/notator/WebMIDISynthHost/issues/24
Object.defineProperty(this, "id", { value: "cwMIDISynth", writable: false });
Object.defineProperty(this, "manufacturer", { value: "chris wilson", writable: false });
Object.defineProperty(this, "name", { value: "MIDI synth (Chris Wilson)", writable: false });
Expand Down Expand Up @@ -143,6 +145,20 @@ WebMIDI.cwMIDISynth = (function()
console.log("cwMIDISynth initialised.");
};

// WebMIDIAPI §4.6 -- MIDIPort interface
// See https://github.com/notator/WebMIDISynthHost/issues/24
CWMIDISynth.prototype.open = function()
{
console.log("cwMIDISynth opened.");
};

// WebMIDIAPI §4.6 -- MIDIPort interface
// See https://github.com/notator/WebMIDISynthHost/issues/24
CWMIDISynth.prototype.close = function()
{
console.log("cwMIDISynth closed.");
};

// WebMIDIAPI MIDIOutput send()
// This synth does not support timestamps
CWMIDISynth.prototype.send = function(message, ignoredTimestamp)
Expand Down
18 changes: 17 additions & 1 deletion sf2Synth1/sf2Synth1.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ WebMIDI.sf2Synth1 = (function(window)
return new Sf2Synth1();
}

/** WebMIDIAPI §10 -- MIDIPort interface **/
// WebMIDIAPI §4.6 -- MIDIPort interface
// See https://github.com/notator/WebMIDISynthHost/issues/23
// and https://github.com/notator/WebMIDISynthHost/issues/24
Object.defineProperty(this, "id", { value: "Sf2Synth01", writable: false });
Object.defineProperty(this, "manufacturer", { value: "gree & ji", writable: false });
Object.defineProperty(this, "name", { value: "Sf2Synth1 (gree & ji)", writable: false });
Expand Down Expand Up @@ -169,6 +171,20 @@ WebMIDI.sf2Synth1 = (function(window)
};
// end var

// WebMIDIAPI §4.6 -- MIDIPort interface
// See https://github.com/notator/WebMIDISynthHost/issues/24
Sf2Synth1.prototype.open = function()
{
console.log("sf2Synth1 opened.");
};

// WebMIDIAPI §4.6 -- MIDIPort interface
// See https://github.com/notator/WebMIDISynthHost/issues/24
Sf2Synth1.prototype.close = function()
{
console.log("sf2Synth1 closed.");
};

// WebMIDIAPI MIDIOutput send()
// This synth does not yet support timestamps (05.11.2015)
Sf2Synth1.prototype.send = function(message, ignoredTimestamp)
Expand Down

0 comments on commit e65aaa5

Please sign in to comment.