# shimi

> A JS framework for building complex MIDI applications

Latest version **4.0.0** (published 2026-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install shimi
pnpm add shimi
yarn add shimi
bun add shimi
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2026-09-02 |
| First published | 2021-07-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 375.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | James Coyle |
| Maintainers | jamescoyle1989 |
| Keywords | midi, music, toolkit, metronome, chord, gamepad, clip |

## Links

- npm: https://www.npmjs.com/package/shimi
- Repository: https://github.com/jamescoyle1989/shimi
- Homepage: https://github.com/jamescoyle1989/shimi#readme
- Issues: https://github.com/jamescoyle1989/shimi/issues
- npm.io page: https://npm.io/package/shimi

## Dependencies (1)

- [es-toolkit](https://npm.io/package/es-toolkit.md) ^1.50.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2026-09-02
- 3.4.0 — 2025-10-23
- 3.3.0 — 2025-10-13
- 3.2.3 — 2025-07-28
- 3.2.2 — 2025-07-28
- 3.2.1 — 2025-07-19
- 3.2.0 — 2025-07-07
- 3.1.1 — 2025-06-30
- 3.1.0 — 2024-02-15
- 3.0.0 — 2023-12-29
- 2.6.0 — 2023-11-11
- 2.5.0 — 2023-10-16
- 2.4.0 — 2023-06-23
- 2.3.0 — 2023-06-02
- 2.2.0 — 2023-04-14
- … 56 more at https://npm.io/package/shimi/versions

## README

# Shimi

![logo](https://raw.githubusercontent.com/jamescoyle1989/shimi/master/assets/logo180px.png)


![GitHub](https://img.shields.io/github/license/jamescoyle1989/shimi)
![npm bundle size](https://img.shields.io/bundlephobia/min/shimi)
![GitHub package.json version](https://img.shields.io/github/package-json/v/jamescoyle1989/shimi)
![GitHub last commit](https://img.shields.io/github/last-commit/jamescoyle1989/shimi)
![npm](https://img.shields.io/npm/dw/shimi)
![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/jamescoyle1989/shimi)
![CircleCI](https://img.shields.io/circleci/build/github/jamescoyle1989/shimi)
[![Coverage Status](https://coveralls.io/repos/github/jamescoyle1989/shimi/badge.svg?branch=master)](https://coveralls.io/github/jamescoyle1989/shimi?branch=master)

## Overview

Shimi is a lightweight javascript MIDI library.

It came out of a desire to easily build new and experimental MIDI instruments out of user input devices, though it can be used for much more than just that.

The library provides an easy, modular way to build up music systems, providing classes for metronomes, scales, chords, clips, arpeggios, and more. 

It includes its own wrapper around the WebAudio API, for generating sounds from MIDI messages in the browser. It can just as easily send and receive MIDI messages to/from external devices and software.


## Example

Here is a simple example, using shimi to play the start of 'Twinkle Twinkle Little Star' every time the user presses the spacebar:

```
<script src="https://unpkg.com/shimi"></script>
<script>
function run() {
    const clock = new shimi.Clock();
    shimi.Clock.default = clock;
    
    const keyboard = new shimi.Keyboard(new shimi.EventSubscriber(document));
    keyboard.activate();
    
    const metronome = new shimi.Metronome(120);

    const midiOut = new shimi.WebAudioMidiOut(new AudioContext()).withDefaultChannels();

    clock.start();

    //Twinkle Twinkle Little Star
    const clip = new shimi.Clip(8)
        .addNote([0,1], 1, 'C4', 80)
        .addNote([2,3], 1, 'G4', 80)
        .addNote([4,5], 1, 'A4', 80)
        .addNote(6, 2, 'G4', 80);
	
    //Start a new playthrough of the clip each time the spacebar is pressed
    keyboard.space.pressed.add(() => {
        const clipPlayer = new shimi.ClipPlayer(clip, metronome, midiOut);
        clipPlayer.beatCount = clip.duration;
        clock.addChild(clipPlayer);
    });
}
run();
</script>
```


## Install
```
$ npm install shimi
```

or

```
<script src="https://unpkg.com/shimi"></script>
```


## Documentation

See the full technical documentation here: https://jamescoyle1989.github.io/shimi/modules.html

---
_Source: https://npm.io/package/shimi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
