YoniTsafir / mididriver

Android midi driver using Sonivox EAS library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Midi Driver Build Status

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 have fixed the 64 bit reverb bug: #15 - Fix math functions for 64-bit. The driver now works correctly on most 64 bit devices.

Devices running 4.2.2 (API 17) and below don't appear to be able to load a second native library unless it's built in. Devices running 7.0 (API 24) and above don't allow the use of unsupported built in native libraries. Devices running 64 bit 5.01 or 5.1.1 may have a broken 64 bit version of the sonivox native library and may use the broken built in version rather then the fixed version in the driver.

App

The MidiTest app is now in a separate repository.

Use

Add the driver to your build.gradle with

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

and:

dependencies {
  compile 'com.github.billthefarmer:mididriver:v1.13'
}

This will currently add all versions of the native libraries, but not 64 bit.

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.

About

Android midi driver using Sonivox EAS library


Languages

Language:C 97.2%Language:C++ 1.1%Language:Assembly 0.8%Language:Java 0.6%Language:Makefile 0.2%Language:Objective-C 0.1%