aboutsummaryrefslogtreecommitdiff
path: root/oscillator.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-12-24 15:25:07 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-12-24 15:25:07 -0500
commit6f820410ef80dc2b92931fcfd094c1b67d7d8764 (patch)
treeb20e7a8e741dc2ab50667f7c32ce52fe58c075eb /oscillator.bqn
parent6030727888ff897a4963138e8ae02717e799eab5 (diff)
Return the exact length from Pluck instead of rounding upHEADmaster
Diffstat (limited to 'oscillator.bqn')
-rw-r--r--oscillator.bqn2
1 files changed, 1 insertions, 1 deletions
diff --git a/oscillator.bqn b/oscillator.bqn
index e918072..b6a47df 100644
--- a/oscillator.bqn
+++ b/oscillator.bqn
@@ -32,5 +32,5 @@ Pink ⇐ {÷⟜(⌈´|) +` 𝕩 ↑ ⥊∘⍉∘≍´⌽ -⟜«∘Rand¨ (1⌈
# Karplus-Stong algorithm for a plucked string
Pluck ⇐ { 𝕊 f‿len‿att: # Frequency, length, attenuation
p ← ⌊o.freq÷f
- ∾ ((÷2×16⋆att÷p)×1⊸⌽⊸+)⍟(↕⌈len÷p) Pink p⥊0
+ len ↑ ∾ ((÷2×16⋆att÷p)×1⊸⌽⊸+)⍟(↕⌈len÷p) Pink p⥊0
}