Git Product home page Git Product logo

Comments (7)

NormannEiland avatar NormannEiland commented on August 10, 2024

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.

frazras avatar frazras commented on August 10, 2024

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.

Scalpweb avatar Scalpweb commented on August 10, 2024

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.

frazras avatar frazras commented on August 10, 2024

This is my code:

var src =  cordova.file.applicationDirectory + 'www/media/midi/audio.mid';
MidiPlayer.setup(src,['1','2','3'], null, mediaStatusCallback);

from midifileplayer.

Scalpweb avatar Scalpweb commented on August 10, 2024

So that should work, right ? You only need to call MidiPlayer.play() in the successCallback and you're good to go.

from midifileplayer.

Scalpweb avatar Scalpweb commented on August 10, 2024

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.

Scalpweb avatar Scalpweb commented on August 10, 2024

And android compatible now :)

from midifileplayer.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.