/usr/share/faust/route.lib is in faust-common 0.9.95~repack1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | //#################################### route.lib ########################################
// A library of basic elements to handle signal routing in Faust.
//
// It should be used using the `si` environment:
//
// ```
// ro = library("route.lib");
// process = ro.functionCall;
// ```
//
// Another option is to import `stdfaust.lib` which already contains the `si`
// environment:
//
// ```
// import("stdfaust.lib");
// process = ro.functionCall;
// ```
//########################################################################################
/************************************************************************
************************************************************************
FAUST library file
Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale
----------------------------------------------------------------------
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
larger FAUST program which directly or indirectly imports this library
file and still distribute the compiled code generated by the FAUST
compiler, or a modified version of this compiled code, under your own
copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
grants you the right to freely choose the license for the resulting
compiled code. In particular the resulting compiled code has no obligation
to be LGPL or GPL. For example you are free to choose a commercial or
closed source license or any other license if you decide so.
************************************************************************
************************************************************************/
ba = library("basic.lib");
si = library("signal.lib");
sp = library("spat.lib");
declare name "Faust Signal Routing Library";
declare version "0.0";
//=============================Functions Reference========================================
//========================================================================================
//--------------------------------`cross`-----------------------------------
// Cross n signals: `(x1,x2,..,xn) -> (xn,..,x2,x1)`.
// `cross` is a standard Faust function.
//
// #### Usage
//
// ```
// cross(n)
// _,_,_ : cross(3) : _,_,_
// ```
//
// Where:
//
// * `n`: number of signals (int, must be known at compile time)
//
// #### Note
//
// Special case: `cross2`:
//
// ```
// cross2 = _,cross(2),_;
// ```
//-----------------------------------------------------------------------------
// cross n cables : (x1,x2,..,xn) -> (xn,..,x2,x1)
cross(n) = si.bus(n) <: par(i,n,ba.selector(n-i-1,n));
cross2 = _,cross(2),_; // for compatibility with some old misceffect.lib functions
//--------------`crossnn`--------------
// Cross two `bus(n)`s.
//
// #### Usage
//
// ```
// _,_,... : crossmm(n) : _,_,...
// ```
//
// Where:
//
// * `n`: the number of signals in the `bus`
//--------------------------------------
crossnn(n) = si.bus(n),si.bus(n) <: si.block(n),si.bus(n),si.bus(n),si.block(n);
//--------------`crossn1`--------------
// Cross bus(n) and bus(1).
//
// #### Usage
//
// ```
// _,_,... : crossn1(n) : _,_,...
// ```
//
// Where:
//
// * `n`: the number of signals in the first `bus`
//--------------------------------------
crossn1(n) = si.bus(n),(si.bus(1)<:si.bus(n)) <: si.block(n),si.bus(n),si.bus(n),
si.block(n):si.bus(1),si.block(n-1),si.bus(n);
//--------------------------`interleave`------------------------------
// Interleave row*col cables from column order to row order.
// input : x(0), x(1), x(2) ..., x(row*col-1)
// output: x(0+0*row), x(0+1*row), x(0+2*row), ..., x(1+0*row), x(1+1*row), x(1+2*row), ...
//
// #### Usage
//
// ```
// _,_,_,_,_,_ : interleave(row,column) : _,_,_,_,_,_
// ```
//
// Where:
//
// * `row`: the number of row (int, known at compile time)
// * `column`: the number of column (int, known at compile time)
//-----------------------------------------------------------------------------
interleave(row,col) = si.bus(row*col) <: par(r, row, par(c, col, ba.selector(r+c*row,row*col)));
//-------------------------------`butterfly`--------------------------------
// Addition (first half) then substraction (second half) of interleaved signals.
//
// #### Usage
//
// ```
// _,_,_,_ : butterfly(n) : _,_,_,_
// ```
//
// Where:
//
// * `n`: size of the butterfly (n is int, even and known at compile time)
//-----------------------------------------------------------------------------
butterfly(n) = si.bus(n) <: interleave(n/2,2), interleave(n/2,2) : par(i, n/2, +), par(i, n/2, -);
//------------------------------`hadamard`----------------------------------
// Hadamard matrix function of size `n = 2^k`.
//
// #### Usage
//
// ```
// _,_,_,_ : hadamard(n) : _,_,_,_
// ```
//
// Where:
//
// * `n`: `2^k`, size of the matrix (int, must be known at compile time)
//
// #### Note:
//
// Implementation contributed by Remy Muller.
//-----------------------------------------------------------------------------
// TODO: author: Remy Muller, revised by RM
hadamard(2) = butterfly(2);
hadamard(n) = butterfly(n) : (hadamard(n/2) , hadamard(n/2));
//---------------`recursivize`-------------
// Create a recursion from two arbitrary processors p and q.
//
// #### Usage
//
// ```
// _,_ : recursivize(p,q) : _,_
//
// ```
//
// Where:
//
// * `p`: the forward arbitrary processor
// * `q`: the feedback arbitrary processor
//----------------------------------------
recursivize(p,q) = (_,_,_,_ :> sp.stereoize(p)) ~ sp.stereoize(q);
|