Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.
/ flutter_midi Public archive
forked from kNoAPP/flutter_midi

Midi Playback in Flutter (Alden's changes that may not be in the master repo) This can likely be deleted if we don't need it.

License

Notifications You must be signed in to change notification settings

IntelliTect/flutter_midi

 
 

Repository files navigation

Buy Me A Coffee Donate github pages GitHub stars flutter_midi

flutter_midi

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

Online Demo: https://rodydavis.github.io/flutter_midi/

Installation

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

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);

About

Midi Playback in Flutter (Alden's changes that may not be in the master repo) This can likely be deleted if we don't need it.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 76.1%
  • Dart 12.9%
  • Java 5.3%
  • Ruby 3.5%
  • HTML 1.7%
  • Objective-C 0.5%