Skip to content

Commit

Permalink
new legendary GNUitar overdrive v2
Browse files Browse the repository at this point in the history
upgrade oboe to 1.9.0
upgrade minsdk to 29
  • Loading branch information
Shaji Khan committed Jun 28, 2024
1 parent df851b0 commit edb3418
Show file tree
Hide file tree
Showing 18 changed files with 96 additions and 32 deletions.
7 changes: 4 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {

defaultConfig {
applicationId "com.shajikhan.ladspa.amprack"
minSdk 24
minSdk 29
targetSdk 33
versionCode 101
versionName '4.51'
Expand Down Expand Up @@ -86,6 +86,7 @@ android {
kotlinCompilerExtensionVersion compose_version
}
namespace 'com.shajikhan.ladspa.amprack'
ndkVersion '26.1.10909125'
}

dependencies {
Expand All @@ -104,7 +105,7 @@ dependencies {
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.firebaseui:firebase-ui-auth:7.2.0'
implementation 'com.google.firebase:firebase-firestore'
implementation "androidx.core:core-splashscreen:1.0.0-beta02"
implementation 'androidx.core:core-splashscreen:1.0.1'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
Expand All @@ -126,7 +127,7 @@ dependencies {

// round seekbar

implementation 'com.google.oboe:oboe:1.8.1'
implementation 'com.google.oboe:oboe:1.9.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"-1": {
"Plugin": true,
"pluginName": "GNUitar Overdrive v2"
},
"0": {
"AudioPort": true,
"InputPort": true,
"index": 0,
"name": "In",
"symbol": "input"
},
"1": {
"AudioPort": true,
"OutputPort": true,
"index": 1,
"name": "Out",
"symbol": "output"
},
"2": {
"InputPort": true,
"ControlPort": true,
"default": 10,
"index": 2,
"maximum": "100",
"minimum": "0",
"name": "Drive"
},
"3": {
"InputPort": true,
"ControlPort": true,
"default": 30,
"index": 3,
"maximum": "100",
"minimum": "0",
"name": "Level"
},
"4": {
"InputPort": true,
"ControlPort": true,
"default": "0",
"index": 4,
"maximum": "6",
"minimum": "-6",
"name": "Treble"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,37 +66,10 @@
"7": {
"InputPort": true,
"ControlPort": true,
"default": "35",
"default": "10",
"index": 7,
"maximum": "50",
"minimum": "-50",
"name": "Gain"
},
"8": {
"InputPort": true,
"ControlPort": true,
"default": "3",
"index": 8,
"maximum": "10",
"minimum": "-10",
"name": "Tone Bass"
},
"9": {
"InputPort": true,
"ControlPort": true,
"default": "-10",
"index": 9,
"maximum": "10",
"minimum": "-10",
"name": "Tone Middle"
},
"10": {
"InputPort": true,
"ControlPort": true,
"default": "0",
"index": 10,
"maximum": "10",
"minimum": "-10",
"name": "Tone Treble"
}
}
6 changes: 6 additions & 0 deletions app/src/main/assets/lv2_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -1366,5 +1366,11 @@
"name": "GNUitar Tube Amplifier v2",
"index": 0,
"library": "libgnuitar-tubeamp.lv2.so"
},
"33500": {
"id": 8106,
"name": "GNUitar Overdrive v2",
"index": 0,
"library": "libgnuitar-distort2-np.lv2.so"
}
}
9 changes: 9 additions & 0 deletions app/src/main/cpp/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,15 @@ void Engine::minimizeLatency () {
OUT
}

void Engine::setBufferSizeFactor (float factor) {
IN

mPlayStream->setBufferSizeInFrames(mPlayStream->getFramesPerBurst() * factor);
mRecordingStream->setBufferSizeInFrames(mRecordingStream->getFramesPerBurst() * factor);

OUT
}

void Engine::setupPushSamples (std::string methodName) {
pushSamplesMethodName = methodName ;
queueManager.add_function(push);
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/cpp/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ class Engine : public oboe::AudioStreamCallback {

void test();
long getTimeStamp();
oboe::LatencyTuner *latencyTuner, *latencyTunerOut;

private:
int32_t mRecordingDeviceId = oboe::kUnspecified;
int32_t mPlaybackDeviceId = oboe::kUnspecified;
oboe::AudioApi mAudioApi = oboe::AudioApi::AAudio;
oboe::LatencyTuner *latencyTuner, *latencyTunerOut;
oboe::Result openStreams();

void closeStreams();
Expand Down Expand Up @@ -141,6 +141,8 @@ class Engine : public oboe::AudioStreamCallback {
static std::string pushSamplesMethodName;

static jclass findClassWithEnv(JNIEnv *env, const char *name);

void setBufferSizeFactor(float factor);
} ;

#endif // __ENGINE__H
21 changes: 21 additions & 0 deletions app/src/main/cpp/native-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1108,4 +1108,25 @@ Java_com_shajikhan_ladspa_amprack_AudioEngine_pushSamples(JNIEnv *env, jclass cl
const char *nativeString = env->GetStringUTFChars(method_name, 0);
engine -> setupPushSamples (std::string (nativeString));
env->ReleaseStringUTFChars(method_name, nativeString);
}
extern "C"
JNIEXPORT void JNICALL
Java_com_shajikhan_ladspa_amprack_AudioEngine_setBufferSizeFactor(JNIEnv *env, jclass clazz, jfloat factor) {
if (engine == nullptr) {
return ;
}

engine->setBufferSizeFactor(factor);
}
extern "C"
JNIEXPORT void JNICALL
Java_com_shajikhan_ladspa_amprack_AudioEngine_latencyTuner(JNIEnv *env, jclass clazz) {
if (engine == nullptr)
return;

engine->latencyTuner->requestReset();
engine->latencyTunerOut->requestReset();

engine->latencyTuner->tune();
engine->latencyTunerOut->tune();
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,6 @@ static void warnLowLatency (Context context) {
public static native int getBufferSizeInFrames (boolean input) ;
public static native void fixGlitches ();
public static native void minimizeLatency ();
public static native void setBufferSizeFactor (float factor);
public static native void latencyTuner ();
}
2 changes: 2 additions & 0 deletions app/src/main/java/com/shajikhan/ladspa/amprack/Rack.java
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,8 @@ public void onClick(View v) {
return;
}

// AudioEngine.setBufferSizeFactor(0.5f);
AudioEngine.latencyTuner();
latency.setText(
String.format( "%.0f ms",
AudioEngine.getLatency(true) +
Expand Down
Binary file not shown.
Binary file modified app/src/main/jniLibs/arm64-v8a/libgnuitar-tubeamp.lv2.so
Binary file not shown.
Binary file not shown.
Binary file modified app/src/main/jniLibs/armeabi-v7a/libgnuitar-tubeamp.lv2.so
Binary file not shown.
Binary file not shown.
Binary file modified app/src/main/jniLibs/x86/libgnuitar-tubeamp.lv2.so
Binary file not shown.
Binary file not shown.
Binary file modified app/src/main/jniLibs/x86_64/libgnuitar-tubeamp.lv2.so
Binary file not shown.
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@
<item>libconvoLV2.so</item>
<item>rt-neural-generic.so</item>
<item>libgnuitar-tubeamp.lv2.so</item>
<item>libgnuitar-distort2-np.lv2.so</item>
</string-array>
<string name="title_activity_settings">Settings</string>

Expand Down

0 comments on commit edb3418

Please sign in to comment.