0.37.0 (71): one engine, one version for Android and iOS

- Three source trees: core/ (shared C++ engine, moved from ios/core),
  app/ (Android UI), ios/app/ (iOS UI)
- Android plays through core/ via JNI (EngineHost, jni_engine.cpp): the Oboe
  callback renders natively; the Kotlin model is mirrored as project text and
  applied as a diff, so playback continues through edits
- The Kotlin engine moves to the unit tests as ReferenceEngine (golden reference)
- Shared MasterRecorder in core/src/host, used by both apps; host_test
- versions.properties: one versionName/versionCode for both platforms,
  continuing Android's numbering (iOS 0.6.0/11 -> 0.37.0/71)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Reactorcoremeltdown
2026-11-16 14:49:46 +01:00
co-authored by Claude Opus 5.5
parent 64e21e0bcc
commit 2bc5cb1cbb
107 changed files with 2921 additions and 1880 deletions
+34
View File
@@ -0,0 +1,34 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
// Kotlin/JVM math semantics, so ports read like the Kotlin and match its output.
// kotlin.math on Float goes through Java's double Math and rounds back to float.
#include <cmath>
namespace sizzle::kt {
inline float tanhf_(float x) { return (float)std::tanh((double)x); }
inline float expf_(float x) { return (float)std::exp((double)x); }
inline float sinf_(float x) { return (float)std::sin((double)x); }
inline float cosf_(float x) { return (float)std::cos((double)x); }
inline float powf_(float a, float b) { return (float)std::pow((double)a, (double)b); }
inline float sqrtf_(float x) { return (float)std::sqrt((double)x); }
inline float log10f_(float x) { return (float)std::log10((double)x); }
/** Float.roundToInt(): Math.round, i.e. floor(x + 0.5). */
inline int roundToInt(float x) { return (int)std::floor((double)x + 0.5); }
inline int roundToInt(double x) { return (int)std::floor(x + 0.5); }
/** Float.toInt(): truncation toward zero, NaN → 0, saturating. */
inline int toInt(float x) {
if (std::isnan(x)) return 0;
if (x >= 2147483647.f) return 2147483647;
if (x <= -2147483648.f) return (-2147483647 - 1);
return (int)x;
}
template <class T> inline T coerceIn(T v, T lo, T hi) { return v < lo ? lo : (v > hi ? hi : v); }
template <class T> inline T coerceAtLeast(T v, T lo) { return v < lo ? lo : v; }
template <class T> inline T coerceAtMost(T v, T hi) { return v > hi ? hi : v; }
} // namespace sizzle::kt