From 6f820410ef80dc2b92931fcfd094c1b67d7d8764 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 24 Dec 2022 15:25:07 -0500 Subject: Return the exact length from Pluck instead of rounding up --- oscillator.bqn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } -- cgit v1.2.3