├── .gitignore ├── .travis.yml ├── AUTHORS ├── COPYING ├── ChangeLog ├── IDs ├── INSTALL ├── Makefile.am ├── NEWS ├── README ├── TODO ├── acconfig.h ├── alias_1407.xml ├── allpass_1895.xml ├── am_pitchshift_1433.xml ├── amp_1181.xml ├── analogue_osc_1416.xml ├── autogen.sh ├── bandpass_a_iir_1893.xml ├── bandpass_iir_1892.xml ├── bode_shifter_1431.xml ├── bode_shifter_cv_1432.xml ├── bozosoity-checker.pl ├── butterworth_1902.xml ├── chebstortion_1430.xml ├── comb_1190.xml ├── comb_1887.xml ├── comb_splitter_1411.xml ├── compile ├── configure.ac ├── const_1909.xml ├── crossover_dist_1404.xml ├── dc_remove_1207.xml ├── debug_1184.xml ├── decay_1886.xml ├── decimator_1202.xml ├── declip_1195.xml ├── delay_1898.xml ├── delayorama_1402.xml ├── depcomp ├── diode_1185.xml ├── divider_1186.xml ├── dj_eq_1901.xml ├── dj_flanger_1438.xml ├── docs ├── Makefile ├── addstyle.pl └── makedocs.pl ├── dont_use_1917 ├── dyson_compress_1403.xml ├── fad_delay_1192.xml ├── fast_lookahead_limiter_1913.xml ├── flanger_1191.xml ├── fm_osc_1415.xml ├── foldover_1213.xml ├── foverdrive_1196.xml ├── freq_tracker_1418.xml ├── gate_1410.xml ├── gate_1921.xml ├── giant_flange_1437.xml ├── gong_1424.xml ├── gong_beater_1439.xml ├── gsm ├── COPYRIGHT ├── Makefile.am ├── README ├── add.c ├── code.c ├── config.h ├── decode.c ├── gsm.h ├── gsm_create.c ├── gsm_decode.c ├── gsm_destroy.c ├── gsm_encode.c ├── gsm_option.c ├── long_term.c ├── lpc.c ├── preprocess.c ├── private.h ├── proto.h ├── rpe.c ├── short_term.c ├── table.c └── unproto.h ├── gsm_1215.xml ├── gverb ├── Makefile.am ├── gverb-test.c ├── gverb.c ├── gverb.h ├── gverbdsp.c └── gverbdsp.h ├── gverb_1216.xml ├── hard_limiter_1413.xml ├── harmonic_gen_1220.xml ├── hermes_filter_1200.xml ├── highpass_iir_1890.xml ├── hilbert_1440.xml ├── imp_1199.xml ├── impulse_1885.xml ├── impulses ├── 01-unit.h ├── 02-steves-flat.h ├── 03-stk-m1.h ├── 04-fender-68-vibrolux-sm57.h ├── 05-fender-68-vibrolux-sm57-off.h ├── 06-fender-68-vibrolux-at4050.h ├── 07-fender-68-vibrolux-ui87.h ├── 08-fender-bassman-sm57.h ├── 09-fender-bassman-sm57-off.h ├── 10-fender-bassman-at4050.h ├── 11-fender-bassman-ui87.h ├── 12-fender-superchamp-sm57.h ├── 13-fender-superchamp-sm57-off.h ├── 14-fender-superchamp-at4050.h ├── 15-fender-superchamp-ui87.h ├── 16-marshall-jcm2000-sm57.h ├── 17-marshall-jcm2000-sm57-off.h ├── 18-marshall-plexi-sm57.h ├── 19-marshall-plexi-sm57-off.h ├── 20-matchless-chieftain-sm57.h ├── 21-matchless-chieftain-sm57-off.h ├── all.h ├── mkall-h.sh ├── reorder.pl └── scale.pl ├── install-sh ├── inv_1429.xml ├── karaoke_1409.xml ├── ladspa-swh.dtd ├── ladspa-util.h ├── ladspa.css ├── ladspa.h ├── latency_1914.xml ├── lcr_delay_1436.xml ├── lowpass_iir_1891.xml ├── ls_filter_1908.xml ├── makestub.pl ├── matrix_ms_st_1421.xml ├── matrix_spatialiser_1422.xml ├── matrix_st_ms_1420.xml ├── mbeq_1197.xml ├── metadata ├── Makefile.am ├── lxml2rdf.pl ├── scale-points.txt ├── swh-aux.rdf ├── swh-plugins.rdf ├── swh-scales.rdf └── txt2scale.pl ├── mkspec.pl ├── mod_delay_1419.xml ├── multivoice_chorus_1201.xml ├── notch_iir_1894.xml ├── phasers_1217.xml ├── pitch_scale_1193.xml ├── pitch_scale_1194.xml ├── plate_1423.xml ├── po ├── .gitignore ├── Makevars ├── POTFILES.in ├── de.po ├── en_GB.po └── swh-plugins.pot ├── pointer_cast_1910.xml ├── rate_shifter_1417.xml ├── retro_flange_1208.xml ├── revdelay_1605.xml ├── ringmod_1188.xml ├── satan_maximiser_1408.xml ├── sc1_1425.xml ├── sc2_1426.xml ├── sc3_1427.xml ├── sc4_1882.xml ├── sc4m_1916.xml ├── se4_1883.xml ├── shaper_1187.xml ├── sifter_1210.xml ├── sin_cos_1881.xml ├── single_para_1203.xml ├── sinus_wavewrapper_1198.xml ├── smooth_decimate_1414.xml ├── split_1406.xml ├── step_muxer_1212.xml ├── surround_encoder_1401.xml ├── svf_1214.xml ├── tape_delay_1211.xml ├── timetest ├── autotimetest.pl ├── timecmp ├── timetest └── timetest.rc ├── transient_1206.xml ├── triple_para_1204.xml ├── util ├── Makefile.am ├── biquad.h ├── blo.c ├── blo.h ├── buffer.c ├── buffer.h ├── db.c ├── db.h ├── iir.c ├── iir.h ├── ls_filter.h ├── pitchscale.c ├── pitchscale.h ├── rms.c ├── rms.h └── waveguide_nl.h ├── valve_1209.xml ├── valve_rect_1405.xml ├── vocoder_1337.xml ├── vynil_1905.xml ├── wave_terrain_1412.xml ├── xfade_1915.xml └── zm1_1428.xml /.gitignore: -------------------------------------------------------------------------------- 1 | m4 2 | missing 3 | aclocal.m4 4 | config.guess 5 | config.h.in 6 | config.sub 7 | configure 8 | ltmain.sh 9 | ltconfig 10 | .deps 11 | .libs 12 | Makefile 13 | Makefile.in 14 | autom4te.cache 15 | config.h 16 | config.h.in~ 17 | config.log 18 | config.rpath 19 | config.status 20 | libtool 21 | stamp-h1 22 | POTFILES 23 | *.o 24 | *.a 25 | *.la 26 | *.lo 27 | *[0123456789].c 28 | *.m4 29 | metadata/swh-plugins.rdf 30 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | compiler: gcc 3 | dist: trusty 4 | sudo: required 5 | matrix: 6 | include: 7 | - os: linux 8 | install: 9 | - sudo apt-get install automake autopoint libxml2-utils perl libxml-perl liblist-moreutils-perl fftw3-dev 10 | script: 11 | - autoreconf -i 12 | - ./configure 13 | - make 14 | - make install prefix=$HOME/dist 15 | - cd $HOME/dist/lib/ladspa/ && echo -e "Found $(ls *.so |wc -l) files\n-------" && ls *.so 16 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | In no particular order: 2 | 3 | Steve Harris - general stuff 4 | Frank Neumann - documentation, proofreading, DSP code 5 | Juhana Sadeharju - DSP code 6 | Joern Nettingsmeier - DSP code, bug reports and inspiration 7 | Mark Knecht - testesting, docuementation 8 | Pascal Haakmat - bugfixes, testing 9 | Marcus Andersson - DSP code 10 | Paul Winkler - documentation 11 | Matthias Nagorni - testing, inspiration 12 | Nathaniel Virgo - bugfixes 13 | Patrick Shirkey - testing, inspiration 14 | 15 | Project maintainted by Steve Harris, Southampton UK. 16 | steve@plugin.org.uk or swh@ecs.soton.ac.uk 17 | 18 | Plugin website at http://plugin.org.uk/ 19 | -------------------------------------------------------------------------------- /IDs: -------------------------------------------------------------------------------- 1 | As of 2007-10-17 I own (approximatly): 2 | 3 | 1181-1220 4 | 1401-1440 5 | 1881-1922 6 | 2821-2900 (known) 7 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swh/ladspa/0f54d2430febb4d5f02d13132dd91d7345e080b5/NEWS -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Compiling 2 | ~~~~~~~~~ 3 | You will need libfftw version 2 or 3 installed with 32 bit float support (eg. 4 | for FFTW3 use --enable-float), for FFTW recommend you specify the appropriate 5 | SIMD instruction set for your CPU with --enable-sse, --enable-sse2, --enable-k7 6 | or --enable-altivec. You can get FFTW from http://www.fftw.org/. 7 | 8 | Install with 9 | autoreconf -i 10 | ./configure 11 | make 12 | su -c "make install". 13 | 14 | This code is normally built from XML source, using Perl and XML::Parser. I 15 | distribute the generated .c files, so you wont need perl, but if you want to 16 | edit the XML source then you will need a copy of Perl and XML::Parser 17 | installed. 18 | 19 | Homepage and docs 20 | ~~~~~~~~~~~~~~~~~ 21 | The homepage for this project is http://plugin.org.uk/ 22 | 23 | Bug reports 24 | ~~~~~~~~~~~ 25 | Please send bug reports or comments to steve@plugin.org.uk, except for bugs 26 | relating to the gverb plugin, for that please send bug reports etc. to Juhana 27 | Sadeharju, kouhia_at_nic.funet.fi. 28 | 29 | Enjoy, 30 | Steve 31 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | Fix denormal issue in LFO phaser (Sampo Savolainen ) 2 | Synced sine osc (requested by Esben Stien) 3 | Gain in MBEQ is wrong (10dB down or so). 4 | -------------------------------------------------------------------------------- /acconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef _CONFIG_H 2 | #define _CONFIG_H 3 | 4 | #undef EXPLICIT_S 5 | #undef ACCEL_3DNOW 6 | #undef HAVE_LRINTF 7 | #undef PACKAGE_LOCALE_DIR 8 | #undef PACKAGE_DATA_DIR 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /alias_1407.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Aliasing 14 |

Simulates aliasing using nyquist frequency modulation. Produces wacky results if the blocks aren't even numbers of samples long.

15 | 16 | 29 | 30 | 31 | Aliasing level 32 |

Controls the amount of simulated aliasing in the output.

33 | 34 |
35 | 36 | 37 | Input 38 | 39 | 40 | 41 | Output 42 | 43 |
44 |
45 | -------------------------------------------------------------------------------- /amp_1181.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | #include "ladspa-util.h" 12 | 13 | 14 | 15 | 16 | Simple amplifier 17 | 18 | 26 | 27 | 28 | Amps gain (dB) 29 |

Controls the gain of the input signal in dB's.

30 | 31 |
32 | 33 | 34 | Input 35 | 36 | 37 | 38 | Output 39 | 40 |
41 |
42 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | autoreconf -i -I m4 || exit 1 3 | 4 | test -n "$NOCONFIGURE" || ./configure "$@" 5 | 6 | exit 0 7 | -------------------------------------------------------------------------------- /bandpass_a_iir_1893.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | #include "config.h" 11 | #include "util/iir.h" 12 | 13 | 14 | 15 | 16 | 17 | Glame Bandpass Analog Filter 18 |

IIR bandpass filter modeled after an analog circuit. This filter was ported from the glame multitrack editor to ladspa. 19 |

20 | 21 | 22 | sample_rate = s_rate; 23 | 24 | 25 | calc_2polebandpass(iirf, gt, center, width, sample_rate); 26 | iir_process_buffer_1s_5(iirf, gt, input, output, sample_count,0); 27 | 28 | // Unused variable 29 | (void)(run_adding_gain); 30 | 31 | 32 | 33 | gt = init_iir_stage(IIR_STAGE_LOWPASS,1,3,2); 34 | iirf = init_iirf_t(gt); 35 | calc_2polebandpass(iirf, gt, *(plugin_data->center), *(plugin_data->width), sample_rate); 36 | 37 | 38 | 39 | free_iirf_t(plugin_data->iirf, plugin_data->gt); 40 | free_iir_stage(plugin_data->gt); 41 | 42 | 43 | 44 | Center Frequency (Hz) 45 | 46 | 47 | 48 | 49 | Bandwidth (Hz) 50 | 51 | 52 | 53 | 54 | Input 55 | 56 | 57 | 58 | Output 59 | 60 | 61 | 62 | 63 | 64 | 65 |
66 |
67 | -------------------------------------------------------------------------------- /bandpass_iir_1892.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | #include "config.h" 11 | #include "util/iir.h" 12 | 13 | 14 | 15 | 16 | 17 | Glame Bandpass Filter 18 |

IIR bandpass filter based using chebishev coefficients. The filter allows you to tweak the number of stages used for 19 | filtering. Every stage adds two more poles, which leads to a steeper dropoff. More stages need more CPU power. This 20 | filter was ported from the glame multitrack editor to ladspa. 21 |

22 | 23 | 24 | sample_rate = s_rate; 25 | 26 | // Uninitialized variables 27 | lfc = 0; 28 | ufc = 0; 29 | 30 | 31 | ufc = (center + width*0.5f)/(float)sample_rate; 32 | lfc = (center - width*0.5f)/(float)sample_rate; 33 | combine_iir_stages(IIR_STAGE_BANDPASS, gt, first, second, 34 | chebyshev(iirf, first, 2*CLAMP((int)stages,1,10), IIR_STAGE_LOWPASS, ufc, 0.5f), 35 | chebyshev(iirf, second, 2*CLAMP((int)stages,1,10), IIR_STAGE_HIGHPASS, lfc, 0.5f)); 36 | iir_process_buffer_ns_5(iirf, gt, input, output, sample_count,RUN_ADDING); 37 | 38 | // Unused variable 39 | (void)(run_adding_gain); 40 | 41 | 42 | 43 | ufc = (*(plugin_data->center) + *(plugin_data->width)*0.5f)/(float)sample_rate; 44 | lfc = (*(plugin_data->center) - *(plugin_data->width)*0.5f)/(float)sample_rate; 45 | first = init_iir_stage(IIR_STAGE_LOWPASS,10,3,2); 46 | second = init_iir_stage(IIR_STAGE_HIGHPASS,10,3,2); 47 | gt = init_iir_stage(IIR_STAGE_BANDPASS,20,3,2); 48 | iirf = init_iirf_t(gt); 49 | chebyshev(iirf, first, 2*CLAMP((int)(*(plugin_data->stages)),1,10), IIR_STAGE_LOWPASS, ufc, 0.5f); 50 | chebyshev(iirf, second, 2*CLAMP((int)(*(plugin_data->stages)),1,10), IIR_STAGE_HIGHPASS, lfc, 0.5f); 51 | combine_iir_stages(IIR_STAGE_BANDPASS, gt, first, second,0,0); 52 | 53 | 54 | 55 | free_iirf_t(plugin_data->iirf, plugin_data->gt); 56 | free_iir_stage(plugin_data->first); 57 | free_iir_stage(plugin_data->second); 58 | free_iir_stage(plugin_data->gt); 59 | 60 | 61 | 62 | Center Frequency (Hz) 63 | 64 | 65 | 66 | 67 | Bandwidth (Hz) 68 | 69 | 70 | 71 | 72 | Stages(2 poles per stage) 73 | 74 | 75 | 76 | 77 | Input 78 | 79 | 80 | 81 | Output 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 |
93 |
94 | -------------------------------------------------------------------------------- /bozosoity-checker.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | %used = (); 4 | 5 | while ($file = shift) { 6 | open(FH, $file); 7 | if (!($file =~ /_(\d+)\.xml/)) { 8 | die "'$file' doesn't look like it contains a LADSPA ID"; 9 | } 10 | $fnid = $1; 11 | #print "looking for $fnid\n"; 12 | 13 | $found = 0; 14 | while () { 15 | if (/id="(\d+)"/) { 16 | $id = $1; 17 | if ($used{$id}) { 18 | print "*** Warning: duplicate ID ($id) found in $file and ".$used{$id}."\n"; 19 | } else { 20 | $used{$id} = $file; 21 | } 22 | if ($id < 1000) { 23 | print "*** Warning: non distributable ID ($id) found in $file\n"; 24 | } elsif ($id < $fnid) { 25 | print "*** Warning: ID $id in XML less than hinted in filename ($fnid)\n"; 26 | } 27 | } 28 | if (/id="$fnid"/) { 29 | $found = 1; 30 | } 31 | } 32 | if (!$found) { 33 | print "*** Warning: no matching ID found in $file\n"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /chebstortion_1430.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | #define HARMONICS 11 14 | #define STAGES 2 15 | 16 | static float cd_lut[STAGES][HARMONICS]; 17 | 18 | /* Calculate Chebychev coefficents from partial magnitudes, adapted from 19 | * example in Num. Rec. */ 20 | void chebpc(float c[], float d[]) 21 | { 22 | int k, j; 23 | float sv, dd[HARMONICS]; 24 | 25 | for (j = 0; j < HARMONICS; j++) { 26 | d[j] = dd[j] = 0.0; 27 | } 28 | 29 | d[0] = c[HARMONICS - 1]; 30 | 31 | for (j = HARMONICS - 2; j >= 1; j--) { 32 | for (k = HARMONICS - j; k >= 1; k--) { 33 | sv = d[k]; 34 | d[k] = 2.0 * d[k - 1] - dd[k]; 35 | dd[k] = sv; 36 | } 37 | sv = d[0]; 38 | d[0] = -dd[0] + c[j]; 39 | dd[0] = sv; 40 | } 41 | 42 | for (j = HARMONICS - 1; j >= 1; j--) { 43 | d[j] = d[j - 1] - dd[j]; 44 | } 45 | d[0] = -dd[0] + 0.5 * c[0]; 46 | } 47 | 48 | ]]> 49 | 50 | 51 | 52 | Chebyshev distortion 53 |

This is an interesting distortion effect that is seeded from incoming 54 | signal envelope. As the level of the signal rises more and more harmonics will 55 | for added to the output signal.

56 |

The distortion control sets the sensitivity of the input.

57 |

The effect evolved from some experiments between Tim Goetze and myself, 58 | attempting to emulate valve based guitar amp distortion. This was one of the 59 | failures, but it still makes an interesting noise.

60 | 61 | 80 | 81 | 87 | 88 | env) { 98 | env = env * 0.9f + a * 0.1f; 99 | } else { 100 | env = env * 0.97f + a * 0.03f; 101 | } 102 | 103 | if (count-- == 0) { 104 | for (i=0; iitm1 = itm1; 126 | plugin_data->otm1 = otm1; 127 | plugin_data->env = env; 128 | plugin_data->count = count; 129 | ]]> 130 | 131 | 132 | Distortion 133 | 134 | 135 | 136 | 137 | Input 138 | 139 | 140 | 141 | 142 | Output 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 |
151 |
152 | -------------------------------------------------------------------------------- /comb_1190.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | #include "ladspa-util.h" 11 | #define COMB_SIZE 0x4000 12 | #define COMB_MASK 0x3FFF 13 | 14 | 15 | 16 | 17 | Comb Filter 18 | 19 | 20 | sample_rate = s_rate; 21 | comb_tbl = malloc(sizeof(LADSPA_Data) * COMB_SIZE); 22 | comb_pos = 0; 23 | last_offset = 1000; 24 | 25 | 26 | 27 | int i; 28 | 29 | for (i = 0; i < COMB_SIZE; i++) { 30 | comb_tbl[i] = 0; 31 | } 32 | comb_pos = 0; 33 | last_offset = 1000; 34 | 35 | 36 | 37 | free(plugin_data->comb_tbl); 38 | 39 | 40 | comb_pos = comb_pos; 63 | plugin_data->last_offset = offset; 64 | ]]> 65 | 66 | 67 | Band separation (Hz) 68 | 69 |

Controls the distance between the filters peaks.

70 |
71 | 72 | 73 | Feedback 74 | 75 |

Feedback level, increases the distinctive wooshy phaser sound.

76 |
77 | 78 | 79 | Input 80 | 81 | 82 | 83 | Output 84 | 85 | 86 | 87 | 88 | 89 | 90 |
91 |
92 | -------------------------------------------------------------------------------- /comb_splitter_1411.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | #include "ladspa-util.h" 11 | #define COMB_SIZE 0x4000 12 | #define COMB_MASK 0x3FFF 13 | 14 | 15 | 16 | 17 | Comb Splitter 18 |

Divides the input up into two parts with frequency peaks at f Hz intervals, skewed by f/2 Hz between the two outputs. Mixing the two outputs will get you exactly the input signal.

19 |

I generally use this trick to divide up an input signal, process the two halves differently, then mix them again. It sounds pretty funky.

20 | 21 | 22 | sample_rate = s_rate; 23 | comb_tbl = malloc(sizeof(LADSPA_Data) * COMB_SIZE); 24 | comb_pos = 0; 25 | last_offset = 1000; 26 | 27 | 28 | 29 | int i; 30 | 31 | for (i = 0; i < COMB_SIZE; i++) { 32 | comb_tbl[i] = 0; 33 | } 34 | comb_pos = 0; 35 | last_offset = 1000; 36 | 37 | 38 | 39 | free(plugin_data->comb_tbl); 40 | 41 | 42 | comb_pos = comb_pos; 67 | plugin_data->last_offset = offset; 68 | ]]> 69 | 70 | 71 | Band separation (Hz) 72 | 73 |

The distance between the frequency peaks.

74 |
75 | 76 | 77 | Input 78 | 79 | 80 | 81 | Output 1 82 |

The sum output.

83 |
84 | 85 | 86 | Output 2 87 |

The difference output.

88 |
89 | 90 | 91 | 92 | 93 | 94 |
95 |
96 | -------------------------------------------------------------------------------- /const_1909.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Constant Signal Generator 14 |

This plugin add an output DC offset at the given amplitude to the input 15 | signal. It has no real use other than for debugging and in modular synths.

16 | 17 | 20 | 21 | last_amp = amp; 32 | ]]> 33 | 34 | 35 | Signal amplitude 36 |

Controls the amplitude of the output signal.

37 | 38 |
39 | 40 | 41 | Input 42 | 43 | 44 | 45 | Output 46 | 47 | 48 | 49 |
50 |
51 | -------------------------------------------------------------------------------- /crossover_dist_1404.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | Crossover distortion 17 |

This is a simulation of the distortion that happens in class B and AB power amps when the signal crosses 0.

18 |

For class B simulations the smooth value should be set to about 0.3 +/- 0.2 and for AB it should be set to near 1.0.

19 | 20 | 39 | 40 | 41 | Crossover amplitude 42 |

Controls the point at which the output signal becomes linear.

43 | 44 |
45 | 46 | 47 | Smoothing 48 |

Controls degree of smoothing of the crossover point.

49 | 50 |
51 | 52 | 53 | Input 54 | 55 | 56 | 57 | Output 58 | 59 |
60 |
61 | -------------------------------------------------------------------------------- /dc_remove_1207.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | DC Offset Remover 14 |

Simply removes the DC (0 Hz) component from an audio signal, uses a high pass filter, so has some side effects, but they should be minimal.

15 | 16 | 20 | 21 | itm1 = itm1; 31 | plugin_data->otm1 = otm1; 32 | ]]> 33 | 34 | 35 | Input 36 | 37 | 38 | 39 | Output 40 | 41 | 42 | 43 | 44 |
45 |
46 | -------------------------------------------------------------------------------- /debug_1184.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | #include "stdio.h" 11 | 12 | 13 | 14 | 15 | Debug Plugin 16 |

Prints some stats about the input stream to stdout. Not intended for general use.

17 | 18 | 19 | printf("sample rate %ld\n", s_rate); 20 | 21 | 22 | 23 | static LADSPA_Data max, min, maxl, minl; 24 | unsigned long pos; 25 | 26 | if (reset) { 27 | max = 0; 28 | min = 0; 29 | maxl = 0; 30 | minl = 1; 31 | } 32 | 33 | for (pos = 0; pos < sample_count; pos++) { 34 | if (allvals) { 35 | printf("%f\n", input[pos]); 36 | } 37 | max = fabs(input[pos]) > max?fabs(input[pos]):max; 38 | min = fabs(input[pos]) < min?fabs(input[pos]):min; 39 | maxl = input[pos] > maxl?input[pos]:maxl; 40 | minl = input[pos] < minl?input[pos]:minl; 41 | buffer_write(output[pos], input[pos]); 42 | } 43 | printf("amplitude (%f, %f)\t", min, max); 44 | printf("level (%f, %f)\n", minl, maxl); 45 | 46 | 47 | 48 | Diplay all values? 49 | 50 | 51 | 52 | 53 | Reset counters? 54 | 55 | 56 | 57 | 58 | Input 59 | 60 | 61 | 62 | Output 63 | 64 |
65 |
66 | -------------------------------------------------------------------------------- /decay_1886.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 | 18 | 19 | 20 | Exponential signal decay 21 |

Based on work by James McCartney in SuperCollider.

22 | 23 | 32 | 33 | 39 | 40 | last_decay_time = decay_time; 45 | plugin_data->b = decay_time == 0.f ? 0.f : exp (LOG001 / (decay_time * sample_rate)); 46 | plugin_data->first_time = 0; 47 | } 48 | 49 | if (decay_time == last_decay_time) { 50 | if (b == 0.f) 51 | for (i=0; ib = decay_time == 0.f ? 0.f : exp (LOG001 / (decay_time * sample_rate)); 60 | b_slope = (plugin_data->b - b) / sample_count; 61 | 62 | for (i=0; ilast_decay_time = decay_time; 68 | } 69 | 70 | plugin_data->y = y; 71 | ]]> 72 | 73 | 74 | Input 75 | 76 | 77 | 78 | Output 79 | 80 | 81 | 82 | Decay Time (s) 83 | 84 |

85 | Time for the echoes to decay by 60 decibels. 86 |

87 |
88 | 89 | 90 | 91 | 92 | 93 | 94 |
95 |
96 | -------------------------------------------------------------------------------- /decimator_1202.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | #include "ladspa-util.h" 12 | ]]> 13 | 14 | 15 | 16 | Decimator 17 |

Decimates (reduces the effective sample rate), and reduces the bit depth of the input signal, allows non integer values for smooth transitions between clean and lofi signals.

18 | 19 | 20 | sample_rate = s_rate; 21 | count = 0.0f; 22 | last_out = 0.0f; 23 | 24 | 25 | = 31.0f || bits < 1.0f) { 31 | step = 0.0f; 32 | stepr = 1.0f; 33 | } else { 34 | step = pow(0.5f, bits - 0.999f); 35 | stepr = 1/step; 36 | } 37 | 38 | if (fs >= sample_rate) { 39 | ratio = 1.0f; 40 | } else { 41 | ratio = fs/sample_rate; 42 | } 43 | 44 | for (pos = 0; pos < sample_count; pos++) { 45 | count += ratio; 46 | 47 | if (count >= 1.0f) { 48 | count -= 1.0f; 49 | delta = modf((input[pos] + (input[pos]<0?-1.0:1.0)*step*0.5) * stepr, &dummy) * step; 50 | last_out = input[pos] - delta; 51 | buffer_write(output[pos], last_out); 52 | } else { 53 | buffer_write(output[pos], last_out); 54 | } 55 | } 56 | 57 | plugin_data->last_out = last_out; 58 | plugin_data->count = count; 59 | ]]> 60 | 61 | 62 | Bit depth 63 | 64 |

The bit depth that the signal will be reduced to.

65 |
66 | 67 | 68 | Sample rate (Hz) 69 | 70 |

The sample rate that the signal will be resampled at.

71 |
72 | 73 | 74 | Input 75 | 76 | 77 | 78 | 79 | Output 80 | 81 | 82 | 83 | 84 | 85 | 86 |
87 |
88 | -------------------------------------------------------------------------------- /declip_1195.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | #define MAX_AMP 1.0f 11 | #define CLIP 0.8f 12 | #define CLIP_A ((MAX_AMP - CLIP) * (MAX_AMP - CLIP)) 13 | #define CLIP_B (MAX_AMP - 2.0f * CLIP) 14 | 15 | 16 | 17 | 18 | Declipper 19 |

Removes nasty clicks from input signals, not very kind to them though.

20 |

This code came from the music-dsp mailing list, but it was unattributed, if it's yours, please drop me a line and I'll credit you.

21 | 22 | -CLIP)) { 29 | buffer_write(output[pos], in); 30 | } else if (in > 0.0f) { 31 | buffer_write(output[pos], MAX_AMP - (CLIP_A / (CLIP_B + in))); 32 | } else { 33 | buffer_write(output[pos], -(MAX_AMP - (CLIP_A / (CLIP_B - in)))); 34 | } 35 | } 36 | ]]> 37 | 38 | 39 | Input 40 | 41 | 42 | 43 | 44 | Output 45 | 46 | 47 |
48 |
49 | -------------------------------------------------------------------------------- /diode_1185.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Diode Processor 13 |

Mangles the signal as if it had been passed through a diode rectifier network.

14 |

You should probably follow this with a DC offset remover, unless you want the offset.

15 | 16 | = 0.0f && mode < 1.0f) { 20 | for (pos = 0; pos < sample_count; pos++) { 21 | buffer_write(output[pos], ((1.0f-mode) * input[pos]) + 22 | (mode * (input[pos] > 0.0f ? input[pos] : 0.0f))); 23 | } 24 | } else if (mode >= 1.0f && mode < 2.0f) { 25 | float fac = mode - 1.0f; 26 | for (pos = 0; pos < sample_count; pos++) { 27 | buffer_write(output[pos], ((1.0f-fac) * (input[pos] > 0 ? 28 | input[pos] : 0.0)) + (fac * fabs(input[pos]))); 29 | } 30 | } else if (mode >= 2) { 31 | float fac = mode < 3 ? mode - 2 : 1.0; 32 | for (pos = 0; pos < sample_count; pos++) { 33 | buffer_write(output[pos], (1.0-fac) * fabs(input[pos])); 34 | } 35 | } else { 36 | for (pos = 0; pos < sample_count; pos++) { 37 | buffer_write(output[pos], input[pos]); 38 | } 39 | } 40 | ]]> 41 | 42 | 43 | Mode (0 for none, 1 for half wave, 2 for full wave) 44 |

The mode parameter is continuously variable from thru to half-wave rectification to full-wave to silence.

45 | 46 |
47 | 48 | 49 | Input 50 | 51 | 52 | 53 | Output 54 | 55 |
56 |
57 | -------------------------------------------------------------------------------- /divider_1186.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Audio Divider (Suboctave Generator) 13 |

Reduces the period of the signal by the factor given, and makes it a square wave in the process. Has some amplitude tracking capability, but not really useful on complex signals.

14 | 15 | 23 | 24 | 0.0f && last <= 0.0f) || 33 | (input[pos] < 0.0f && last >= 0.0)) { 34 | zeroxs++; 35 | if (den == 1) { 36 | out = out > 0.0f ? -1.0f : 1.0f; 37 | lamp = amp / count; 38 | zeroxs = 0; 39 | count = 0; 40 | amp = 0; 41 | } 42 | } 43 | amp += fabs(input[pos]); 44 | if (den > 1 && (zeroxs % den) == den-1) { 45 | out = out > 0.0f ? -1.0f : 1.0f; 46 | lamp = amp / count; 47 | zeroxs = 0; 48 | count = 0; 49 | amp = 0; 50 | } 51 | last = input[pos]; 52 | buffer_write(output[pos], out * lamp); 53 | } 54 | 55 | plugin_data->last = last; 56 | plugin_data->amp = amp; 57 | plugin_data->lamp = lamp; 58 | plugin_data->zeroxs = zeroxs; 59 | plugin_data->count = count; 60 | plugin_data->out = out; 61 | ]]> 62 | 63 | 64 | Denominator 65 | 66 |

The factor the incoming frequency will be divided by.

67 |
68 | 69 | 70 | Input 71 | 72 | 73 | 74 | Output 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 |
96 |
97 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | all: ladspa-swh.html ladspa-swh.pdf 2 | 3 | test: 4 | touch ../amp_1181.xml 5 | make view 6 | 7 | view: ladspa-swh.ps 8 | gv ladspa-swh.ps 9 | 10 | ladspa-swh.tex: ../*.xml 11 | ./makedocs.pl ../*.xml > ladspa-swh.tex 12 | latex ladspa-swh.tex 13 | latex ladspa-swh.tex 14 | 15 | ladspa-swh.dvi: ladspa-swh.tex 16 | latex ladspa-swh.tex 17 | latex ladspa-swh.tex 18 | 19 | ladspa-swh.ps: ladspa-swh.dvi 20 | dvips ladspa-swh.dvi -o 21 | 22 | ladspa-swh.pdf: ladspa-swh.ps 23 | ps2pdf ladspa-swh.ps 24 | 25 | ladspa-swh.html: ladspa-swh.tex 26 | tth -v -Lladspa-swh ladspa-swh-tmp.html 27 | ./addstyle.pl ladspa-swh.html 28 | rm -f ladspa-swh-tmp.html 29 | date -I > timestamp.txt 30 | -------------------------------------------------------------------------------- /docs/addstyle.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | $style = < 5 | BODY { 6 | font-family: sans-serif; 7 | font-size: 10pt; 8 | color: black; 9 | background: white; 10 | } 11 | 12 | H1 { 13 | font-size: 16pt; 14 | } 15 | 16 | H2 { 17 | padding-top: 10pt; 18 | font-size: 14pt; 19 | } 20 | 21 | H3 { 22 | padding-top: 10pt; 23 | font-size: 12pt; 24 | } 25 | 26 | P { 27 | font-size: 10pt; 28 | } 29 | 30 | TD { 31 | font-size: 10pt; 32 | } 33 | 34 | A { 35 | text-decoration: none; 36 | } 37 | 38 | EOB 39 | 40 | while(<>) { 41 | s/<\/title>/$&\n$style/i; 42 | print; 43 | } 44 | -------------------------------------------------------------------------------- /docs/makedocs.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use XML::Parser; 4 | 5 | my $parser = new XML::Parser(ErrorContext => 2); 6 | 7 | $parser->setHandlers(Start => \&start, 8 | End => \&end, 9 | Char => \&char); 10 | 11 | &loadstats; 12 | &preamble; 13 | while ($file = shift) { 14 | $parser->parsefile($file); 15 | } 16 | &postamble; 17 | 18 | sub start { 19 | my ($p, $el, %attr) = @_; 20 | 21 | unshift(@elements, $el); 22 | if ($el eq "plugin") { 23 | $pluginLabel = $attr{label}; 24 | $pluginLabelLabel = $attr{label}; 25 | $pluginLabel =~ s/%/\\%/g; 26 | $pluginLabel =~ s/_/\\_/g; 27 | $pluginID = $attr{id}; 28 | $title = ""; 29 | } 30 | } 31 | 32 | sub char { 33 | my ($p, $str) = @_; 34 | 35 | $str =~ s/%/\\%/g; 36 | $str =~ s/_/\\_/g; 37 | if ($elements[0] eq "name" && $elements[1] eq "plugin") { 38 | print '\subsection{'.$str.' ('.$pluginLabel.', '.$pluginID.")\\label{${pluginLabelLabel}}\\label{id${pluginID}}}\n"; 39 | if ($cycles{$pluginID}) { 40 | print "CPU usage: ".$cycles{$pluginID}." cycles/sample\n\n"; 41 | } 42 | } 43 | $title = '\subsubsection*{'.$str."}\n" if $elements[0] eq "name" && $elements[1] eq "port"; 44 | if ($elements[0] eq "p") { 45 | print $title.$str; 46 | $title = ""; 47 | } 48 | } 49 | 50 | sub end { 51 | my ($p, $el) = @_; 52 | 53 | shift(@elements); 54 | } 55 | 56 | sub loadstats { 57 | open(DATA, "../timetest/timetest.results"); 58 | while() { 59 | @line = split(" "); 60 | $cycles{$line[0]} = $line[2]; 61 | } 62 | } 63 | 64 | sub preamble { 65 | $date = `date -I`; 66 | chomp $date; 67 | print < 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | #include "ladspa-util.h" 10 | 11 | #define BASE_BUFFER 8 // Base buffer length (s) 12 | 13 | 14 | 15 | 16 | Fractionally Addressed Delay Line 17 |

A fixed ring buffer delay implementation. Has different dynamics to a normal delay, more suitable for certain things.

18 |

Changes in delay length are generally more pleasing, but delays >2s long have reduced sound quality.

19 | 20 | 33 | 34 | 35 | int i; 36 | 37 | for (i = 0; i < buffer_size; i++) { 38 | buffer[i] = 0; 39 | } 40 | phase = 0; 41 | last_phase = 0; 42 | last_in = 0.0f; 43 | 44 | 45 | 46 | free(plugin_data->buffer); 47 | 48 | 49 | 1.0f ? 1.0f : lin_inc; 68 | lin_int = 0.0f; 69 | for (track = last_phase; track < phase; track++) { 70 | lin_int += lin_inc; 71 | buffer[track % buffer_size] = out * fb + 72 | LIN_INTERP(lin_int, last_in, input[pos]); 73 | } 74 | last_in = input[pos]; 75 | buffer_write(output[pos], out); 76 | if (phase >= buffer_size) { 77 | phase -= buffer_size; 78 | } 79 | } 80 | 81 | // Store current phase in instance 82 | plugin_data->phase = phase; 83 | plugin_data->last_phase = last_phase; 84 | plugin_data->last_in = last_in; 85 | ]]> 86 | 87 | 88 | Delay (seconds) 89 |

The neutral delay time is 2 seconds. Times above 2 seconds will have reduced quality and times below will have increased CPU usage.

90 | 91 |
92 | 93 | 94 | Feedback (dB) 95 | 96 | 97 | 98 | 99 | Input 100 | 101 | 102 | 103 | Output 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 |
114 |
115 | -------------------------------------------------------------------------------- /fm_osc_1415.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | #include "ladspa-util.h" 12 | #include "util/blo.h" 13 | 14 | 15 | 16 | 17 | FM Oscillator 18 | 19 | 23 | 24 | wave = LIMIT(f_round(wave) - 1, 0, BLO_N_WAVES-1); 27 | 28 | for (pos = 0; pos < sample_count; pos++) { 29 | blo_hd_set_freq(osc, fm[pos]); 30 | buffer_write(output[pos], blo_hd_run_cub(osc)); 31 | } 32 | ]]> 33 | 34 | tables); 36 | blo_h_free(plugin_data->osc); 37 | ]]> 38 | 39 | 40 | Waveform (1=sin, 2=tri, 3=squ, 4=saw) 41 |

The shape of the waveform.

42 |

54 | 55 |
56 | 57 | 58 | Frequency (Hz) 59 |

The frequency of the output (in Hertz).

60 | 61 |
62 | 63 | 64 | Output 65 | 66 | 67 | 68 | 69 |
70 |
71 | -------------------------------------------------------------------------------- /foldover_1213.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Foldover distortion 14 |

Uses a sinwave approximation to simulate valve style foldover distortion.

15 |

Probably should have a DC offset remover on the output, but it's not always necessary.

16 | 17 | 27 | 28 | 29 | Drive 30 | 31 |

Controls the degree of distortion.

32 |
33 | 34 | 35 | Skew 36 | 37 |

Controls the asymmetry of the waveform.

38 |
39 | 40 | 41 | Input 42 | 43 | 44 | 45 | Output 46 | 47 |
48 |
49 | -------------------------------------------------------------------------------- /foverdrive_1196.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Fast overdrive 13 |

A simple overdrive. Compresses the extreme peaks to make a sound similar to an overdriven amplifier.

14 | 15 | 16 | unsigned long pos; 17 | const float drivem1 = drive - 1.0f; 18 | 19 | for (pos = 0; pos < sample_count; pos++) { 20 | LADSPA_Data x = input[pos]; 21 | const float fx = fabs(x); 22 | buffer_write(output[pos], x*(fx + drive)/(x*x + drivem1*fx + 1.0f)); 23 | } 24 | 25 | 26 | 27 | Drive level 28 | 29 |

Controls the point at which the signal starts to distort, and the degree of distortion.

30 |
31 | 32 | 33 | Input 34 | 35 | 36 | 37 | Output 38 | 39 |
40 |
41 | -------------------------------------------------------------------------------- /freq_tracker_1418.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | Frequency tracker 17 | 18 | 25 | 26 | 32 | 33 | 0.0f) { 41 | if (cross_time > 3.0f) { 42 | f = fs / ((float)cross_time * 2.0f); 43 | } 44 | cross_time = 0; 45 | } 46 | xm1 = input[pos]; 47 | cross_time++; 48 | fo = fo * damp_lp + f * damp_lpi; 49 | fo = flush_to_zero(fo); 50 | buffer_write(freq[pos], fo); 51 | } 52 | 53 | plugin_data->last_amp = xm1; 54 | plugin_data->fo = fo; 55 | plugin_data->f = f; 56 | plugin_data->cross_time = cross_time; 57 | ]]> 58 | 59 | 60 | Tracking speed 61 |

This controls the level of damping applied to the output.

62 |

High values will make the frequency output jump around, low values will make it a bit slow to respond.

63 | 64 |
65 | 66 | 67 | Input 68 | 69 | 70 | 71 | Frequency (Hz) 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 |
80 |
81 | -------------------------------------------------------------------------------- /gong_beater_1439.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | #include "ladspa-util.h" 12 | 13 | 14 | 15 | 16 | Gong beater 17 |

A plugin to simulator the action of a beater on a gong surface, used to trigger the gong physical model.

18 |

It is triggered by an impulse on the input, eg. from a mic or piezo placed near a solid surface, for an event sequencer.

19 | 20 | 29 | 30 | 37 | 38 | 0.05f) { 48 | running = strike_duration * fs; 49 | imp_level = fabs(input[pos]); 50 | } 51 | buffer_write(output[pos], input[pos] * imp_amp); 52 | } 53 | for (; running && pos < sample_count; pos++, running--) { 54 | if (fabs(input[pos]) > imp_level) { 55 | imp_level = fabs(input[pos]); 56 | } 57 | x -= omega * y; 58 | y += omega * x; 59 | xm -= omega * 0.5f * ym; 60 | ym += omega * 0.5f * xm; 61 | 62 | buffer_write(output[pos], input[pos] * imp_amp + y * strike_amp * 63 | imp_level * 4.0f * ym); 64 | } 65 | } 66 | 67 | plugin_data->x = x; 68 | plugin_data->y = y; 69 | plugin_data->xm = xm; 70 | plugin_data->ym = ym; 71 | plugin_data->running = running; 72 | plugin_data->imp_level = imp_level; 73 | ]]> 74 | 75 | 76 | Impulse gain (dB) 77 |

The gain of the input impulse mixed into the output, bringing this up allows you to make the outputted strike more impulsive, but may reduce the gongyness of the resulting output sound.

78 | 79 |
80 | 81 | 82 | Strike gain (dB) 83 |

The gain of the simulated pressure wave mixed into the output, bringing this up allows you to make the outputted strike more pure. The final output level is also proportional to the amplitude of the trigger.

84 | 85 |
86 | 87 | 88 | Strike duration (s) 89 |

The duration of the pressure wave used to simulate the action of the beater on the gong surface. The longer the duration the more sonorous the resulting gong sound.

90 | 91 |
92 | 93 | 94 | Input 95 | 96 | 97 | 98 | Output 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 |
109 |
110 | -------------------------------------------------------------------------------- /gsm/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann, 2 | Technische Universitaet Berlin 3 | 4 | Any use of this software is permitted provided that this notice is not 5 | removed and that neither the authors nor the Technische Universitaet Berlin 6 | are deemed to have made any representations as to the suitability of this 7 | software for any purpose nor are held responsible for any defects of 8 | this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 9 | 10 | As a matter of courtesy, the authors request to be informed about uses 11 | this software has found, about bugs in this software, and about any 12 | improvements that may be of general interest. 13 | 14 | Berlin, 28.11.1994 15 | Jutta Degener 16 | Carsten Bormann 17 | -------------------------------------------------------------------------------- /gsm/Makefile.am: -------------------------------------------------------------------------------- 1 | LIBTOOL=libtool 2 | RANLIB=ranlib 3 | 4 | noinst_HEADERS = gsm.h config.h private.h proto.h unproto.h 5 | noinst_LIBRARIES = libgsm.a 6 | 7 | CFILES = add.c decode.c gsm_decode.c gsm_encode.c long_term.c preprocess.c \ 8 | short_term.c code.c gsm_create.c gsm_destroy.c gsm_option.c lpc.c rpe.c table.c 9 | 10 | libgsm_a_SOURCES = $(CFILES) $(noinst_HEADERS) 11 | 12 | # Disable autoheader. 13 | AUTOHEADER=echo 14 | 15 | -------------------------------------------------------------------------------- /gsm/README: -------------------------------------------------------------------------------- 1 | GSM 06.10 13 kbit/s RPE/LTP speech codec 2 | ---------------------------------------- 3 | 4 | All the file in this directory were written by Jutta Degener 5 | and Carsten Borman for The Communications and Operating Systems 6 | Research Group (KBS) at the Technische Universitaet Berlin. 7 | 8 | Their work was released under the following license which is 9 | assumed to be compatible with The GNU Lesser General Public License. 10 | 11 | ---------------------------------------------------------------------------- 12 | 13 | Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann, 14 | Technische Universitaet Berlin 15 | 16 | Any use of this software is permitted provided that this notice is not 17 | removed and that neither the authors nor the Technische Universitaet Berlin 18 | are deemed to have made any representations as to the suitability of this 19 | software for any purpose nor are held responsible for any defects of 20 | this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 21 | 22 | As a matter of courtesy, the authors request to be informed about uses 23 | this software has found, about bugs in this software, and about any 24 | improvements that may be of general interest. 25 | 26 | Berlin, 28.11.1994 27 | Jutta Degener (jutta@cs.tu-berlin.de) 28 | Carsten Bormann (cabo@cs.tu-berlin.de) 29 | 30 | ---------------------------------------------------------------------------- 31 | 32 | Jutta Degener and Carsten Bormann's work can be found on their homepage 33 | at: 34 | 35 | http://kbs.cs.tu-berlin.de/~jutta/toast.html 36 | 37 | -------------------------------------------------------------------------------- /gsm/code.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische 3 | * Universitaet Berlin. See the accompanying file "COPYRIGHT" for 4 | * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 5 | */ 6 | 7 | /* $Header: /home/cvs/giga/ladspa-swh/gsm/code.c,v 1.2 2003/03/07 23:26:13 swh Exp $ */ 8 | 9 | #include "config.h" 10 | #include 11 | 12 | 13 | #ifdef HAS_STDLIB_H 14 | #include 15 | #else 16 | # include "proto.h" 17 | extern char * memcpy P((char *, char *, int)); 18 | #endif 19 | 20 | #include "private.h" 21 | #include "gsm.h" 22 | #include "proto.h" 23 | 24 | /* 25 | * 4.2 FIXED POINT IMPLEMENTATION OF THE RPE-LTP CODER 26 | */ 27 | 28 | void Gsm_Coder P8((S,s,LARc,Nc,bc,Mc,xmaxc,xMc), 29 | 30 | struct gsm_state * S, 31 | 32 | word * s, /* [0..159] samples IN */ 33 | 34 | /* 35 | * The RPE-LTD coder works on a frame by frame basis. The length of 36 | * the frame is equal to 160 samples. Some computations are done 37 | * once per frame to produce at the output of the coder the 38 | * LARc[1..8] parameters which are the coded LAR coefficients and 39 | * also to realize the inverse filtering operation for the entire 40 | * frame (160 samples of signal d[0..159]). These parts produce at 41 | * the output of the coder: 42 | */ 43 | 44 | word * LARc, /* [0..7] LAR coefficients OUT */ 45 | 46 | /* 47 | * Procedure 4.2.11 to 4.2.18 are to be executed four times per 48 | * frame. That means once for each sub-segment RPE-LTP analysis of 49 | * 40 samples. These parts produce at the output of the coder: 50 | */ 51 | 52 | word * Nc, /* [0..3] LTP lag OUT */ 53 | word * bc, /* [0..3] coded LTP gain OUT */ 54 | word * Mc, /* [0..3] RPE grid selection OUT */ 55 | word * xmaxc,/* [0..3] Coded maximum amplitude OUT */ 56 | word * xMc /* [13*4] normalized RPE samples OUT */ 57 | ) 58 | { 59 | int k; 60 | word * dp = S->dp0 + 120; /* [ -120...-1 ] */ 61 | word * dpp = dp; /* [ 0...39 ] */ 62 | 63 | static word e[50]; 64 | 65 | word so[160]; 66 | 67 | Gsm_Preprocess (S, s, so); 68 | Gsm_LPC_Analysis (S, so, LARc); 69 | Gsm_Short_Term_Analysis_Filter (S, LARc, so); 70 | 71 | for (k = 0; k <= 3; k++, xMc += 13) { 72 | 73 | Gsm_Long_Term_Predictor ( S, 74 | so+k*40, /* d [0..39] IN */ 75 | dp, /* dp [-120..-1] IN */ 76 | e + 5, /* e [0..39] OUT */ 77 | dpp, /* dpp [0..39] OUT */ 78 | Nc++, 79 | bc++); 80 | 81 | Gsm_RPE_Encoding ( S, 82 | e + 5, /* e ][0..39][ IN/OUT */ 83 | xmaxc++, Mc++, xMc ); 84 | /* 85 | * Gsm_Update_of_reconstructed_short_time_residual_signal 86 | * ( dpp, e + 5, dp ); 87 | */ 88 | 89 | { register int i; 90 | register longword ltmp; 91 | for (i = 0; i <= 39; i++) 92 | dp[ i ] = GSM_ADD( e[5 + i], dpp[i] ); 93 | } 94 | dp += 40; 95 | dpp += 40; 96 | 97 | } 98 | (void)memcpy( (char *)S->dp0, (char *)(S->dp0 + 160), 99 | 120 * sizeof(*S->dp0) ); 100 | } 101 | -------------------------------------------------------------------------------- /gsm/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische 3 | * Universitaet Berlin. See the accompanying file "COPYRIGHT" for 4 | * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 5 | */ 6 | 7 | /*$Header: /home/cvs/giga/ladspa-swh/gsm/config.h,v 1.1 2001/06/10 21:36:51 swh Exp $*/ 8 | 9 | #ifndef CONFIG_H 10 | #define CONFIG_H 11 | 12 | //*efine SIGHANDLER_T int /* signal handlers are void */ 13 | //*efine HAS_SYSV_SIGNAL 1 /* sigs not blocked/reset? */ 14 | 15 | #define HAS_STDLIB_H 1 /* /usr/include/stdlib.h */ 16 | //*efine HAS_LIMITS_H 1 /* /usr/include/limits.h */ 17 | #define HAS_FCNTL_H 1 /* /usr/include/fcntl.h */ 18 | //*efine HAS_ERRNO_DECL 1 /* errno.h declares errno */ 19 | 20 | #define HAS_FSTAT 1 /* fstat syscall */ 21 | #define HAS_FCHMOD 1 /* fchmod syscall */ 22 | #define HAS_CHMOD 1 /* chmod syscall */ 23 | #define HAS_FCHOWN 1 /* fchown syscall */ 24 | #define HAS_CHOWN 1 /* chown syscall */ 25 | //*efine HAS__FSETMODE 1 /* _fsetmode -- set file mode */ 26 | 27 | #define HAS_STRING_H 1 /* /usr/include/string.h */ 28 | //*efine HAS_STRINGS_H 1 /* /usr/include/strings.h */ 29 | 30 | #define HAS_UNISTD_H 1 /* /usr/include/unistd.h */ 31 | #define HAS_UTIME 1 /* POSIX utime(path, times) */ 32 | //*efine HAS_UTIMES 1 /* use utimes() syscall instead */ 33 | #define HAS_UTIME_H 1 /* UTIME header file */ 34 | //*efine HAS_UTIMBUF 1 /* struct utimbuf */ 35 | //*efine HAS_UTIMEUSEC 1 /* microseconds in utimbuf? */ 36 | 37 | #endif /* CONFIG_H */ 38 | -------------------------------------------------------------------------------- /gsm/decode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische 3 | * Universitaet Berlin. See the accompanying file "COPYRIGHT" for 4 | * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 5 | */ 6 | 7 | /* $Header: /home/cvs/giga/ladspa-swh/gsm/decode.c,v 1.1 2001/06/10 21:36:51 swh Exp $ */ 8 | 9 | #include 10 | 11 | #include "private.h" 12 | #include "gsm.h" 13 | #include "proto.h" 14 | 15 | /* 16 | * 4.3 FIXED POINT IMPLEMENTATION OF THE RPE-LTP DECODER 17 | */ 18 | 19 | static void Postprocessing P2((S,s), 20 | struct gsm_state * S, 21 | register word * s) 22 | { 23 | register int k; 24 | register word msr = S->msr; 25 | register longword ltmp; /* for GSM_ADD */ 26 | register word tmp; 27 | 28 | for (k = 160; k--; s++) { 29 | tmp = GSM_MULT_R( msr, 28180 ); 30 | msr = GSM_ADD(*s, tmp); /* Deemphasis */ 31 | *s = GSM_ADD(msr, msr) & 0xFFF8; /* Truncation & Upscaling */ 32 | } 33 | S->msr = msr; 34 | } 35 | 36 | void Gsm_Decoder P8((S,LARcr, Ncr,bcr,Mcr,xmaxcr,xMcr,s), 37 | struct gsm_state * S, 38 | 39 | word * LARcr, /* [0..7] IN */ 40 | 41 | word * Ncr, /* [0..3] IN */ 42 | word * bcr, /* [0..3] IN */ 43 | word * Mcr, /* [0..3] IN */ 44 | word * xmaxcr, /* [0..3] IN */ 45 | word * xMcr, /* [0..13*4] IN */ 46 | 47 | word * s) /* [0..159] OUT */ 48 | { 49 | int j, k; 50 | word erp[40], wt[160]; 51 | word * drp = S->dp0 + 120; 52 | 53 | for (j=0; j <= 3; j++, xmaxcr++, bcr++, Ncr++, Mcr++, xMcr += 13) { 54 | 55 | Gsm_RPE_Decoding( S, *xmaxcr, *Mcr, xMcr, erp ); 56 | Gsm_Long_Term_Synthesis_Filtering( S, *Ncr, *bcr, erp, drp ); 57 | 58 | for (k = 0; k <= 39; k++) wt[ j * 40 + k ] = drp[ k ]; 59 | } 60 | 61 | Gsm_Short_Term_Synthesis_Filter( S, LARcr, wt, s ); 62 | Postprocessing(S, s); 63 | } 64 | -------------------------------------------------------------------------------- /gsm/gsm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische 3 | * Universitaet Berlin. See the accompanying file "COPYRIGHT" for 4 | * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 5 | */ 6 | 7 | /*$Header: /home/cvs/giga/ladspa-swh/gsm/gsm.h,v 1.1 2001/06/10 21:36:51 swh Exp $*/ 8 | 9 | #ifndef GSM_H 10 | #define GSM_H 11 | 12 | #ifdef __cplusplus 13 | # define NeedFunctionPrototypes 1 14 | #endif 15 | 16 | #if __STDC__ 17 | # define NeedFunctionPrototypes 1 18 | #endif 19 | 20 | #ifdef _NO_PROTO 21 | # undef NeedFunctionPrototypes 22 | #endif 23 | 24 | #ifdef NeedFunctionPrototypes 25 | # include /* for FILE * */ 26 | #endif 27 | 28 | #undef GSM_P 29 | #if NeedFunctionPrototypes 30 | # define GSM_P( protos ) protos 31 | #else 32 | # define GSM_P( protos ) ( /* protos */ ) 33 | #endif 34 | 35 | /* 36 | * Interface 37 | */ 38 | 39 | typedef struct gsm_state * gsm; 40 | typedef short gsm_signal; /* signed 16 bit */ 41 | typedef unsigned char gsm_byte; 42 | typedef gsm_byte gsm_frame[33]; /* 33 * 8 bits */ 43 | 44 | #define GSM_MAGIC 0xD /* 13 kbit/s RPE-LTP */ 45 | 46 | #define GSM_PATCHLEVEL 10 47 | #define GSM_MINOR 0 48 | #define GSM_MAJOR 1 49 | 50 | #define GSM_OPT_VERBOSE 1 51 | #define GSM_OPT_FAST 2 52 | #define GSM_OPT_LTP_CUT 3 53 | #define GSM_OPT_WAV49 4 54 | #define GSM_OPT_FRAME_INDEX 5 55 | #define GSM_OPT_FRAME_CHAIN 6 56 | 57 | extern gsm gsm_create GSM_P((void)); 58 | extern void gsm_destroy GSM_P((gsm)); 59 | 60 | extern int gsm_print GSM_P((FILE *, gsm, gsm_byte *)); 61 | extern int gsm_option GSM_P((gsm, int, int *)); 62 | 63 | extern void gsm_encode GSM_P((gsm, gsm_signal *, gsm_byte *)); 64 | extern int gsm_decode GSM_P((gsm, gsm_byte *, gsm_signal *)); 65 | 66 | extern int gsm_explode GSM_P((gsm, gsm_byte *, gsm_signal *)); 67 | extern void gsm_implode GSM_P((gsm, gsm_signal *, gsm_byte *)); 68 | 69 | #undef GSM_P 70 | 71 | #endif /* GSM_H */ 72 | -------------------------------------------------------------------------------- /gsm/gsm_create.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische 3 | * Universitaet Berlin. See the accompanying file "COPYRIGHT" for 4 | * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 5 | */ 6 | 7 | #include "config.h" 8 | 9 | #ifdef HAS_STRING_H 10 | #include 11 | #else 12 | # include "proto.h" 13 | extern char * memset P((char *, int, int)); 14 | #endif 15 | 16 | #ifdef HAS_STDLIB_H 17 | # include 18 | #else 19 | # ifdef HAS_MALLOC_H 20 | # include 21 | # else 22 | extern char * malloc(); 23 | # endif 24 | #endif 25 | 26 | #include 27 | 28 | #include "gsm.h" 29 | #include "private.h" 30 | #include "proto.h" 31 | 32 | gsm gsm_create P0() 33 | { 34 | gsm r; 35 | 36 | r = (gsm)malloc(sizeof(struct gsm_state)); 37 | if (!r) return r; 38 | 39 | memset((char *)r, 0, sizeof(*r)); 40 | r->nrp = 40; 41 | 42 | return r; 43 | } 44 | -------------------------------------------------------------------------------- /gsm/gsm_destroy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische 3 | * Universitaet Berlin. See the accompanying file "COPYRIGHT" for 4 | * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 5 | */ 6 | 7 | /* $Header: /home/cvs/giga/ladspa-swh/gsm/gsm_destroy.c,v 1.1 2001/06/10 21:36:51 swh Exp $ */ 8 | 9 | #include "gsm.h" 10 | #include "config.h" 11 | #include "proto.h" 12 | 13 | #ifdef HAS_STDLIB_H 14 | # include 15 | #else 16 | # ifdef HAS_MALLOC_H 17 | # include 18 | # else 19 | extern void free(); 20 | # endif 21 | #endif 22 | 23 | void gsm_destroy P1((S), gsm S) 24 | { 25 | if (S) free((char *)S); 26 | } 27 | -------------------------------------------------------------------------------- /gsm/gsm_option.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische 3 | * Universitaet Berlin. See the accompanying file "COPYRIGHT" for 4 | * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 5 | */ 6 | 7 | /* $Header: /home/cvs/giga/ladspa-swh/gsm/gsm_option.c,v 1.1 2001/06/10 21:36:51 swh Exp $ */ 8 | 9 | #include "private.h" 10 | 11 | #include "gsm.h" 12 | #include "proto.h" 13 | 14 | int gsm_option P3((r, opt, val), gsm r, int opt, int * val) 15 | { 16 | int result = -1; 17 | 18 | switch (opt) { 19 | case GSM_OPT_LTP_CUT: 20 | #ifdef LTP_CUT 21 | result = r->ltp_cut; 22 | if (val) r->ltp_cut = *val; 23 | #endif 24 | break; 25 | 26 | case GSM_OPT_VERBOSE: 27 | #ifndef NDEBUG 28 | result = r->verbose; 29 | if (val) r->verbose = *val; 30 | #endif 31 | break; 32 | 33 | case GSM_OPT_FAST: 34 | 35 | #if defined(FAST) && defined(USE_FLOAT_MUL) 36 | result = r->fast; 37 | if (val) r->fast = !!*val; 38 | #endif 39 | break; 40 | 41 | case GSM_OPT_FRAME_CHAIN: 42 | 43 | #ifdef WAV49 44 | result = r->frame_chain; 45 | if (val) r->frame_chain = *val; 46 | #endif 47 | break; 48 | 49 | case GSM_OPT_FRAME_INDEX: 50 | 51 | #ifdef WAV49 52 | result = r->frame_index; 53 | if (val) r->frame_index = *val; 54 | #endif 55 | break; 56 | 57 | case GSM_OPT_WAV49: 58 | 59 | #ifdef WAV49 60 | result = r->wav_fmt; 61 | if (val) r->wav_fmt = !!*val; 62 | #endif 63 | break; 64 | 65 | default: 66 | break; 67 | } 68 | return result; 69 | } 70 | -------------------------------------------------------------------------------- /gsm/preprocess.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische 3 | * Universitaet Berlin. See the accompanying file "COPYRIGHT" for 4 | * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 5 | */ 6 | 7 | /* $Header: /home/cvs/giga/ladspa-swh/gsm/preprocess.c,v 1.1 2001/06/10 21:36:51 swh Exp $ */ 8 | 9 | #include 10 | #include 11 | 12 | #include "private.h" 13 | 14 | #include "gsm.h" 15 | #include "proto.h" 16 | 17 | /* 4.2.0 .. 4.2.3 PREPROCESSING SECTION 18 | * 19 | * After A-law to linear conversion (or directly from the 20 | * Ato D converter) the following scaling is assumed for 21 | * input to the RPE-LTP algorithm: 22 | * 23 | * in: 0.1.....................12 24 | * S.v.v.v.v.v.v.v.v.v.v.v.v.*.*.* 25 | * 26 | * Where S is the sign bit, v a valid bit, and * a "don't care" bit. 27 | * The original signal is called sop[..] 28 | * 29 | * out: 0.1................... 12 30 | * S.S.v.v.v.v.v.v.v.v.v.v.v.v.0.0 31 | */ 32 | 33 | 34 | void Gsm_Preprocess P3((S, s, so), 35 | struct gsm_state * S, 36 | word * s, 37 | word * so ) /* [0..159] IN/OUT */ 38 | { 39 | 40 | word z1 = S->z1; 41 | longword L_z2 = S->L_z2; 42 | word mp = S->mp; 43 | 44 | word s1; 45 | longword L_s2; 46 | 47 | longword L_temp; 48 | 49 | word msp, lsp; 50 | word SO; 51 | 52 | longword ltmp; /* for ADD */ 53 | ulongword utmp; /* for L_ADD */ 54 | 55 | register int k = 160; 56 | 57 | while (k--) { 58 | 59 | /* 4.2.1 Downscaling of the input signal 60 | */ 61 | SO = SASR( *s, 3 ) << 2; 62 | s++; 63 | 64 | assert (SO >= -0x4000); /* downscaled by */ 65 | assert (SO <= 0x3FFC); /* previous routine. */ 66 | 67 | 68 | /* 4.2.2 Offset compensation 69 | * 70 | * This part implements a high-pass filter and requires extended 71 | * arithmetic precision for the recursive part of this filter. 72 | * The input of this procedure is the array so[0...159] and the 73 | * output the array sof[ 0...159 ]. 74 | */ 75 | /* Compute the non-recursive part 76 | */ 77 | 78 | s1 = SO - z1; /* s1 = gsm_sub( *so, z1 ); */ 79 | z1 = SO; 80 | 81 | assert(s1 != MIN_WORD); 82 | 83 | /* Compute the recursive part 84 | */ 85 | L_s2 = s1; 86 | L_s2 <<= 15; 87 | 88 | /* Execution of a 31 bv 16 bits multiplication 89 | */ 90 | 91 | msp = SASR( L_z2, 15 ); 92 | lsp = L_z2-((longword)msp<<15); /* gsm_L_sub(L_z2,(msp<<15)); */ 93 | 94 | L_s2 += GSM_MULT_R( lsp, 32735 ); 95 | L_temp = (longword)msp * 32735; /* GSM_L_MULT(msp,32735) >> 1;*/ 96 | L_z2 = GSM_L_ADD( L_temp, L_s2 ); 97 | 98 | /* Compute sof[k] with rounding 99 | */ 100 | L_temp = GSM_L_ADD( L_z2, 16384 ); 101 | 102 | /* 4.2.3 Preemphasis 103 | */ 104 | 105 | msp = GSM_MULT_R( mp, -28180 ); 106 | mp = SASR( L_temp, 15 ); 107 | *so++ = GSM_ADD( mp, msp ); 108 | } 109 | 110 | S->z1 = z1; 111 | S->L_z2 = L_z2; 112 | S->mp = mp; 113 | } 114 | -------------------------------------------------------------------------------- /gsm/proto.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische 3 | * Universitaet Berlin. See the accompanying file "COPYRIGHT" for 4 | * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 5 | */ 6 | 7 | /*$Header: /home/cvs/giga/ladspa-swh/gsm/proto.h,v 1.1 2001/06/10 21:36:51 swh Exp $*/ 8 | 9 | #ifndef PROTO_H 10 | #define PROTO_H 11 | 12 | /*#if __cplusplus*/ 13 | # define NeedFunctionPrototypes 1 14 | /*#endif*/ 15 | 16 | #if __STDC__ 17 | # define NeedFunctionPrototypes 1 18 | #endif 19 | 20 | #ifdef _NO_PROTO 21 | # undef NeedFunctionPrototypes 22 | #endif 23 | 24 | #undef P /* gnu stdio.h actually defines this... */ 25 | #undef P0 26 | #undef P1 27 | #undef P2 28 | #undef P3 29 | #undef P4 30 | #undef P5 31 | #undef P6 32 | #undef P7 33 | #undef P8 34 | 35 | #if NeedFunctionPrototypes 36 | 37 | # define P( protos ) protos 38 | 39 | # define P0() (void) 40 | # define P1(x, a) (a) 41 | # define P2(x, a, b) (a, b) 42 | # define P3(x, a, b, c) (a, b, c) 43 | # define P4(x, a, b, c, d) (a, b, c, d) 44 | # define P5(x, a, b, c, d, e) (a, b, c, d, e) 45 | # define P6(x, a, b, c, d, e, f) (a, b, c, d, e, f) 46 | # define P7(x, a, b, c, d, e, f, g) (a, b, c, d, e, f, g) 47 | # define P8(x, a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h) 48 | 49 | #else /* !NeedFunctionPrototypes */ 50 | 51 | # define P( protos ) ( /* protos */ ) 52 | 53 | # define P0() () 54 | # define P1(x, a) x a; 55 | # define P2(x, a, b) x a; b; 56 | # define P3(x, a, b, c) x a; b; c; 57 | # define P4(x, a, b, c, d) x a; b; c; d; 58 | # define P5(x, a, b, c, d, e) x a; b; c; d; e; 59 | # define P6(x, a, b, c, d, e, f) x a; b; c; d; e; f; 60 | # define P7(x, a, b, c, d, e, f, g) x a; b; c; d; e; f; g; 61 | # define P8(x, a, b, c, d, e, f, g, h) x a; b; c; d; e; f; g; h; 62 | 63 | #endif /* !NeedFunctionPrototypes */ 64 | 65 | #endif /* PROTO_H */ 66 | -------------------------------------------------------------------------------- /gsm/table.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische 3 | * Universitaet Berlin. See the accompanying file "COPYRIGHT" for 4 | * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 5 | */ 6 | 7 | /* $Header: /home/cvs/giga/ladspa-swh/gsm/table.c,v 1.1 2001/06/10 21:36:51 swh Exp $ */ 8 | 9 | /* Most of these tables are inlined at their point of use. 10 | */ 11 | 12 | /* 4.4 TABLES USED IN THE FIXED POINT IMPLEMENTATION OF THE RPE-LTP 13 | * CODER AND DECODER 14 | * 15 | * (Most of them inlined, so watch out.) 16 | */ 17 | 18 | #define GSM_TABLE_C 19 | #include "private.h" 20 | #include "gsm.h" 21 | 22 | /* Table 4.1 Quantization of the Log.-Area Ratios 23 | */ 24 | /* i 1 2 3 4 5 6 7 8 */ 25 | word gsm_A[8] = {20480, 20480, 20480, 20480, 13964, 15360, 8534, 9036}; 26 | word gsm_B[8] = { 0, 0, 2048, -2560, 94, -1792, -341, -1144}; 27 | word gsm_MIC[8] = { -32, -32, -16, -16, -8, -8, -4, -4 }; 28 | word gsm_MAC[8] = { 31, 31, 15, 15, 7, 7, 3, 3 }; 29 | 30 | 31 | /* Table 4.2 Tabulation of 1/A[1..8] 32 | */ 33 | word gsm_INVA[8]={ 13107, 13107, 13107, 13107, 19223, 17476, 31454, 29708 }; 34 | 35 | 36 | /* Table 4.3a Decision level of the LTP gain quantizer 37 | */ 38 | /* bc 0 1 2 3 */ 39 | word gsm_DLB[4] = { 6554, 16384, 26214, 32767 }; 40 | 41 | 42 | /* Table 4.3b Quantization levels of the LTP gain quantizer 43 | */ 44 | /* bc 0 1 2 3 */ 45 | word gsm_QLB[4] = { 3277, 11469, 21299, 32767 }; 46 | 47 | 48 | /* Table 4.4 Coefficients of the weighting filter 49 | */ 50 | /* i 0 1 2 3 4 5 6 7 8 9 10 */ 51 | word gsm_H[11] = {-134, -374, 0, 2054, 5741, 8192, 5741, 2054, 0, -374, -134 }; 52 | 53 | 54 | /* Table 4.5 Normalized inverse mantissa used to compute xM/xmax 55 | */ 56 | /* i 0 1 2 3 4 5 6 7 */ 57 | word gsm_NRFAC[8] = { 29128, 26215, 23832, 21846, 20165, 18725, 17476, 16384 }; 58 | 59 | 60 | /* Table 4.6 Normalized direct mantissa used to compute xM/xmax 61 | */ 62 | /* i 0 1 2 3 4 5 6 7 */ 63 | word gsm_FAC[8] = { 18431, 20479, 22527, 24575, 26623, 28671, 30719, 32767 }; 64 | -------------------------------------------------------------------------------- /gsm/unproto.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische 3 | * Universitaet Berlin. See the accompanying file "COPYRIGHT" for 4 | * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 5 | */ 6 | 7 | /*$Header: /home/cvs/giga/ladspa-swh/gsm/unproto.h,v 1.1 2001/06/10 21:36:51 swh Exp $*/ 8 | 9 | #ifdef PROTO_H /* sic */ 10 | #undef PROTO_H 11 | 12 | #undef P 13 | #undef P0 14 | #undef P1 15 | #undef P2 16 | #undef P3 17 | #undef P4 18 | #undef P5 19 | #undef P6 20 | #undef P7 21 | #undef P8 22 | 23 | #endif /* PROTO_H */ 24 | -------------------------------------------------------------------------------- /gverb/Makefile.am: -------------------------------------------------------------------------------- 1 | LIBTOOL=libtool 2 | RANLIB=ranlib 3 | 4 | noinst_HEADERS = gverb.h gverbdsp.h 5 | 6 | noinst_LIBRARIES = libgverb.a 7 | 8 | libgverb_a_SOURCES = gverb.c gverbdsp.c 9 | 10 | # Disable autoheader. 11 | AUTOHEADER=echo 12 | -------------------------------------------------------------------------------- /gverb/gverb-test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "gverb.h" 7 | 8 | void run(const char *desc); 9 | 10 | #define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val)) 11 | #define SIZE 48000 12 | 13 | float in[SIZE], out[2][SIZE]; 14 | ty_gverb *verb; 15 | 16 | int main(int argc, char *argv[]) 17 | { 18 | long long then, now; 19 | unsigned int i; 20 | float v; 21 | 22 | verb = gverb_new(48000, 300.0f, 50.0f, 7.0f, 0.5f, 15.0f, 0.5f, 0.5f, 0.5f); 23 | for (i=0; i RAND_MAX / 5) { 76 | v *= -1.0f; 77 | } 78 | v *= -1.0f; 79 | in[i] = 1.0f; 80 | } 81 | run("+0dB pulse constant"); 82 | 83 | for (i=0; i 25 | #include 26 | #include 27 | #include 28 | 29 | #include "gverbdsp.h" 30 | 31 | #define TRUE 1 32 | #define FALSE 0 33 | 34 | ty_diffuser *diffuser_make(int size, float coeff) 35 | { 36 | ty_diffuser *p; 37 | int i; 38 | 39 | p = (ty_diffuser *)malloc(sizeof(ty_diffuser)); 40 | p->size = size; 41 | p->coeff = coeff; 42 | p->idx = 0; 43 | p->buf = (float *)malloc(size*sizeof(float)); 44 | for (i = 0; i < size; i++) p->buf[i] = 0.0; 45 | return(p); 46 | } 47 | 48 | void diffuser_free(ty_diffuser *p) 49 | { 50 | free(p->buf); 51 | free(p); 52 | } 53 | 54 | void diffuser_flush(ty_diffuser *p) 55 | { 56 | memset(p->buf, 0, p->size * sizeof(float)); 57 | } 58 | 59 | ty_damper *damper_make(float damping) 60 | { 61 | ty_damper *p; 62 | 63 | p = (ty_damper *)malloc(sizeof(ty_damper)); 64 | p->damping = damping; 65 | p->delay = 0.0f; 66 | return(p); 67 | } 68 | 69 | void damper_free(ty_damper *p) 70 | { 71 | free(p); 72 | } 73 | 74 | void damper_flush(ty_damper *p) 75 | { 76 | p->delay = 0.0f; 77 | } 78 | 79 | ty_fixeddelay *fixeddelay_make(int size) 80 | { 81 | ty_fixeddelay *p; 82 | int i; 83 | 84 | p = (ty_fixeddelay *)malloc(sizeof(ty_fixeddelay)); 85 | p->size = size; 86 | p->idx = 0; 87 | p->buf = (float *)malloc(size*sizeof(float)); 88 | for (i = 0; i < size; i++) p->buf[i] = 0.0; 89 | return(p); 90 | } 91 | 92 | void fixeddelay_free(ty_fixeddelay *p) 93 | { 94 | free(p->buf); 95 | free(p); 96 | } 97 | 98 | void fixeddelay_flush(ty_fixeddelay *p) 99 | { 100 | memset(p->buf, 0, p->size * sizeof(float)); 101 | } 102 | 103 | int isprime(int n) 104 | { 105 | unsigned int i; 106 | const unsigned int lim = (int)sqrtf((float)n); 107 | 108 | if (n == 2) return(TRUE); 109 | if ((n & 1) == 0) return(FALSE); 110 | for(i = 3; i <= lim; i += 2) 111 | if ((n % i) == 0) return(FALSE); 112 | return(TRUE); 113 | } 114 | 115 | int nearest_prime(int n, float rerror) 116 | /* relative error; new prime will be in range 117 | * [n-n*rerror, n+n*rerror]; 118 | */ 119 | { 120 | int bound,k; 121 | 122 | if (isprime(n)) return(n); 123 | /* assume n is large enough and n*rerror enough smaller than n */ 124 | bound = n*rerror; 125 | for(k = 1; k <= bound; k++) { 126 | if (isprime(n+k)) return(n+k); 127 | if (isprime(n-k)) return(n-k); 128 | } 129 | return(-1); 130 | } 131 | -------------------------------------------------------------------------------- /gverb/gverbdsp.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef GVERBDSP_H 3 | #define GVERBDSP_H 4 | 5 | #include "../ladspa-util.h" 6 | 7 | typedef struct { 8 | int size; 9 | int idx; 10 | float *buf; 11 | } ty_fixeddelay; 12 | 13 | typedef struct { 14 | int size; 15 | float coeff; 16 | int idx; 17 | float *buf; 18 | } ty_diffuser; 19 | 20 | typedef struct { 21 | float damping; 22 | float delay; 23 | } ty_damper; 24 | 25 | ty_diffuser *diffuser_make(int, float); 26 | void diffuser_free(ty_diffuser *); 27 | void diffuser_flush(ty_diffuser *); 28 | //float diffuser_do(ty_diffuser *, float); 29 | 30 | ty_damper *damper_make(float); 31 | void damper_free(ty_damper *); 32 | void damper_flush(ty_damper *); 33 | //void damper_set(ty_damper *, float); 34 | //float damper_do(ty_damper *, float); 35 | 36 | ty_fixeddelay *fixeddelay_make(int); 37 | void fixeddelay_free(ty_fixeddelay *); 38 | void fixeddelay_flush(ty_fixeddelay *); 39 | //float fixeddelay_read(ty_fixeddelay *, int); 40 | //void fixeddelay_write(ty_fixeddelay *, float); 41 | 42 | int isprime(int); 43 | int nearest_prime(int, float); 44 | 45 | static inline float diffuser_do(ty_diffuser *p, float x) 46 | { 47 | float y,w; 48 | 49 | w = x - p->buf[p->idx]*p->coeff; 50 | w = flush_to_zero(w); 51 | y = p->buf[p->idx] + w*p->coeff; 52 | p->buf[p->idx] = w; 53 | p->idx = (p->idx + 1) % p->size; 54 | return(y); 55 | } 56 | 57 | static inline float fixeddelay_read(ty_fixeddelay *p, int n) 58 | { 59 | int i; 60 | 61 | i = (p->idx - n + p->size) % p->size; 62 | return(p->buf[i]); 63 | } 64 | 65 | static inline void fixeddelay_write(ty_fixeddelay *p, float x) 66 | { 67 | p->buf[p->idx] = x; 68 | p->idx = (p->idx + 1) % p->size; 69 | } 70 | 71 | static inline void damper_set(ty_damper *p, float damping) 72 | { 73 | p->damping = damping; 74 | } 75 | 76 | static inline float damper_do(ty_damper *p, float x) 77 | { 78 | float y; 79 | 80 | y = x*(1.0-p->damping) + p->delay*p->damping; 81 | p->delay = y; 82 | return(y); 83 | } 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /hard_limiter_1413.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | #include "ladspa-util.h" 13 | ]]> 14 | 15 | 16 | 17 | Hard Limiter 18 |

Brick hard limiter with residue mixer.

19 | 20 | limit_g ? data - limit_g : 0.0; 28 | data -= residue; 29 | buffer_write(output[i], 30 | sign * (wet_gain * data + res_gain * residue)); 31 | } 32 | ]]> 33 | 34 | 35 | dB limit 36 |

37 | 38 |
39 | 40 | 41 | Wet level 42 |

Output level for limited signal.

43 | 44 |
45 | 46 | 47 | Residue level 48 |

Output level for residue signal.

49 | 50 |
51 | 52 | 53 | Input 54 | 55 | 56 | 57 | Output 58 | 59 | 60 |
61 |
62 | -------------------------------------------------------------------------------- /highpass_iir_1890.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | #include "config.h" 11 | #include "util/iir.h" 12 | 13 | 14 | 15 | 16 | 17 | Glame Highpass Filter 18 |

IIR highpass filter based using chebishev coefficients. The filter allows you to tweak the number of stages used for 19 | filtering. Every stage adds two more poles, which leads to a steeper dropoff. More stages need more CPU power. This 20 | filter was ported from the glame multitrack editor to ladspa. 21 |

22 | 23 | 24 | sample_rate = s_rate; 25 | 26 | 27 | chebyshev(iirf, gt, 2*CLAMP((int)stages,1,10), IIR_STAGE_HIGHPASS, cutoff/(float)sample_rate, 0.5f); 28 | iir_process_buffer_ns_5(iirf, gt, input, output, sample_count,RUN_ADDING); 29 | 30 | // Unused variable 31 | (void)(run_adding_gain); 32 | 33 | 34 | 35 | gt = init_iir_stage(IIR_STAGE_HIGHPASS,10,3,2); 36 | iirf = init_iirf_t(gt); 37 | chebyshev(iirf, gt, 2*CLAMP((int)(*(plugin_data->stages)),1,10), IIR_STAGE_HIGHPASS, *(plugin_data->cutoff)/(float)sample_rate, 0.5f); 38 | 39 | 40 | 41 | free_iirf_t(plugin_data->iirf, plugin_data->gt); 42 | free_iir_stage(plugin_data->gt); 43 | 44 | 45 | 46 | Cutoff Frequency 47 | 48 | 49 | 50 | 51 | Stages(2 poles per stage) 52 | 53 | 54 | 55 | 56 | Input 57 | 58 | 59 | 60 | Output 61 | 62 | 63 | 64 | 65 | 66 | 67 |
68 |
69 | -------------------------------------------------------------------------------- /hilbert_1440.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | #include "ladspa-util.h" 12 | 13 | #define D_SIZE 256 14 | #define NZEROS 200 15 | 16 | /* The non-zero taps of the Hilbert transformer */ 17 | static float xcoeffs[] = { 18 | +0.0008103736f, +0.0008457886f, +0.0009017196f, +0.0009793364f, 19 | +0.0010798341f, +0.0012044365f, +0.0013544008f, +0.0015310235f, 20 | +0.0017356466f, +0.0019696659f, +0.0022345404f, +0.0025318040f, 21 | +0.0028630784f, +0.0032300896f, +0.0036346867f, +0.0040788644f, 22 | +0.0045647903f, +0.0050948365f, +0.0056716186f, +0.0062980419f, 23 | +0.0069773575f, +0.0077132300f, +0.0085098208f, +0.0093718901f, 24 | +0.0103049226f, +0.0113152847f, +0.0124104218f, +0.0135991079f, 25 | +0.0148917649f, +0.0163008758f, +0.0178415242f, +0.0195321089f, 26 | +0.0213953037f, +0.0234593652f, +0.0257599469f, +0.0283426636f, 27 | +0.0312667947f, +0.0346107648f, +0.0384804823f, +0.0430224431f, 28 | +0.0484451086f, +0.0550553725f, +0.0633242001f, +0.0740128560f, 29 | +0.0884368322f, +0.1090816773f, +0.1412745301f, +0.1988673273f, 30 | +0.3326528346f, +0.9997730178f, -0.9997730178f, -0.3326528346f, 31 | -0.1988673273f, -0.1412745301f, -0.1090816773f, -0.0884368322f, 32 | -0.0740128560f, -0.0633242001f, -0.0550553725f, -0.0484451086f, 33 | -0.0430224431f, -0.0384804823f, -0.0346107648f, -0.0312667947f, 34 | -0.0283426636f, -0.0257599469f, -0.0234593652f, -0.0213953037f, 35 | -0.0195321089f, -0.0178415242f, -0.0163008758f, -0.0148917649f, 36 | -0.0135991079f, -0.0124104218f, -0.0113152847f, -0.0103049226f, 37 | -0.0093718901f, -0.0085098208f, -0.0077132300f, -0.0069773575f, 38 | -0.0062980419f, -0.0056716186f, -0.0050948365f, -0.0045647903f, 39 | -0.0040788644f, -0.0036346867f, -0.0032300896f, -0.0028630784f, 40 | -0.0025318040f, -0.0022345404f, -0.0019696659f, -0.0017356466f, 41 | -0.0015310235f, -0.0013544008f, -0.0012044365f, -0.0010798341f, 42 | -0.0009793364f, -0.0009017196f, -0.0008457886f, -0.0008103736f, 43 | }; 44 | 45 | 46 | 47 | 48 | Hilbert transformer 49 |

A Hilbert Transformer phase shifts the input signal by 90degrees. It outputs the 90 degree phase shifted signal and the unshifted signal, both delayed by an equivalent amount

50 |

This plugin was written for a demo at the LAD Meet in 2003.

51 | 52 | 57 | 58 | delay); 60 | ]]> 61 | 62 | dptr = dptr; 79 | 80 | *(plugin_data->latency) = 99; 81 | ]]> 82 | 83 | 84 | Input 85 | 86 | 87 | 88 | 0deg output 89 | 90 | 91 | 92 | 90deg output 93 | 94 | 95 | 96 | latency 97 | 98 | 99 | 100 | 101 |
102 |
103 | -------------------------------------------------------------------------------- /impulse_1885.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 | 18 | 19 | 20 | Nonbandlimited single-sample impulses (Frequency: Control) 21 |

Based on work by James McCartney in SuperCollider.

22 | 23 | 27 | 28 | 31 | 32 | 1.f) { 38 | phase -= 1.f; 39 | buffer_write(out[i], 1.f); 40 | } else { 41 | buffer_write(out[i], 0.f); 42 | } 43 | phase += phase_step; 44 | } 45 | 46 | plugin_data->phase = phase; 47 | ]]> 48 | 49 | 50 | Frequency (Hz) 51 | 52 |

53 | Frequency for the impulses. 54 |

55 |
56 | 57 | 58 | Output 59 | 60 | 61 | 62 | 63 |
64 |
65 | -------------------------------------------------------------------------------- /impulses/01-unit.h: -------------------------------------------------------------------------------- 1 | float unit[] = { 1.0f }; 2 | -------------------------------------------------------------------------------- /impulses/all.h: -------------------------------------------------------------------------------- 1 | /* Generated file, do not edit */ 2 | 3 | #define IMPULSES 21 4 | 5 | #include "impulses/01-unit.h" 6 | #include "impulses/02-steves-flat.h" 7 | #include "impulses/03-stk-m1.h" 8 | #include "impulses/04-fender-68-vibrolux-sm57.h" 9 | #include "impulses/05-fender-68-vibrolux-sm57-off.h" 10 | #include "impulses/06-fender-68-vibrolux-at4050.h" 11 | #include "impulses/07-fender-68-vibrolux-ui87.h" 12 | #include "impulses/08-fender-bassman-sm57.h" 13 | #include "impulses/09-fender-bassman-sm57-off.h" 14 | #include "impulses/10-fender-bassman-at4050.h" 15 | #include "impulses/11-fender-bassman-ui87.h" 16 | #include "impulses/12-fender-superchamp-sm57.h" 17 | #include "impulses/13-fender-superchamp-sm57-off.h" 18 | #include "impulses/14-fender-superchamp-at4050.h" 19 | #include "impulses/15-fender-superchamp-ui87.h" 20 | #include "impulses/16-marshall-jcm2000-sm57.h" 21 | #include "impulses/17-marshall-jcm2000-sm57-off.h" 22 | #include "impulses/18-marshall-plexi-sm57.h" 23 | #include "impulses/19-marshall-plexi-sm57-off.h" 24 | #include "impulses/20-matchless-chieftain-sm57.h" 25 | #include "impulses/21-matchless-chieftain-sm57-off.h" 26 | 27 | #ifdef __clang__ 28 | static void mk_imps(fftw_real **impulse_freq) 29 | #else 30 | static inline void mk_imps(fftw_real **impulse_freq) 31 | #endif 32 | { 33 | int c = 0; 34 | MK_IMP(unit); 35 | MK_IMP(steves_flat); 36 | MK_IMP(stk_m1); 37 | MK_IMP(fender_68_vibrolux_sm57); 38 | MK_IMP(fender_68_vibrolux_sm57_off); 39 | MK_IMP(fender_68_vibrolux_at4050); 40 | MK_IMP(fender_68_vibrolux_ui87); 41 | MK_IMP(fender_bassman_sm57); 42 | MK_IMP(fender_bassman_sm57_off); 43 | MK_IMP(fender_bassman_at4050); 44 | MK_IMP(fender_bassman_ui87); 45 | MK_IMP(fender_superchamp_sm57); 46 | MK_IMP(fender_superchamp_sm57_off); 47 | MK_IMP(fender_superchamp_at4050); 48 | MK_IMP(fender_superchamp_ui87); 49 | MK_IMP(marshall_jcm2000_sm57); 50 | MK_IMP(marshall_jcm2000_sm57_off); 51 | MK_IMP(marshall_plexi_sm57); 52 | MK_IMP(marshall_plexi_sm57_off); 53 | MK_IMP(matchless_chieftain_sm57); 54 | MK_IMP(matchless_chieftain_sm57_off); 55 | }; 56 | -------------------------------------------------------------------------------- /impulses/mkall-h.sh: -------------------------------------------------------------------------------- 1 | #! 2 | 3 | echo "/* Generated file, do not edit */" > all.h 4 | echo "" >> all.h 5 | export count=`ls -1 [0-9][0-9]* | wc -l` 6 | echo "#define IMPULSES $count" >> all.h 7 | echo "" >> all.h 8 | ls -1 [0-9][0-9]* | awk '{print "#include \"impulses/" $0 "\""}' >> all.h 9 | echo "" >> all.h 10 | echo "#ifdef __clang__" >> all.h 11 | echo "static void mk_imps(fftw_real **impulse_freq)" >> all.h 12 | echo "#else" >> all.h 13 | echo "static inline void mk_imps(fftw_real **impulse_freq)" >> all.h 14 | echo "#endif" >> all.h 15 | echo "{" >> all.h 16 | echo " int c = 0;" >> all.h 17 | ls -1 [0-9][0-9]* | sed 's/...//;s/\.h//;s/-/_/g' | awk '{print "\tMK_IMP(" $0 ");"}' >> all.h 18 | echo "};" >> all.h 19 | -------------------------------------------------------------------------------- /impulses/reorder.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | $n = 1; 4 | while (<>) { 5 | chomp; 6 | $ns = sprintf("%02d", $n); 7 | $fr = $_; 8 | s/^../$ns/; 9 | print "mv $fr $_\n"; 10 | $n++; 11 | } 12 | -------------------------------------------------------------------------------- /impulses/scale.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | $scale = shift; 4 | 5 | while(<>) { 6 | s/([0-9.]+f)/&scale($1)/gxe; 7 | print; 8 | } 9 | 10 | sub scale { 11 | local ($val) = @_; 12 | 13 | return sprintf("%.13f", $val / $scale); 14 | } 15 | -------------------------------------------------------------------------------- /inv_1429.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Inverter 14 |

A utility plugin that inverts the signal, also (wrongly) known as a 180 degree phase shift.

15 | 16 | 23 | 24 | 25 | Input 26 | 27 | 28 | 29 | Output 30 | 31 |
32 |
33 | -------------------------------------------------------------------------------- /karaoke_1409.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Karaoke 14 |

Attempts to strip the vocals from a stereo signal.

15 | 16 | 28 | 29 | 30 | Vocal volume (dB) 31 |

Controls the attenuation of the vocal (centre channel) in dB's.

32 |

The greater the attenuation the greater the loss of stereo field.

33 | 34 |
35 | 36 | 37 | Left in 38 | 39 | 40 | 41 | Right in 42 | 43 | 44 | 45 | Left out 46 | 47 | 48 | 49 | Right out 50 | 51 |
52 |
53 | -------------------------------------------------------------------------------- /ladspa-swh.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 28 | 29 | 31 | 32 | 33 | 35 | -------------------------------------------------------------------------------- /ladspa.css: -------------------------------------------------------------------------------- 1 | /* CSS stylesheet */ 2 | 3 | ladspa:before { 4 | content: "LADSPA Plugin Details"; 5 | margin: 0.5em 0em; 6 | display: block; 7 | font-size: 16pt; 8 | font-weight: bold; 9 | font-family: helvetica; 10 | } 11 | 12 | ladspa { 13 | display: block; 14 | color: black; 15 | margin: 0em 0.5em 0.5em 0.5em; 16 | text-align: left; 17 | font-size: 10pt; 18 | background-color: white; 19 | } 20 | 21 | plugin > name { 22 | display: block; 23 | color: black; 24 | margin: 0.5em 0em; 25 | font-weight: bold; 26 | font-family: helvetica; 27 | font-size: 12pt; 28 | } 29 | 30 | plugin > name:after { 31 | content: " (ID " counters(id, ".") ")"; 32 | } 33 | 34 | port > name:before { 35 | content: "Port: "; 36 | } 37 | 38 | port > name { 39 | display: block; 40 | color: black; 41 | margin: 0.5em 0.5em; 42 | font-weight: bold; 43 | font-family: helvetica; 44 | font-size: 12pt; 45 | } 46 | 47 | port > range:before { 48 | display: block; 49 | margin: 0.5em 1em; 50 | content: "Range: " attr(min) " - " attr(max); 51 | font-size: 10pt; 52 | } 53 | 54 | range { 55 | display: block; 56 | } 57 | 58 | global { 59 | font-size: 10pt; 60 | } 61 | 62 | port:after { 63 | content: "Label: " attr(label) " (" attr(type) " " attr(dir) ")"; 64 | display: block; 65 | margin: 0.5em 1em; 66 | font-size: 10pt; 67 | } 68 | 69 | code:before { 70 | margin: 0em -0.5em; 71 | content: "Global code "; 72 | display: block; 73 | font-family: helvetica; 74 | font-weight: bold; 75 | font-size: 12pt; 76 | } 77 | 78 | code { 79 | font-size: 10pt; 80 | font-family: courier; 81 | display: block; 82 | white-space: pre; 83 | margin: 0.5em 1em; 84 | } 85 | 86 | callback:before { 87 | margin: 0em -0.5em; 88 | content: "Callback: " attr(event); 89 | display: block; 90 | font-family: helvetica; 91 | font-weight: bold; 92 | font-size: 12pt; 93 | } 94 | 95 | callback { 96 | font-size: 10pt; 97 | font-family: courier; 98 | display: block; 99 | white-space: pre; 100 | margin: 0.5em 1em; 101 | } 102 | 103 | meta.first { 104 | display: block; 105 | content: "Metadata"; 106 | } 107 | 108 | meta:after { 109 | margin: 0em 1em; 110 | text-transform: capitalize; 111 | content: attr(name) ": " attr(value); 112 | display: block; 113 | } 114 | 115 | meta { 116 | display: block; 117 | } 118 | 119 | p { 120 | display: block; 121 | margin: 0.5em 1em; 122 | } 123 | -------------------------------------------------------------------------------- /latency_1914.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | #include "ladspa-util.h" 12 | 13 | 14 | 15 | 16 | Artificial latency 17 |

Reports its delay value as systemic latency. Does nothing else, *this is not a delay*.

18 |

Can be used to correct for latency between channels.

19 | 20 | 23 | 24 | latency) = (float)delay_fr; 34 | ]]> 35 | 36 | 37 | Delay (ms) 38 | 39 | 40 | 41 | 42 | Input 43 | 44 | 45 | 46 | Output 47 | 48 | 49 | 50 | latency 51 | 52 | 53 | 54 |
55 |
56 | -------------------------------------------------------------------------------- /lowpass_iir_1891.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | #include "config.h" 11 | #include "util/iir.h" 12 | #include "ladspa-util.h" 13 | 14 | 15 | 16 | 17 | 18 | Glame Lowpass Filter 19 |

IIR lowpass filter based using chebishev coefficients. The filter allows you to tweak the number of stages used for 20 | filtering. Every stage adds two more poles, which leads to a steeper dropoff. More stages need more CPU power. This 21 | filter was ported from the glame multitrack editor to ladspa. 22 |

23 | 24 | 25 | sample_rate = s_rate; 26 | 27 | 28 | chebyshev(iirf, gt, 2*CLAMP((int)stages,1,10), IIR_STAGE_LOWPASS, cutoff/(float)sample_rate, 0.5f); 29 | iir_process_buffer_ns_5(iirf, gt, input, output, sample_count,RUN_ADDING); 30 | 31 | // Unused variable 32 | (void)(run_adding_gain); 33 | 34 | 35 | 36 | gt = init_iir_stage(IIR_STAGE_LOWPASS,10,3,2); 37 | iirf = init_iirf_t(gt); 38 | chebyshev(iirf, gt, 2*CLAMP(f_round(*(plugin_data->stages)),1,10), IIR_STAGE_LOWPASS, 39 | *(plugin_data->cutoff)/(float)sample_rate, 0.5f); 40 | 41 | 42 | 43 | free_iirf_t(plugin_data->iirf, plugin_data->gt); 44 | free_iir_stage(plugin_data->gt); 45 | 46 | 47 | 48 | Cutoff Frequency 49 | 50 | 51 | 52 | 53 | Stages(2 poles per stage) 54 | 55 | 56 | 57 | 58 | Input 59 | 60 | 61 | 62 | Output 63 | 64 | 65 | 66 | 67 | 68 | 69 |
70 |
71 | -------------------------------------------------------------------------------- /ls_filter_1908.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | #include "ladspa-util.h" 12 | #include "util/ls_filter.h" 13 | 14 | 15 | 16 | 17 | LS Filter 18 |

This is a filter created for the LinkSampler project - its designed to closely follow the filter used in giga sampler.

19 | 20 | 24 | 25 | 28 | 29 | 40 | 41 | filt); 43 | ]]> 44 | 45 | 46 | Filter type (0=LP, 1=BP, 2=HP) 47 |

The type of the filter, 0 for low pass, 1 for band pass, 2 for high pass.

48 | 49 |
50 | 51 | 52 | Cutoff frequency (Hz) 53 |

Controls the frequency at which the filter starts to effect the audio signal.

54 |

eg. a lowpass filter with a cutoff frequency of 1000 Hz will only let frequencies below 1000 Hz through.

55 | 56 |
57 | 58 | 59 | Resonance 60 |

Creates a peak at the cutoff frequency, for the classic overdriven filter sound. At high values the peak at the cutoff will overwhelm the filtered signal.

61 | 62 |
63 | 64 | 65 | Input 66 | 67 | 68 | 69 | Output 70 | 71 | 72 | 73 | 74 |
75 |
76 | -------------------------------------------------------------------------------- /matrix_ms_st_1421.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Matrix: MS to Stereo 14 | 15 | 23 | 24 | 25 | Width 26 |

The width of the dematrixed stereo field. 1 will give you normal width, 0 will make it completely mono, < 1 will make it narrower and > 1 will make it wider.

27 | 28 |
29 | 30 | 31 | Mid 32 | 33 | 34 | Side 35 | 36 | 37 | 38 | Left 39 | 40 | 41 | Right 42 | 43 |
44 |
45 | -------------------------------------------------------------------------------- /matrix_st_ms_1420.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Matrix: Stereo to MS 14 | 15 | 23 | 24 | 25 | Left 26 | 27 | 28 | Right 29 | 30 | 31 | 32 | Mid 33 | 34 | 35 | Side 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /metadata/Makefile.am: -------------------------------------------------------------------------------- 1 | pkgdata_DATA = swh-plugins.rdf swh-aux.rdf swh-scales.rdf 2 | EXTRA_DIST = lxml2rdf.pl txt2scale.pl scale-points.txt $(pkgdata_DATA) 3 | pkgdatadir = $(datadir)/ladspa/rdf 4 | 5 | swh-plugins.rdf: @top_srcdir@/*.xml 6 | ./lxml2rdf.pl $(sort $^) > $@ 7 | xmllint -noout swh-plugins.rdf 8 | 9 | swh-scales.rdf: scale-points.txt 10 | ./txt2scale.pl scale-points.txt > swh-scales.rdf 11 | -------------------------------------------------------------------------------- /metadata/lxml2rdf.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | print < 5 | 7 | 8 | 9 | 10 | ]> 11 | 15 | 16 | EOB 17 | 18 | $ocnt = 0; 19 | 20 | while (<>) { 21 | if (m()) { 25 | #$plabel = $1; 26 | $pid = $2; 27 | if ($3) { 28 | @classes = split(",", $4); 29 | $class = shift @classes; 30 | } else { 31 | $class = "Plugin"; 32 | } 33 | %defaults = (); 34 | %min = (); 35 | %max = (); 36 | print " \n"; 37 | while ($extra_class = shift @classes) { 38 | print " \n"; 39 | } 40 | if ($pcreator) { 41 | print " $pcreator\n"; 42 | } 43 | $ocnt = 0; 44 | } 45 | if ($ocnt == 0 && m((.*?))) { 46 | print " $1\n"; 47 | } 48 | if (m()) { 49 | $ocnt++; 50 | next if ($3 eq "audio"); 51 | print " \n"; 52 | print " \n"; 53 | print " \n"; 54 | $hints = $5; 55 | if ($hints && $hints =~ m((default_[a-z0-9]+))) { 56 | $defaults{$ocnt} = $hints; 57 | } 58 | } 59 | if (m( 1) { 65 | print " \n"; 66 | print " \n"; 67 | for $i (sort keys %defaults) { 68 | $dp = $defaults{$i} =~ m((default_[a-z0-9]+)); 69 | if ($dp) { 70 | $hint = $1; 71 | } else { 72 | $hint = ""; 73 | } 74 | if ($hint eq "default_0") { 75 | $val = 0.0; 76 | } elsif ($hint eq "default_1") { 77 | $val = 1.0; 78 | } elsif ($hint eq "default_440") { 79 | $val = 440.0; 80 | } elsif ($hint eq "default_minimum") { 81 | $val = $min{$i}; 82 | } elsif ($hint eq "default_low") { 83 | $val = $min{$i} * 0.75 + $max{$i} * 0.25; 84 | } elsif ($hint eq "default_middle") { 85 | $val = ( $min{$i} + $max{$i} ) / 2.0; 86 | } elsif ($hint eq "default_high") { 87 | $val = $min{$i} * 0.25 + $max{$i} * 0.75; 88 | } elsif ($hint eq "default_maximum") { 89 | $val = $max{$i}; 90 | } else { 91 | print STDERR "ERROR $defaults{$i}\n"; 92 | $val = "ERROR"; 93 | } 94 | print " \n"; 95 | print " \n"; 96 | print " \n"; 97 | print " \n"; 98 | print " \n"; 99 | } 100 | print " \n"; 101 | print " \n"; 102 | } 103 | print " \n\n"; 104 | } 105 | } 106 | 107 | print "\n"; 108 | -------------------------------------------------------------------------------- /metadata/scale-points.txt: -------------------------------------------------------------------------------- 1 | 1416.0 2 | 1 sine 3 | 2 triangle 4 | 3 square 5 | 4 saw 6 | 7 | 1432.1 8 | -1 down 9 | 1 up 10 | 11 | 1185.0 12 | 0 none 13 | 1 half wave 14 | 2 full wave 15 | 16 | 1415.0 17 | 1 sine 18 | 2 triangle 19 | 3 square 20 | 4 saw 21 | 22 | 1410.7 23 | -1 key listen 24 | 0 gate 25 | 1 bypass 26 | 27 | 1921.8 28 | -1 key listen 29 | 0 gate 30 | 1 bypass 31 | 32 | 1922.8 33 | -1 key listen 34 | 0 gate 35 | 1 bypass 36 | 37 | 1200.1 38 | 0 sine 39 | 1 triangle 40 | 2 saw 41 | 3 square 42 | 4 S&H 43 | 44 | 1200.3 45 | 0 sine 46 | 1 triangle 47 | 2 saw 48 | 3 square 49 | 4 S&H 50 | 51 | 1200.5 52 | 0 sine 53 | 1 triangle 54 | 2 saw 55 | 3 square 56 | 4 S&H 57 | 58 | 1200.7 59 | 0 sine 60 | 1 triangle 61 | 2 saw 62 | 3 square 63 | 4 S&H 64 | 65 | 1908.0 66 | 0 LP 67 | 1 BP 68 | 2 HP 69 | 70 | 1188.0 71 | 0 none 72 | 1 AM 73 | 2 RM 74 | 75 | 1189.0 76 | 0 none 77 | 1 AM 78 | 2 RM 79 | 80 | 1214.2 81 | 0 none 82 | 1 LP 83 | 2 HP 84 | 3 BP 85 | 4 BR 86 | 5 AP 87 | -------------------------------------------------------------------------------- /metadata/swh-aux.rdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | ]> 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /metadata/txt2scale.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | print < 5 | 7 | 8 | 9 | 10 | ]> 11 | 15 | 16 | EOB 17 | 18 | $first = 1; 19 | $port = ""; 20 | 21 | while (<>) { 22 | chomp; 23 | if (/^([0-9]+\.[0-9]+)/) { 24 | $port = $1; 25 | if (!$first) { 26 | &endScale; 27 | } 28 | $first = 0; 29 | print < 31 | 32 | 33 | EOB 34 | } 35 | 36 | if (/^\s*([0-9]+)\s+(.*)/) { 37 | print < 39 | 40 | 41 | EOB 42 | } 43 | } 44 | 45 | if (!$first) { 46 | &endScale; 47 | } 48 | 49 | print < 52 | EOB 53 | 54 | sub endScale { 55 | print < 57 | 58 | 59 | EOB 60 | } 61 | -------------------------------------------------------------------------------- /mkspec.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | $package = shift(@ARGV); 4 | $version = shift(@ARGV); 5 | @files = @ARGV; 6 | 7 | open(OUT, ">swh-plugins-$version.spec") || die "Can't create spec file: $!"; 8 | 9 | print OUT < 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | #include "ladspa-util.h" 12 | 13 | 14 | 15 | 16 | Modulatable delay 17 |

A delay whose tap can be modulated at audio rate.

18 |

Requested by Matthias Nagorni at LinuxTag 2002, in order to make a Leslie simulator.

19 | 20 | 31 | 32 | 36 | 37 | buffer); 39 | ]]> 40 | 41 | write_ptr = write_ptr; 55 | ]]> 56 | 57 | 58 | Base delay (s) 59 | 60 | 61 | 62 | 63 | Delay (s) 64 | 65 | 66 | 67 | 68 | Input 69 | 70 | 71 | 72 | Output 73 | 74 | 75 | 76 | 77 | 78 | 79 |
80 |
81 | -------------------------------------------------------------------------------- /notch_iir_1894.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | #include "config.h" 11 | #include "util/iir.h" 12 | 13 | 14 | 15 | 16 | 17 | Mag's Notch Filter 18 |

IIR notch filter based using chebishev coefficients. The filter allows you to tweak the number of stages used for 19 | filtering. Every stage adds two more poles, which leads to a steeper dropoff. More stages need more CPU power. 20 |

21 | 22 | 23 | sample_rate = s_rate; 24 | ufc = lfc = 0.0f; 25 | 26 | 27 | ufc = (center - width*0.5f)/(float)sample_rate; 28 | lfc = (center + width*0.5f)/(float)sample_rate; 29 | chebyshev(iirf1, first, 2*CLAMP((int)stages,1,10), IIR_STAGE_LOWPASS, ufc, 0.5f); 30 | chebyshev(iirf2, second, 2*CLAMP((int)stages,1,10), IIR_STAGE_HIGHPASS, lfc, 0.5f); 31 | iir_process_buffer_ns_5(iirf1, first, input, output, sample_count, RUN_ADDING); 32 | iir_process_buffer_ns_5(iirf2, second, input, output, sample_count, 1); /* add to first buffer */ 33 | 34 | // Unused variable 35 | (void)(run_adding_gain); 36 | 37 | 38 | 39 | ufc = (*(plugin_data->center) - *(plugin_data->width)*0.5f)/(float)sample_rate; 40 | lfc = (*(plugin_data->center) + *(plugin_data->width)*0.5f)/(float)sample_rate; 41 | first = init_iir_stage(IIR_STAGE_LOWPASS,10,3,2); 42 | second = init_iir_stage(IIR_STAGE_HIGHPASS,10,3,2); 43 | iirf1 = init_iirf_t(first); 44 | iirf2 = init_iirf_t(second); 45 | chebyshev(iirf1, first, 2*CLAMP((int)(*(plugin_data->stages)),1,10), IIR_STAGE_LOWPASS, ufc, 0.5f); 46 | chebyshev(iirf2, second, 2*CLAMP((int)(*(plugin_data->stages)),1,10), IIR_STAGE_HIGHPASS, lfc, 0.5f); 47 | 48 | 49 | 50 | free_iirf_t(plugin_data->iirf1, plugin_data->first); 51 | free_iirf_t(plugin_data->iirf2, plugin_data->second); 52 | free_iir_stage(plugin_data->first); 53 | free_iir_stage(plugin_data->second); 54 | 55 | 56 | 57 | Center Frequency (Hz) 58 | 59 | 60 | 61 | 62 | Bandwidth (Hz) 63 | 64 | 65 | 66 | 67 | Stages(2 poles per stage) 68 | 69 | 70 | 71 | 72 | Input 73 | 74 | 75 | 76 | Output 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 |
88 |
89 | -------------------------------------------------------------------------------- /pitch_scale_1193.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 18 | Pitch Scaler 19 |

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.

20 |

The FFT block size and oversampling has been kept at a minimum to keep the CPU usage low.

21 | 22 | 23 | pitch_scale(buffers, mult, FRAME_LENGTH, OVER_SAMP, sample_count, sample_rate, input, output, RUN_ADDING, run_adding_gain); 24 | 25 | *(plugin_data->latency) = FRAME_LENGTH - (FRAME_LENGTH / 26 | OVER_SAMP); 27 | 28 | 29 | 30 | int i; 31 | float arg; 32 | 33 | buffers = malloc(sizeof(sbuffers)); 34 | sample_rate = s_rate; 35 | buffers->gInFIFO = malloc(FRAME_LENGTH * sizeof(float)); 36 | buffers->gOutFIFO = malloc(FRAME_LENGTH * sizeof(float)); 37 | buffers->gLastPhase = malloc(FRAME_LENGTH * sizeof(float)); 38 | buffers->gSumPhase = malloc(FRAME_LENGTH * sizeof(float)); 39 | buffers->gOutputAccum = malloc(2*FRAME_LENGTH * sizeof(float)); 40 | buffers->gAnaFreq = malloc(FRAME_LENGTH * sizeof(float)); 41 | buffers->gAnaMagn = malloc(FRAME_LENGTH * sizeof(float)); 42 | buffers->gSynFreq = malloc(FRAME_LENGTH * sizeof(float)); 43 | buffers->gSynMagn = malloc(FRAME_LENGTH * sizeof(float)); 44 | buffers->gWindow = malloc(FRAME_LENGTH * sizeof(float)); 45 | /* 46 | if (aplan == NULL) { 47 | #ifdef FFTW3 48 | aplan = fftwf_plan_r2r_1d(FRAME_LENGTH, ps_in, ps_out, FFTW_R2HC, FFTW_MEASURE); 49 | splan = fftwf_plan_r2r_1d(FRAME_LENGTH, ps_in, ps_out, FFTW_HC2R, FFTW_MEASURE); 50 | #else 51 | aplan = rfftw_create_plan(FRAME_LENGTH, FFTW_REAL_TO_COMPLEX, FFTW_ESTIMATE); 52 | splan = rfftw_create_plan(FRAME_LENGTH, FFTW_COMPLEX_TO_REAL, FFTW_ESTIMATE); 53 | #endif 54 | } 55 | */ 56 | 57 | arg = 2.0f * M_PI / (float)(FRAME_LENGTH-1); 58 | for (i=0; i < FRAME_LENGTH; i++) { 59 | // Blackman-Harris 60 | buffers->gWindow[i] = 0.35875f - 0.48829f * cos(arg * (float)i) + 0.14128f * cos(2.0f * arg * (float)i) - 0.01168f * cos(3.0f * arg * (float)i); 61 | // Gain correction 62 | buffers->gWindow[i] *= 0.761f; 63 | 64 | } 65 | 66 | 67 | 68 | memset(buffers->gInFIFO, 0, FRAME_LENGTH*sizeof(float)); 69 | memset(buffers->gOutFIFO, 0, FRAME_LENGTH*sizeof(float)); 70 | memset(buffers->gLastPhase, 0, FRAME_LENGTH*sizeof(float)/2); 71 | memset(buffers->gSumPhase, 0, FRAME_LENGTH*sizeof(float)/2); 72 | memset(buffers->gOutputAccum, 0, 2*FRAME_LENGTH*sizeof(float)); 73 | memset(buffers->gAnaFreq, 0, FRAME_LENGTH*sizeof(float)); 74 | memset(buffers->gAnaMagn, 0, FRAME_LENGTH*sizeof(float)); 75 | buffers->gRover = 0; 76 | 77 | /* do one run to make sure the plans are set up */ 78 | pitch_scale(buffers, 1.0, FRAME_LENGTH, 4, FRAME_LENGTH, sample_rate, buffers->gInFIFO, buffers->gOutFIFO, 0, 0.0f); 79 | 80 | 81 | buffers->gInFIFO); 83 | free (plugin_data->buffers->gOutFIFO); 84 | free (plugin_data->buffers->gLastPhase); 85 | free (plugin_data->buffers->gSumPhase); 86 | free (plugin_data->buffers->gOutputAccum); 87 | free (plugin_data->buffers->gAnaFreq); 88 | free (plugin_data->buffers->gAnaMagn); 89 | free (plugin_data->buffers->gSynFreq); 90 | free (plugin_data->buffers->gSynMagn); 91 | free (plugin_data->buffers->gWindow); 92 | free (plugin_data->buffers); 93 | ]]> 94 | 95 | 96 | Pitch co-efficient 97 | 98 | 99 | 100 | 101 | Input 102 | 103 | 104 | 105 | Output 106 | 107 | 108 | 109 | latency 110 | 111 | 112 | 113 | 114 | 115 |
116 |
117 | -------------------------------------------------------------------------------- /pitch_scale_1194.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | #include "util/pitchscale.h" 11 | 12 | #define FRAME_LENGTH 4096 13 | #define OVER_SAMP 16 14 | 15 | 16 | 17 | 18 | Higher Quality Pitch Scaler 19 |

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.

20 |

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.

21 | 22 | 23 | pitch_scale(buffers, mult, FRAME_LENGTH, OVER_SAMP, sample_count, sample_rate, input, output, RUN_ADDING, run_adding_gain); 24 | *(plugin_data->latency) = FRAME_LENGTH - (FRAME_LENGTH 25 | / OVER_SAMP); 26 | 27 | 28 | 29 | int i; 30 | float arg; 31 | 32 | buffers = malloc(sizeof(sbuffers)); 33 | sample_rate = s_rate; 34 | buffers->gInFIFO = malloc(FRAME_LENGTH * sizeof(float)); 35 | buffers->gOutFIFO = malloc(FRAME_LENGTH * sizeof(float)); 36 | buffers->gLastPhase = malloc(FRAME_LENGTH * sizeof(float)); 37 | buffers->gSumPhase = malloc(FRAME_LENGTH * sizeof(float)); 38 | buffers->gOutputAccum = malloc(2*FRAME_LENGTH * sizeof(float)); 39 | buffers->gAnaFreq = malloc(FRAME_LENGTH * sizeof(float)); 40 | buffers->gAnaMagn = malloc(FRAME_LENGTH * sizeof(float)); 41 | buffers->gSynFreq = malloc(FRAME_LENGTH * sizeof(float)); 42 | buffers->gSynMagn = malloc(FRAME_LENGTH * sizeof(float)); 43 | buffers->gWindow = malloc(FRAME_LENGTH * sizeof(float)); 44 | 45 | arg = 2.0f * M_PI / (float)(FRAME_LENGTH-1); 46 | for (i=0; i < FRAME_LENGTH; i++) { 47 | // Blackman-Harris 48 | buffers->gWindow[i] = 0.35875f - 0.48829f * cos(arg * (float)i) + 0.14128f * cos(2.0f * arg * (float)i) - 0.01168f * cos(3.0f * arg * (float)i); 49 | // Gain correction 50 | buffers->gWindow[i] *= 0.761f; 51 | 52 | } 53 | 54 | 55 | 56 | gInFIFO, 0, FRAME_LENGTH*sizeof(float)); 58 | memset(buffers->gOutFIFO, 0, FRAME_LENGTH*sizeof(float)); 59 | memset(buffers->gLastPhase, 0, FRAME_LENGTH*sizeof(float)/2); 60 | memset(buffers->gSumPhase, 0, FRAME_LENGTH*sizeof(float)/2); 61 | memset(buffers->gOutputAccum, 0, 2*FRAME_LENGTH*sizeof(float)); 62 | memset(buffers->gAnaFreq, 0, FRAME_LENGTH*sizeof(float)); 63 | memset(buffers->gAnaMagn, 0, FRAME_LENGTH*sizeof(float)); 64 | buffers->gRover = 0; 65 | pitch_scale(buffers, 1.0, FRAME_LENGTH, 16, FRAME_LENGTH, sample_rate, buffers->gInFIFO, buffers->gOutFIFO, 0, 0.0f); 66 | ]]> 67 | 68 | buffers->gInFIFO); 70 | free (plugin_data->buffers->gOutFIFO); 71 | free (plugin_data->buffers->gLastPhase); 72 | free (plugin_data->buffers->gSumPhase); 73 | free (plugin_data->buffers->gOutputAccum); 74 | free (plugin_data->buffers->gAnaFreq); 75 | free (plugin_data->buffers->gAnaMagn); 76 | free (plugin_data->buffers->gSynFreq); 77 | free (plugin_data->buffers->gSynMagn); 78 | free (plugin_data->buffers->gWindow); 79 | free (plugin_data->buffers); 80 | ]]> 81 | 82 | 83 | Pitch co-efficient 84 | 85 |

The pitch scaling factor, a value of 2.0 will increase the pitch by one octave, etc.

86 |
87 | 88 | 89 | Input 90 | 91 | 92 | 93 | Output 94 | 95 | 96 | 97 | latency 98 | 99 | 100 | 101 | 102 | 103 |
104 |
105 | -------------------------------------------------------------------------------- /plate_1423.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | #include "util/waveguide_nl.h" 12 | 13 | #define LP_INNER 0.96f 14 | #define LP_OUTER 0.983f 15 | 16 | #define RUN_WG(n, junct_a, junct_b) waveguide_nl_process_lin(w[n], junct_a - out[n*2+1], junct_b - out[n*2], out+n*2, out+n*2+1) 17 | 18 | 19 | 20 | 21 | Plate reverb 22 |

A physical model of a steel plate reverb.

23 |

Based on Josep Comajuncosas' gong model, it uses 8 linear waveguides to model the plate.

24 | 25 | 38 | 39 | 46 | 47 | size * scale); 54 | } 55 | for (pos=0; pos<4; pos++) { 56 | waveguide_nl_set_fc(w[pos], LP_INNER * lpscale); 57 | } 58 | for (; pos<8; pos++) { 59 | waveguide_nl_set_fc(w[pos], LP_OUTER * lpscale); 60 | } 61 | 62 | for (pos = 0; pos < sample_count; pos++) { 63 | const float alpha = (out[0] + out[2] + out[4] + out[6]) * 0.5f 64 | + input[pos]; 65 | const float beta = (out[1] + out[9] + out[14]) * 0.666666666f; 66 | const float gamma = (out[3] + out[8] + out[11]) * 0.666666666f; 67 | const float delta = (out[5] + out[10] + out[13]) * 0.666666666f; 68 | const float epsilon = (out[7] + out[12] + out[15]) * 0.666666666f; 69 | 70 | RUN_WG(0, beta, alpha); 71 | RUN_WG(1, gamma, alpha); 72 | RUN_WG(2, delta, alpha); 73 | RUN_WG(3, epsilon, alpha); 74 | RUN_WG(4, beta, gamma); 75 | RUN_WG(5, gamma, delta); 76 | RUN_WG(6, delta, epsilon); 77 | RUN_WG(7, epsilon, beta); 78 | 79 | buffer_write(outputl[pos], beta * wet + input[pos] * (1.0f - wet)); 80 | buffer_write(outputr[pos], gamma * wet + input[pos] * (1.0f - wet)); 81 | } 82 | ]]> 83 | 84 | w[i]); 89 | } 90 | free(plugin_data->w); 91 | free(plugin_data->out); 92 | ]]> 93 | 94 | 95 | Reverb time 96 |

Controls the RT60 time of the reverb. Actually controls the size of the plate. The mapping between plate size and RT60 time is just a heuristic, so it's not very accurate.

97 | 98 |
99 | 100 | 101 | Damping 102 |

Controls the degree that the surface of the plate is damped.

103 | 104 |
105 | 106 | 107 | Dry/wet mix 108 |

Controls the balance between the dry and wet signals.

109 | 110 |
111 | 112 | 113 | Input 114 | 115 | 116 | 117 | Left output 118 | 119 | 120 | 121 | Right output 122 | 123 | 124 | 125 | 126 |
127 |
128 | -------------------------------------------------------------------------------- /po/.gitignore: -------------------------------------------------------------------------------- 1 | /boldquot.sed 2 | /en@boldquot.header 3 | /en@quot.header 4 | /insert-header.sin 5 | /Makefile.in.in 6 | /Makevars.template 7 | /Rules-quot 8 | /quot.sed 9 | /remove-potcdate.sed 10 | /remove-potcdate.sin 11 | /stamp-po 12 | /*.gmo 13 | -------------------------------------------------------------------------------- /po/Makevars: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | 3 | # Usually the message domain is the same as the package name. 4 | DOMAIN = $(PACKAGE) 5 | 6 | # These two variables depend on the location of this directory. 7 | subdir = po 8 | top_builddir = .. 9 | 10 | # These options get passed to xgettext. 11 | XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ 12 | 13 | # This is the copyright holder that gets inserted into the header of the 14 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 15 | # package. (Note that the msgstr strings, extracted from the package's 16 | # sources, belong to the copyright holder of the package.) Translators are 17 | # expected to transfer the copyright for their translations to this person 18 | # or entity, or to disclaim their copyright. The empty string stands for 19 | # the public domain; in this case the translators are expected to disclaim 20 | # their copyright. 21 | COPYRIGHT_HOLDER = JAMin project 22 | 23 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 24 | # message catalogs shall be used. It is usually empty. 25 | EXTRA_LOCALE_CATEGORIES = 26 | 27 | MSGID_BUGS_ADDRESS = jamin-devel@lists.sourceforge.net 28 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | amp_1181.c 2 | diode_1185.c 3 | divider_1186.c 4 | shaper_1187.c 5 | ringmod_1188.c 6 | comb_1190.c 7 | declip_1195.c 8 | foverdrive_1196.c 9 | sinus_wavewrapper_1198.c 10 | hermes_filter_1200.c 11 | multivoice_chorus_1201.c 12 | flanger_1191.c 13 | decimator_1202.c 14 | single_para_1203.c 15 | triple_para_1204.c 16 | transient_1206.c 17 | fad_delay_1192.c 18 | dc_remove_1207.c 19 | retro_flange_1208.c 20 | valve_1209.c 21 | sifter_1210.c 22 | tape_delay_1211.c 23 | step_muxer_1212.c 24 | foldover_1213.c 25 | svf_1214.c 26 | gsm_1215.c 27 | gverb_1216.c 28 | phasers_1217.c 29 | harmonic_gen_1220.c 30 | surround_encoder_1401.c 31 | delayorama_1402.c 32 | dyson_compress_1403.c 33 | crossover_dist_1404.c 34 | valve_rect_1405.c 35 | split_1406.c 36 | alias_1407.c 37 | satan_maximiser_1408.c 38 | karaoke_1409.c 39 | gate_1410.c 40 | comb_splitter_1411.c 41 | wave_terrain_1412.c 42 | hard_limiter_1413.c 43 | smooth_decimate_1414.c 44 | fm_osc_1415.c 45 | analogue_osc_1416.c 46 | rate_shifter_1417.c 47 | freq_tracker_1418.c 48 | mod_delay_1419.c 49 | matrix_st_ms_1420.c 50 | matrix_ms_st_1421.c 51 | matrix_spatialiser_1422.c 52 | plate_1423.c 53 | gong_1424.c 54 | sc1_1425.c 55 | sc2_1426.c 56 | sc3_1427.c 57 | zm1_1428.c 58 | inv_1429.c 59 | chebstortion_1430.c 60 | bode_shifter_1431.c 61 | bode_shifter_cv_1432.c 62 | am_pitchshift_1433.c 63 | sc4_1882.c 64 | lcr_delay_1436.c 65 | giant_flange_1437.c 66 | dj_flanger_1438.c 67 | gong_beater_1439.c 68 | hilbert_1440.c 69 | sin_cos_1881.c 70 | se4_1883.c 71 | bandpass_a_iir_1893.c 72 | bandpass_iir_1892.c 73 | highpass_iir_1890.c 74 | lowpass_iir_1891.c 75 | notch_iir_1894.c 76 | dj_eq_1901.c 77 | butterworth_1902.c 78 | allpass_1895.c 79 | comb_1887.c 80 | decay_1886.c 81 | delay_1898.c 82 | impulse_1885.c 83 | vynil_1905.c 84 | revdelay_1605.c 85 | ls_filter_1908.c 86 | const_1909.c 87 | pointer_cast_1910.c 88 | fast_lookahead_limiter_1913.c 89 | latency_1914.c 90 | xfade_1915.c 91 | mbeq_1197.c 92 | pitch_scale_1193.c 93 | pitch_scale_1194.c 94 | imp_1199.c 95 | -------------------------------------------------------------------------------- /pointer_cast_1910.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | #include "ladspa-util.h" 14 | #include "util/biquad.h" 15 | 16 | typedef union { 17 | LADSPA_Data fp; 18 | int in; 19 | } pcast; 20 | ]]> 21 | 22 | 23 | 24 | Pointer cast distortion 25 |

This distortion is created by treating the floating point representation 26 | of the input signal as a 0.32 1's complement fixedpoint integer. Its very 27 | unmusical but supprisingly recognisable. I'm not sure that its useful for 28 | anything, but it can make interesting noises.

29 | 30 | 34 | 35 | 38 | 39 | 57 | 58 | filt); 60 | ]]> 61 | 62 | 63 | Effect cutoff freq (Hz) 64 |

Controls the frequencies that will be passed to the effect.

65 | 66 |
67 | 68 | 69 | Dry/wet mix 70 |

Controls the ammunt of distorting mixed into the output.

71 | 72 |
73 | 74 | 75 | Input 76 | 77 | 78 | 79 | Output 80 | 81 | 82 | 83 | 84 |
85 |
86 | -------------------------------------------------------------------------------- /rate_shifter_1417.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | #include "ladspa-util.h" 12 | 13 | 14 | 15 | 16 | Rate shifter 17 |

Stretches or compresses the input with a ringbuffer.

18 |

Because of the ringbuffer you will get stretches of silence or clicks when the read pointer passes the write pointer.

19 |

The ringbuffer is about 2.7-3.0s long, depending on the sample rate.

20 |

Versions with variable buffer sizes or declicking code would be easy (but a bit less efficient); shout if you would find them useful.

21 | 22 | 34 | 35 | 41 | 42 | buffer); 44 | ]]> 45 | 46 | read_ptr.all = read_ptr.all; 66 | plugin_data->write_ptr = write_ptr; 67 | ]]> 68 | 69 | 70 | Rate 71 |

The rate of the output signal; eg. 2.0 will double the speed. Negative numbers will play backwards.

72 |

Pretty much any value will work, but the ranges give what most people are going to want to use. You can get some interesting sounds with very high numbers (e.g. 2000).

73 | 74 |
75 | 76 | 77 | Input 78 | 79 | 80 | 81 | Output 82 | 83 | 84 | 85 | 86 | 87 | 88 |
89 |
90 | -------------------------------------------------------------------------------- /satan_maximiser_1408.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | #include "ladspa-util.h" 13 | 14 | #define BUFFER_SIZE 16 15 | #define BUFFER_MASK 15 16 | ]]> 17 | 18 | 19 | 20 | Barry's Satan Maximiser 21 |

Formerly Stupid Compressor. Thanks to Matt Yee-King for the name.

22 |

Compresses signals with a stupidly short attack and decay, infinite 23 | ratio and hard knee. Not really as a compressor, but good harsh (non-musical) 24 | distortion.

25 | 26 | 31 | 32 | 37 | 38 | buffer); 40 | ]]> 41 | 42 | env) { 57 | env = fabs(input[pos]); 58 | } else { 59 | env = fabs(input[pos]) * env_tr + env * (1.0f - env_tr); 60 | } 61 | if (env <= knee) { 62 | env_sc = 1.0f / knee; 63 | } else { 64 | env_sc = 1.0f / env; 65 | } 66 | buffer[buffer_pos] = input[pos]; 67 | buffer_write(output[pos], buffer[(buffer_pos - delay) & BUFFER_MASK] * env_sc); 68 | buffer_pos = (buffer_pos + 1) & BUFFER_MASK; 69 | } 70 | 71 | plugin_data->env = env; 72 | plugin_data->buffer_pos = buffer_pos; 73 | ]]> 74 | 75 | 76 | Decay time (samples) 77 |

Controls the envelope decay time.

78 | 79 |
80 | 81 | 82 | Knee point (dB) 83 |

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.

84 | 85 |
86 | 87 | 88 | Input 89 | 90 | 91 | 92 | Output 93 | 94 | 95 | 96 | 97 | 98 |
99 |
100 | -------------------------------------------------------------------------------- /shaper_1187.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Wave shaper 13 |

This plugin reshapes the wave by an exponential function, inspiration was taken from the Nord module of the same name.

14 |

If you are getting rubbish out then it's probably because the host isn't using the input/output range hints, which are very important for this plugin.

15 | 16 | -1.0f) { 21 | shape = 1.0f; 22 | } else if (shapep < 0) { 23 | shape = -1.0f / shapep; 24 | } else { 25 | shape = shapep; 26 | } 27 | 28 | for (pos = 0; pos < sample_count; pos++) { 29 | if (input[pos] < 0.0f) { 30 | buffer_write(output[pos], -pow(-input[pos], shape)); 31 | } else { 32 | buffer_write(output[pos], pow(input[pos], shape)); 33 | } 34 | } 35 | ]]> 36 | 37 | 38 | Waveshape 39 |

Positive values have an expanding effect, and negative values have a compressing effect.

40 | 41 |
42 | 43 | 44 | Input 45 | 46 | 47 | 48 | 49 | Output 50 | 51 | 52 |
53 |
54 | -------------------------------------------------------------------------------- /sin_cos_1881.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | #include "ladspa-util.h" 12 | 13 | 14 | 15 | 16 | Sine + cosine oscillator 17 |

This is a simple oscillator that outputs sinewaves with a 90 degree phase shift between them.

18 |

The current implementation is very inefficient, but I will improve it later.

19 | 20 | 25 | 26 | 2.0 * M_PI) { 39 | phi -= 2.0 * M_PI; 40 | } 41 | 42 | plugin_data->phi = phi; 43 | plugin_data->last_om = target_om; 44 | ]]> 45 | 46 | 47 | Base frequency (Hz) 48 |

The base frequency of the output waves.

49 | 50 |
51 | 52 | 53 | Pitch offset 54 |

The pitch offset of the output waves. Final oscillator frequency is $base + 2\^pitch$.

55 | 56 |
57 | 58 | 59 | Sine output 60 | 61 | 62 | 63 | Cosine output 64 | 65 | 66 | 67 | 68 | 69 |
70 |
71 | -------------------------------------------------------------------------------- /single_para_1203.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | #include "util/biquad.h" 12 | 13 | 14 | 15 | 16 | Single band parametric 17 |

A single band of a parametric filter.

18 | 19 | 24 | 25 | 28 | 29 | filter); 31 | ]]> 32 | 33 | 42 | 43 | 44 | Gain (dB) 45 |

The attenuation/gain of the eq.

46 | 47 |
48 | 49 | 50 | Frequency (Hz) 51 |

The centre frequency (ie. point of most/least attenuation).

52 |

Beware of high values for Frequency and Bandwidth, if the high pitch (Frequency * 2$^{Bandwidth}$) goes over half the sample rate you will get aliasing.

53 |

Note: if your host offers you a frequency range between 0 and 0.4 then it's not rendering the input parameter correctly, the input frequency will actually be that number multiplied by the sample rate (e.g. 44.1kHz).

54 | 55 |
56 | 57 | 58 | Bandwidth (octaves) 59 |

The pitch difference from the centre before the attenuation has reached half the gain.

60 | 61 |
62 | 63 | 64 | Input 65 | 66 | 67 | 68 | 69 | Output 70 | 71 | 72 | 73 | 74 | 75 |
76 |
77 | -------------------------------------------------------------------------------- /sinus_wavewrapper_1198.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Sinus wavewrapper 13 |

Produces an unusual distortion effect, for a more amp like tone, see the valve saturation plugin (section \ref{valve}).

14 | 15 | 27 | 28 | 29 | Wrap degree 30 | 31 | 32 | 33 | 34 | Input 35 | 36 | 37 | 38 | 39 | Output 40 | 41 | 42 |
43 |
44 | -------------------------------------------------------------------------------- /smooth_decimate_1414.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | #include "ladspa-util.h" 12 | 13 | 14 | 15 | 16 | Smooth Decimator 17 | 18 | 24 | 25 | 29 | 30 | = 1.0f) { 39 | accum -= 1.0f; 40 | buffer_pos = (buffer_pos + 1) & 7; 41 | buffer[buffer_pos] = input[pos]; 42 | } 43 | smoothed = cube_interp(accum, buffer[(buffer_pos - 3) & 7], 44 | buffer[(buffer_pos - 2) & 7], 45 | buffer[(buffer_pos - 1) & 7], 46 | buffer[buffer_pos]); 47 | buffer_write(output[pos], LIN_INTERP(smooth, buffer[(buffer_pos - 3) & 7], smoothed)); 48 | } 49 | 50 | plugin_data->accum = accum; 51 | plugin_data->buffer_pos = buffer_pos; 52 | ]]> 53 | 54 | buffer); 56 | ]]> 57 | 58 | 59 | Resample rate 60 |

The rate at which the output signal will be resampled

61 | 62 |
63 | 64 | 65 | Smoothing 66 |

The amount of smoothing on the output signal.

67 | 68 |
69 | 70 | 71 | Input 72 | 73 | 74 | 75 | Output 76 | 77 | 78 | 79 | 80 | 81 | 82 |
83 |
84 | -------------------------------------------------------------------------------- /split_1406.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Mono to Stereo splitter 13 |

Takes a mono input signal, and outputs it to both left and right channel, thus \"stereophizing" it.

14 | 15 | 16 | unsigned long pos; 17 | 18 | for (pos = 0; pos < sample_count; pos++) { 19 | const LADSPA_Data in = input[pos]; 20 | 21 | buffer_write(out1[pos], in); 22 | buffer_write(out2[pos], in); 23 | } 24 | 25 | 26 | 27 | Input 28 | 29 | 30 | 31 | 32 | Output 1 33 | 34 | 35 | 36 | 37 | Output 2 38 | 39 | 40 |
41 |
42 | -------------------------------------------------------------------------------- /timetest/autotimetest.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | $html = 0; 4 | $skip = 0; 5 | 6 | while (@ARGV) { 7 | $plugin = shift(@ARGV).""; 8 | 9 | if ($plugin eq "--html") { 10 | $html = 1; 11 | print "\n"; 12 | print "\n"; 13 | next; 14 | } 15 | 16 | @data = `analyseplugin $plugin`; 17 | 18 | $port = 0; 19 | $ins = 0; 20 | $id = 0; 21 | $seen = 0; 22 | 23 | for (@data) { 24 | if (/Plugin Name: "(.*?)"/) { 25 | if ($seen) { 26 | #&run($port, $ins, $id, $title); 27 | &run; 28 | } 29 | if (/Debug/) { 30 | $skip = 1; 31 | } 32 | $title = $1; 33 | $seen = 1; 34 | $ins = 0; 35 | $id = 0; 36 | $port = 0; 37 | } 38 | if (/Plugin Label: "(.*?)"/) { 39 | $label = $1; 40 | } 41 | if (/Plugin Unique ID: (\d+)/) { 42 | $id = $1; 43 | } 44 | if (/"(.*?)" input, control, ([0-9.e-]+).*? to ([0-9.e-]+)/i) { 45 | #$name[$port] = $1; 46 | $min[$port] = $2; 47 | if ($min[$port] eq "...") { 48 | $min[$port] = 0.0; 49 | } 50 | $max[$port] = $3; 51 | if ($max[$port] eq "...") { 52 | $max[$port] = $min[$port]; 53 | } 54 | $port++; 55 | } 56 | if (/input, audio/) { 57 | $ins++; 58 | } 59 | } 60 | 61 | if ($skip) { 62 | $skip = 0; 63 | next; 64 | } 65 | 66 | &run; 67 | } 68 | 69 | #&run; 70 | #&run($port, $ins, $id, $title); 71 | 72 | if ($html) { 73 | print "
UIDNamePIII MHzCycles /
sample
\n"; 74 | } 75 | 76 | sub run { 77 | #local ($port, $ins, $id, $title) = @_; 78 | 79 | my $afile = "XXX"; 80 | if ($ins == 1) { 81 | $afile = "happyness-ext-m.wav"; 82 | } elsif ($ins == 2) { 83 | $afile = "happyness-ext-s.wav"; 84 | } else { 85 | print STDERR "No valid input file for $id\n"; 86 | #next; 87 | } 88 | 89 | if ($html) { 90 | printf("$id$title"); 91 | } else { 92 | printf("%-48s ", $title); 93 | } 94 | 95 | my $base = ""; 96 | for $i (0..$port-1) { 97 | $base .= " ".($min[$i]+$max[$i])/2; 98 | } 99 | 100 | $cycles = 9999999999999; 101 | $pers = 99999999; 102 | for (1..5) { 103 | $cmd = "applyplugin ../testdata/$afile /dev/null $plugin $label$base 2>&1"; 104 | $out = `$cmd`; 105 | last if ($? != 0); 106 | chomp $out; 107 | $out =~ /Plugin cycles: (\d+) \((\d+)\//; 108 | if (!$1) { 109 | print STDERR "$? $out\n$cmd\n"; 110 | $err = 1; 111 | } 112 | if ($1 < $cycles) { 113 | $cycles = $1; 114 | } 115 | if ($2 < $pers) { 116 | $pers = $2; 117 | } 118 | } 119 | if ($err || $?) { 120 | if ($html) { 121 | print "??????\n\n"; 122 | } else { 123 | print "???\n$cmd\n"; 124 | } 125 | $err = 0; 126 | return; 127 | } 128 | $cycles /= 8000000.0; 129 | if ($html) { 130 | printf "%.1f$pers\n", $cycles; 131 | } else { 132 | printf "%3.1f\t%d\n", $cycles, $pers; 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /timetest/timecmp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | my $pattern = shift @ARGV; 4 | 5 | my $reps = 4; 6 | 7 | open(RC, "timetest.rc"); 8 | while() { 9 | next if /^\s*#/; 10 | next if /^\s*$/; 11 | next if ($pattern && !/$pattern/); 12 | @stuff = split("\t"); 13 | $name = $stuff[0]; 14 | $line = $stuff[1]; 15 | chomp $line; 16 | $line =~ /(\S+\.so)/; 17 | $command = $line." 2>&1"; 18 | $cycles = 10000000000; 19 | $pers = 100000; 20 | my $count; 21 | for $count (1..$reps+1) { 22 | $out = `$command`; 23 | chomp $out; 24 | $out =~ /Plugin cycles: (\d+) \((\d+)\//; 25 | if ($1 < $cycles) { 26 | $cycles = $1; 27 | } 28 | if ($2 < $pers) { 29 | $pers = $2; 30 | } 31 | } 32 | $out =~ /UID: (\d+)/; 33 | $UID = $1; 34 | $acycles = $cycles; 35 | 36 | $line =~ s/(.*\.\.)/$1\/icc-so/; 37 | #print $line."\n"; 38 | $command = $line." 2>&1"; 39 | $cycles = 10000000000; 40 | $pers = 100000; 41 | $ok = 1; 42 | for $count (1..$reps+1) { 43 | $out = `$command`; 44 | chomp $out; 45 | unless ($out =~ /Plugin cycles: (\d+) \((\d+)\//) { 46 | print("ERROR\t$name\n"); 47 | $ok = 0; 48 | last; 49 | } 50 | if ($1 < $cycles) { 51 | $cycles = $1; 52 | } 53 | if ($2 < $pers) { 54 | $pers = $2; 55 | } 56 | } 57 | next if !$ok; 58 | $out =~ /UID: (\d+)/; 59 | $UID = $1; 60 | print sprintf("%.3f", ($cycles/$acycles))."\t$name\n"; 61 | } 62 | -------------------------------------------------------------------------------- /timetest/timetest: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | my $pattern = shift @ARGV; 4 | 5 | my $reps = 4; 6 | 7 | open(RC, "timetest.rc"); 8 | open(DATA, ">timetest.results"); 9 | print("\n"); 10 | print("\n"); 11 | while() { 12 | next if /^\s*#/; 13 | next if /^\s*$/; 14 | next if ($pattern && !/$pattern/); 15 | @stuff = split("\t"); 16 | $name = $stuff[0]; 17 | $line = $stuff[1]; 18 | chomp $line; 19 | $line =~ /(\S+\.so)/; 20 | $command = $line." 2>&1"; 21 | $cycles = 10000000000; 22 | $pers = 100000; 23 | my $count; 24 | for $count (1..$reps+1) { 25 | $out = `$command`; 26 | chomp $out; 27 | $out =~ /Plugin cycles: (\d+) \((\d+)\//; 28 | if ($1 < $cycles) { 29 | $cycles = $1; 30 | } 31 | if ($2 < $pers) { 32 | $pers = $2; 33 | } 34 | } 35 | $out =~ /UID: (\d+)/; 36 | $UID = $1; 37 | $cycles /= 1000000; 38 | $doc = "http://plugin.org.uk/ladspa-swh/docs/ladspa-swh.html#id$UID"; 39 | print("\n"); 40 | print DATA "$UID ".sprintf("%.2f", $cycles/8)." ".sprintf("%.0f", $pers)."\n"; 41 | } 42 | print("
PluginPIII MHz used to process
44.1k/16bit mono file
Cycles per sample
", $name, "", sprintf("%.2f", $cycles/8), "", sprintf("%.0f", $pers),"
\n"); 43 | -------------------------------------------------------------------------------- /timetest/timetest.rc: -------------------------------------------------------------------------------- 1 | Amp applyplugin ../testdata/happyness-ext-m.wav /dev/null ../amp_1181.so amp 0 2 | Fast overdrive applyplugin ../testdata/happyness-ext-m.wav /dev/null ../foverdrive_1196.so foverdrive 1 3 | #Overdrive (with colouration) applyplugin ../testdata/happyness-ext-m.wav /dev/null ../overdrive_1182.so overdrive 0 0.5 0.5 0.5 4 | Comb filter applyplugin ../testdata/happyness-ext-m.wav /dev/null ../comb_1190.so comb 500 50 150 5 | Waveshaper applyplugin ../testdata/happyness-ext-m.wav /dev/null ../shaper_1187.so shaper 5 6 | Ringmod w/ LFO applyplugin ../testdata/happyness-ext-m.wav /dev/null ../ringmod_1188.so ringmod_1i1o1l 2 50 0.3 0.4 0.5 0.6 7 | Audio divider applyplugin ../testdata/happyness-ext-m.wav /dev/null ../divider_1186.so divider 8 8 | Diode processor applyplugin ../testdata/happyness-ext-m.wav /dev/null ../diode_1185.so diode 1.5 9 | Decliper applyplugin ../testdata/happyness-ext-m.wav /dev/null ../declip_1195.so declip 10 | Pitch scaler applyplugin ../testdata/happyness-ext-m.wav /dev/null ../pitch_scale_1193.so pitchScale 0.7 11 | Pitch scaler (high quality) applyplugin ../testdata/happyness-ext-m.wav /dev/null ../pitch_scale_1194.so pitchScaleHQ 0.7 12 | 16 band EQ applyplugin ../testdata/happyness-ext-m.wav /dev/null ../mbeq_1197.so mbeq -70 -60 -50 -40 -30 -20 -10 -5 +5 +10 +5 0 0 0 0 0 13 | Sinus wavewrapper applyplugin ../testdata/happyness-ext-m.wav /dev/null ../sinus_wavewrapper_1198.so sinusWavewrapper 0.2 14 | Hermes filter applyplugin ../testdata/happyness-ext-m.wav /dev/null ../hermes_filter_1200.so hermesFilter 3 0 0.27 1 100 1 40 1 1.5 1 2 -4 -4 -50 -70 -70 -70 200 1000 3 1 3 5 1500 0.65 0 130 0 5 400 0.8 0 0 -177 1 150 0.9 0.97 30 30 0.025 0.9 0.5 0.05 0.7 0.5 0.1 0.5 0.5 0 -20 -20 15 | Chorus (3 voice) applyplugin ../testdata/happyness-ext-m.wav /dev/null ../multivoice_chorus_1201.so multivoiceChorus 3 20 3 1 10 0 16 | Flanger applyplugin ../testdata/happyness-ext-m.wav /dev/null ../flanger_1191.so flanger 1 0.3 0.5 0.7 17 | Decimator applyplugin ../testdata/happyness-ext-m.wav /dev/null ../decimator_1202.so decimator 4 1000 18 | Analogue style oscilator applyplugin ../testdata/happyness-ext-m.wav /dev/null ../analogue_osc_1205.so analogueOsc 50 0 19 | Transient processor applyplugin ../testdata/happyness-ext-m.wav /dev/null ../transient_1206.so transient 0.7 -0.7 20 | Fractional Delay applyplugin ../testdata/happyness-ext-m.wav /dev/null ../fad_delay_1192.so fadDelay 3 -10 21 | DC offset remover applyplugin ../testdata/happyness-ext-m.wav /dev/null ../dc_remove_1207.so dcRemove 22 | Retro flanger applyplugin ../testdata/happyness-ext-m.wav /dev/null ../retro_flange_1208.so retroFlange 5 4 23 | Valve saturation applyplugin ../testdata/happyness-ext-m.wav /dev/null ../valve_1209.so valve 0.5 0.5 24 | Sifter applyplugin ../testdata/happyness-ext-m.wav /dev/null ../sifter_1210.so sifter 32 25 | Tape style delay (4 taps) applyplugin ../testdata/happyness-ext-m.wav /dev/null ../tape_delay_1211.so tapeDelay 1 -10 0.1 -10 0.2 -10 0.3 -10 0.4 -10 26 | Foldover distorter applyplugin ../testdata/happyness-ext-m.wav /dev/null ../foldover_1213.so foldover 0.5 0.5 27 | State variable filter applyplugin ../testdata/happyness-ext-m.wav /dev/null ../amp_1181.so amp -89 ../svf_1214.so svf 2 3000 0.5 0.5 28 | GSM phone effect applyplugin ../testdata/happyness-ext-m.wav /dev/null ../gsm_1215.so gsm 0.5 1 0 29 | GVerb (reverb) applyplugin ../testdata/happyness-ext-m.wav /dev/null ../gverb_1216.so gverb 150 5 0.5 0.25 0 0 0 30 | LFO Phaser applyplugin ../testdata/happyness-ext-m.wav /dev/null ../phasers_1217.so lfoPhaser 10 0.5 0.6 1 31 | 4x4 pole allpass applyplugin ../testdata/happyness-ext-m.wav /dev/null ../phasers_1217.so fourByFourPole 1000 0.7 2000 -0.7 3000 0.8 4000 -0.8 32 | Auto phaser applyplugin ../testdata/happyness-ext-m.wav /dev/null ../phasers_1217.so autoPhaser 1 0.1 0.0001 0.6 0.01 33 | Harmonic generator applyplugin ../testdata/happyness-ext-m.wav /dev/null ../harmonic_gen_1220.so harmonicGen 1 0 0 0 0 0 0 0 0 0 34 | -------------------------------------------------------------------------------- /util/Makefile.am: -------------------------------------------------------------------------------- 1 | LIBTOOL=libtool 2 | RANLIB=ranlib 3 | 4 | noinst_HEADERS = rms.h db.h blo.h pitchscale.h waveguide_nl.h biquad.h iir.h buffer.h ls_filter.h 5 | 6 | noinst_LIBRARIES = librms.a libdb.a libblo.a libpitchscale.a libiir.a 7 | 8 | librms_a_SOURCES = rms.c 9 | libdb_a_SOURCES = db.c 10 | libblo_a_SOURCES = blo.c 11 | libblo_a_CFLAGS = -I@top_srcdir@ 12 | libpitchscale_a_SOURCES = pitchscale.c 13 | libpitchscale_a_CFLAGS = $(FFTW_CFLAGS) 14 | #libpitchscale_a_LIBS = $(FFTW_LIBS) 15 | libiir_a_SOURCES = iir.c 16 | libiir_a_CPPFLAGS = -I@top_srcdir@ 17 | #libbuffer_a_SOURCES = buffer.c 18 | # Disable autoheader. 19 | AUTOHEADER=echo 20 | -------------------------------------------------------------------------------- /util/buffer.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swh/ladspa/0f54d2430febb4d5f02d13132dd91d7345e080b5/util/buffer.c -------------------------------------------------------------------------------- /util/buffer.h: -------------------------------------------------------------------------------- 1 | #ifndef _BUFFER_H 2 | #define _BUFFER_H 3 | 4 | /* subtract buffer b from a, save in c 5 | * 6 | * this could be sped up by vector operations 7 | */ 8 | 9 | static inline void buffer_sub(const float* a, const float *b, float *c, int cnt) { 10 | int i; 11 | for(i=0;i 2 | #include 3 | 4 | #include "db.h" 5 | 6 | float db_data[DB_TABLE_SIZE]; 7 | float lin_data[LIN_TABLE_SIZE]; 8 | 9 | void db_init() 10 | { 11 | unsigned int i; 12 | 13 | for (i=0; i LIN_TABLE_SIZE - 3) { 39 | return lin_data[LIN_TABLE_SIZE - 2]; 40 | } 41 | return cube_interp(ofs, lin_data[base-1], lin_data[base], lin_data[base+1], lin_data[base+2]); 42 | } 43 | 44 | static inline float f_db2lin_lerp(float db) 45 | { 46 | float scale = (db - DB_MIN) * (float)LIN_TABLE_SIZE / (DB_MAX - DB_MIN); 47 | int base = f_round(scale - 0.5f); 48 | float ofs = scale - base; 49 | 50 | if (base < 1) { 51 | return 0.0f; 52 | } else if (base > LIN_TABLE_SIZE - 3) { 53 | return lin_data[LIN_TABLE_SIZE - 2]; 54 | } 55 | return (1.0f - ofs) * lin_data[base] + ofs * lin_data[base+1]; 56 | } 57 | 58 | static inline float f_lin2db_cube(float lin) 59 | { 60 | float scale = (lin - LIN_MIN) * (float)DB_TABLE_SIZE / (LIN_MAX - LIN_MIN); 61 | int base = f_round(scale - 0.5f); 62 | float ofs = scale - base; 63 | 64 | if (base < 2) { 65 | return db_data[2] * scale * 0.5f - 23 * (2.0f - scale); 66 | } else if (base > DB_TABLE_SIZE - 3) { 67 | return db_data[DB_TABLE_SIZE - 2]; 68 | } 69 | return cube_interp(ofs, db_data[base-1], db_data[base], db_data[base+1], db_data[base+2]); 70 | } 71 | 72 | static inline float f_lin2db_lerp(float lin) 73 | { 74 | float scale = (lin - LIN_MIN) * (float)DB_TABLE_SIZE / (LIN_MAX - LIN_MIN); 75 | int base = f_round(scale - 0.5f); 76 | float ofs = scale - base; 77 | 78 | if (base < 2) { 79 | return db_data[2] * scale * 0.5f - 23.0f * (2.0f - scale); 80 | } else if (base > DB_TABLE_SIZE - 2) { 81 | return db_data[DB_TABLE_SIZE - 1]; 82 | } 83 | return (1.0f - ofs) * db_data[base] + ofs * db_data[base+1]; 84 | } 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /util/ls_filter.h: -------------------------------------------------------------------------------- 1 | #ifndef LS_FILTER_H 2 | #define LS_FILTER_H 3 | 4 | #include 5 | 6 | #define FILT_MIDI_2_FREQ(m) (m * 80.0f + 10.0f) 7 | #define FILT_MIDI_2_RESO(m) (m * 0.00787f) 8 | 9 | #define LSF_BW 0.9 10 | #define LSF_FB 0.9f 11 | 12 | typedef struct { 13 | biquad filt; 14 | biquad bp_filt; 15 | bq_t scale; 16 | bq_t resonance; 17 | } ls_filt; 18 | 19 | typedef enum { 20 | LS_FILT_TYPE_LP = 0, 21 | LS_FILT_TYPE_BP = 1, 22 | LS_FILT_TYPE_HP = 2 23 | } ls_filt_type; 24 | 25 | static inline void ls_filt_init(ls_filt *f) 26 | { 27 | biquad_init(&(f->filt)); 28 | biquad_init(&(f->bp_filt)); 29 | } 30 | 31 | static inline void ls_filt_setup(ls_filt *f, ls_filt_type t, bq_t cutoff, 32 | bq_t resonance, bq_t fs) 33 | { 34 | bp_set_params(&(f->bp_filt), cutoff, 0.7, fs); 35 | 36 | switch(t) { 37 | case LS_FILT_TYPE_LP: 38 | lp_set_params(&(f->filt), cutoff, 1.0 - resonance * LSF_BW, fs); 39 | break; 40 | case LS_FILT_TYPE_BP: 41 | bp_set_params(&(f->filt), cutoff, 1.0 - resonance * LSF_BW, fs); 42 | break; 43 | case LS_FILT_TYPE_HP: 44 | hp_set_params(&(f->filt), cutoff, 1.0 - resonance * LSF_BW, fs); 45 | break; 46 | default: 47 | /* oops, its not a known type - should really happen, but 48 | lets make the output silent just in case */ 49 | lp_set_params(&(f->filt), 1.0, 1.0, fs); 50 | break; 51 | } 52 | 53 | f->scale = 1.0f - resonance * 0.7f; 54 | f->resonance = resonance; 55 | } 56 | 57 | static inline bq_t ls_filt_run(ls_filt *f, bq_t in) 58 | { 59 | return biquad_run(&(f->filt), in) * f->scale + 60 | biquad_run_fb(&(f->bp_filt), in, f->resonance * LSF_FB) * 61 | f->resonance; 62 | } 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /util/pitchscale.h: -------------------------------------------------------------------------------- 1 | #ifndef PITCHSCALE_H 2 | #define PITCHSCALE_H 3 | 4 | #include 5 | 6 | #ifndef _USE_MATH_DEFINES 7 | #define _USE_MATH_DEFINES 8 | #endif 9 | 10 | #include 11 | 12 | #ifdef FFTW3 13 | 14 | #include 15 | 16 | typedef fftwf_plan fft_plan; 17 | typedef float fftw_real; 18 | 19 | #else 20 | 21 | #ifdef EXPLICIT_S 22 | #include 23 | #else 24 | #include 25 | #endif //EXPLICIT_S 26 | 27 | typedef rfftw_plan fft_plan; 28 | 29 | #endif //FFTW3 30 | 31 | typedef struct { 32 | float *gInFIFO; 33 | float *gOutFIFO; 34 | float *gLastPhase; 35 | float *gSumPhase; 36 | float *gOutputAccum; 37 | float *gAnaFreq; 38 | float *gAnaMagn; 39 | float *gSynFreq; 40 | float *gSynMagn; 41 | float *gWindow; 42 | long gRover; 43 | } sbuffers; 44 | 45 | #define MAX_FRAME_LENGTH 4096 46 | 47 | #define true 1 48 | #define false 0 49 | 50 | void pitch_scale(sbuffers *buffers, const double pitchScale, const long 51 | fftFrameLength, const long osamp, const long numSampsToProcess, 52 | const double sampleRate, const float *indata, float *outdata, 53 | const int adding, const float gain); 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /util/rms.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "rms.h" 3 | 4 | rms_env *rms_env_new() 5 | { 6 | rms_env *new = (rms_env *)calloc(1, sizeof(rms_env)); 7 | 8 | return new; 9 | } 10 | 11 | void rms_env_reset(rms_env *r) 12 | { 13 | unsigned int i; 14 | 15 | for (i=0; ibuffer[i] = 0.0f; 17 | } 18 | r->pos = 0; 19 | r->sum = 0.0f; 20 | } 21 | 22 | void rms_env_free(rms_env *r) 23 | { 24 | free(r); 25 | } 26 | -------------------------------------------------------------------------------- /util/rms.h: -------------------------------------------------------------------------------- 1 | #ifndef _RMS_H 2 | #define _RMS_H 3 | 4 | #include 5 | 6 | #define RMS_BUF_SIZE 64 7 | 8 | typedef struct { 9 | float buffer[RMS_BUF_SIZE]; 10 | unsigned int pos; 11 | float sum; 12 | } rms_env; 13 | 14 | rms_env *rms_env_new(); 15 | 16 | static inline float rms_env_process(rms_env *r, float x); 17 | 18 | void rms_env_reset(rms_env *r); 19 | 20 | void rms_env_free(rms_env *r); 21 | 22 | inline static float rms_env_process(rms_env *r, const float x) 23 | { 24 | r->sum -= r->buffer[r->pos]; 25 | r->sum += x; 26 | if (r->sum < 1.0e-6) { 27 | r->sum = 0.0f; 28 | } 29 | r->buffer[r->pos] = x; 30 | r->pos = (r->pos + 1) & (RMS_BUF_SIZE - 1); 31 | 32 | return sqrt(r->sum / (float)RMS_BUF_SIZE); 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /util/waveguide_nl.h: -------------------------------------------------------------------------------- 1 | #ifndef WAVEGUIDE_NL_H 2 | #define WAVEGUIDE_NL_H 3 | 4 | #include 5 | #include 6 | 7 | typedef struct { 8 | int size; 9 | float *buffer[2]; 10 | int ptr; 11 | int delay; 12 | float fc; 13 | float lp[2]; 14 | float a1a; 15 | float a1b; 16 | float zm1[2]; 17 | } waveguide_nl; 18 | 19 | waveguide_nl *waveguide_nl_new(int size, float fc, float da, float db) 20 | { 21 | waveguide_nl *wg = malloc(sizeof(waveguide_nl)); 22 | wg->size = size; 23 | wg->delay = size; 24 | wg->buffer[0] = calloc(size, sizeof(float)); 25 | wg->buffer[1] = calloc(size, sizeof(float)); 26 | wg->ptr = 0; 27 | wg->fc = fc; 28 | wg->lp[0] = 0.0f; 29 | wg->lp[1] = 0.0f; 30 | wg->zm1[0] = 0.0f; 31 | wg->zm1[1] = 0.0f; 32 | wg->a1a = (1.0f - da) / (1.0f + da); 33 | wg->a1b = (1.0f - db) / (1.0f + db); 34 | 35 | return wg; 36 | } 37 | 38 | void waveguide_nl_reset(waveguide_nl *wg) 39 | { 40 | memset(wg->buffer[0], 0, wg->size * sizeof(float)); 41 | memset(wg->buffer[1], 0, wg->size * sizeof(float)); 42 | wg->lp[0] = 0.0f; 43 | wg->lp[1] = 0.0f; 44 | wg->zm1[0] = 0.0f; 45 | wg->zm1[1] = 0.0f; 46 | } 47 | 48 | void waveguide_nl_free(waveguide_nl *wg) 49 | { 50 | if (!wg) { 51 | return; 52 | } 53 | free(wg->buffer[0]); 54 | free(wg->buffer[1]); 55 | free(wg); 56 | } 57 | 58 | void waveguide_nl_set_delay(waveguide_nl *wg, int delay) 59 | { 60 | if (delay > wg->size) { 61 | wg->delay = wg->size; 62 | } else if (delay < 1) { 63 | wg->delay = 1; 64 | } else { 65 | wg->delay = delay; 66 | } 67 | } 68 | 69 | void waveguide_nl_set_fc(waveguide_nl *wg, float fc) 70 | { 71 | wg->fc = fc; 72 | } 73 | 74 | void waveguide_nl_set_ap(waveguide_nl *wg, float da, float db) 75 | { 76 | wg->a1a = (1.0f - da) / (1.0f + da); 77 | wg->a1b = (1.0f - db) / (1.0f + db); 78 | } 79 | 80 | void waveguide_nl_process_lin(waveguide_nl *wg, float in0, float in1, float *out0, float *out1) 81 | { 82 | float tmp; 83 | 84 | *out0 = wg->buffer[0][(wg->ptr + wg->delay) % wg->size]; 85 | *out0 = wg->lp[0] * (wg->fc - 1.0f) + wg->fc * *out0; 86 | wg->lp[0] = *out0; 87 | tmp = *out0 * -(wg->a1a) + wg->zm1[0]; 88 | wg->zm1[0] = tmp * wg->a1a + *out0; 89 | *out0 = tmp; 90 | 91 | *out1 = wg->buffer[1][(wg->ptr + wg->delay) % wg->size]; 92 | *out1 = wg->lp[1] * (wg->fc - 1.0f) + wg->fc * *out1; 93 | wg->lp[1] = *out1; 94 | tmp = *out1 * -(wg->a1a) + wg->zm1[1]; 95 | wg->zm1[1] = tmp * wg->a1a + *out1; 96 | *out1 = tmp; 97 | 98 | wg->buffer[0][wg->ptr] = in0; 99 | wg->buffer[1][wg->ptr] = in1; 100 | wg->ptr--; 101 | if (wg->ptr < 0) { 102 | wg->ptr += wg->size; 103 | } 104 | } 105 | 106 | void waveguide_nl_process(waveguide_nl *wg, float in0, float in1, float *out0, float *out1) 107 | { 108 | float tmp; 109 | float a1; 110 | float b; 111 | 112 | *out0 = wg->buffer[0][(wg->ptr + wg->delay) % wg->size]; 113 | *out0 = wg->lp[0] * (wg->fc - 1.0f) + wg->fc * *out0; 114 | wg->lp[0] = *out0; 115 | b = (*out0 + 1.0) * 6.0f; 116 | if (b > 1.0f) { 117 | b = 1.0f; 118 | } 119 | 120 | if (b < 0.0f) { 121 | b = 0.0f; 122 | } 123 | a1 = b * wg->a1a + (1.0f - b) * wg->a1b; 124 | tmp = *out0 * -a1 + wg->zm1[0]; 125 | wg->zm1[0] = tmp * a1 + *out0; 126 | *out0 = tmp; 127 | 128 | *out1 = wg->buffer[1][(wg->ptr + wg->delay) % wg->size]; 129 | *out1 = wg->lp[1] * (wg->fc - 1.0f) + wg->fc * *out1; 130 | wg->lp[1] = *out1; 131 | b = (*out1 + 1.0) * 6.0f; 132 | if (b > 1.0f) { 133 | b = 1.0f; 134 | } 135 | 136 | if (b < 0.0f) { 137 | b = 0.0f; 138 | } 139 | a1 = b * wg->a1a + (1.0f - b) * wg->a1b; 140 | tmp = *out1 * -a1 + wg->zm1[1]; 141 | wg->zm1[1] = tmp * a1 + *out1; 142 | *out1 = tmp; 143 | 144 | wg->buffer[0][wg->ptr] = in0; 145 | wg->buffer[1][wg->ptr] = in1; 146 | wg->ptr--; 147 | if (wg->ptr < 0) { 148 | wg->ptr += wg->size; 149 | } 150 | } 151 | 152 | #endif 153 | -------------------------------------------------------------------------------- /valve_1209.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | Valve saturation 17 |

A model of valve (tube) distortion, lacking some of the harmonics you would get in a real tube amp, but sounds good nonetheless.

18 |

Taken from Ragnar Bendiksen's thesis: \url{https://web.archive.org/web/20050212034404/http://www.notam02.no/~rbendiks/Diplom/Innhold.html}.

19 | 20 | 24 | 25 | itm1 = itm1; 61 | plugin_data->otm1 = otm1; 62 | ]]> 63 | 64 | 65 | Distortion level 66 |

How hard the signal is driven against the limit of the amplifier.

67 | 68 |
69 | 70 | 71 | Distortion character 72 |

The hardness of the sound, low for soft, high for hard.

73 | 74 |
75 | 76 | 77 | Input 78 | 79 | 80 | 81 | Output 82 | 83 | 84 | 85 | 86 | 87 |
88 |
89 | -------------------------------------------------------------------------------- /valve_rect_1405.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | Valve rectifier 17 | 18 | 34 | 35 | 42 | 43 | avg); 45 | ]]> 46 | 47 | lp1tm1) { 55 | lp1tm1 = x; 56 | } else { 57 | lp1tm1 = 0.9999f * lp1tm1 + 0.0001f * x; 58 | } 59 | 60 | avgs -= avg[apos]; 61 | avgs += lp1tm1; 62 | avg[apos++] = lp1tm1; 63 | apos %= avg_size; 64 | 65 | lp2tm1 = 0.999f * lp2tm1 + avgs*avg_sizer * 0.001f; 66 | q = lp1tm1 * sag - lp2tm1 * 1.02f - 1.0f; 67 | if (q > -0.01f) { 68 | q = -0.01f; 69 | } else if (q < -1.0f) { 70 | q = -1.0f; 71 | } 72 | 73 | if (input[pos] == q) { 74 | fx = 1.0f / dist + q / (1.0f - f_exp(dist * q)); 75 | } else { 76 | fx = (input[pos] - q) / 77 | (1.0f - f_exp(-dist * (input[pos] - q))) + 78 | q / (1.0f - f_exp(dist * q)); 79 | } 80 | 81 | buffer_write(output[pos], fx); 82 | } 83 | 84 | plugin_data->lp1tm1 = lp1tm1; 85 | plugin_data->lp2tm1 = lp2tm1; 86 | plugin_data->avgs = avgs; 87 | plugin_data->apos = apos; 88 | ]]> 89 | 90 | 91 | Sag level 92 |

The level of power supply sag that will be caused by attacks.

93 | 94 |
95 | 96 | 97 | Distortion 98 |

How harsh the distortion caused by the sag will be.

99 | 100 |
101 | 102 | 103 | Input 104 | 105 | 106 | 107 | Output 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 |
118 |
119 | -------------------------------------------------------------------------------- /wave_terrain_1412.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Wave Terrain Oscillator 14 |

A Wave Terrain oscillator, taken from Curtis Roads' example in {\em The Computer Music Tutorial}.

15 |

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).

16 | 17 | 27 | 28 | 29 | x 30 | 31 | 32 | 33 | y 34 | 35 | 36 | 37 | z 38 | 39 |
40 |
41 | -------------------------------------------------------------------------------- /xfade_1915.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | #include "ladspa-util.h" 12 | 13 | 14 | 15 | 16 | Crossfade 17 | 18 | 28 | 29 | 30 | Crossfade 31 |

Controls the degree to which the inputs are mixed into the output. A 32 | value of -1 means that the output is just the A input, and a value of 1.0 33 | means that it is just the B input.

34 | 35 |
36 | 37 | 38 | Input A left 39 | 40 | 41 | Input A right 42 | 43 | 44 | 45 | Input B left 46 | 47 | 48 | Input B right 49 | 50 | 51 | 52 | Output left 53 | 54 | 55 | Output right 56 | 57 |
58 | 59 | 60 | Crossfade (4 outs) 61 | 62 | 74 | 75 | 76 | Crossfade 77 |

Controls the degree to which the inputs are mixed into the output. A 78 | value of -1 means that the output is just the A input, and a value of 1.0 79 | means that it is just the B input.

80 | 81 |
82 | 83 | 84 | Input A left 85 | 86 | 87 | Input A right 88 | 89 | 90 | 91 | Input B left 92 | 93 | 94 | Input B right 95 | 96 | 97 | 98 | Output A left 99 | 100 | 101 | Output A right 102 | 103 | 104 | 105 | Output B left 106 | 107 | 108 | Output B right 109 | 110 |
111 |
112 | -------------------------------------------------------------------------------- /zm1_1428.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | z-1 14 |

A plugin that implements the $z^{-1}$ function (a single sample delay).

15 | 16 | 19 | 20 | 23 | 24 | xm1 = xm1; 34 | ]]> 35 | 36 | 37 | Input 38 | 39 | 40 | 41 | Output 42 | 43 | 44 | 45 |
46 |
47 | --------------------------------------------------------------------------------