Skip to content

Commit

Permalink
Adds guard if navigator.requestMIDIAccess missing #74
Browse files Browse the repository at this point in the history
  • Loading branch information
Marak committed Apr 17, 2022
1 parent fabda13 commit 18ad758
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Once you've loaded Buddy Pond you can type the following commands to get help:

Type `/help` in any chat window to get help.

**BuddyScript Commands**
**`BuddyScript` Commands**

Type `/bs` in any chat window to see `BuddyScript` commands.

Expand Down
11 changes: 11 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@ For contributions, please first see: https://github.com/Marak/buddypond/issues

We have many issues open and welcomed for first time contributors!

- add merlin welcome message ( server-side )
- port dicey to server

- add mission impossible music to minesweeper

- add console can send /bs without login
- ability to set globe and maps as wallpaper?
- ability to set any app as wallpaper?

- add super mario bros sound fx and gif when you get GBP
- add anonymous geo location in message ( same permissions as flag? )

- paint loses context / has bug with disabled send after local save
- paint and sound recorder and mirror apps should have drop down select for context output

BuddyScript v1

X - enable /paint, \paint style commands ( easiest to type and remember )
Expand Down
2 changes: 2 additions & 0 deletions desktop/apps/EASTER-EGG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Ideas for community apps:
- MIDI Controller
- https://medium.com/swinginc/playing-with-midi-in-javascript-b6999f2913c3
- https://developer.mozilla.org/en-US/docs/Web/API/MIDIAccess
- https://medium.com/@keybaudio/virtual-midi-devices-on-macos-a45cdbdffdaf

- Sound FX Board
- Use midi fighter button pad with sound fx
Expand All @@ -87,3 +88,4 @@ Ideas for community apps:




7 changes: 6 additions & 1 deletion desktop/apps/desktop.midi/desktop.midi.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ desktop.app.midi.load = function loadmidiGames (params, next) {

function init() {
logText("Initializing MIDI...");
navigator.requestMIDIAccess().then( onSuccess, onFailure ); //get midi access
if (!navigator.requestMIDIAccess) {
alert('Could not connect to Web MIDI API.\nTry Opera or Chrome?\n')
} else {
navigator.requestMIDIAccess().then( onSuccess, onFailure ); //get midi access
}
}

function onSuccess( access ) {
Expand All @@ -41,6 +45,7 @@ desktop.app.midi.load = function loadmidiGames (params, next) {

function onFailure( err ) {
logText("MIDI Init Error. Error code: " + err.code);
alert('Web MIDI Initialization error. Please see console logs.')
}

function handleMIDIMessage(event){
Expand Down

0 comments on commit 18ad758

Please sign in to comment.