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