#include "config.h"
#include "util/iir.h"
#include "util/buffer.h"
Butterworth X-over filter
Butterworth lowpass filter
Butterworth highpass filter
#include "ladspa-util.h"
#include "util/blo.h"
]]>
This plugin simulates the output you get from an analogue synth's osciallators.
You can get a reasonable emualtion of a 303's square (for exmaple) if you set the warmth to about 0.4 and the instability to about 0.05.
The frequency is currently a control input, and there is no interpolation, so if your host is using large block sieze it will sound steppy.
I'm unsure whether to convert this to an audio input or inpolate the control in.
The frequency of the output (Hz).
The degree of softening that is applied to the generted waveform, reduces the number of harmonics in the output.
The degree of pitch instability of the output. Turning this too high with square and saw waves will produce an anoying jittery sound, I want to fix this but it is tricky.
-CLIP)) {
return sc_in;
} else if (sc_in > 0.0f) {
return MAX_AMP - (CLIP_A / (CLIP_B + sc_in));
} else {
return -(MAX_AMP - (CLIP_A / (CLIP_B - sc_in)));
}
}
/* Store data in SVF struct, takes the sampling frequency, cutoff frequency
and Q, and fills in the structure passed */
inline void setup_svf(sv_filter *sv, float fs, float fc, float q, int t) {
sv->f = 2.0f * sinf(M_PI * fc / (float)(fs * F_R));
sv->q = 2.0f * cosf(powf(q, 0.1f) * M_PI * 0.5f);
sv->qnrm = sqrtf(sv->q*0.5f + 0.01f);
switch(t) {
case F_LP:
sv->op = &(sv->l);
break;
case F_HP:
sv->op = &(sv->h);
break;
case F_BP:
sv->op = &(sv->b);
break;
case F_BR:
sv->op = &(sv->n);
break;
default:
sv->op = &(sv->p);
}
}
/* Change the frequency of a running SVF */
inline void setup_f_svf(sv_filter *sv, const float fs, const float fc) {
sv->f = 2.0f * sin(M_PI * fc / ((float)(fs * F_R)));
}
/* Run one sample through the SV filter. Filter is by andy@vellocet */
inline float run_svf(sv_filter *sv, float in) {
float out;
int i;
in = sv->qnrm * in ;
for (i=0; i < F_R; i++) {
// only needed for pentium chips
in = flush_to_zero(in);
sv->l = flush_to_zero(sv->l);
// very slight waveshape for extra stability
sv->b = sv->b - sv->b * sv->b * sv->b * 0.001f;
// regular state variable code here
// the notch and peaking outputs are optional
sv->h = in - sv->l - sv->q * sv->b;
sv->b = sv->b + sv->f * sv->h;
sv->l = sv->l + sv->f * sv->b;
sv->n = sv->l + sv->h;
sv->p = sv->l - sv->h;
out = *(sv->op);
in = out;
}
return out;
}
inline int wave_tbl(const float wave) {
switch (f_round(wave)) {
case 0:
return BLO_SINE;
break;
case 1:
return BLO_TRI;
break;
case 2:
return BLO_SAW;
break;
case 3:
return BLO_SQUARE;
break;
}
return NOISE;
}
]]>
This plugin is a simulation of a modern analogue synth called a Pro Tone, with some extra features bolted on, like a crossover. I tried to make it as comprehensive as possible, without requiring ludicrous amounts of CPU juice.
N.B. as far as I know, noone has tried to use this (I certainly haven't), so it may be full of bugs and what not. The parameters are all undocumented, but there is a diagram of the routing on the website. Without a custom interface however it would be very hard to use.
Historical note: the name is a bad pun, it comes from the name Hermes Trimegistus given to the Egyptian god Thoth by the greeks, it means Thrice Blessed, or something similar.
This is an implementation of a Multivoice (as opposed to Multiscale) chorus algorithm. Its uses a novel, sinc based noise interpolation method to produce a subtle modulation law which makes it possible to get away with larger numbers of voices without the metallic, artificial sound common in chorus effects.
The individual voices can either be running at the same base delay (set this to zero) or staggered.
Setting this to non-zero values can make the output sound richer, but will make it sound grainy with some type of signal.
The maximum amount that a voice will be detuned by. I recommend a value of 1, but you may be able to get away with higher values if the signal is less harmonic.
The frequency that the detune effect will be modulated at. A matter of taste, for most types of input lower will be more subtle.
With large numbers of voices the output can become too high, so use this to trim the amplitude to a more helpful level.
A Wave Terrain oscillator, taken from Curtis Roads' example in {\em The Computer Music Tutorial}.
Inputs x and y move the cursor around on a 2D landscape "wavetable" that is used to generate the output. The function used is z = (x - y) * (x - 1) * (x + 1) * (y - 1) * (y + 1).
/*
GVerb algorithm designed and implemented by Juhana Sadeharju.
LADSPA implementation and GVerb speeds ups by Steve Harris.
Comments and suggestions should be mailed to Juhana Sadeharju
(kouhia at nic funet fi).
*/
#include "ladspa-util.h"
#include "gverb/gverbdsp.h"
#include "gverb/gverb.h"
A mono in, stereo out reverb implementation by Juhana Sadeharju (kouhia at nic.funet.fi). I ported it to LADSPA and did some testing.
Please contact Juhana directly regarding any bugs you find.
The size of the room, in meters. Excessivly large, and excessivly small values will make it sound a bit unrealistic.
Values of around 30 sound good.
Reverb decay time, in seconds. 7 is a good place to start.
This controls the high frequency damping (a lowpass filter), values near 1 will make it sound very bright, values near 0 will make it sound very dark.
This is like a damping control for the input, it has a similar effect to the damping control, but is subtly different.
The amount of dry signal to be mixed with the reverberated signal.
The quantity of early reflections (scatter reflections directly from the source). Think of Lexicons ambiance patches.
The level of the classic reverb tail reflections.
#include "ladspa-util.h"
int refcount;
LADSPA_Data *sin_tbl, *tri_tbl, *saw_tbl, *squ_tbl;
long sample_rate;
This is a simple 2 input ring modulator.
It is important that the modulator input is bounded to (-1, +1), otherwise you will get rubbish on the output.
This is the audio input.
This is the modulator input.
This is a simple ring modulator and LFO.
#include "util/pitchscale.h"
#define FRAME_LENGTH 4096
#define OVER_SAMP 16
A pitch shifter implementation that scales the harmonics appropriately with the base frequencies. It is an implementation of Stephen M. Sprengler's pitch scaler design. It gives reasonable, general purpose results for small changes, but won't give Antares or Eventide anything to worry about.
The FFT block size and oversampling has been kept at reasonable levels to keep the CPU usage low, but it is smoother than the other Pitch Scaler.
The pitch scaling factor, a value of 2.0 will increase the pitch by one octave, etc.
#include "ladspa-util.h"
#define BUFFER_SIZE 16
#define BUFFER_MASK 15
]]>
Formerly Stupid Compressor. Thanks to Matt Yee-King for the name.
Compresses signals with a stupidly short attack and decay, infinite ratio and hard knee. Not really as a compressor, but good harsh (non-musical) distortion.
Controls the envelope decay time.
Controls the knee roll-off point, ie. the point above which the compression kicks in. 0 will have no effect, -90 will remove virtually all dynamic range.
#include "util/waveguide_nl.h"
#define RUN_WG(n, junct_a, junct_b) waveguide_nl_process(w[n], junct_a - out[n*2+1], junct_b - out[n*2], out+n*2, out+n*2+1)
A physical model of a metal gong.
Based on Josep Comajuncosas' gong explorer, which was built in Sync Modular, it uses 8 linear waveguides with nonlinear filters to model the gong surface.
Controls the degree of damping in the centre of the gong.
Controls the degree of damping on the edge of the gong.
Controls the vertical position of the "microphone", 0 is the centre and 1 is the edge.
The size of the upper, inner waveguide.
The stiffness of the gong against deflections in the positive direction.
The stiffness of the gong against deflections in the negative direction.
The size of the right, inner waveguide.
The stiffness of the gong against deflections in the positive direction.
The stiffness of the gong against deflections in the negative direction.
The size of the lower, inner waveguide.
The stiffness of the gong against deflections in the positive direction.
The stiffness of the gong against deflections in the negative direction.
The size of the left, inner waveguide.
The stiffness of the gong against deflections in the positive direction.
The stiffness of the gong against deflections in the negative direction.
The size of the upper right, outer waveguide.
The stiffness of the gong against deflections in the positive direction.
The stiffness of the gong against deflections in the negative direction.
The size of the lower right, outer waveguide.
The stiffness of the gong against deflections in the positive direction.
The stiffness of the gong against deflections in the negative direction.
The size of the lower left, outer waveguide.
The stiffness of the gong against deflections in the positive direction.
The stiffness of the gong against deflections in the negative direction.
The size of the upper left, outer waveguide.
The stiffness of the gong against deflections in the positive direction.
The stiffness of the gong against deflections in the negative direction.
#include "ladspa-util.h"
#define COMB_SIZE 0x4000
#define COMB_MASK 0x3FFF
Controls the distance between the filters peaks.
Feedback level, increases the distinctive wooshy phaser sound.
pivot) {
q_sort(array, pivot+1, right);
}
}
inline int partition(LADSPA_Data array[], int left, int right) {
float pivot = array[left];
while (left < right) {
while (array[right] >= pivot && left < right) {
right--;
}
if (left != right) {
array[left] = array[right];
left++;
}
while (array[left] <= pivot && left < right) {
left++;
}
if (left != right) {
array[right] = array[left];
right--;
}
}
array[left] = pivot;
return left;
}
]]>
Sorts and mixes blocks of the input signal to give a "bumpy ramp" effect.
Certain types of input will produce silence on the output (mostly ones with only low frequency components).
This is a very odd effect, and doesn't really have any music applications, but can produce some interesting noises.