android_midi 0.20.0
android_midi: ^0.20.0 copied to clipboard
A Flutter plugin for advanced MIDI device control and messaging on Android, with native performance.
0.20.0 Channel Management & Performance Optimization #
This update introduces a major refactoring of the MIDI communication layer to improve code quality, enhance channel management flexibility, and optimize performance for low-latency applications.
New Features
- Dynamic Channel Control: The MIDI API now supports sending messages to single, multiple, or all 16 MIDI channels dynamically using a new
channelsparameter. - Performance Optimization (Batching): All MIDI messages are now batched and sent in a single
sendRawDataplatform call. This significantly reduces the overhead of crossing the Dart-to-native bridge, minimizing latency and jitter. - Improved Code Structure: The refactoring separates the data preparation logic from the data transmission logic.
MidiChannelis a new class responsible for preparing raw MIDI byte data for individual channels.AndroidMidihandles the orchestration, collecting data from multipleMidiChannelobjects and sending it in a single, batched operation.
- Major API refactor: all MIDI methods now use named parameters for clarity and future-proofing.
- UI integration for custom MIDI message sending.
- Improved error handling and comments throughout the codebase.
- Updated widget tests to match new UI and API signatures.
Breaking Changes
- The
send...methods (e.g.,sendNoteOn,sendControlChange) no longer take achannelparameter. This has been replaced by the new optionalchannelsparameter, which accepts aList<int>.
How to Use
- Single Channel: To send a message to channel 5, use
sendNoteOn(..., channels: [5]). - Multiple Channels: To send a message to channels 0 and 1, use
sendNoteOn(..., channels: [0, 1]). - All Channels: To broadcast a message to all channels, simply omit the
channelsparameter:sendNoteOn(...).
0.1.0 #
- Initial public release.
- Core MIDI device and event models (note on/off, control change, program change, pitch bend, aftertouch, SysEx).
- High-level APIs for playing notes, chords, arpeggios, sequences, and phrases with tempo control.
- Real-time MIDI input/output streams.
- Platform interface and method channel for Android MIDI.
- Native JNI integration for low-latency MIDI messaging.
- Example app and test coverage for all main features.