API Reference TuningFork v#0.1.0

Copy Markdown View Source

Modules

Sound synthesised on the BEAM: play a TuningFork.Voice on a TuningFork.Stage.

Keeps rendered audio on disk, keyed by name and fingerprint.

Chord names to the MIDI notes that play them.

A multiplier that moves over the length of a note, as {progress, value} breakpoints.

An attack-decay-sustain-release shape in seconds, sampled by time.

A resonant filter, cut off at a frequency in hertz.

Reads FLAC into 16-bit PCM.

Effects applied to a whole buffer of rendered audio.

Effects on a stream, a block at a time, carrying their state between blocks.

Voices for General MIDI's instrument and drum numbers.

The soundfont files Strudel plays each gm_* name from, in the order n picks them.

Strudel's gm_* instrument names and the General MIDI programs they stand for.

Names to voices: voice/2 turns a drum name, a note name, a MIDI number, hertz or a map of controls into a TuningFork.Voice.

Reads a Standard MIDI File, and turns one into a TuningFork.Score.

Sums signed 16-bit little-endian PCM buffers, clipping at full scale, and pans mono sound.

Pitches, scales and chords by note name, such as :a4, :fs3 or :eb5.

Open Sound Control messages, as the bytes that go over the wire.

A UDP socket for sending TuningFork.Osc messages, and reading them back.

Plays a TuningFork.Score out over OSC, in time.

One line of music, written by moving a cursor measured in beats.

Reads a block of loop source into a score.

Patterns of events over cycles, queried by span.

Patterns of control maps, built as a chain of setters that TuningFork.Kit turns into voices.

Mini-notation strings parsed into a TuningFork.Pattern.

Walks a pattern in time, rendering the events that come due to PCM block by block.

Turns a typed line of mini-notation or Elixir into a pattern.

Chord symbols to voicings, as Strudel renders them.

The ireal and ireal-ext chord voicing dictionaries: chord symbol to voicings as interval names.

Repeatable randomness from a generator value that every function returns alongside its result.

A reverb whose state carries between calls: Freeverb, eight comb filters into four allpasses on each channel.

A list read round and round, so any integer index is in it.

Recorded audio, to be played as a TuningFork.Voice.

Recordings by name, for TuningFork.Kit to find.

Turns a recording in a format this library does not read itself (MP3, OGG, AAC and the rest) into a WAV, through a converter found on the machine.

Downloads a file once into the cache directory and gives its local path.

Soundfont instruments as Strudel plays them: one file per instrument, a zone per key range, each zone a recording with its root pitch and loop.

A set of named recordings described by a strudel.json, registered with TuningFork.Sample.Bank.

Named scales, and the MIDI notes their degrees stand for.

Notes on a beat grid with a tempo map, rendered to one buffer that loops without a break.

Rows of live-coded source, and the one pattern they add up to.

What a live-coding front end draws for a session row, as numbers rather than pictures.

The behaviour of an output for mixed samples: opened once, written to in chunks, closed.

A sink that keeps everything written in a caller-owned process, for recording a stage.

A sink that sends everything written to a process as {:pcm, binary}.

A sink that plays through a PulseAudio or PipeWire server by piping PCM into pacat.

A sink that discards everything written to it.

Sonic Pi's vocabulary: play, sleep, sample, live_loop, with_fx and the rest.

The words of TuningFork.SonicPi that take a block, as functions taking a fn.

What TuningFork.SonicPi.run/1 reads out of a buffer of source.

The TuningFork.SonicPi.Thread the calling process is running.

Sonic Pi's effects as the TuningFork.Fx effects that play them.

A sounding note or an open effect, for TuningFork.SonicPi.control/2.

Notes, chords and scales by Sonic Pi's names, as MIDI numbers.

What one Sonic Pi thread carries while its code runs, and the score it played.

Evaluating typed source without diagnostics on standard error, and trimming error messages.

A process that mixes sounding voices, loops, patterns and scores into one stream and writes it to a TuningFork.Sink.

The looping layers under a TuningFork.Stage: named PCM buffers read from one playhead, each at its own gain, replaceable at a bar boundary with a cross-fade.

Values one loop leaves for another, read as they stood at the reader's own time.

The ETS tables holding TuningFork.Tick counters and time-stamped TuningFork.State values.

Reads a Strudel piece — the JavaScript as written at strudel.cc — into the pattern chains this library plays.

Counters that step once each time a loop comes round.

Walks a score in time, a block at a time, handing out the notes that have come due.

One sound described as a waveform, pitch, envelope and filter, rendered to 16-bit PCM.

A voice rendered block by block, changeable between blocks.

16-bit little-endian PCM wrapped in a WAV header, and read back out of one.

Oscillators, as functions from phase (0.0 to 1.0 over one cycle) to amplitude (-1.0 to 1.0).

Mix Tasks

Render a MIDI file to a WAV. No audio device is opened.