Android midi driver using Sonivox EAS library
Branch: master
Clone or download
billthefarmer Merge pull request #33 from TacoTheDank/master
Small misc updates (1.16 -> 1.17)
Latest commit 929025a Jan 28, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app bump buildTools and gradle, delete iml file, and some other small mis… Jan 28, 2019
gradle/wrapper
library bump buildTools and gradle, delete iml file, and some other small mis… Jan 28, 2019
.gitignore Add various include files to avoid editing Sonivox sources Sep 20, 2018
.travis.yml bump buildTools and gradle, delete iml file, and some other small mis… Jan 28, 2019
Apache-2.0.txt Add Apache 2.0 license Jan 14, 2016
README.md bump buildTools and gradle, delete iml file, and some other small mis… Jan 28, 2019
build.gradle bump buildTools and gradle, delete iml file, and some other small mis… Jan 28, 2019
gpl-3.0.txt
gradle.properties Add javadoc comments Jul 13, 2018
gradlew bump buildTools and gradle, delete iml file, and some other small mis… Jan 28, 2019
gradlew.bat bump buildTools and gradle, delete iml file, and some other small mis… Jan 28, 2019
ic_launcher.png
settings.gradle Move sources to library folder Jun 11, 2017

README.md

Logo Midi Driver Build Status JitPack Join the chat at https://gitter.im/mididriver/Lobby

Android midi driver using Sonivox EAS library. The library is available in Releases.

Licensed under GPL or Apache license - your choice.

Includes Sonivox EAS library rebuilt without spurious references to libutils and libcutils. The ARM versions have been build with the assembler source files.

Bugs

Google has fixed the 64 bit reverb bug: #15 - Fix math functions for 64-bit. The driver should now work correctly on all 64 bit devices.

The Sonivox library is now built as a static library and linked with the midi library. This should resolve problems with various android versions.

Use

Add the driver to your build.gradle with

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

and:

dependencies {
    implementation 'com.github.billthefarmer:mididriver:v1.17'
}

Methods

    void start() // Start the driver. Call from onResume().

    void stop()  // Stop the driver. Call from onPause();

    void addOnMidiStartListener(OnMidiStartListener l);

    void queueEvent(byte[]) // Send a midi message. This method now just
                            // calls write()

Listener

    void onMidiStart() // This is called when the driver has started so
                       // that program change messages, etc, may be sent.
                       // This is now somewhat redundant but has been left in.

Native Methods

    boolean init()  // Return true on success, or false on failure.
	
    int[] config()  // Return a four element array of ints with part of
                    // the EAS onfig:

        config[0] = pLibConfig->maxVoices;
        config[1] = pLibConfig->numChannels;
        config[2] = pLibConfig->sampleRate;
        config[3] = pLibConfig->mixBufferSize;

    boolean write(byte buffer[]) // Writes midi data to the Sonivox
                                 // synthesizer. The length of the array
                                 // should be the exact length of the
                                 // message or messages. Returns true
                                 // on success, false on
                                 // failure.

    boolean setVolume(int volume) // Set master volume for EAS
                                  // synthesizer (between 0 and 100).
                                  // Returns true on success, false on
                                  // failure.

    boolean shutdown() // Shut down the synthesizer. Returns true on
                       // success, false on failure.

C/C++ Native Functions

#include "midi.h"

    jboolean midi_init()  // Return true on success, or false on failure.
    jboolean midi_write(EAS_U8 *bytes, jint length)
                                 // Writes midi data to the Sonivox
                                 // synthesizer. The length of the array
                                 // should be the exact length of the
                                 // message or messages. Returns true
                                 // on success, false on
                                 // failure.
    jboolean midi_setVolume(jint volume)
                                  // Set master volume for EAS
                                  // synthesizer (between 0 and 100).
                                  // Returns true on success, false on
                                  // failure.
    jboolean midi_shutdown() // Shut down the synthesizer. Returns true on
                             // success, false on failure.