mikeperri / flutter_sequencer

A Flutter plugin for music sequencing.
Other
90 stars 38 forks source link

Adding Track throwing MissingPluginException with isAsset: true and Instruments return id=-1 if isAsset==true #46

Open dbrowne11 opened 7 months ago

dbrowne11 commented 7 months ago

I am working on adding flutter sequencer to an existing project. I have a single dart file in which I set up three instruments: a .sfz piano, a .sf2 piano, and a runtime generated synth. Other than not passing a tuning path for the .sfz file these were essentially copied from the readme example. I then use this pattern to add the tracks.

sequence.createTracks([piano, synth]).then((tracks) { _tracks = tracks; });

With isAsset==True, I get this error log:

E/flutter (16132): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method normalizeAssetDir on channel flutter_sequencer) E/flutter (16132): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308:7) E/flutter (16132): E/flutter (16132): #1 NativeBridge.normalizeAssetDir (package:flutter_sequencer/native_bridge.dart:102:20) E/flutter (16132): E/flutter (16132): #2 Track.build (package:flutter_sequencer/track.dart:56:13) E/flutter (16132): E/flutter (16132): #3 Sequence._createTrack (package:flutter_sequencer/sequence.dart:341:19) E/flutter (16132): E/flutter (16132): #4 Future.wait. (dart:async/future.dart:525:21) E/flutter (16132): E/flutter (16132): #5 Sequence._createTracks (package:flutter_sequencer/sequence.dart:351:20) E/flutter (16132): E/flutter (16132): #6 Sequence.createTracks. (package:flutter_sequencer/sequence.dart:62:24) E/flutter (16132):

With isAsset==False: both sfz and sf2 'addtrack' functions return a -1 id, which I believe happens in the BaseScheduler but I haven't figured out why that function fails.

The track for the synth (a RuntimeSfzInstrument) works properly, which leads me to believe that I have the package setup properly,

Please let me know if you have further questions or are able to help.