diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-02-18 21:39:57 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-02-18 21:50:25 -0500 |
| commit | 5643af00cc8922d94b91b53b37ba4a42eaa0d07c (patch) | |
| tree | 06a110ddf8e5ad915d9f2aee33f3a929e847f0c0 | |
| parent | fc71ae905f997d5650ece1be804f8f3ba13f718b (diff) | |
Clipping functionality
| -rw-r--r-- | mix.bqn | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -24,6 +24,14 @@ Stereo β βΛβ(2>=) # Pan signal π© to position π¨, where 0 is hard left and 1 is hard right Pan β (25ββΓββΒ¬ββ£) β₯β0βΈΒ»Λ ((=βΛβ2)-Β·(ΓΓβ0βΈβ)Β·ββ-1-Λ2Γβ£)βΈ(+ΛβΓβΒ―1βΏβ)βStereo +# Clipping functions clip to [Β―1,1] by default +# _norm changes this to match the format if it's an integer format +_norm β { (π¨π½β’)βΎ(Γ·β(2β1-ΛΒ―1βo.fmt)) π© } +# Clip signal π© to the maximum possible range. +Clip β 1βΒ―1ββ’ +# π¨ is an integer giving "sharpness". Perform a soft clip. +Softclip β { Γ·β(1βΈ+βΎ(ββ(2βπ¨β£3))) π© } + # Multiply leading or trailing samples of π© by π¨. FadefrontβΏFadeback β {πf: {π¨βΈΓβΎ((Fβ π¨)ββ’)π©}β1 }Β¨ β’βΏ- |
