Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rodydavis/flutter_midi
Midi Playback in Flutter
https://github.com/rodydavis/flutter_midi
dart flutter midi midi-player music
Last synced: 7 days ago
JSON representation
Midi Playback in Flutter
- Host: GitHub
- URL: https://github.com/rodydavis/flutter_midi
- Owner: rodydavis
- License: mit
- Created: 2020-01-13T20:56:07.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-10T10:44:15.000Z (8 months ago)
- Last Synced: 2024-10-27T06:55:52.617Z (12 days ago)
- Topics: dart, flutter, midi, midi-player, music
- Language: Swift
- Homepage: https://rodydavis.github.io/flutter_midi/
- Size: 12.8 MB
- Stars: 62
- Watchers: 3
- Forks: 56
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![Buy Me A Coffee](https://img.shields.io/badge/Donate-Buy%20Me%20A%20Coffee-yellow.svg)](https://www.buymeacoffee.com/rodydavis)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WSH3GVC49GNNJ)
![github pages](https://github.com/rodydavis/flutter_midi/workflows/github%20pages/badge.svg)
[![GitHub stars](https://img.shields.io/github/stars/rodydavis/flutter_midi?color=blue)](https://github.com/rodydavis/flutter_midi)
[![flutter_midi](https://img.shields.io/pub/v/flutter_midi.svg)](https://pub.dev/packages/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
``` ruby
assets:
- assets/sf2/Piano.SF2
- assets/sf2/SmallTimGM6mb.sf2
```
Load the sound font to prepare to play;```dart
@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
```dart
FlutterMidi.playMidiNote(midi: 60);
FlutterMidi.playMidiNote(midi: 60, velocity: 120);FlutterMidi.stopMidiNote(midi: 60);
FlutterMidi.stopMidiNote(midi: 60, velocity: 120);
```