# react-native-midi-player

> A library for React-Native to help you play midi files

Latest version **1.0.6** (published 2020-01-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-midi-player
pnpm add react-native-midi-player
yarn add react-native-midi-player
bun add react-native-midi-player
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2020-01-28 |
| First published | 2020-01-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 24.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andy Monga |
| Maintainers | andy67 |
| Keywords | react-native, midi, midi player, music |

## Links

- npm: https://www.npmjs.com/package/react-native-midi-player
- Repository: https://github.com/amonga67/react-native-midi-player
- Homepage: https://github.com/amonga67/react-native-midi-player#readme
- Issues: https://github.com/amonga67/react-native-midi-player/issues
- npm.io page: https://npm.io/package/react-native-midi-player

## 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

- 1.0.6 (latest) — 2020-01-28
- 1.0.5 — 2020-01-28
- 1.0.4 — 2020-01-28
- 1.0.3 — 2020-01-28
- 1.0.2 — 2020-01-28
- 1.0.1 — 2020-01-28
- 1.0.0 — 2020-01-28

## README

# react-native-midi-player

## Getting started

`$ npm install react-native-midi-player --save`

### Install (IOS)


- Run the following:

```bash
cd ios
pod install
```

## Usage
```javascript
import MidiPlayer from 'react-native-midi-player';

// path of midi file in device
const midiPath = 'path to your midi file.midi';
MidiPlayer.init(midiPath)
```
#### play music
```javascript
MidiPlayer.play()
```
#### pause music
```javascript
MidiPlayer.pause()
```
#### stop music
```javascript
MidiPlayer.stop()
```
#### set tempo of midi file 
```javascript
MidiPlayer.setTempo(120)
```
#### set sound font of midi file 
```javascript
MidiPlayer.setSoundFont('Grand piano')
```
#### set reverberation 
```javascript
MidiPlayer.setReverb('Cathedral')
```
## Api

### `play(): void`
### `pause(): void`
### `stop(): void`
### `setTempo(tempo: number): void`
- Parameters:
    - tempo: Tempo in beats per minute
### `setSoundFont(font: string): void`
- Parameters:
    - font: Sound font string in following list: 
        - 'Grand Piano'
        - 'Drama Piano'
        - 'Giga Piano'
        - 'Kawai Grand Piano'

### `setReverb(preset: string): void`
- Parameters:
    - preset: Add reverberation effect, string in following list: 
        - 'No reverb'
        - 'Cathedral'
        - 'Large Hall'
        - 'Large Hall 2'
        - 'Large Room'
        - 'Large Room 2'
        - 'Medium Chamber'
        - 'Medium Hall'
        - 'Medium Hall 2'
        - 'Medium Hall 3'
        - 'Medium Room'
        - 'Plate'
        - 'Small Room'

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