# Harmonic Protocols
A fork of Harmonic Protocol with a matrix mixer. To recreate a Harmonic Protocol drone, set the mixer to an offset diagonal line.
# 1 Listen
The Harmonic Protocols live interface lets you choose from 5 tunings, and design a custom tone control matrix.
Audio is generated live in your browser. Plays automatically in Firefox, interact to start playback in other browsers. Starts quiet.
Hold button down above a black nib to increase gain, hold button down below a black nib to decrease gain. Red squares show current audio levels. Try increasing the gain of nibs with large red squares on the sides. Audio flows from the sides through the matrix towards the top and bottom.
# 1.1 Note
Playback may struggle on low-power machines like mobile phone or Raspberry Pi. Tunings with fewer tones need less CPU power. The sound should be a smooth drone without rhythmic clicks (stuttering clicks are a sign of processor overload).
# 2 Process
Stereo feedback loop 1/9 second long, with left and right blended with a rotation matrix (angle 2PI/12).
Inside the loop, compute RMS level per EDO (Equal Division of the Octave) step per channel via a bank of biquad bandpass filters over 4 octaves upwards from MIDI note 24, accumulated modulo octaves. Low pass filter for the RMS at 9/32 Hz.
Amplify each individual EDO step by a matrix multiplication of the accumulated energy vector. Distort each band using a rational approximation to tanh(). Apply strong dynamic range compression to the stereo mix to normalize peak levels to ~±1.
# 3 Source
# 3.1 Desktop Version
Requires SDL2 and libsndfile.
git clone https://code.mathr.co.uk/dr1.git && cd dr1/harmonic-protocols && make
# 3.2 Web Version
git clone https://code.mathr.co.uk/dr1.git && cd dr1/harmonic-protocols && make harmonic-protocols.html && mv harmonic-protocols.js* harmonic-protocols.wasm* live/
Live folder should be server over HTTP(S) to work properly, file:// URLs may not work.
To comply with the AGPLv3+ license you must make the corresponding source code available.