From 7aabb1702a9aa89b74fcac099c01ead25e2e062f Mon Sep 17 00:00:00 2001 From: Phil Burk Date: Wed, 10 Jul 2024 12:14:38 -0700 Subject: [PATCH] OboeTester: use lower pitches for high channel counts Go up by a minor third or a perfect fourth just intoned interval. Fixes #2066 --- apps/OboeTester/app/src/main/cpp/NativeAudioContext.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/OboeTester/app/src/main/cpp/NativeAudioContext.cpp b/apps/OboeTester/app/src/main/cpp/NativeAudioContext.cpp index 614e6fbc9..d0ea68eda 100644 --- a/apps/OboeTester/app/src/main/cpp/NativeAudioContext.cpp +++ b/apps/OboeTester/app/src/main/cpp/NativeAudioContext.cpp @@ -426,6 +426,8 @@ void ActivityTestOutput::configureAfterOpen() { mTriangleOscillator.output.connect(&(mExponentialShape.input)); { double frequency = 330.0; + // Go up by a minor third or a perfect fourth just intoned interval. + const float interval = (mChannelCount > 8) ? (6.0f / 5.0f) : (4.0f / 3.0f); for (int i = 0; i < mChannelCount; i++) { sineOscillators[i].setSampleRate(outputStream->getSampleRate()); sineOscillators[i].frequency.setValue(frequency); @@ -434,7 +436,7 @@ void ActivityTestOutput::configureAfterOpen() { sawtoothOscillators[i].frequency.setValue(frequency); sawtoothOscillators[i].amplitude.setValue(AMPLITUDE_SAWTOOTH); - frequency *= 4.0 / 3.0; // each wave is at a higher frequency + frequency *= interval; // each wave is at a higher frequency setChannelEnabled(i, true); } }