react-native-midi-player
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

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'

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'

Package Sidebar

Install

npm i react-native-midi-player

Weekly Downloads

18

Version

1.0.6

License

MIT

Unpacked Size

25.8 MB

Total Files

23

Last publish

Collaborators

  • andy67