aboutsummaryrefslogtreecommitdiff
path: root/wav.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-12-06 11:09:01 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-12-06 11:09:01 -0500
commit4ba3085412b0e945082c950cc25835630876b74c (patch)
treeee372f4cce83d3a649e21d32b42dd881dd63fad4 /wav.bqn
parent5bae72f11fa660a787ff24fc6cb55c83c9f1765a (diff)
Move options to a separate file so they can be shared across scripts
Diffstat (limited to 'wav.bqn')
-rw-r--r--wav.bqn12
1 files changed, 2 insertions, 10 deletions
diff --git a/wav.bqn b/wav.bqn
index 623959a..24e1a4a 100644
--- a/wav.bqn
+++ b/wav.bqn
@@ -3,16 +3,8 @@
⟨ReadWav, WriteWav, ReadWav_set, ReadWav_coerce⟩⇐
-o ← options ⇐ {
- FBytes ⇐ •FBytes
- fmt ⇐ 1‿16 # Format: 16-bit integer
- freq ⇐ 44100 # Frequency: 44.1kHz
- warn_dither ⇐ 0 # Whether to warn on non-integer signal
- warn_clip ⇐ 1 # Whether to warn on out-of-bounds signal
- Dither ⇐ ⌊ (0.5 + 0 -˝∘(•RAND∘⥊)˜ (2∾≢))⊸+
- Resample ⇐ "No resampling function specified"!0˙
- Set ⇐ {fmt‿freq↩𝕩}
-}
+"wav.bqn takes a single option namespace, or no arguments" ! 1≥≠•args
+o ← ≠◶⟨•Import∘"options.bqn", ⊑⟩ •args
# The output from ReadWav, or input to WriteWav, is either:
# - A list of: