fluxa

Description

Fluxa is the fluxus audio synth for livecoding, it contains quite basic atomic components which can be used together to create more complicated sounds. It uses an experimental and fairly brutal method of graph node garbage collection which gives it certain non-deterministic qualities. It's also been battle tested in many a live performance. The fluxa server needs to be run and connected to jack in order for you to hear anything. Also, fluxa is not in the default namespace, so use eg (require fluxus-017/fluxa).

(reload)

Returns void

Causes samples to be reloaded if you need to restart the fluxa server

Example

 (reload)

(sine frequency-number-or-node)

Returns node-id-number

Creates a sine wave generator node

Example

 (play-now (mul (sine 440) (adsr 0.1 0.1 0 0)))

(saw frequency-number-or-node)

Returns node-id-number

Creates a saw wave generator node

Example

 (play-now (mul (saw 440) (adsr 0.1 0.1 0 0)))

(tri frequency-number-or-node)

Returns node-id-number

Creates a triangle wave generator node

Example

 (play-now (mul (tri 440) (adsr 0.1 0.1 0 0)))

(squ frequency-number-or-node)

Returns node-id-number

Creates a square wave generator node

Example

 (play-now (mul (squ 440) (adsr 0.1 0.1 0 0)))

(white frequency-number-or-node)

Returns node-id-number

Creates a white noise generator node

Example

 (play-now (mul (white 5) (adsr 0.1 0.1 0 0)))

(pink frequency-number-or-node)

Returns node-id-number

Creates a pink noise generator node

Example

 (play-now (mul (pink 5) (adsr 0.1 0.1 0 0)))

(add number-or-node number-or-node)

Returns node-id-number

Maths node - adds two signals together

Example

 (play-now (mul (add (sine 440) (sine 220)) (adsr 0.1 0.1 0 0)))

(sub number-or-node number-or-node)

Returns node-id-number

Maths node - subtracts two signals

Example

 (play-now (mul (sub (sine 440) (sine 220)) (adsr 0.1 0.1 0 0)))

(mul number-or-node number-or-node)

Returns node-id-number

Maths node - multiplies two signals

Example

 (play-now (mul (mul (sine 440) (sine 220)) (adsr 0.1 0.1 0 0)))

(div number-or-node number-or-node)

Returns node-id-number

Maths node - divides two signals

Example

 (play-now (mul (div (sine 440) 2) (adsr 0.1 0.1 0 0)))

(pow number-or-node number-or-node)

Returns node-id-number

Maths node - produces a signal raised to the power of another

Example

 (play-now (mul (pow (adsr 0 0.1 0 0) 10) (sine 440)))

(adsr attack-number-or-node decay-number-or-node sustain-number-or-node release-number-or-node)

Returns node-id-number

Creates an envelope generator node

Example

 (play-now (mul (sine 440) (adsr 0.1 0.1 0 0)))

(mooglp signal-node cutoff-number-or-node resonance-number-or-node)

Returns node-id-number

Creates an low pass moog filter node

Example

 (play-now (mul (mooglp (squ 440) 0.1 0.4) (adsr 0.1 0.1 0 0)))

(moogbp signal-node cutoff-number-or-node resonance-number-or-node)

Returns node-id-number

Creates an band pass moog filter node

Example

 (play-now (mul (moogbp (squ 440) 0.1 0.4) (adsr 0.1 0.1 0 0)))

(mooghp signal-node cutoff-number-or-node resonance-number-or-node)

Returns node-id-number

Creates an high pass moog filter node

Example

 (play-now (mul (mooghp (squ 440) 0.1 0.4) (adsr 0.1 0.1 0 0)))

(formant signal-node cutoff-number-or-node resonance-number-or-node)

Returns node-id-number

Creates a formant filter node

Example

 (play-now (mul (formant (squ 440) 0.1 0.4) (adsr 0.1 0.1 0 0)))

(sample sample-filename-string frequency-number-or-node)

Returns node-id-number

Creates a sample playback node

Example

 (play-now (sample "helicopter.wav" 440))

(crush signal-node frequency-number-or-node bit-depth-number-or-node)

Returns node-id-number

Creates a crush effect node

Example

 (play-now (crush (sine 440) 0.4 8))

(distort signal-node amount-number-or-node)

Returns node-id-number

Creates a distortion effect node

Example

 (play-now (distort (sine 440) 0.9))

(klip signal-node amount-number-or-node)

Returns node-id-number

Creates a hard clipping distortion effect node

Example

 (play-now (klip (sine 440) 0.9))

(echo signal-node delay-time-number-or-node feedback-number-or-node)

Returns node-id-number

Creates a echo effect node

Example

 (play-now (echo 3 (sine 440)))

(play time node optional-pan)

Returns void

Plays a supplied node at the specified time.

Example

 (play (+ (time-now) 10) (mul (adsr 0 0.1 0 0) (sine 440)))

(play-now node)

Returns void

Plays a supplied node as soon as possible

Example

 (play-now (mul (adsr 0 0.1 0 0) (sine 440)))

(fluxa-debug true-or-false)

Returns void

Turns on or off fluxa debugging, the server will print information out to stdout

Example

 (fluxa-debug #t)

(volume amount-number)

Returns void

Sets the global volume

Example

 (volume 2.5)

(pan pan-number)

Returns void

Sets the global pan where -1 is left and 1 is right (probably)

Example

 (pan 0)

(max-synths number)

Returns void

Sets the maximum amount of synth graphs fluxa will run at the same time. This is a processor usage safeguard, when the count is exceeded the oldest synth graph will be stopped so it's nodes can be recycled. The default count is 10.

Example

 (max-synths 10)

(searchpath path-string)

Returns void

Add a searchpath to use when looking for samples

Example

 (searchpath "/path/to/my/samples/)

(eq bass-number middle-number high-number)

Returns void

Sets a simple global equaliser. This is more as a last resort when performing without a mixer.

Example

 (eq 2 1 0.5) ; bass boost

(comp attack-number release-number threshold-number slope-number)

Returns void

A global compressor. Not sure if this works yet.

Example

 (comp 0.1 0.1 0.5 3)

(note note-number)

Returns frequency-number

Returns the frequency for the supplied note. Fluxa uses just intonation by default.

Example

 (note 35)

(reset)

Returns void

Resets the fluxa server.

Example

 (reset)

(clock-map)

Returns void

A way of using lists as sequences. The lists can be of differing length, leading to polyrhythms.

Example

 (seq (lambda (time clock)
    (clock-map
      (lambda (nt cutoff)
        (play time (mul (adsr 0 0.1 0 0)
          (mooglp (saw (note nt)) cutoff 0.4))))
      clock
      (list 39 28 3)
      (list 0.1 0.1 0.4 0.9))))

(zmod clock-number count-number)

Returns true-or-false

Just shorthand for (zero? (modulo clock-number count-number)), as it can be used a lot.

Example

 (seq (lambda (time clock)
     (when (zmod clock 4) ; play the note every 4th beat
         (play time (mul (adsr 0 0.1 0 0) (sine (note nt)))))))

(seq proc)

Returns void

Sets the global fluxa sequence procedure, which will be called automatically in order to create new events. seq can be repeatedly called to update the procedure as in livecoding.

Example

 (seq (lambda (time clock)
     (when (zmod clock 4) ; play the note every 4th beat
         (play time (mul (adsr 0 0.1 0 0) (sine (note nt)))))))

(reload)

Returns void

Causes samples to be reloaded if you need to restart the fluxa server

Example

 (reload)

(sine frequency-number-or-node)

Returns node-id-number

Creates a sine wave generator node

Example

 (play-now (mul (sine 440) (adsr 0.1 0.1 0 0)))

(saw frequency-number-or-node)

Returns node-id-number

Creates a saw wave generator node

Example

 (play-now (mul (saw 440) (adsr 0.1 0.1 0 0)))

(tri frequency-number-or-node)

Returns node-id-number

Creates a triangle wave generator node

Example

 (play-now (mul (tri 440) (adsr 0.1 0.1 0 0)))

(squ frequency-number-or-node)

Returns node-id-number

Creates a square wave generator node

Example

 (play-now (mul (squ 440) (adsr 0.1 0.1 0 0)))

(white frequency-number-or-node)

Returns node-id-number

Creates a white noise generator node

Example

 (play-now (mul (white 5) (adsr 0.1 0.1 0 0)))

(pink frequency-number-or-node)

Returns node-id-number

Creates a pink noise generator node

Example

 (play-now (mul (pink 5) (adsr 0.1 0.1 0 0)))

(add number-or-node number-or-node)

Returns node-id-number

Maths node - adds two signals together

Example

 (play-now (mul (add (sine 440) (sine 220)) (adsr 0.1 0.1 0 0)))

(sub number-or-node number-or-node)

Returns node-id-number

Maths node - subtracts two signals

Example

 (play-now (mul (sub (sine 440) (sine 220)) (adsr 0.1 0.1 0 0)))

(mul number-or-node number-or-node)

Returns node-id-number

Maths node - multiplies two signals

Example

 (play-now (mul (mul (sine 440) (sine 220)) (adsr 0.1 0.1 0 0)))

(div number-or-node number-or-node)

Returns node-id-number

Maths node - divides two signals

Example

 (play-now (mul (div (sine 440) 2) (adsr 0.1 0.1 0 0)))

(pow number-or-node number-or-node)

Returns node-id-number

Maths node - produces a signal raised to the power of another

Example

 (play-now (mul (pow (adsr 0 0.1 0 0) 10) (sine 440)))

(adsr attack-number-or-node decay-number-or-node sustain-number-or-node release-number-or-node)

Returns node-id-number

Creates an envelope generator node

Example

 (play-now (mul (sine 440) (adsr 0.1 0.1 0 0)))

(mooglp signal-node cutoff-number-or-node resonance-number-or-node)

Returns node-id-number

Creates an low pass moog filter node

Example

 (play-now (mul (mooglp (squ 440) 0.1 0.4) (adsr 0.1 0.1 0 0)))

(moogbp signal-node cutoff-number-or-node resonance-number-or-node)

Returns node-id-number

Creates an band pass moog filter node

Example

 (play-now (mul (moogbp (squ 440) 0.1 0.4) (adsr 0.1 0.1 0 0)))

(mooghp signal-node cutoff-number-or-node resonance-number-or-node)

Returns node-id-number

Creates an high pass moog filter node

Example

 (play-now (mul (mooghp (squ 440) 0.1 0.4) (adsr 0.1 0.1 0 0)))

(formant signal-node cutoff-number-or-node resonance-number-or-node)

Returns node-id-number

Creates a formant filter node

Example

 (play-now (mul (formant (squ 440) 0.1 0.4) (adsr 0.1 0.1 0 0)))

(sample sample-filename-string frequency-number-or-node)

Returns node-id-number

Creates a sample playback node

Example

 (play-now (sample "helicopter.wav" 440))

(crush signal-node frequency-number-or-node bit-depth-number-or-node)

Returns node-id-number

Creates a crush effect node

Example

 (play-now (crush (sine 440) 0.4 8))

(distort signal-node amount-number-or-node)

Returns node-id-number

Creates a distortion effect node

Example

 (play-now (distort (sine 440) 0.9))

(klip signal-node amount-number-or-node)

Returns node-id-number

Creates a hard clipping distortion effect node

Example

 (play-now (klip (sine 440) 0.9))

(echo signal-node delay-time-number-or-node feedback-number-or-node)

Returns node-id-number

Creates a echo effect node

Example

 (play-now (echo 3 (sine 440)))

(ks freq cutoff resonance)

Returns node-id-number

Karplus strong "ocillator" node. Plucks virtual strings by filtering white noise in a feedback delay loop set resonate at the desired frequency.

Example

 (play-now (ks (random 1000) 0.9 0.1))

(play time node optional-pan)

Returns void

Plays a supplied node at the specified time.

Example

 (play (+ (time-now) 10) (mul (adsr 0 0.1 0 0) (sine 440)))

(play-now node)

Returns void

Plays a supplied node as soon as possible

Example

 (play-now (mul (adsr 0 0.1 0 0) (sine 440)))

(fluxa-debug true-or-false)

Returns void

Turns on or off fluxa debugging, the server will print information out to stdout

Example

 (fluxa-debug #t)

(volume amount-number)

Returns void

Sets the global volume

Example

 (volume 2.5)

(pan pan-number)

Returns void

Sets the global pan where -1 is left and 1 is right (probably)

Example

 (pan 0)

(max-synths number)

Returns void

Sets the maximum amount of synth graphs fluxa will run at the same time. This is a processor usage safeguard, when the count is exceeded the oldest synth graph will be stopped so it's nodes can be recycled. The default count is 10.

Example

 (max-synths 10)

(searchpath path-string)

Returns void

Add a searchpath to use when looking for samples

Example

 (searchpath "/path/to/my/samples/)

(eq bass-number middle-number high-number)

Returns void

Sets a simple global equaliser. This is more as a last resort when performing without a mixer.

Example

 (eq 2 1 0.5) ; bass boost

(comp attack-number release-number threshold-number slope-number)

Returns void

A global compressor. Not sure if this works yet.

Example

 (comp 0.1 0.1 0.5 3)

(note note-number)

Returns frequency-number

Returns the frequency for the supplied note. Fluxa uses just intonation by default.

Example

 (note 35)

(reset)

Returns void

Resets the fluxa server.

Example

 (reset)

(clock-map)

Returns void

A way of using lists as sequences. The lists can be of differing length, leading to polyrhythms.

Example

 (seq (lambda (time clock)
    (clock-map
      (lambda (nt cutoff)
        (play time (mul (adsr 0 0.1 0 0)
          (mooglp (saw (note nt)) cutoff 0.4))))
      clock
      (list 39 28 3)
      (list 0.1 0.1 0.4 0.9))))

(zmod clock-number count-number)

Returns true-or-false

Just shorthand for (zero? (modulo clock-number count-number)), as it can be used a lot.

Example

 (seq (lambda (time clock)
     (when (zmod clock 4) ; play the note every 4th beat
         (play time (mul (adsr 0 0.1 0 0) (sine (note nt)))))))

(seq proc)

Returns void

Sets the global fluxa sequence procedure, which will be called automatically in order to create new events. seq can be repeatedly called to update the procedure as in livecoding.

Example

 (seq (lambda (time clock)
     (when (zmod clock 4) ; play the note every 4th beat
         (play time (mul (adsr 0 0.1 0 0) (sine (note nt)))))))