aboutsummaryrefslogtreecommitdiff
path: root/mix.bqn
diff options
context:
space:
mode:
Diffstat (limited to 'mix.bqn')
-rw-r--r--mix.bqn8
1 files changed, 8 insertions, 0 deletions
diff --git a/mix.bqn b/mix.bqn
index 1ad248f..21172c0 100644
--- a/mix.bqn
+++ b/mix.bqn
@@ -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 }Β¨ βŠ’β€Ώ-