flutter_midi 0.1.1+3 copy "flutter_midi: ^0.1.1+3" to clipboard
flutter_midi: ^0.1.1+3 copied to clipboard

outdated

A FLutter Plugin to Play midi on iOS and Android.

flutter_midi #

A FLutter Plugin to Play midi on iOS and Android. This uses SoundFont (.sf2) Files.

Instalation #

Download a sound font file, example: sound_font.SF2 file here.

Create an /assets folder and store the .sf2 files

Update pubspec.yaml

assets:
   - assets/sf2/Piano.SF2
   - assets/sf2/SmallTimGM6mb.sf2

Load the sound font to prepare to play;

 @override
  void initState() {
    load('assets/sf2/Piano.SF2');
    super.initState();
  }
  
 void load(String asset) async {
    FlutterMidi.unmute(); // Optionally Unmute
    ByteData _byte = await rootBundle.load(asset);
    FlutterMidi.prepare(sf2: _byte);
  }

Play and Stop the Midi Notes

 FlutterMidi.playMidiNote(midi: 60);

 FlutterMidi.stopMidiNote(midi: 60);
45
likes
0
pub points
80%
popularity

Publisher

verified publisherrodydavis.com

A FLutter Plugin to Play midi on iOS and Android.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, path_provider

More

Packages that depend on flutter_midi