Make the vendored synth plain ASCII
soundThing's comments use em dashes and an arrow, and this repository is plain ASCII throughout because the tooling around it does not do Unicode. Tests/docs.sh caught it the first time it ran against the new file, which is what that check is for. Comments only; nothing the compiler sees has changed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
co-authored by
Claude Opus 5
parent
f58b0f93af
commit
b0d06aa6e5
@@ -215,9 +215,9 @@ float filterTick(Filter *f, float input, float cutoff, float resonance, float sa
|
|||||||
if (resonance < 0.0f) resonance = 0.0f;
|
if (resonance < 0.0f) resonance = 0.0f;
|
||||||
if (resonance > 0.99f) resonance = 0.99f;
|
if (resonance > 0.99f) resonance = 0.99f;
|
||||||
|
|
||||||
// Andy Simper TPT SVF (bilinear integration — unconditionally stable)
|
// Andy Simper TPT SVF (bilinear integration - unconditionally stable)
|
||||||
float g = tanf((float)M_PI * cutoff / sampleRate);
|
float g = tanf((float)M_PI * cutoff / sampleRate);
|
||||||
float Q = 0.5f + resonance * 9.5f; // resonance 0..0.99 → Q 0.5..10.0
|
float Q = 0.5f + resonance * 9.5f; // resonance 0..0.99 -> Q 0.5..10.0
|
||||||
float k = 1.0f / Q;
|
float k = 1.0f / Q;
|
||||||
float a1 = 1.0f / (1.0f + g * (g + k));
|
float a1 = 1.0f / (1.0f + g * (g + k));
|
||||||
float a2 = g * a1;
|
float a2 = g * a1;
|
||||||
@@ -259,7 +259,7 @@ const char *filterTypeName(FilterType t)
|
|||||||
// o->phase += freq / sampleRate;
|
// o->phase += freq / sampleRate;
|
||||||
// if (o->phase >= 1.0f) o->phase -= 1.0f;
|
// if (o->phase >= 1.0f) o->phase -= 1.0f;
|
||||||
//
|
//
|
||||||
// // Clocked noise — draw a new random value once per cycle
|
// // Clocked noise - draw a new random value once per cycle
|
||||||
// if (o->waveform == WAVE_NOISE) {
|
// if (o->waveform == WAVE_NOISE) {
|
||||||
// o->noisePhase += freq / sampleRate;
|
// o->noisePhase += freq / sampleRate;
|
||||||
// if (o->noisePhase >= 1.0f) {
|
// if (o->noisePhase >= 1.0f) {
|
||||||
@@ -281,7 +281,7 @@ float oscillatorTick(Oscillator *o, float freqHz, float bendMultiplier, float sa
|
|||||||
o->phase += freq / sampleRate;
|
o->phase += freq / sampleRate;
|
||||||
if (o->phase >= 1.0f) o->phase -= 1.0f;
|
if (o->phase >= 1.0f) o->phase -= 1.0f;
|
||||||
|
|
||||||
// Clocked noise — draw a new random value once per cycle
|
// Clocked noise - draw a new random value once per cycle
|
||||||
if (o->waveform == WAVE_NOISE) {
|
if (o->waveform == WAVE_NOISE) {
|
||||||
o->noisePhase += freq / sampleRate;
|
o->noisePhase += freq / sampleRate;
|
||||||
if (o->noisePhase >= 1.0f) {
|
if (o->noisePhase >= 1.0f) {
|
||||||
@@ -576,7 +576,7 @@ void synthSyncVoices(Synth *s)
|
|||||||
s->voices[v].filter.resModDepth = s->voices[0].filter.resModDepth;
|
s->voices[v].filter.resModDepth = s->voices[0].filter.resModDepth;
|
||||||
|
|
||||||
// Sync envelope settings but NOT runtime state
|
// Sync envelope settings but NOT runtime state
|
||||||
// Each voice needs its own stage, value — just copy the parameters
|
// Each voice needs its own stage, value - just copy the parameters
|
||||||
s->voices[v].ampEnv.attackSec = s->voices[0].ampEnv.attackSec;
|
s->voices[v].ampEnv.attackSec = s->voices[0].ampEnv.attackSec;
|
||||||
s->voices[v].ampEnv.decaySec = s->voices[0].ampEnv.decaySec;
|
s->voices[v].ampEnv.decaySec = s->voices[0].ampEnv.decaySec;
|
||||||
s->voices[v].ampEnv.sustainLevel = s->voices[0].ampEnv.sustainLevel;
|
s->voices[v].ampEnv.sustainLevel = s->voices[0].ampEnv.sustainLevel;
|
||||||
|
|||||||
Reference in New Issue
Block a user