flutter_midi 0.1.0 copy "flutter_midi: ^0.1.0" to clipboard
flutter_midi: ^0.1.0 copied to clipboard

outdated

A FLutter Plugin to Play midi on iOS and Android.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_midi/flutter_midi.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    load('assets/sf2/SmallTimGM6mb.sf2');
    super.initState();
  }

  void load(String asset) async {
    print("Loading File...");
    FlutterMidi.unmute();
    ByteData _byte = await rootBundle.load(asset);
    //assets/sf2/SmallTimGM6mb.sf2
    //assets/sf2/Piano.SF2
    FlutterMidi.prepare(sf2: _byte);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: RaisedButton(
            child: Text("Play C"),
            onPressed: () {
              FlutterMidi.playMidiNote(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