Skip to content

Commit

Permalink
more songs
Browse files Browse the repository at this point in the history
  • Loading branch information
yvesgurcan committed Feb 3, 2020
1 parent 0968bd7 commit 6ce4785
Show file tree
Hide file tree
Showing 20 changed files with 2,479 additions and 1,213 deletions.
2 changes: 1 addition & 1 deletion example/react/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
</head>
<body>
<div id="app"></div>
<script type="text/javascript" src="main.b69a2399d1ac1cd97c5b.js"></script></body>
<script type="text/javascript" src="main.315fa65eb26b7f9339f2.js"></script></body>
</html>
1,208 changes: 1,208 additions & 0 deletions example/react/main.315fa65eb26b7f9339f2.js

Large diffs are not rendered by default.

1,208 changes: 0 additions & 1,208 deletions example/react/main.b69a2399d1ac1cd97c5b.js

This file was deleted.

1,196 changes: 1,196 additions & 0 deletions example/react/main.f71493c2a7f9b27b60a0.js

Large diffs are not rendered by default.

Binary file added example/react/midi/alienate.mid
Binary file not shown.
Binary file added example/react/midi/bunny.mid
Binary file not shown.
Binary file added example/react/midi/cccool.mid
Binary file not shown.
Binary file added example/react/midi/d_messag.mid
Binary file not shown.
Binary file added example/react/midi/dm2ttl.mid
Binary file not shown.
Binary file added example/react/midi/e1m9.mid
Binary file not shown.
Binary file added example/react/midi/e2m1.mid
Binary file not shown.
Binary file added example/react/midi/excalibr.mid
Binary file not shown.
Binary file added example/react/midi/fastway.mid
Binary file not shown.
Binary file added example/react/midi/grabbag.mid
Binary file not shown.
Binary file added example/react/midi/invader.mid
Binary file not shown.
Binary file added example/react/midi/make-it-tighter.mid
Binary file not shown.
Binary file added example/react/midi/runlike.mid
Binary file not shown.
Binary file added example/react/midi/sphereful.mid
Binary file not shown.
Binary file added example/react/midi/stalker.mid
Binary file not shown.
78 changes: 74 additions & 4 deletions example/react/src/components/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,79 @@ const MIDI_END = 'MIDI_END';
const MIDI_ERROR = 'MIDI_ERROR';

const SONGS = [
{ url: 'midi/d_runnin.mid', name: 'Running from evil - Bobby Prince' },
{
url: 'midi/fastway.mid',
name: "Rise of the Triad - Goin' down the fast way - Lee Jackson"
},
{
url: 'midi/runlike.mid',
name: 'Rise of the Triad - Run like Smeg - Lee Jackson'
},
{
url: 'midi/excalibr.mid',
name: 'Rise of the Triad - Excalibur - Bobby Prince'
},
{
url: 'midi/cccool.mid',
name: 'Rise of the Triad - CCCool - Bobby Prince'
},
{
url: 'midi/bunny.mid',
name: 'Doom - End music - Bobby Prince'
},
{
url: 'midi/e1m9.mid',
name: 'Doom - Hiding the secrets - Bobby Prince'
},
{
url: 'midi/e2m1.mid',
name: 'Doom - I sawed the demons - Bobby Prince'
},
{
url: 'midi/dm2ttl.mid',
name: 'Doom II - Title - Bobby Prince'
},
{
url: 'midi/d_runnin.mid',
name: 'Doom II - Running from evil - Bobby Prince'
},
{
url: 'midi/d_messag.mid',
name: 'Doom II - Message for the Archvile - Bobby Prince'
},
{
url: 'midi/grabbag.mid',
name: 'Duke Nukem 3D - Grabbag - Lee Jackson'
},
{
url: 'midi/stalker.mid',
name: 'Duke Nukem 3D - Stalker - Lee Jackson'
},
{
url: 'midi/fatcmdr.mid',
name: 'Going after the fat commander - Bobby Prince'
name: 'Duke Nukem 3D - Going after the fat commander - Bobby Prince'
},
{
url: 'midi/invader.mid',
name: 'Duke Nukem 3D - Invader - Bobby Prince'
},
{
url: 'midi/make-it-tighter.mid',
name: 'Commander Keen - Make it tighter - Bobby Prince'
},
{
url: 'midi/alienate.mid',
name: 'Commander Keen - Aliens ate my babysitter - Bobby Prince'
},
{
url: 'midi/sphereful.mid',
name:
'Commander Keen - Be Very Sphereful With My Diamonds - Bobby Prince'
},
{
url: 'midi/veggies.mid',
name: "You've got to eat your vegetables - Bobby Prince"
name:
"Commander Keen - You've got to eat your vegetables - Bobby Prince"
},
{
url: 'midi/this-file-does-not-exist.mid',
Expand Down Expand Up @@ -63,10 +128,15 @@ const Player = () => {
useEffect(() => {
if (!midiPlayer) {
const eventLogger = payload => {
console[event === MIDI_ERROR ? 'error' : 'log'](payload);
console.log(payload);
setCurrentSongState(payload.event);
setCurrentSongTime(payload.time || 0);

if (payload.event === MIDI_ERROR) {
console.error(payload.message);
console.error(payload.error);
}

if (payload.event === MIDI_END) {
let nextIndex = currentSongIndex + 1;
if (nextIndex > SONGS.length - 1) {
Expand Down

0 comments on commit 6ce4785

Please sign in to comment.