diff --git a/app/build.gradle b/app/build.gradle index 49cc959..9f0dd27 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,6 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 28 + namespace "org.billthefarmer.miditest" defaultConfig { applicationId "org.billthefarmer.miditest" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 531d5e3..5f30610 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ + xmlns:android="http://schemas.android.com/apk/res/android"> - \ No newline at end of file + diff --git a/library/src/main/jni/lib_src/eas_dlssynth.c b/library/src/main/jni/lib_src/eas_dlssynth.c index 8606a29..a07262c 100644 --- a/library/src/main/jni/lib_src/eas_dlssynth.c +++ b/library/src/main/jni/lib_src/eas_dlssynth.c @@ -348,11 +348,24 @@ EAS_RESULT DLS_StartVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOIC pWTVoice->phaseAccum = (EAS_U32) pSynth->pDLS->pDLSSamples + pSynth->pDLS->pDLSSampleOffsets[pDLSRegion->wtRegion.waveIndex]; if (pDLSRegion->wtRegion.region.keyGroupAndFlags & REGION_FLAG_IS_LOOPED) { +#if defined (_8_BIT_SAMPLES) pWTVoice->loopStart = pWTVoice->phaseAccum + pDLSRegion->wtRegion.loopStart; pWTVoice->loopEnd = pWTVoice->phaseAccum + pDLSRegion->wtRegion.loopEnd - 1; +#else //_16_BIT_SAMPLES + pWTVoice->loopStart = pWTVoice->phaseAccum + (pDLSRegion->wtRegion.loopStart<<1); + pWTVoice->loopEnd = pWTVoice->phaseAccum + (pDLSRegion->wtRegion.loopEnd<<1) - 2; +#endif } else - pWTVoice->loopStart = pWTVoice->loopEnd = pWTVoice->phaseAccum + pSynth->pDLS->pDLSSampleLen[pDLSRegion->wtRegion.waveIndex] - 1; + { +#if defined (_8_BIT_SAMPLES) + pWTVoice->loopStart = pWTVoice->loopEnd = pWTVoice->phaseAccum + + pSynth->pDLS->pDLSSampleLen[pDLSRegion->wtRegion.waveIndex] - 1; +#else //_16_BIT_SAMPLES + pWTVoice->loopStart = pWTVoice->loopEnd = pWTVoice->phaseAccum + + pSynth->pDLS->pDLSSampleLen[pDLSRegion->wtRegion.waveIndex] - 2; +#endif + } return EAS_SUCCESS; } diff --git a/library/src/main/jni/midi.cpp b/library/src/main/jni/midi.cpp index 3bc82e0..6c04905 100644 --- a/library/src/main/jni/midi.cpp +++ b/library/src/main/jni/midi.cpp @@ -21,6 +21,7 @@ /////////////////////////////////////////////////////////////////////////////// #include +#include #include #include