Wax is a browser-based audio synthesis environment inspired by Max and other data-flow programming systems.
By adding devices to a virtual workspace and connecting them together, you can create custom digital signal processing algorithms.
All devices communicate to each other with audio signals, similar to a modular synthesizer.
As a supplement to the README document, this walkthrough video demonstrates how Wax works.
Wax runs entirely in the browser. When you load the web page, the virtual workspace is empty except for two speaker
devices at the bottom.
To view a list of all objects, press the "all devices" button. This will list each device along with a link to its below documentation.
In the top-left corner of the web app, there is an examples
folder containing several pre-patched system states to demonstrate how elements can be connected together. Select any element from the dropdown to load that state.
Double-click or press 'n' to open the interface for adding a device to the workspace. Then begin typing to find the object you want to add. Press enter
or click the add
button to add the device to the workspace.
For device documentation, click the i
button at the top of the device.
Creating connections between two devices will create a data flow between them at audio rate, from the output of the source device
to the input of the target device
. Device outputs are listed as buttons on the right of the device, and device inputs are listed as buttons on the left.
There are two ways to delete a connection. Double-click on a connection deletes it. Single-clicking on a connection will highlight it. Once a connection is highlighted, press delete
to delete the connection.
Click-drag on the workspace to select multiple devices at once. Selected devices have a bold, white border. Selected devices are draggable to anywhere the workspace.
When a device is selected, press delete
or click the x
button to delete the device.
Some devices have text inputs which allow the user to type in values to control the device. These text inputs accept numbers or expressions in Facet, a live coding language based in JavaScript. Press enter
to transmit the number or expression into the device, or if on a mobile device, press the regen
button.
IMPORTANT: Many parameters are available via both the text input and as an audio rate data flow connection. In this case, the signal input takes precedence, and the corresponding text input will have no effect until the signal is disconnected.
As an example, here are several useful Facet commands, which allow you add tunable randomness to device parameters:
choose()
. For example:choose([1,2,34]) // each time it's regenerated, it will choose either 1,2,3, or 4
rf()
. For example:rf(-1,1) // random float between -1 and 1
ri()
. For example:ri(10,60) // random integer between 10 and 60
Some devices have a regen
button which causes all device parameters to regenerate every time a signal connected to regen
goes above 0.5. For static numbers, this will have no effect, but if the device parameter is written as Facet code, the resulting can be different each time it's generated.
For example, if you have a number
device, and you enter ri(10,1000)
for its value
, then each time the regen
signal goes above 0.5, the output from number
will be a new, random integer between 10 and 1000. If you entered choose([2,3,4,6,8])
as its value
, then the output from number
would be either 2, 3, 4, 6, or 8.
IMPORTANT: inputs will not regenerate while the cursor is inside of it. After modifying an input, click outside of it to begin regenerating.
- create new device:
n
- duplicate selected device(s):
[command] + d
- delete selected device(s):
delete
- create number device:
f
- create comment device:
c
- create toggle device:
t
- create slider device:
s
- create button device:
b
In Wax, system states can be saved, reloaded, and shared.
Press the share URL
button to copy the system state to your clipboard as a URL. NOTE: audio files will not be included and need to be sent separately.
Press the save
button to save the system state as a zip file, including all audio files that were loaded.
Press the load
button to load a previously saved .zip file, including all audio files.
Press the Lock
button to lock all objects in place and prevent accidental dragging. You can still interact with all UI elements but cannot create and delete connections or objects. This is especially helpful when interacting with UI elements on touchscreen devices.
With devices connected to an output
objet, press the start recording
button. When you want to stop, press the stop recording button
, and enter the name for your wav file. It will then initiate an automatic download to your computer. NOTE: on mobile devices, recordings that include microphone input might sound garbled.
Computes the absolute value of the input signal.
Adds input 1
to input 2
.
Generates an attack-decay-release envelope every time trigger in
goes above 0.5.
attack (ms)
: the number of milliseconds to reach the envelope peak.decay (ms)
: the number of miliseconds to go from the envelope peak to thelevel
value.level
: the maximum value that the envelope reaches.release (ms)
: the number of milliseconds to go from thelevel
value to silence.
Applies an allpass filter to input
.
delay (ms)
controls the delay of the allpass filter.
Computes the logical AND of input 1
input 2
.
Applies a band-pass filter to input
.
cutoff
controls the center frequency of the filter.q
controls the resonance of the filter at the cutoff.
Loads an audio buffer into the workpace so it can be accessed by the pattern
object via the sample()
Facet method.
Outputs a 1 while the button is pressed and otherwise outputs 0.
Compares the current sample with the previous sample value in input
and returns 1 if the current sample value increased, -1 if it decreased, and 0 if it stayed the same. difference
outputs the difference between the current input
and the input
1 sample ago.
Clips any values in input 1
below minimum
or above maximum
to be equal to minimum
and maximum
, respectively.
Returns metronomic subdivisions of tempo (ms)
. Each outlet runs at a different, increasingly faster speed.
Applies a comb filter effect to input
. feedback
expect a range of floats 0 - 1.
Stores text in the workspace which can be saved and loaded as part of system presets.
Imparts the spectral envelope of modulator
onto carrier
.
Counts upwards from 0 to maximum
, incrementing every time trigger
goes above 0.5. hit maximum
will output a 1 while the counter is at its maximum and a 0 otherwise.
Applies a declicking algorithm to input
with user control over when to avoid clicks. From the Cyling '74 RNBO Documentation of swanramp:: "Performs click compensation using Miller Puckette's switch-and-ramp technique. When the right inlet receives a positive value, swanramp~ triggers a ramp that starts from the value of the last sample in the left inlet and goes down to zero over the number of samples specified. This ramp is mixed with the input signal to prevent clicks."
Applies a delay effect to input
, lasting delay time (ms)
and feeding back based on feedback
.
wet
controls dry/wet balance and expects a range of floats 0 - 1.
Divides input 1
and input 2
.
Downsamples input
by amount
, which expects a range of floats 0 - 1. Higher amount
values produce more downsampling.
Generates a new value in a random walk of values between 0 and maximum
, with step
being the maximum value between each step, every time trigger
goes above 0.5.
Computes the logical EQUALS of input 1
input 2
.
Applies a FFT-based bandpass filter to input
, passing only frequencies between low
and high
.
Applies a FFT-based bin threshold gate to input
, passing only FFT bin frequencies higher than threshold
. Values for threshold
are normalized and clipped between 0 and 1.
Folds any values in input 1
below minimum
or above maximum
. If the input value exceeds maximum
, the output will be the amount above subtracted from maximum
. If the input value is below minimum
, the output will be the amount below added to from minimum
.
Generates grains lasting size (ms)
from a loaded audio file, starting at the position
point, which expects a float between 0 - 1. A new grain will generate every time trigger
goes above 0.5.
Computes the boolean representation of whether input 1
is greater than input 2
.
Applies a high-pass filter to input
.
cutoff
controls the center frequency of the filter.q
controls the resonance of the filter at the cutoff.
Converts an input value in hz
to its equivalent number in milliseconds
.
Converts an input value in hz
to its equivalent number in samples
.
Returns the first two channels of the browser's default audio input device as a signal. If the microphone has one output channel, that channel will be available on output 1
.
This feature is experimental because each browser's implementation of the web audio API is different. Some combinations of browser and audio input device may not work. Before loading the page, set the default audio input device for the browser.
NOTE: if audio is muted when a microphone is added, audio will resume so that the microphone is created correctly.
Computes the boolean representation of whether input 1
is greater than input 2
.
Applies a peak-limiter to input 1
.
Applies a low-pass filter to input
.
cutoff
controls the center frequency of the filter.q
controls the resonance of the filter at the cutoff.
Mixes input 1
and input 2
together using a crossfade
parameter between 0 and 1. A crossfade
value of 0.5 will mix the signals together equally, and a crossfade
value of 0 or 1 will return only the signal at that input.
Outputs two floats between -1 and 1 corresponding to the device's orientation in space.
- The
pitch
outlet returns the device's tilt upwards or downwards: pointing straight up is 1; pointing straight down is -1; and resting flat is 0. - The
roll
outlet returns the device's rotational position around its front-to-back axis. - NOTE: this device is only available on mobile devices which report device motion data via DeviceMotionEvents.
Converts an input value in ms
to its equivalent number in hz
.
Converts an input value in ms
to its equivalent number in samples
.
Converts an input value of a MIDI note number to its corresponding frequency in hz
.
Computes the modulo operand
of input
.
Multiplies input 1
and input 2
.
Generates white noise.
Computes the logical NOT of input 1
.
Returns value
as a signal.
Computes the logical OR of input 1
input 2
.
Overdrives input
by amount
, which expects a range of floats 0 - 1. Higher amount
values produce more distortion.
Connects the audio stream to the computer's selected audio output device on channel channel
.
NOTE: if you change want to use a different audio output device, you will need to reload the page. Make sure to save your state beforehand so you can reload it.
Generates a customizable wavetable using Facet, a live coding language based in JavaScript.
phase
values between 0 and 1 select a corresponding relative position in the wavetable.- Every time the
enter
key is pressed, the pattern will reevaluate. Hold thecommand
key while pressingenter
in order to avoid creating a newline. - The
size
outlet returns a signal corresponding to the number of samples in the pattern. - NOTE: FacetPatterns must be initialized with
_
. So the allpattern
devices should have code looking like the following examples, which are all valid:_.noise(16)
_.ramp(100,30,32).key('c','minor').mtof()
_.from([20,40,40,80,80,80,80,160,160,160,160,160,160,160,160]).shuffle().palindrome()
Generates a phasor between 0 and 1, oscillating at frequency
.
Applies a time-domain frequency shift effect of shift amt
to input
. A shift amt
of 2 will be twice as high frequency.
Plays a loaded audio file at rate
every time trigger
goes above 0.5.
- The
sync
outlet signal is the current playback position normalized between 0 and 1. A nonzeroloop
input will loop file playback. - The
start pos
andend pos
values control the relative start and end point of audio file playback and expect values between 0 and 1.
Generates a synthetic string pluck at frequency
Hz using Karplus-Strong synthesis. damping
controls how long the string resonates and expects values between 0 and 1.
Displays the current value of input
every 100ms. Helpful for debugging.
Returns a random number between minimum
and maximum
, every time trigger
goes above 0.5.
Records input 1
and input 2
to a stereo audio buffer for length (ms)
milliseconds.
- A signal that rises above 0.5 in
start/stop
will start the recording, and a signal that falls below 0.5 will stop it. You can use atoggle
UI element to controlstart/stop
. - To export the last recording, send a signal that rises above 0.5 to
save
. You can use abutton
UI element to controlsave
.
Generates a rectangle wave between -1 and 1, oscillating at frequency
and with configurable pulsewidth
.
Applies a reverb effect to input
.
feedback
controls feedback of the delay lines.size
functions as a coefficient, multiplying all delay line times and expects a range of floats 0 - 1.wet
controls dry/wet balance and expects a range of floats 0 - 1.
Rotates the 4 input signals rightwards every time trigger
goes above 0.5. In other words, input 1
will cyclically move from its initial output position at output 1
, to output 2
, then output 3
, and finally output 4
before wrapping back to output 1
again.
Rounds input
to the nearest integer.
Applies a sample-and-hold effect to input
, holding its value every time trigger
goes above 0.5.
Converts an input value in samples
to its equivalent number in hz
.
Converts an input value in samples
to its equivalent number in ms
.
Generates a sawtooth wave between -1 and 1, oscillating at frequency
.
Translates input
into a different number range.
low in
is the minimum value ininput
.high in
is the maximum value ininput
.low out
is the minimum value desired in the output.high out
is the minimum value desired in the output.exponent
scales the output range according to an exponential curve and should be greater than or equal to 1.
Generates a sine wave between -1 and 1, oscillating at frequency
. The phase of the sine wave can be modified at signal-rate with phase
,which will be added to the frequency
parameter.
Decides whether to pass or mute input
every time input
goes above 0.1, based on prob
.
Outputs a float between 0 and 1. Move the slider to change the offset.
Smooths input
by ramping from its previous value to its new value, ramping up over up (ms)
and down over down (ms)
. exponent
controls the contour of the ramp: at 0, the ramp moves linearly to the new value, and at 1, the ramp moves logarithmically.
Slows input
down so it only changes once for every interval (ms)
that passes.
Computes the square root of input 1
.
Subtracts input 2
from input 1
.
Outputs a 0 when the button is off
and outputs a 1 when the button is on
. Click the button to switch states.
Outputs two floats between 0 and 1, corresponding to the selected x/y position in a 2D touchpad.
Generates a triangle wave between -1 and 1, oscillating at frequency
and with configurable pulsewidth
. The phase of the triangle wave can be modified at signal-rate with phase
,which will be added to the frequency
parameter.
Reads through a loaded audio file like a wavetable, with phase
values between 0 and 1 selecting a corresponding relative position in the audio file.
Wraps any values in input 1
below minimum
or above maximum
. If the input value exceeds maximum
, the output will be the amount exceeded plus minimum
. If the input value is below minimum
, the output will be the amount below subtracted from maximum
.
- The
size
outlet returns a signal corresponding to the number of samples in the pattern.