aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-02-05 20:21:41 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-02-06 08:04:46 -0500
commitd59799a44faa0154307d2e2c033d6908adf7cd65 (patch)
treedc6397b612f0736bab7d40c5932dde654cb47c4e
parent1d7ee204132258c2cc8d614b53bc68ab1cd07095 (diff)
Use ⋈ instead of ≍○<
-rw-r--r--filter.bqn16
-rw-r--r--mix.bqn6
-rw-r--r--panap.bqn4
-rw-r--r--wav.bqn8
4 files changed, 17 insertions, 17 deletions
diff --git a/filter.bqn b/filter.bqn
index 9c65071..d57e651 100644
--- a/filter.bqn
+++ b/filter.bqn
@@ -59,14 +59,14 @@ Filter ← {
_f ← { !∘0⊘(𝔽⊸Filter) }
# Compute the frequency response from coefficients
-#Response ← ≍○<⟜(1∾-)○⌽´ ⊸ ((|·÷´{+⟜(𝕩⊸×)´𝕨}¨)⎉∞‿0) ⟜ (⋆0i1×Om)
+#Response ← ⋈⟜(1∾-)○⌽´ ⊸ ((|·÷´{+⟜(𝕩⊸×)´𝕨}¨)⎉∞‿0) ⟜ (⋆0i1×Om)
Om ← (2×π)×{𝕩÷o.freq}
Tom ← Tan Om÷2˙
# 1-pole low-pass and high-pass filters
-Lp1 ← (⥊¨ ·≍⟜¬ 1+⌾÷Om) _f
-Hp1 ← ((-⊸≍ ≍○< ⥊) 1÷∘+Om) _f
+Lp1 ← (⋈¨ ·⋈⟜¬ 1+⌾÷Om) _f
+Hp1 ← ((-⊸⋈ ⋈ ⋈) 1÷∘+Om) _f
# 2-pole *-pass
f2types ← "bw"‿"cd"‿"bessel"
@@ -78,7 +78,7 @@ Filter2 ← { type‿nPasses‿isHighpass:
Clp2 ← {
e ← ¯1 ⊑ a ← 𝕨 × ≍⟜(ט) Tom 𝕩
b ← (1‿2‿1 ∾˜ 2×1-˜÷e) × e ÷ 1++´a
- ¯3 (↑ ≍○< ↓) (1-+´)⊸∾ b
+ ¯3 (↑⋈↓) (1-+´)⊸∾ b
}
(isHighpass ⊑ ⟨
x Clp2 ÷⟜c
@@ -91,7 +91,7 @@ Filter2 ← { type‿nPasses‿isHighpass:
# Once more, with resonance
# Lp2q and Hp2q are identical to Lp2 and Hp2 when Q=÷√2
Resfilt ← {
- Om⊸(Sin⊸÷⟜(2⊸×) (+⟜1 ÷˜ 𝕏 ≍○< -⟜1≍2⊸×) Cos∘⊣)´ _f
+ Om⊸(Sin⊸÷⟜(2⊸×) (+⟜1 ÷˜ 𝕏 ⋈ -⟜1≍2⊸×) Cos∘⊣)´ _f
}
Lp2q‿Hp2q‿Bp2q ← Resfilt¨ ⟨ 1⊸-÷2‿1‿2˙ , 1⊸+÷2‿¯1‿2˙ , ×⟜1‿0‿¯1 ⟩
@@ -99,7 +99,7 @@ Lp2q‿Hp2q‿Bp2q ← Resfilt¨ ⟨ 1⊸-÷2‿1‿2˙ , 1⊸+÷2‿¯1‿2˙ ,
Peak ← { g‿f‿q:
k ← Tom f
ab ← 1‿4‿0‿2‿3‿0 ⊏ +⟜(k⊸×)´¨ ¯2‿0‿2 <⊸∾ {1‿𝕩‿1}¨ ⥊≍⟜- q ÷˜ 10⋆0⌈-⊸≍g÷20
- 3 (↑ ≍○< -∘↓) (1⊸↓ ÷ ⊑) ab
+ 3 (↑ ⋈ -∘↓) (1⊸↓ ÷ ⊑) ab
} _f
# Q to bandwidth and vice-versa for peaking filters
NtoQ ← {𝕊𝕩: (√÷-⟜1)𝕩 ; 𝕊⁼𝕩: -⟜1⌾(ט)⊸+ 1+÷2×ט𝕩} 2⊸⋆
@@ -111,7 +111,7 @@ Shelf ← {
k ← Tom f
v1 ← 10 ⋆ t × 0⌈-⊸≍g÷40
ab ← ⥊ 1‿0‿2⊸⊏˘ (ט1⌊v1) ÷˜ (k×v1) {+⟜(𝕨⊸×)´𝕩}⌜ ¯2‿0‿2 <⊸∾ {1‿𝕩‿1}¨ ≍⟜- q
- 2 (↓ ≍○<○⌽ -∘↑) (1⊸↓ ÷ ⊑) ab
+ 2 (↓ ⋈○⌽ -∘↑) (1⊸↓ ÷ ⊑) ab
} _f
# Shortcuts for low- and high-shelf
LShelf ← 1⊸∾⊸Shelf
@@ -124,4 +124,4 @@ Notch ← {
⟨1,-c,1⟩‿⟨t-1,c⟩ ÷ 1+t
} _f
-AllPass ← (≍○<⟜(-∘⌽1⊸↓) ⟨1,¯2×⊑,+´×˜⟩{𝕎𝕩}¨<) _f
+AllPass ← (⋈⟜(-∘⌽1⊸↓) ⟨1,¯2×⊑,+´×˜⟩{𝕎𝕩}¨<) _f
diff --git a/mix.bqn b/mix.bqn
index 5f86513..d149a01 100644
--- a/mix.bqn
+++ b/mix.bqn
@@ -8,7 +8,7 @@ I ⇐ <⟜0 ⌽∘⊢⍟⊣ ↕⊸÷∘|
# Add two signals 𝕨 and 𝕩 or a list of signals 𝕩,
# extending to the length of the longest signal.
-Add ⇐ +´ ·(⌈´(¯1⊑≢)¨)⊸(↑⎉1¨) ⊢⊘(≍○<)
+Add ⇐ +´ ·(⌈´(¯1⊑≢)¨)⊸(↑⎉1¨) ⊢⊘⋈
# Like add, but concatenate instead (no extension).
Concat ⇐ (∾ (0⥊˜·⌈´=¨)⊸(<∘⊣↓¨↓)) ⊘ (∾⎉1)
# Like ⌽⎉1, but the end of the signal does not wrap around.
@@ -38,7 +38,7 @@ Fadefront‿Fadeback ⇐ {𝕊f: {𝕨⊸×⌾((F≠𝕨)↑⊢)𝕩}⎉1 }¨
# 𝕗 is the overlap amount. Fade 𝕨 into 𝕩, linearly.
_crossfade ⇐ {
- G←↑≍○<↓
+ G←↑⋈↓
(-𝕗)⊸G⊸(∾ 1⌽∾˜○(1⊸↓) ∾⟜< (¬⊸≍I𝕗)+˝∘×≍○⊑)⟜(𝕗⊸G)⎉1
}
@@ -57,6 +57,6 @@ Reverb ⇐ {
k0← ⌈⌾(÷⟜l) k # Rounded up
𝕨 {
CW ← ⊏ · (FFT n↑𝕨)⊸M⌾FFT n⊸↑
- {t←0 ⋄ k↑⥊ {r‿s←(-o)(t⊸+⌾(o⊸↑)∘↓≍○<↑)CW𝕩⋄t↩s⋄r}˘ ∘‿l⥊k0↑𝕩}⎉1 𝕩
+ {t←0 ⋄ k↑⥊ {r‿s←(-o)(t⊸+⌾(o⊸↑)∘↓⋈↑)CW𝕩⋄t↩s⋄r}˘ ∘‿l⥊k0↑𝕩}⎉1 𝕩
}⎉(1≍1+0⌈-˜○=) 𝕩
}
diff --git a/panap.bqn b/panap.bqn
index 313ff72..33bd5a5 100644
--- a/panap.bqn
+++ b/panap.bqn
@@ -116,8 +116,8 @@ Get_panap_coeff ← { 𝕊 n‿rr‿f:
sv ← (ט ÷ (4×q) + ×⟜((3-r)+2×re)) 1+r-2×re
- GetZ ← ⊢ ≍ √∘-⟜(ט) # 𝕩 is real part and 𝕨 is square magnitude
- (GetZ○⊑ ≍○< GetZ○(⊑+sv×+´))´ ⟨r‿¯1,re‿1⟩
+ GetZ ← ⊢ ⋈ √∘-⟜(ט) # 𝕩 is real part and 𝕨 is square magnitude
+ (GetZ○⊑ ⋈ GetZ○(⊑+sv×+´))´ ⟨r‿¯1,re‿1⟩
}
# ---------------------------------------------------------
diff --git a/wav.bqn b/wav.bqn
index 3f38a78..729cdde 100644
--- a/wav.bqn
+++ b/wav.bqn
@@ -83,7 +83,7 @@ _audioConvert ← {
maxval←(1-2⋆-m+1)×2⋆(2⋆e)-b+1
{
𝕩 ×↩ 2⋆-m
- p‿s ← (2⋆e) (| ≍○< ⌊∘÷˜) ⌊𝕩
+ p‿s ← (2⋆e) (| ⋈ ⌊∘÷˜) ⌊𝕩
p +↩ ¬n←0<p
(¯1⋆s)×(2⋆p-b) × n+1|𝕩
}_withInv_{
@@ -126,7 +126,7 @@ Decode ← {
# Integer from little-endian unsigned bytes
ToInt ← 256⊸×⊸+˜´ -⟜@
- hdr‿dat ← wh.len +´⊸(↑ ≍○< ↓) 𝕩
+ hdr‿dat ← wh.len +´⊸(↑⋈↓) 𝕩
# Assign field values to field names.
hdr ↩ ('i'=wh.typ) ToInt∘⊢⍟⊣¨ wh.len /⊸⊔ hdr
@@ -135,7 +135,7 @@ Decode ← {
"subchunk1Size is invalid" ! ⊑ 0‿2‿24 ∊˜ se←subchunk1Size-16
If (se>0)‿{𝕤
! se = 2 + ToInt 2↑subchunk2ID
- ext←@ ⋄ ext‿dat ↩ se (↑ ≍○< ↓) dat
+ ext←@ ⋄ ext‿dat ↩ se (↑⋈↓) dat
If (se>2)‿{𝕤
If (audioFormat = 65534)‿{𝕤⋄ audioFormat ↩ ToInt 4↑ext }
}
@@ -143,7 +143,7 @@ Decode ← {
# Ignore remaining subchunks
s ← subchunk2Size
While {𝕤⋄"data"≢subchunk2ID}‿{𝕤
- subchunk2ID‿s‿dat ↩ (4⊸↑ ≍○< ToInt∘((4+↕4)⊸⊏) ≍○< 8⊸↓) s ↓ dat
+ subchunk2ID‿s‿dat ↩ (4⊸↑ ⋈ ToInt∘((4+↕4)⊸⊏) ⋈ 8⊸↓) s ↓ dat
subchunk2Size +↩ s+8
}
# Check that fields match their definitions