synth4

a text based audio-visual modular-synthesizer

download v0.6.1.a86df1 (requires osx 14.4) (6/6/2024)

simple video demonstration

usage

the program is essentially a text editor with some additional modes

keyboard shortcuts for text navigation

the following txt file is an annotated script file that explains the basics. the program supports drag and drop, so just drag the txt file into the window and it should start playing

example_scene.txt

unordered roadmap

script functions

operator overlaods exist for the add,sub,mul,div functions that take two parameters

ANYTHING import(STRING name) VOID export(FLOAT value) VOID export(STRING name, FLOAT value) VOID export(FLOAT_ARRAY value) VOID export(STRING name, FLOAT_ARRAY value) VOID export(INTEGER value) VOID export(STRING name, INTEGER value) FLOAT_ARRAY adsr(NUMBER|FLOAT_ARRAY attack time, NUMBER|FLOAT_ARRAY decay time, NUMBER|FLOAT_ARRAY sustain level, NUMBER|FLOAT_ARRAY release time, FLOAT_ARRAY signals) STRING euc(NUMBER k, NUMBER n) STRING euc(NUMBER k, NUMBER n, NUMBER shift) FLOAT lfo(STRING lfo_type, NUMBER frequency) FLOAT lfo(STRING lfo_type, NUMBER frequency, NUMBER amplitude) FLOAT lfo(STRING lfo_type, NUMBER frequency, NUMBER amplitude, NUMBER phase_offset) FLOAT_ARRAY lfo_a(STRING lfo_type, NUMBER frequency, NUMBER amplitude) FLOAT_ARRAY lfo_a(STRING lfo_type, NUMBER frequency, NUMBER amplitude, NUMBER phase_offset) FLOAT_ARRAY osc(STRING wave_table, NUMBER|FLOAT_ARRAY frequency, NUMBER|FLOAT_ARRAY amplitude) FLOAT_ARRAY osc(FLOAT_ARRAY wave_table, NUMBER|FLOAT_ARRAY frequency, NUMBER|FLOAT_ARRAY amplitude) FLOAT_ARRAY seq(NUMBER bpm, STRING pattern) FLOAT_ARRAY white_noise() FLOAT_ARRAY lowpass(FLOAT_ARRAY signal, NUMBER cutoff frequency) FLOAT_ARRAY highpass(FLOAT_ARRAY signal, NUMBER cutoff frequency) FLOAT_ARRAY bandpass(FLOAT_ARRAY signal, NUMBER min cutoff frequency, NUMBER max cutoff frequency) FLOAT_ARRAY bandstop(FLOAT_ARRAY signal, NUMBER min cutoff frequency, NUMBER max cutoff frequency) INTEGER add(INTEGER a, INTEGER b) FLOAT add(FLOAT a, FLOAT b) FLOAT add(FLOAT a, INTEGER b) FLOAT add(INTEGER a, FLOAT b) FLOAT_ARRAY add(FLOAT_ARRAY a, FLOAT_ARRAY b) FLOAT_ARRAY add(FLOAT a, FLOAT_ARRAY b) FLOAT_ARRAY add(FLOAT_ARRAY a, FLOAT b) FLOAT_ARRAY add(INTEGER a, FLOAT_ARRAY b) FLOAT_ARRAY add(FLOAT_ARRAY a, INTEGER b) SHAPE add(SHAPE shape a, SHAPE shape b) SHAPE add(SHAPE shape a, SHAPE shape b, NUMBER blend) INTEGER sub(INTEGER a, INTEGER b) FLOAT sub(FLOAT a, FLOAT b) FLOAT sub(FLOAT a, INTEGER b) FLOAT sub(INTEGER a, FLOAT b) FLOAT_ARRAY sub(FLOAT_ARRAY a, FLOAT_ARRAY b) FLOAT_ARRAY sub(FLOAT a, FLOAT_ARRAY b) FLOAT_ARRAY sub(FLOAT_ARRAY a, FLOAT b) FLOAT_ARRAY sub(INTEGER a, FLOAT_ARRAY b) FLOAT_ARRAY sub(FLOAT_ARRAY a, INTEGER b) SHAPE sub(SHAPE shape a, SHAPE shape b) SHAPE sub(SHAPE shape a, SHAPE shape b, NUMBER blend) INTEGER mul(INTEGER a, INTEGER b) FLOAT mul(FLOAT a, FLOAT b) FLOAT mul(FLOAT a, INTEGER b) FLOAT mul(INTEGER a, FLOAT b) FLOAT_ARRAY mul(FLOAT_ARRAY a, FLOAT_ARRAY b) FLOAT_ARRAY mul(FLOAT a, FLOAT_ARRAY b) FLOAT_ARRAY mul(FLOAT_ARRAY a, FLOAT b) FLOAT_ARRAY mul(INTEGER a, FLOAT_ARRAY b) FLOAT_ARRAY mul(FLOAT_ARRAY a, INTEGER b) SHAPE mul(SHAPE shape, TRANSFORM transform) SHAPE mul(TRANSFORM transform, SHAPE shape) TRANSFORM mul(TRANSFORM transform_a, TRANSFORM transform_b) INTEGER div(INTEGER a, INTEGER b) FLOAT div(FLOAT a, FLOAT b) FLOAT div(FLOAT a, INTEGER b) FLOAT div(INTEGER a, FLOAT b) FLOAT_ARRAY div(FLOAT_ARRAY a, FLOAT_ARRAY b) FLOAT_ARRAY div(FLOAT a, FLOAT_ARRAY b) FLOAT_ARRAY div(FLOAT_ARRAY a, FLOAT b) FLOAT_ARRAY div(INTEGER a, FLOAT_ARRAY b) FLOAT_ARRAY div(FLOAT_ARRAY a, INTEGER b) INTEGER max(INTEGER a, INTEGER b) FLOAT max(FLOAT a, FLOAT b) FLOAT max(FLOAT a, INTEGER b) FLOAT max(INTEGER a, FLOAT b) FLOAT_ARRAY max(FLOAT_ARRAY a, FLOAT_ARRAY b) FLOAT_ARRAY max(FLOAT a, FLOAT_ARRAY b) FLOAT_ARRAY max(FLOAT_ARRAY a, FLOAT b) FLOAT_ARRAY max(INTEGER a, FLOAT_ARRAY b) FLOAT_ARRAY max(FLOAT_ARRAY a, INTEGER b) INTEGER min(INTEGER a, INTEGER b) FLOAT min(FLOAT a, FLOAT b) FLOAT min(FLOAT a, INTEGER b) FLOAT min(INTEGER a, FLOAT b) FLOAT_ARRAY min(FLOAT_ARRAY a, FLOAT_ARRAY b) FLOAT_ARRAY min(FLOAT a, FLOAT_ARRAY b) FLOAT_ARRAY min(FLOAT_ARRAY a, FLOAT b) FLOAT_ARRAY min(INTEGER a, FLOAT_ARRAY b) FLOAT_ARRAY min(FLOAT_ARRAY a, INTEGER b) INTEGER atan2(INTEGER a, INTEGER b) FLOAT atan2(FLOAT a, FLOAT b) FLOAT atan2(FLOAT a, INTEGER b) FLOAT atan2(INTEGER a, FLOAT b) FLOAT_ARRAY atan2(FLOAT_ARRAY a, FLOAT_ARRAY b) FLOAT_ARRAY atan2(FLOAT a, FLOAT_ARRAY b) FLOAT_ARRAY atan2(FLOAT_ARRAY a, FLOAT b) FLOAT_ARRAY atan2(INTEGER a, FLOAT_ARRAY b) FLOAT_ARRAY atan2(FLOAT_ARRAY a, INTEGER b) INTEGER pow(INTEGER a, INTEGER b) FLOAT pow(FLOAT a, FLOAT b) FLOAT pow(FLOAT a, INTEGER b) FLOAT pow(INTEGER a, FLOAT b) FLOAT_ARRAY pow(FLOAT_ARRAY a, FLOAT_ARRAY b) FLOAT_ARRAY pow(FLOAT a, FLOAT_ARRAY b) FLOAT_ARRAY pow(FLOAT_ARRAY a, FLOAT b) FLOAT_ARRAY pow(INTEGER a, FLOAT_ARRAY b) FLOAT_ARRAY pow(FLOAT_ARRAY a, INTEGER b) INTEGER abs(INTEGER a) FLOAT abs(FLOAT a) FLOAT_ARRAY abs(FLOAT_ARRAY a) INTEGER negate(INTEGER a) FLOAT negate(FLOAT a) FLOAT_ARRAY negate(FLOAT_ARRAY a) INTEGER sin(INTEGER a) FLOAT sin(FLOAT a) FLOAT_ARRAY sin(FLOAT_ARRAY a) SHAPE sin(SHAPE shape, NUMBER frequency, NUMBER amplitude, NUMBER phase_offset) INTEGER cos(INTEGER a) FLOAT cos(FLOAT a) FLOAT_ARRAY cos(FLOAT_ARRAY a) INTEGER tan(INTEGER a) FLOAT tan(FLOAT a) FLOAT_ARRAY tan(FLOAT_ARRAY a) INTEGER asin(INTEGER a) FLOAT asin(FLOAT a) FLOAT_ARRAY asin(FLOAT_ARRAY a) INTEGER acos(INTEGER a) FLOAT acos(FLOAT a) FLOAT_ARRAY acos(FLOAT_ARRAY a) INTEGER atan(INTEGER a) FLOAT atan(FLOAT a) FLOAT_ARRAY atan(FLOAT_ARRAY a) INTEGER exp(INTEGER a) FLOAT exp(FLOAT a) FLOAT_ARRAY exp(FLOAT_ARRAY a) INTEGER exp2(INTEGER a) FLOAT exp2(FLOAT a) FLOAT_ARRAY exp2(FLOAT_ARRAY a) INTEGER expm1(INTEGER a) FLOAT expm1(FLOAT a) FLOAT_ARRAY expm1(FLOAT_ARRAY a) INTEGER log(INTEGER a) FLOAT log(FLOAT a) FLOAT_ARRAY log(FLOAT_ARRAY a) INTEGER log10(INTEGER a) FLOAT log10(FLOAT a) FLOAT_ARRAY log10(FLOAT_ARRAY a) INTEGER log2(INTEGER a) FLOAT log2(FLOAT a) FLOAT_ARRAY log2(FLOAT_ARRAY a) INTEGER log1p(INTEGER a) FLOAT log1p(FLOAT a) FLOAT_ARRAY log1p(FLOAT_ARRAY a) INTEGER sqrt(INTEGER a) FLOAT sqrt(FLOAT a) FLOAT_ARRAY sqrt(FLOAT_ARRAY a) FLOAT acc(FLOAT increment) FLOAT acc(FLOAT increment, FLOAT initial_value) FLOAT rng() FLOAT rng(FLOAT min, FLOAT exclusive_max) FLOAT_ARRAY rng(FLOAT_ARRAY min, FLOAT_ARRAY exclusive_max) FLOAT lerp(FLOAT a, FLOAT b, FLOAT blend) INTEGER lerp(INTEGER a, INTEGER b, FLOAT blend) FLOAT_ARRAY lerp(FLOAT_ARRAY a, FLOAT_ARRAY b, FLOAT blend) FLOAT_ARRAY lerp(FLOAT_ARRAY a, FLOAT_ARRAY b, FLOAT_ARRAY blend) SHAPE lerp(SHAPE shape a, SHAPE shape b, FLOAT blend) FLOAT sum(FLOAT values) INTEGER sum(INTEGER values) FLOAT_ARRAY sum(FLOAT_ARRAY values) INTEGER notes(STRING notes) INTEGER notes(STRING scale, STRING root_note) FLOAT note_hz(INTEGER notes) FLOAT note_hz(INTEGER notes, STRING device) FLOAT_ARRAY note_signals(INTEGER notes) FLOAT_ARRAY note_signals(INTEGER notes, STRING device) VOID draw(SHAPE shape) VOID draw(SHAPE shape, TRANSFORM transform) SHAPE cone() SHAPE cone(NUMBER radius, NUMBER height) SHAPE cube() SHAPE cube(NUMBER width, NUMBER height, NUMBER depth) SHAPE cube(NUMBER size) SHAPE cylinder() SHAPE cylinder(NUMBER radius, NUMBER height) SHAPE pyramid() SHAPE pyramid(NUMBER radius, NUMBER height) SHAPE sphere() SHAPE sphere(NUMBER radius) SHAPE torus() SHAPE torus(NUMBER large_radius, NUMBER small_radius) SHAPE intersect(SHAPE shape a, SHAPE shape b) SHAPE intersect(SHAPE shape a, SHAPE shape b, NUMBER blend) SHAPE reflect(SHAPE shape) SHAPE twist(SHAPE shape, NUMBER rate) SHAPE transform(SHAPE shape, TRANSFORM transform) SHAPE transform(TRANSFORM transform, SHAPE shape) TRANSFORM matrix() TRANSFORM rotate_x(TRANSFORM transform, NUMBER angle) TRANSFORM rotate_x(NUMBER angle) TRANSFORM rotate_y(TRANSFORM transform, NUMBER angle) TRANSFORM rotate_y(NUMBER angle) TRANSFORM rotate_z(TRANSFORM transform, NUMBER angle) TRANSFORM rotate_z(NUMBER angle) TRANSFORM translate_x(TRANSFORM transform, NUMBER x) TRANSFORM translate_x(NUMBER x) TRANSFORM translate_y(TRANSFORM transform, NUMBER y) TRANSFORM translate_y(NUMBER y) TRANSFORM translate_z(TRANSFORM transform, NUMBER z) TRANSFORM translate_z(NUMBER z) TRANSFORM translate(TRANSFORM transform, NUMBER x, NUMBER y, NUMBER z) TRANSFORM translate(NUMBER x, NUMBER y, NUMBER z) TRANSFORM inverse(TRANSFORM transform) TEXTURE cshift_r(TEXTURE input_texture, FLOAT red_x, FLOAT red_y)

old

old versions

change log

last updated 6/6/2024