react-native-midi-player
v1.0.6
Published
A library for React-Native to help you play midi files
Downloads
80
Maintainers
Readme
react-native-midi-player
Getting started
$ npm install react-native-midi-player --save
Install (IOS)
- Run the following:
cd ios
pod install
Usage
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
MidiPlayer.play()
pause music
MidiPlayer.pause()
stop music
MidiPlayer.stop()
set tempo of midi file
MidiPlayer.setTempo(120)
set sound font of midi file
MidiPlayer.setSoundFont('Grand piano')
set reverberation
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'
- font: Sound font string in following list:
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'
- preset: Add reverberation effect, string in following list: