pinout-wave: wave pinout-freq: freq
osc: Oscillator [t wave|freq] [b out]
merge: ChannelMerger [t l|r] [b out]
pinout-out: out
pinout-wave - osc:wave pinout-freq - osc:freq osc:out - merge:l pinout-out - merge:out

Preface

To hear is not to listen

The human`s hearing|> has a remarkable low perception latency|>, considering the senses|> of skin|>, mouth|>, nose|>, eye|>, and ear|>.

Both ears are connected to the "thumb-sized" brainstem|> near between them, with only a few centimeters of vestibulocochlear nerve|> [what a word!].

  1. Distance between both eardrums|>: about 14cm
  2. Outer head distance: about 17.5-20cm
  3. Maximal interaural time difference|>: about 0.63ms, this is with the speed of sound|> 343m/s * 0.63ms ~ 21.6cm.
  4. The time discrimination|>Hearing#Time_discrimination is better than the upper limit of the heard frequencies suggests: 10µs ≙ 100kHz.
  5. The human hearing range|> is commonly given as 20Hz to 20kHz. But: young people typically can hear grasshoppers|>, Bats|> and even dog whistles|>, the older rather not.

Sound localization|> is very precise and fast. The reaction time ear to skeletal muscle|> is mainly limited by the nerve conduction velocity|>: 50-60m/s brain to muscle, 33-120m/s muscle to brain for e.g. tension feedback.

Modular Audio Synthesizer Construction Set

Using: Web Audio API, JS Module /e/appetizer.js

This is a JavaScript|> digital breadboard|>, coming with a set of primary modules, to build modular synthesizers|> from JSON|>-style descriptions or even a set of schematic diagrams|> the sketch-board-style.

The primary modules create or modify digital signals|>, typically represented in single-precision floating-point format|> (32bit) at 48kHz in continuous blocks of 128 samples|>Sampling (signal processing).

  1. create: waves from sine to sample play and envelopes
  2. modify: gain, delay, biquad filters|>Electronic_filter_topology#Biquad_filter_topology, convolution|>, dynamics processing, wave shaping

About

Using the common browser standards

Notes on the Web Audio API|m>Web/API/Web_Audio_API, the Web MIDI API|m>Web/API/Web_MIDI_API and the Media Capture and Streams API|m>Web/API/MediaDevices/enumerateDevices:

  1. An AudioNode|m>Web/API/AudioNode is tied to the AudioContext|m>Web/API/BaseAudioContext constructed with, which is currently not available in Web Workers|m>Web/API/Web_Workers_API.
  2. The only way to create a custom AudioNode or AudioParam|m>Web/API/AudioParam is a AudioWorkletNode|m>Web/API/AudioWorkletNode: awn:AudioWorkletNode [t inputs|parameters][b outputs]

    +AudioWorkletNode()|m>Web/API/AudioWorkletNode/AudioWorkletNode

    awp:AudioWorkletProcessor

    +process(inputs|m>Web/API/AudioWorkletProcessor/process#inputs,
    outputs|m>Web/API/AudioWorkletProcessor/process#outputs,
    parameters|m>Web/API/AudioWorkletProcessor/process#parameters_2)
    |m>Web/API/AudioWorkletProcessor/process

      // Load WorkletProcessor code from separate file:
      await audioContext.audioWorklet.addModule("some-processor.js");
      // The WorkletModule registers at least one processor:
      registerProcessor(name, processorCtor)
  3. An "a-rate" AudioParam value is calculated for each sample, while a "k-rate" is calculated for sample blocks, currently fixed to 128 samples. With 48000Hz sampling rate this a 375Hz block rate.
  4. The standard audio nodes don`t offer a parameter description, e.g. "a-rate" or "k-rate".
  5. OscillatorNode|m>Web/API/OscillatorNode, GainNode|m>Web/API/GainNode and DelayNode|m>Web/API/DelayNode have "a-rate" parameters.
  6. AudioBufferSourceNode|m>Web/API/AudioBufferSourceNode or DynamicsCompressorNode|m>Web/API/DynamicsCompressorNode have "k-rate" parameters.
  7. currentTime|m>Web/API/BaseAudioContext/currentTime unprecise because of security.
  8. Cannot restart an AudioBufferSourceNode|m>Web/API/AudioBufferSourceNode or OscillatorNode|m>Web/API/OscillatorNode.
  9. AudioParam to audio signal: ConstantSourceNode|m>Web/API/Web_Audio_API/Controlling_multiple_parameters_with_ConstantSourceNode
  10. Audio nodes can have multiple inputs and outputs with different channel configurations. Standard nodes have none or one input and none or one output, except the ChannelSplitterNode|m>Web/API/ChannelSplitterNode and ChannelMergerNode|m>Web/API/ChannelMergerNode.

TODO

  1. default parameters
  2. audio input
  3. restartable Oscillator / SampleNode
  4. OT: toggle button (checkbox replacement)
  5. better value inputs