Mx.Instrument.Vocabulary (mx v0.1.0)

Copy Markdown View Source

The nodes and functions a defsynth builds its sound from, named by what they do, with each argument named by its unit.

Numbers: hz/1, db/1, log2/1, exp/1, sin/1, cos/1, clamp/3 and select/3, worked out at once on numbers and when the note starts on its options. Sources: impulse/0, follow/1, time/0, sine/1, vibrato/1, partials/2, bowed_string/1, air_jet/1, saw/1, square/1, triangle/1, pulse/1 and noise/1. Filters: lowpass/2, highpass/2 and bandpass/2, at hz: with q: and poles:, lowshelf/2, highshelf/2 and peak/2, at hz: with q: and db:, mode/2, a resonator struck by its input at hz:, ringing at level: and fading 60 dB over fade: seconds, wind_bands/2, delay/2, and dc_block/1. Shapes: envelope/1 and perc/1 are levels over time, and envelope/2 and perc/2 scale a sound by them. Mixing: mix/1 adds a list of sounds, and gain/2 scales one. A synth ends with note_envelope/2, shaping its sound by the note's envelope, or rings/2, ending it after seconds:.

Summary

Functions

A flute's air jet at the pitch hz:, blown at the pressure breath:, its sound taking even: of its square for the even harmonics. wander: drifts the breath as a note holds, catch: lets it fall at a slur, corner: is the bore's corner in Hz, tuned: the breath at which the jet is in tune, and lift: makes high notes louder; each is 0 unless given. sound: and side: are functions of the jet's sound and of the side of the edge it flows to, from 0 to 1, and the jet plays what they give added together.

A bowed string at the MIDI note:, bowed at speed: and force:, reached over takes: seconds, at position: along it from the bridge, its speed swayed by rosin: times pink noise.

value, held between low and high.

The gain of a level in decibels.

A sound with any constant offset taken out.

A sound delayed by seconds:, which may change as it plays, up to max:.

Segments from silence through each point, {seconds, level} straight, {seconds, level, curve} bent, or {seconds, level, :exp} exponential.

A sound scaled by the level envelope/1 gives for points.

One of the note's options as a sound, gliding to each new value the song gives over the option's _slide seconds.

A sound scaled by a level.

The frequency of a MIDI note.

A single sample at the start of the note.

Sounds added together.

Noise, :white or :pink.

A sound shaped by the note's envelope, from the options envelope_attrs/1 declares.

Harmonics of the pitch hz at each of ratios:, with their levels: and starting phases: in radians; a level of 0 leaves its harmonic out.

A quick rise over attack: and a fall to silence over release:.

A sound scaled by the level perc/1 gives for opts.

A sound that rings until it fades by itself, ending after seconds:.

then where condition holds, and otherwise elsewhere.

The seconds since the note started.

A vibrato's swing depth: deep at hz:, growing in from a quarter second after the note starts over 1.2 more, its depth drifting by about a third and its rate wandering about 6 percent, as a player's do.

A wind's sound through peaks at mx's eight bands up to 3162 Hz, gains: eight in dB at each of pp, mf and ff, and levels: in dB at each, following vel:.

Functions

air_jet(opts)

A flute's air jet at the pitch hz:, blown at the pressure breath:, its sound taking even: of its square for the even harmonics. wander: drifts the breath as a note holds, catch: lets it fall at a slur, corner: is the bore's corner in Hz, tuned: the breath at which the jet is in tune, and lift: makes high notes louder; each is 0 unless given. sound: and side: are functions of the jet's sound and of the side of the edge it flows to, from 0 to 1, and the jet plays what they give added together.

bowed_string(opts)

A bowed string at the MIDI note:, bowed at speed: and force:, reached over takes: seconds, at position: along it from the bridge, its speed swayed by rosin: times pink noise.

clamp(value, low, high)

value, held between low and high.

db(decibels)

The gain of a level in decibels.

dc_block(sound)

A sound with any constant offset taken out.

delay(sound, opts)

A sound delayed by seconds:, which may change as it plays, up to max:.

envelope(points)

Segments from silence through each point, {seconds, level} straight, {seconds, level, curve} bent, or {seconds, level, :exp} exponential.

envelope(sound, points)

A sound scaled by the level envelope/1 gives for points.

follow(option)

One of the note's options as a sound, gliding to each new value the song gives over the option's _slide seconds.

gain(sound, level)

A sound scaled by a level.

hz(note)

The frequency of a MIDI note.

impulse()

A single sample at the start of the note.

mix(sounds)

Sounds added together.

noise(colour)

Noise, :white or :pink.

note_envelope(sound, note)

A sound shaped by the note's envelope, from the options envelope_attrs/1 declares.

partials(hz, opts)

Harmonics of the pitch hz at each of ratios:, with their levels: and starting phases: in radians; a level of 0 leaves its harmonic out.

perc(opts)

A quick rise over attack: and a fall to silence over release:.

perc(sound, opts)

A sound scaled by the level perc/1 gives for opts.

rings(sound, opts)

A sound that rings until it fades by itself, ending after seconds:.

select(condition, then, otherwise)

then where condition holds, and otherwise elsewhere.

time()

The seconds since the note started.

vibrato(opts)

A vibrato's swing depth: deep at hz:, growing in from a quarter second after the note starts over 1.2 more, its depth drifting by about a third and its rate wandering about 6 percent, as a player's do.

wind_bands(sound, opts)

A wind's sound through peaks at mx's eight bands up to 3162 Hz, gains: eight in dB at each of pp, mf and ff, and levels: in dB at each, following vel:.