Comments (7)
You need to use a sound font. I use one for all the standard MIDI channels. I do not have a sample program at the moment. But if you add the sound font and call the different javascript functions, you should be far,
from midifileplayer.
So far I have figured out that this is the way to execute the plugin:
MidiPlayer.setup(src, ["1",'2','3'], null, mediaStatusCallback);
MidiPlayer.play();
where the method setup is defined as follows: setup(midiFilePath, programs, success, error, status);
but I cannot figure out what the programs variable is supposed to be. I know it is expecting an array of numbers but what are these numbers and how are they related to the mdid file? I see that the code is already including the soundfont so I am clueless as to what other input is required.
from midifileplayer.
The array of numbers are used to associate each midi tracks to an instrument number. Basically, your soundfont has a bunch of instruments, and you can let the plugin knows which instrument must be used for each track.
Also, please note the midiFilePath must be an absolute path.
from midifileplayer.
This is my code:
var src = cordova.file.applicationDirectory + 'www/media/midi/audio.mid';
MidiPlayer.setup(src,['1','2','3'], null, mediaStatusCallback);
from midifileplayer.
So that should work, right ? You only need to call MidiPlayer.play() in the successCallback and you're good to go.
from midifileplayer.
I just submitted a Pull Request with an usage sample. If it does not get accepted soon, please refer to my master branch. The sample is working fine on my iPhone 5s.
from midifileplayer.
And android compatible now :)
from midifileplayer.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from midifileplayer.