iOS 0.3.1: engine, model and file formats in C++, verified against Kotlin; longer settings
Engine (sequencer, mixer, FX chains, MIDI effects) renders four whole songs like AudioEngine.kt (two bit-exact, two within 9e-6). ProjectIo / SngFormat / PresetIo round-trip the Kotlin-written files; Float.toString is JDK 17's, checked on all 2^32 floats. Params now holds 255-character values (sample ids were cut). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b1dc5ed8db
commit
7bc54e6466
@@ -133,7 +133,7 @@ struct ToolboxSlot {
|
||||
void clearSlot();
|
||||
float f(const char *key, float fallback = 0.f) const { return values.f(key, fallback); }
|
||||
const char *s(const char *key, const char *fallback = "") const { return values.s(key, fallback); }
|
||||
void set(const char *key, float v); // stored as Kotlin's Float.toString text
|
||||
void set(const char *key, float v); // stored as Kotlin's Float.toString text (no allocation)
|
||||
void set(const char *key, const char *v);
|
||||
};
|
||||
|
||||
@@ -160,5 +160,10 @@ struct Project {
|
||||
/** Kotlin's Float.toString (JDK 17's algorithm), e.g. "120.0", "0.8", "1.0E-4":
|
||||
* what Android writes into settings and files. */
|
||||
std::string kotlinFloatToString(float v);
|
||||
/** Buffer size for kotlinFloatToChars (at most 26 chars + NUL). */
|
||||
inline constexpr int KOTLIN_FLOAT_CHARS = 32;
|
||||
/** The same text written into [out] (KOTLIN_FLOAT_CHARS bytes), NUL-terminated;
|
||||
* returns its length. No allocation: safe on the audio thread. */
|
||||
int kotlinFloatToChars(float v, char *out);
|
||||
|
||||
} // namespace sizzle::model
|
||||
|
||||
Reference in New Issue
Block a user