2024/10/12

DoubleLoopCymbal

Download DoubleLoopCymbal (github.io)
Source Code (github.com)

DoubleLoopCymbal is a synthesizer that produces a sound somewhere between hi-hat and triangle. Metallic texture comes from 2 all-pass loops.

Block diagram is available on the manual page.

It is making some metallic noise, however it sounds synthetic when listening closer. Different tunings are tried, but I couldn't manage to add a better closing texture, and the crash texture which appears on a real cymbal when hit hard. It seems like closing of hi-hat can't be made from allpass loops. To stop sound, the feeds of allpasses should be moved to 0. However changing the feeds adds a texture similar to a phaser. On the crash texture, I found a better method described by henry bracey (link, description is on a comment). This method is not implement in this time since I wanted to make DoubleLoopCymbal lighter than ClangCymbal.

There are also a bug fix for GlitchSprinkler and a new parameter for GenericDrum. Both could be downloaded from the release page on GitHub.

---

DoubleLoopCymbal のダウンロードとマニュアル (github.io)
ソースコード (github.com)

DoubleLoopCymbal はハイハットとトライアングルの間のような音が出るシンセサイザです。オールパスループというディレイのつなぎ方を使って金属的な質感を出しています。

マニュアルに大まかなブロック線図を掲載しています。

金属音は出ていますが、よく聞くと胡散臭い音をしています。チューニングをいろいろと試したのですが、クローズの質感と、強く叩いたときのクラッシュシンバルのような質感は出せなかったです。クローズについてはオールパスループでは無理です。音を止めるにはフィードを下げなければなりませんが、そうするとフェイザをかけたような質感が現れてしまいます。クラッシュについては henry bracey さんによる良さそうな方法 (リンク、コメント欄に解説あり) を見つけたのですが ClangCymbal よりも軽くしたかったので今回は実装を見送りました。

また GlitchSprinkler のバグ修正と GenericDrum の機能追加も行いました。どちらもリリースページからダウンロードできます。

2024/08/29

適応ノッチフィルタの実装

適応ノッチフィルタの実装を読む (github.io)

適応ノッチフィルタの実装について調べました。適応ノッチフィルタはサイン波にノイズが加わった信号から、サイン波だけを消すときに使えます。ただしノイズの種類によってはうまく動かないこともあります。

今回調べた適応ノッチフィルタは内部で位相差のある 2 つの信号を作って振幅変調 (AM) をかけています。入力がサイン波であればカットオフ周波数の周りでの位相差によって AM 信号の直流成分の符号が変わります。この直流の符号の向きが入力のサイン波の周波数へと向かうようにする、というのが適応の仕組みです。直流成分の符号は位相差を φ とすると sgn(-cos(φ)) で計算できます。 sgn は符号関数です。

図は Ishibashi らによる “DSP Implementation of Adaptive Notch Filerts With Overflow Avoidance in Fixed-Point Arithmetic” で紹介されていた CPZ-ANF という名前の適応ノッチフィルタの、内部の 2 つの信号の位相差を示しています。 "Cutoff" の周りで位相差が -π/2 をまたぐので、位相差が -3π/2 を上回る範囲では適応がうまくいきます。位相差が -3π/2 を下回るような高い周波数では適応は失敗しがちです。

2024/08/26

より手軽な LFO のテンポシンク

より手軽な LFO のテンポシンクを読む (github.io)

以前の LFO のテンポシンクよりも手軽な方法を思いついたので試しました。 EMA フィルタによる同期と、蔵本モデルによる同期を紹介しています。以前の方法は状態遷移が煩雑でしたが、今回の方法は状態遷移が不要です。 DAW 上で動くプラグインの LFO であれば、同期先の周波数と位相がどちらも分かっているので EMA フィルタによる同期が適しています。

画像は逆走を防いだ EMA フィルタによる同期の例です。

2024/08/15

Integer Sample Tuning Table / 整数サンプル調律の表

Take a look at integer sample tuning table (github.io)

This is a tuning table used in GlitchSprinkler. They are named as `Discrete` tunings in GlitchSprinkler plugin. Web synth version is always using a tuning that `Min period` in the table parameter is 2 samples.

The errors of pitches are quite bad at higher frequencies, even around 1000 Hz.

---

整数サンプル調律の表を見る (github.io)

この調律は GlitchSprinkler で使われているものです。プラグイン版では Tuning の `Discrete` のいずれかを選べば対応する調律が使えます。 Web シンセ版は表の `Min period` を 2 サンプルに設定したときの調律に固定されています。

ピッチの誤差は高い周波数で悪くなり、 1000 Hz あたりでもかなりずれています。

2024/08/11

Release of GlitchSprinkler Plugin / GlitchSprinkler のプラグイン版を公開

GlitchSprinkler Manual (github.io)

GlitchSprinkler plugin version is ready. Download link is available on the manual page linked above.

GlitchSprinkler is a synthesizer specialized to play fast arpeggio. It is mostly the same as the web synth version, but a resonant low-pass filter is added. It has some character that comes from integer sample period and a bit unusual note stealing.

By making the period an integer sample, it is possible to make it appear as though aliasing is not present to the human ear. This method is faster to calculate than proper anti-aliasing, but has a side effect that makes higher notes to be out of tune. It also can't work well with pitch bend.

The note stealing affects rhythm. A note changes or stops only when the oscillator completes the current cycle. This jitters the rhythm especially when the tempo is fast, or the note is low.

---

GlitchSprinker のマニュアル (github.io)

GlitchSprinkler のプラグイン版を公開しました。ダウンロードは上にリンクしたマニュアルページからできます。

GlitchSprinkler は速いアルペジオに特化したシンセサイザです。 Web シンセ版とほとんど同じですが、ローパスフィルタが追加されています。音については、周期が必ず整数サンプルになることと、変なノートスティーリングによる独特の癖があります。

周期を整数サンプルにすることにより、人間の耳にはエイリアシングが聞き取れないようにごまかすことができます。この方法はまともなアンチエイリアシングに比べると計算が速いのですが、高い音程ほどピッチがずれるという副作用があります。また、ピッチベンドとの相性も悪いです。

ノートスティーリングはリズムに影響を与えています。ノートの変更や停止は、オシレーターが現在のサイクルを完了したときにのみ行われます。これにより、テンポが速い場合やノートが低い場合に特にリズムが揺れます。

2024/08/06

Dark Color Scheme for Uhhyou Web Synthesizers / Uhhyou Web Synthesizers のダークモード

Dark color scheme is added for Uhhyou Web Synthesizers.

This dark color scheme is just an invert of light color scheme. It's not 100% invert, but 87.4% (≈ 1 - (0x20 / 0xff)) to make background color to be #202020.

Currently, the color scheme only respects the setting provided by operating system. The pages are using `prefers-color-scheme`, however there's no easy way to change it within web pages. I was hoping that calling something like `window.setColorScheme("dark")` to change the color scheme, but it seems like there's no way to toggle `prefers-color-scheme` from JavaScript.

---

ダークモードを Uhhyou Web Synthesizers に追加しました。

このダークモードの配色はライトモードの単なる反転です。ただし、背景色を #202020 にするために 100% ではなく 87.4% (≈ 1 - (0x20 / 0xff)) の反転になっています。

配色は OS の設定によってのみ変更できます。 `prefers-color-scheme` を使っているのですが、このメディア特性 (media feature) をページ内から変更する方法が無いようです。今後、 `window.setColorScheme("dark")` のような形で簡単に変更できるようになって欲しいところです。


2024/07/28

sin, cos を反復的に計算するアルゴリズムのレシピ

 「sin, cos を反復的に計算するアルゴリズムのレシピ」 を読む (github.io)

Martin Vicanek による “A New Recursive Quadrature Oscillator” をもとにして sin, cos を反復的に計算するアルゴリズムの実装についてまとめました。ほとんどの用途では標準ライブラリの sin, cos で十分ですが、加算合成シンセサイザでは計算量を節約するために反復的に計算するアルゴリズムを使いたいときがあります。

画像は各アルゴリズムの周波数を変えたときの振幅の変化を示した図です。

2024/07/26

「n dB/oct のスロープを持つフィルタ」の改訂

n dB/octのスロープを持つフィルタ」の内容が怪しかった、というよりも物足りなかったので改訂しました。主な追加点は「IIR のハイシェルフフィルタを使う方法」の節で、この方法が最もまともに任意の傾きを設定できます。 以前に実装した Slope Filter では 1 次の整合ハイシェルフフィルタを使っていたのですが、バイリニア変換した 1 次ローパスにバイパスを足し合わせたハイシェルフフィルタのほうが適していたことが分かりました。 

FIR では -6 dB/oct より緩やかなスロープであればピンクノイズフィルタが使えます。 Exponential 窓による FIR フィルタは -12 dB/oct のスロープだけであれば近似できるようです。

2024/07/23

GlitchSprinkler Plugin is under Development

Plugin version of GlitchSprinkler is in progress. It will take more time for testing, making presets, and writing manual. Source code is already available on `develop` branch on the git repository. For now, It's better not to use for productions.

Original Web Synth: https://ryukau.github.io/UhhyouWebSynthesizers/GlitchSprinkler/synth.html

---

プラグイン版の GlitchSprinkler を制作中です。テスト、プリセットの作成、マニュアルの作成にまだ時間がかかります。ソースコードは GitHub リポジトリの `develop` ブランチから入手できます。互換性のない変更を加えるかもしれないので、まだ本番には使わないことをお勧めします。

元になった Web シンセ: https://ryukau.github.io/UhhyouWebSynthesizers/GlitchSprinkler/synth.html

「お手軽なFIRフィルタのレシピ」の改訂

お手軽なFIRフィルタのレシピ」の記事の内容がかなり怪しかったので改訂しました。「n dB/octのスロープを持つフィルタ」も近々改訂します。

2024/07/02

FL Studio 2024 の Spreader

I got curious about the new Spreader plugin added into FL Studio 2024, so I attempted to recreate it in Patcher. It went surprisingly well. The resulting flp was posted on Image-Line forum with a title of "Spreader recreated in Patcher" (the link requires Image-Line account).

The image is a block diagram of recreated patch that resembles Spreader.

Edit on 2024/10/03: Fixed the image to correct one. Previous image was wrong.

---

FL Studio 2024 で増えた Spreader の仕組みが気になったので Patcher で再現を試みたところ、うまくいきました。 Image-Line フォーラム (要アカウント) に "Spreader recreated in Patcher" というトピックで結果の flp を投稿しています。

画像は再現したパッチをブロック線図にしたものです。

2024/10/03 の変更: 画像を正しいブロック線図のものに修正。