2023/07/10

GlitchSprinkler

Try GlitchSprinkler (github.io)
Read Source Code (github.com)

GlitchSprinkler is an usual synthesizer with oscillator and arpeggiator.

Oscillator is using polynomial approximation to generate waveform. The approximation only tries to cross the control points on top right canvas. That's why the waveform slithers. Also polynomial approximation only works for smooth functions, which means that it can't approximate sharp edges.

Arpeggiator is using overtone series to make variation for detune, as following.

  1. List all the prime numbers up to `2^(Pitch Variation)`.
  2. Convert the prime numbers into octave and take float modulo of 1, which is `fmod(log2(prime), 1.0)`.
  3. Add a variation if wrapped octave falls into a scale by computing `abs(octave - pitchInScale) < (Pitch Drift) / 2400`.

I'm not sure if this makes audible difference. Probably it's too subtle to distinguish from random detune.

---

GlitchSprinkler を試す (github.io)
ソースコードを読む (github.com)

GlitchSprinkler はオシレータとアルペジエータを備えたよくあるシンセサイザです。

オシレータは波形の生成に多項式近似を用いています。ここでの近似は、右上のキャンバスに表示されている制御点を通過する以外の制約を与えていません。なので、制御点を動かすと波形がくねります。また多項式近似は滑らかな関数しか近似できないので鋭い角は表現できません。

アルペジエータは倍音列からデチューンのバリエーションを生成しています。以下は手順です。

  1. `2^(Pitch Variation)` までの素数をリスト。
  2. 得られた素数をオクターブに変換して小数部のみを取り出す。 `fmod(log2(prime), 1.0)` 。
  3. 得られたオクターブの値がスケール内のいずれかのピッチに近ければバリエーションに追加。 `abs(octave - pitchInScale) < (Pitch Drift) / 2400` 。

耳でわかるような質感の差が出るかどうかはわかりません。ランダムにデチューンした音と区別がつかない気がします。