blob: 079c4ffbb0d61141a4d5c2296cfa806dce3e67db (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
FBytes ⇐ •FBytes
fmt ⇐ 1‿16 # Format: 16-bit integer
freq ⇐ 44100 # Frequency: 44.1kHz
Set ⇐ {fmt‿freq↩𝕩}
SetFBytes ⇐ {FBytes↩𝕏}
SetFreq ⇐ {freq↩𝕩}
# For generating random waveforms; result is a shape 𝕩 array of uniform
# random numbers between 0 and 1
RandFloats ⇐ •rand.Range⟜0
# For reading/writing wave files
warn_dither ⇐ 0 # Whether to warn on non-integer signal
warn_clip ⇐ 1 # Whether to warn on out-of-bounds signal
Dither ⇐ ⌊ (-˝ ·RandFloats 2∾≢)⊸+
Resample ⇐ "No resampling function specified"!0˙
|