FlutterMidiEngineWeb class
Web implementation of FlutterMidiEnginePlatform.
Uses SpessaSynth (https://github.com/spessasus/spessasynth_lib, Apache-2.0), an SF2/SF3/DLS synthesizer that runs in an AudioWorklet. The JavaScript files ship as web-only assets of this plugin (see assets/web and tool/build_web_synth.sh), so nothing is loaded from a CDN.
- Inheritance
-
- Object
- PlatformInterface
- FlutterMidiEnginePlatform
- FlutterMidiEngineWeb
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
changeProgram(
{required int program, int channel = 0}) → Future< void> -
Change the program (instrument) on a channel
program- Program number (0-127)channel- MIDI channel (0-15)override -
loadSoundfont(
String path) → Future< bool> -
Load a soundfont file from the given path
An empty path loads the built-in sounds.
override
-
loadSoundfontBytes(
Uint8List bytes) → Future< bool> -
Load a soundfont from its raw bytes.
Used on the web, where there is no file system to write the file to.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
playNote(
{required int note, int velocity = 64, int channel = 0}) → Future< void> -
Play a MIDI note
note- MIDI note number (0-127)velocity- Note velocity (0-127)channel- MIDI channel (0-15)override -
resetAllControllers(
) → Future< void> -
Reset all controllers on all channels
override
-
sendControlChange(
{required int controller, required int value, int channel = 0}) → Future< void> -
Send a raw MIDI control change message
controller- Controller number (0-127)value- Controller value (0-127)channel- MIDI channel (0-15)override -
sendPitchBend(
{required int value, int channel = 0}) → Future< void> -
Send a pitch bend message
value- Pitch bend value (-8192 to 8191, 0 is center)channel- MIDI channel (0-15)override -
setChorus(
{int voices = 3, double level = 0.5, double speed = 0.3, double depth = 0.8}) → Future< void> -
Sets the chorus send level (CC 93) on all channels. The other
parameters are not used, same as on iOS and macOS.
override
-
setPan(
{required int pan, int channel = 0}) → Future< void> -
Set the pan position for a channel
pan- Pan position (0=left, 64=center, 127=right)channel- MIDI channel (0-15)override -
setReverb(
{double roomSize = 0.2, double damping = 0.5, double width = 0.5, double level = 0.3}) → Future< void> -
Sets the reverb send level (CC 91) on all channels. The other
parameters are not used, same as on iOS and macOS.
override
-
setVolume(
{required int volume, int channel = 0}) → Future< void> -
Set the volume for a channel
volume- Volume level (0-127)channel- MIDI channel (0-15)override -
stopAllNotes(
) → Future< void> -
Stop all currently playing notes on all channels
override
-
stopNote(
{required int note, int velocity = 64, int channel = 0}) → Future< void> -
Stop a MIDI note
note- MIDI note number (0-127)velocity- Release velocity (0-127)channel- MIDI channel (0-15)override -
toString(
) → String -
A string representation of this object.
inherited
-
unloadSoundfont(
) → Future< bool> -
Unload the current soundfont and free resources
override
-
unmute(
) → Future< void> -
On the web this resumes the audio output, which browsers block until
the user interacts with the page. Call it from a tap handler.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
registerWith(
Registrar registrar) → void - Registers this class as the default platform implementation.