GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - hacklily/hackmidi: JavaScript library to play MIDI files in Edge, Firefox, Safari, and Chrome.

BranchesTags
Open more actions menu

Latest commit

 

History

181 Commits
181 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
docs-src
docs-src
 
 
docs
docs
 
 
lib
lib
 
 
scripts
scripts
 
 
src
src
 
 
vendor
vendor
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.mailmap
.mailmap
 
 
LICENSE.txt
LICENSE.txt
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Hackmidi

A JavaScript library to play MIDI files in Edge, Firefox, Safari, and Chrome.

A fork of midihackery. Powered by libtimidity. Used in Hacklily.

Installation

npm install hackmidi --save

Usage

import {playerFromMIDIBuffer} from "hackmidi";

fetch("Chop-28-4.mid")
  .then(response => response.arrayBuffer())
  .then(buffer => playerFromMIDIBuffer(buffer, "samples/"))
  .then(player => {
    player.addChangeListener((timeInSeconds, isPlaying) => {
      console.log(timeInSeconds, isPlaying);  // (0, false)
    });

    player.play();

    // ...
    
    player.pause();

    // ...
    
    player.seek(20.5 /* seconds */);
  });

Demo

See https://www.hacklily.org/hackmidi/.

About

JavaScript library to play MIDI files in Edge, Firefox, Safari, and Chrome.

www.hacklily.org/hackmidi/

Resources

Readme
LGPL-3.0 license
Activity
Custom properties

Stars

13 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.