mirror of
https://codeberg.org/armin/monostep.git
synced 2026-09-01 04:10:46 +02:00
Polish GUI, add pattern retrig option, and rework voice DSP
This commit is contained in:
parent
8ed279e84c
commit
4732240cc7
7 changed files with 546 additions and 129 deletions
|
|
@ -103,7 +103,6 @@ inline float renderWave (Waveform w, float phase, float inc)
|
|||
|
||||
case Waveform::super:
|
||||
{
|
||||
// A small detuned stack of band-limited saws -> fat, chorus-like lead.
|
||||
float sum = 0.0f;
|
||||
const float detunes[3] = { -0.01f, 0.0f, 0.01f };
|
||||
|
||||
|
|
@ -118,8 +117,6 @@ inline float renderWave (Waveform w, float phase, float inc)
|
|||
|
||||
case Waveform::sah:
|
||||
{
|
||||
// Sample & hold: a stepped random level per fraction of the cycle.
|
||||
// Deterministic (no shared state) so each oscillator is independent.
|
||||
const int steps = 16;
|
||||
const float f = frac (phase);
|
||||
int s = static_cast<int> (std::floor (f * (float) steps));
|
||||
|
|
@ -135,7 +132,6 @@ inline float renderWave (Waveform w, float phase, float inc)
|
|||
|
||||
case Waveform::formant:
|
||||
{
|
||||
// Two formant-like bands via slow AM sidebands (fixed ratios).
|
||||
const float w = phase * 6.283185307179586f;
|
||||
const float env = 0.5f + 0.3f * std::cos (w * 0.5f) + 0.2f * std::cos (w * 0.25f);
|
||||
return std::sin (w) * env;
|
||||
|
|
@ -143,7 +139,6 @@ inline float renderWave (Waveform w, float phase, float inc)
|
|||
|
||||
case Waveform::pwm:
|
||||
{
|
||||
// Fixed 20 % pulse, band-limited at both edges.
|
||||
const float width = 0.2f;
|
||||
const float f = frac (phase);
|
||||
float v = (f < width) ? 1.0f : -1.0f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue