full chromatic scale, fix regression of crossfading, second row of keys

This commit is contained in:
veclavtalica
2024-06-24 16:28:19 +03:00
parent 561dece028
commit 1bb675d158
5 changed files with 91 additions and 18 deletions

View File

@ -15,8 +15,9 @@
struct stfu_trojka {
struct stfu_phaser phasers[STFU_TROJKA_OP_COUNT];
struct stfu_envelope envelopes[STFU_TROJKA_OP_COUNT];
float gains[STFU_TROJKA_OP_COUNT];
float gains[STFU_TROJKA_OP_COUNT]; // todo: Combine with indices?
float freq_scales[STFU_TROJKA_OP_COUNT];
float indices[STFU_TROJKA_OP_COUNT - 1]; /* 1 to 100 */
float key_frequency;
float feedback_gain; // todo: Separate gain for channels?
float left_feedback, right_feedback;
@ -28,8 +29,8 @@ static struct stfu_trojka stfu_sample_trojka(struct stfu_trojka synth, float buf
synth.envelopes[i] = stfu_pump_envelope(synth.envelopes[i]);
}
float left_modulator_stack = synth.envelopes[1].v * sinf(synth.phasers[1].v + synth.envelopes[0].v * sinf(synth.phasers[0].v)) + synth.left_feedback * synth.feedback_gain;
float right_modulator_stack = synth.envelopes[1].v * sinf(synth.phasers[1].v + synth.envelopes[0].v * sinf(synth.phasers[0].v)) + synth.right_feedback * synth.feedback_gain;
float left_modulator_stack = synth.envelopes[1].v * synth.indices[1] * sinf(synth.phasers[1].v + synth.envelopes[0].v * synth.indices[0] * sinf(synth.phasers[0].v)) + synth.left_feedback * synth.feedback_gain;
float right_modulator_stack = left_modulator_stack;
synth.left_feedback = left_modulator_stack;
synth.right_feedback = right_modulator_stack;