Re: [Faudiostream-users] Triangle LFO with controllable phase?

2023-02-26 Thread Hermann Meyer



Am 27.02.23 um 00:26 schrieb Christopher Arndt:

Am 27.02.23 um 00:07 schrieb Julius Smith:

I think writing the triangle-wave from scratch as Dario did is the
best way to go when possible.


I used Dario's code for the LFO in this chorus effect I created:

https://gist.github.com/SpotlightKid/9fe3b2638b8a1fa8b1a1d007716a45cb

I wanted a chorus effect, which is versatile but still has intuitive
controls. I plan on creating a plugin with a custom UI with the DPF
framework later.

One thing that doesn't work the way I want it yet is the bypass
switch. Is there a way to use something like 'select2' to switch
between two signals but still have a smooth transition without clicks
caused by sudden amplitude jumps?

Chris


Hi

I always implement the bypass switch in C/C++. When using select2 in
faust, always both path been processed. That means, even when you switch
into bypass, the CPU load will stay the same. So, it's not a true bypass.

Here is a example for smooth true bypass and multi select in C++

https://github.com/brummer10/ModularAmpToolKit.lv2/blob/main/PreAmps/PreAmps.cpp#L170

the effects itself been done in faust.

regards

hermann



___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


Re: [Faudiostream-users] How to place values in lists?

2022-08-17 Thread Hermann Meyer


Am 17.08.22 um 18:10 schrieb Robin Gareus:

Hello Faust community,

I'm brushing up my FAUST skills. It's been over a decade and it's
amazing to see how far things have grown. Well now, I just ran into an
issue:


How can I place signal primitive into a list?

e.g. use  _,_  as list arguments (_,_) for `an.analyzer(3, HERE)`


If I understand correctly, lists are just parallel composition. So I
expected an extra pair of brackets to work. Why doesn't it?


-8<-

Perhaps the deeper issue is the design-pattern that I'm aiming for. So
let me elaborate. The specific use-case is a multiband effect[1]:

The following works (implementation omitted for readability):

```
apply(fq,g1,g2,g3,g4) = _;

freqs=100,200,300;

process= _ <: par(i,2,_)
: (an.analyzer(6, (freqs)) , _)
: apply (freqs);

```

Now, I'd like to make this generic for arbitrary numbers of frequency
bands, rather than 3 hardcoded band-splits. This is similar how
an.analyzer() or filterbank work, except with an additional gain
parameter for each band:


```
nuapply(freqs, gain) = _
   with {
 nb   = ba.count(freqs);
 f(n) = ba.take(n, freqs);
 g(n) = ba.take(n, gain); // bm +1 elemements
   };
```

So far so good. This works with explicit literal arguments.

However I fails to see how the output of analysis stage can be passed as
list.

I tried another approach using `nu2apply(freqs)` and then
selectn() the gain levels from input bus, but that quickly becomes a mess.

What is the Faustian way to implement this?

Thanks in advance,
robin



This is a example I use



hifr1  =hslider("crossover_b1_b2 [log][name:Crossover B1-B2
(hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 2, 1.08);
hifr2  =hslider("crossover_b2_b3 [log][name:Crossover B2-B3
(hz)][tooltip: Crossover fi.bandpass frequency]",210,20,2,1.08);
hifr3  =hslider("crossover_b3_b4 [log][name:Crossover B3-B4
(hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,2,1.08);
hifr4  =hslider("crossover_b4_b5 [log][name:Crossover B4-B5
(hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,2,1.08);

geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));

process    = _: geq: ( dist5s , dist4s , dist3s, dist2s, dist1s) :>
*(gain1) with {
    dist1s = ef.cubicnl(drive1,offset1: si.smooth(0.999)) :
fi.dcblockerat(1.0) : vmeter1;
    dist2s = ef.cubicnl(drive2,offset2: si.smooth(0.999)) :
fi.dcblockerat(1.0) : vmeter2;
    dist3s = ef.cubicnl(drive3,offset3: si.smooth(0.999)) :
fi.dcblockerat(1.0) : vmeter3;
    dist4s = ef.cubicnl(drive4,offset4: si.smooth(0.999)) :
fi.dcblockerat(1.0) : vmeter4;
    dist5s = ef.cubicnl(drive5,offset5: si.smooth(0.999)) :
fi.dcblockerat(1.0) : vmeter5;

};

were you could put anything you like into the filterbank, when defined,
while set frequency at runtime.

What makes me struggled on the beginning was that the filterbank always
have one channel more then defined, last freq to nyquist.

regards

hermann



___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


[Faudiostream-users] LV2 generator/designer

2022-07-24 Thread Hermann Meyer

Hi

I worked on a LV2 generator tool and have now implemented faust support.

The tool is now able to generate a LV2 bundle with X11 based UI for
faust dsp files.

The file could be load by dnd on the designer interface.

I've uploaded a little demo showing how it works.

https://i.imgur.com/THSArvd.gif


The project page is here:

https://github.com/brummer10/XUiDesigner


It's still early stage, but it may be helpful already, or at least bring
some fun.


regards

hermann



___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


Re: [Faudiostream-users] DIstortion, Clipping, Bitcrushing and other Distortion-Types

2020-12-06 Thread Hermann Meyer

Here is  example for how you could use lookup table distortion in faust:

https://github.com/brummer10/LittleFly.lv2/blob/master/LittleFly/dsp/LittleFly.dsp

Am 06.12.20 um 14:44 schrieb michel buffa:

Well, I've been working on tube guitar amp simulations for a while +
we ported several overdrive/distortion/fuzz pedals from Faust to
WebAudio.

You can of course follow the advises that have been posted previously
+ also :

  * Look at the faustlib + guitarix.lib as said,
  * Look at Oleg Kapitonov's overdrive + amp sim in faust
(https://github.com/olegkapitonov/Kapitonov-Plugins-Pack
faust .dsp source code in LV2 dir)
  * Look at Nick Thomson Temper distorsion (includes a negative
feedback loop), we used it as a starting point for the faust
implementation of the power amp stage of a guitar amp simulation
(kemper : https://github.com/creativeintent/temper) + look for the
video and paper we wrote for IFC 2020
(https://ifc20.sciencesconf.org/321481)
  * Look at these following examples :
  o Big Muff fuzz at OWL pedal patch page :
https://www.rebeltech.org/patch-library/patch/Big_Muff_Fuzz
  o Overdrive pedal from guitariw project :
https://www.rebeltech.org/patch-library/patch/Guitarix_Overdrive
  o OSC tube distorsion from OWL pedal patch page :
https://www.rebeltech.org/patch-library/patch/OscTube
  o Ibanez TS9 Overdrive re-creation, example from FAUST
distribution :

https://raw.githubusercontent.com/grame-cncm/faust/master-dev/examples/misc/guitarix.dsp

For tube emulation, there are different approaches. Tubes have a
temporal behavior that produces the sag and squish effect (current
load during attack, unload during release) that is difficult to reproduce.
In our power amp we used filters + waveshaper + bandpass filter driven
by the input signal enveloppe. In a JavaScript implementation we
altered in real time the transfer function of the waveshapers (not
possible in faust), but some people managed to implement a more
accurate model (at the price of high cpu usage) such as what is done
in the Swanky Amp plugin (whose DSP code is written in Faust), see
https://github.com/resonantdsp and their web site
(https://www.resonantdsp.com/#posts read all blog posts)

Only few implementations address the sag/squish reproduction.

BTW if someone has good links with explanation about faust
implementation of tubes with sag/squish, please share :-)

Michel

Le dim. 6 déc. 2020 à 14:07, Till Bovermann mailto:lf...@lfsaw.de>> a écrit :

thanks for the mention, dario!

a very nice distortion heavily used by me in my SuperCollider
writings (adopted form Josh Parmenter and Julian Rohrhuber) is to
amplify the signal and run it through a `tanh` sinusoid function.
the overtone resulting spectrum is quite nice to the ear.

Also interesting in in this regard are the various distortion
plugins you can find in this repo:


https://github.com/supercollider/sc3-plugins/blob/master/source/DistortionUGens/DistortionUGens.cpp

for the algorithms, look for functions with `_next` in their name...

cheers
        Till


--
Till Bovermann

https://tai-studio.org | http://lfsaw.de |
https://www.instagram.com/_lfsaw/










> On 5. Dec 2020, at 15:56, Dario Sanfilippo
mailto:sanfilippo.da...@gmail.com>>
wrote:
>
> You may also want to check the saturators in Zavalishin's book;
Google "the art of va filter design". I have implemented some of
those here:
https://github.com/dariosanfilippo/edgeofchaos/blob/master/stabilityEOC.lib.
>
> For the folding functions, you can see what Till has ported from
Supercollider:

https://github.com/tai-studio/faust-sc/blob/116f80e38ea1ca5c95053f4360804f45dd7494b9/lib/scUGens.lib#L470.
>
> These wavefolding techniques also seem interesting and could be
implemented in Faust:
https://ccrma.stanford.edu/~jatin/ComplexNonlinearities/Wavefolder.html.
I'll give it a try later.
>
> I've been doing some experiments with time-variant transfer
functions being written by the input signal itself and I've had
promising results, although this algorithm, ideally, should be
implemented using tables where each point in the TF smoothly
transitions from the current value to the new one. As it is now,
you often hear a click when the TF value is overwritten in the
delay line as it most likely jumps.
>
> You can have a look here:

https://github.com/dariosanfilippo/edgeofchaos/blob/a010b0ca6c5d8b850ecbf954b4e4aff4ad60a752/outformationEOC.lib#L571.
>
> Cheers,
> Dario
>
> On Fri, 4 Dec 2020 at 16:52, da mailto:d...@randomstyles.net>> wrote:
> hello,
>
> i am trying to figure out how to create different distortion
effects. is
> there a site where you can look at some algorithms and how to
implement
> them into faust?
>
> i

Re: [Faudiostream-users] optimising faust processors / tipps for great performance

2018-12-04 Thread Hermann Meyer


Am 04.12.18 um 18:41 schrieb Joshua Peschke:

i noticed for example that the smoothing of parameters seems to affect 
performance quite much (if there are lots of them..). do you have any 
suggestions on how to minimise this? any hints are very much appreciated!



Hi

some care needs to be taking when you smooth parameters. Smoothing 
itself isn't really expensive, but in combination with, for example 
db2linear it could make things worse.


Let's have a look at the generated code, when we use (from the examples)

gain        = vslider("[1]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo;

we get a loop like this:

virtual void compute (int count, FAUSTFLOAT** input, FAUSTFLOAT** output) {
        float     fSlow0 = (0.001f * powf(10,(0.05f * 
float(fslider0; // powf called for db2linear once for each callback

        FAUSTFLOAT* input0 = input[0];
        FAUSTFLOAT* output0 = output[0];
        for (int i=0; i            fRec0[0] = (fSlow0 + (0.999f * fRec0[1])); // <- parameter 
smoothing

            output0[i] = (FAUSTFLOAT)((float)input0[i] * fRec0[0]);
            // post processing
            fRec0[1] = fRec0[0]; // <- parameter smoothing
        }
    }

parameter smoothing is 1 addition and one multiplication and one 
"memmove", for each sample.


now, when you use it like this:

gain        = vslider("[1]", 0, -70, +4, 0.1) : si.smoo : ba.db2linear;

we get a loop like this:

virtual void compute (int count, FAUSTFLOAT** input, FAUSTFLOAT** output) {
        float     fSlow0 = (0.001f * float(fslider0));
        FAUSTFLOAT* input0 = input[0];
        FAUSTFLOAT* output0 = output[0];
        for (int i=0; i            fRec0[0] = (fSlow0 + (0.999f * fRec0[1])); // <- parameter 
smoothing
            output0[i] = (FAUSTFLOAT)((float)input0[i] * powf(10,(0.05f 
* fRec0[0]))); // additional powf call in inner loop

            // post processing
            fRec0[1] = fRec0[0]; // <- parameter smoothing
        }
    }

Parameter smoothing use the same resources as in the example above, but 
we've now the pow call in the inner loop, means it will be called for 
any sample, instead like in the above loop, once at any callback.






___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


Re: [Faudiostream-users] Waveform selector?

2017-07-24 Thread Hermann Meyer

Hi


We've a tremolo with waveform select in guitarix, using select3()

here is the source file, Note that it is written for faust 0.9.73, so 
you've to port it to the new library structure in faust.


As well we using our own GUI, so we could translate checkbox to our 
needs, you should replace it with a slider or a knob in order to use the 
generic faust UI.


https://sourceforge.net/p/guitarix/git/ci/master/tree/trunk/src/faust/tremolo.dsp


regards
hermann

Am 24.07.2017 um 19:28 schrieb Steve Duell:

Hello,

Would someone be so kind as to give me some pointers?

The application I'm developing is essentially a tremolo modified from 
the example in Romain's workshop.  I'm trying to replace the sine 
oscillator with a choice of oscillators running various waveforms to 
give different shapes to the amplitude modulation.  This is where I'm 
stuck.


Below is some pseudocode which hopefully illustrates what I'm trying 
to achieve. What I'm missing is the user control that actually SELECTS 
the source to use for the 'signal' variable:


tremolo = *(1-depth*((signal) : si.smooth(smoother)))
with{
depth = vslider("Depth[style:knob]",1,0,1,0.01) : si.smoo;
duty = vslider("P/W[style:knob]",0.5,0,1,0.01) : si.smoo;
smoother =
vslider("De-click[style:knob]",0.95,0.5,0.999,0.001) : si.smoo;
signal =  os.oscsin(freq) or;
  os.triangle(freq) or;
  os.sawtooth(freq) or;
  os.lf_pulsetrainpos(freq,duty) or;
};


Thanks a ton for any tips you can give me.

-Steve Duell




--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


Re: [Faudiostream-users] Pitched envelope

2017-07-16 Thread Hermann Meyer



Am 16.07.2017 um 17:49 schrieb Hermann Meyer:

Am 16.07.2017 um 16:17 schrieb Yassin Philip:

Hello everyone

The idea is to rapidly rise, and (a bit slower) fall, the pitch of a 
sound, so this pitch has to evolve over time..? Googling for it is a 
bit tricky, and I can't find any recipe anywhere :(


Also, is is possible to assign the parameter value of a Faust 
function's to the output of another? To, for instance, lower or rise 
an eQ band frequency with the output of a compressor?


If it is, I'd really like to learn how :)

yPhil



Hi

It's easier then you think. So, for example what I'm using in GxQuack 
(envelope controlled wah pedal with some extra features) is:


Wah = (x : lowpass(1,6000.0) : highpass(1,10.0)  : reduce(max,256) 
:  amp_follower_ud(attack,release) : min(1.0) : max(0.0) );


instead a slider like this

Wah = vslider("Wah[name:Wah]", 0.5, 0, 1, 0.01) : Inverted(0) : 
smooth(s);



Note, that this is with faust-0.9.73, so you need to convert that to 
the new faust library structure.


attack is the "rise" time, release is the "fall" time.


https://github.com/brummer10/GxQuack.lv2

regards
hermann



For reference, here is the full GxQuack dsp file ( only work with faust 
> 0.9.90) :


// generated by build_wah.py
// DO NOT MODIFY!
declare id "quack";
declare name "quack";
declare category "Envelope Filter";

import("filter.lib");
import("effect.lib");
import("reduce.lib");

p2 = pre : iir((b0/a0,b1/a0),(a1/a0)) with {
LogPot(a, x) = if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = if(b, 1 - x, x);
s = 0.993;
fs = float(SR);
pre = _;


b0 = 0.0260145681581686;

b1 = 0.0260145681581686;

a0 = 2.02913631633715e-5*fs + 0.0260145681581686;

a1 = -2.02913631633715e-5*fs + 0.0260145681581686;
};

p2a = pre : iir((b0/a0,b1/a0),(a1/a0)) with {
LogPot(a, x) = if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = if(b, 1 - x, x);
s = 0.993;
fs = float(SR);
pre = _;


b0 = 1.85778624631907e-5*fs;

b1 = -1.85778624631907e-5*fs;

a0 = 1.85778624631907e-5*fs + 0.108262601766846;

a1 = -1.85778624631907e-5*fs + 0.108262601766846;
};

pr = vslider("Tone[enum:Off|Low|High]", 0, 0, 2,1) ;
tone = _<:select3(pr,_,p2,p2a) ;
dri = cubicnl(0.25,0.01);
d = vslider("Drive[enum:Off|On]", 0, 0, 1,1) ;
drive = _<:select2(d,_,dri) ;

s = 0.993;
Inverted(b, x) = if(b, 1 - x, x);
attack = 0.01; //vslider("Attack[name:Attack]", 0.01, 0.01, 1, 
0.01) : smooth(s);
release = 0.1; //vslider("Release[name:Release]", 0.1, 0.01, 1, 
0.01) : smooth(s);
Gain = hslider("Gain[name:Gain]", 0, -12, 6, 0.01) : 
component("music.lib").db2linear : smooth(s);
peak = hslider("Peak[name:Peak]", 5, -6, 20, 0.1) : 
component("music.lib").db2linear : smooth(s);

r = vslider("Range[enum:Low|High]", 0, 0, 1,1) ;
range = vslider("Depth[name:Depth]", 1.0, 0, 1, 0.01) : smooth(s);

p_orig(x) = x : pre : 
iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0),(a1/a0,a2/a0,a3/a0,a4/a0)) with {

LogPot(a, x) = if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = if(b, 1 - x, x);
fs = float(SR);
pre = dcblockerat(228.092318096);

Wah = (x : lowpass(1,6000.0) : highpass(1,10.0) : *(peak) : 
reduce(max,256) :  amp_follower_ud(attack,release) : min(1.0) : 
max(0.0)  : Inverted(r) : *(range));
   // Wah = vslider("Wah[name:Wah]", 0.5, 0, 1, 0.01) : Inverted(0) 
: smooth(s);


b0 = Wah*(Wah*pow(fs,2)*(fs*(1.25354929406751e-21*fs + 
3.48240441754786e-17) + 5.13677938472839e-14) + 
fs*(fs*(fs*(-1.25190991419205e-21*fs - 3.48523283496869e-17) - 
5.2316993141028e-14) - 1.41321715027133e-12)) + 
fs*(fs*(fs*(-7.5608386057978e-21*fs - 2.50316072052274e-16) - 
3.73895528562635e-13) - 2.00079255029258e-12);


b1 = Wah*(Wah*pow(fs,3)*(-5.01419717627005e-21*fs - 
6.96480883509573e-17) + fs*(pow(fs,2)*(5.0076396567682e-21*fs + 
6.97046566993739e-17) - 2.82643430054267e-12)) + 
fs*(pow(fs,2)*(3.02433544231912e-20*fs + 5.00632144104549e-16) - 
4.00158510058516e-12);


b2 = Wah*(Wah*pow(fs,2)*(7.52129576440508e-21*pow(fs,2) - 
1.02735587694568e-13) + pow(fs,2)*(-7.5114594851523e-21*pow(fs,2) + 
1.04633986282056e-13)) + pow(fs,2)*(-4.53650316347868e-20*pow(fs,2) + 
7.47791057125271e-13);


b3 = Wah*(Wah*pow(fs,3)*(-5.01419717627005e-21*fs + 
6.96480883509573e-17) + fs*(pow(fs,2)*(5.0076396567682e-21*fs - 
6.97046566993739e-17) + 2.82643430054267e-12)) + 
fs*(pow(fs,2)*(3.02433544231912e-20*fs - 5.00632144104549e-16) + 
4.00158510058516e-12);


b4 = Wah*(Wah*pow(fs,2)*(fs*(1.25354929406751e-21*fs - 
3.48240441754786e-17) + 5.13677938472839e-14) + 
fs*(fs*(fs*(-1.25190991419205e-21*fs + 3.48523283496869e-17) - 
5.2316993141028e-14) + 1.41321715027133e-12)) +

Re: [Faudiostream-users] Pitched envelope

2017-07-16 Thread Hermann Meyer

Am 16.07.2017 um 16:17 schrieb Yassin Philip:

Hello everyone

The idea is to rapidly rise, and (a bit slower) fall, the pitch of a 
sound, so this pitch has to evolve over time..? Googling for it is a 
bit tricky, and I can't find any recipe anywhere :(


Also, is is possible to assign the parameter value of a Faust 
function's to the output of another? To, for instance, lower or rise 
an eQ band frequency with the output of a compressor?


If it is, I'd really like to learn how :)

yPhil



Hi

It's easier then you think. So, for example what I'm using in GxQuack 
(envelope controlled wah pedal with some extra features) is:


Wah = (x : lowpass(1,6000.0) : highpass(1,10.0)  : reduce(max,256) 
:  amp_follower_ud(attack,release) : min(1.0) : max(0.0) );


instead a slider like this

Wah = vslider("Wah[name:Wah]", 0.5, 0, 1, 0.01) : Inverted(0) : smooth(s);


Note, that this is with faust-0.9.73, so you need to convert that to the 
new faust library structure.


attack is the "rise" time, release is the "fall" time.


https://github.com/brummer10/GxQuack.lv2

regards
hermann

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


Re: [Faudiostream-users] Input Src Selector

2016-04-13 Thread Hermann Meyer


Am 13.04.2016 um 09:23 schrieb Simon Staudenmayer:
> Hello Faust-Team,
>
> I have a problem getting a simple source selector to work.
> The faust code is the following:
>
> switcher(channels,1) =_ , par(i, channels-1,!);
> switcher(channels, channels) = par(i, channels-1,!),_;
> switcher(channels, pos)=par(i, pos-1, !), _ , par(i, channels-pos, !);
>
> srces = 3;
> position = 2
>
> process= par(i,srces_): switcher(srces,position);
>
> This works, however, if I want to control the position with a slider, 
> e.g. like
>
> process = ...switcher(srces, sel_osci);
>
> it fails with "the node of the tree is not an int nor a float": I 
> tried already the following things, but all were unsuccessful:
>
> sel_osci = 1:*(hslider("oscisrc [style:knob]", 1 , 1, 3 , 1));
> sel_osci = 1:*(hslider("oscisrc [style:knob]", 1 , 1, 3 , 1)): int;
> sel_osci = 1:*(hslider("oscisrc [style:knob]", 1 , 1, 3 , 1)): int;
> sel_osci = int(hslider("oscisrc [style:knob]", 1 , 1, 3 , 1)));
>
>
> Another method, though no ideal (because of the merging :>), I tried was
>
> switch(k, srces) = *(k == pos);
> switcher(srces, position) = par(i, srces, _) : par(i, srces, switch(i, 
> position)):>_;
>
> This worked, but I got weird some audio artefacts (sometimes two 
> oscillators could be heard at once or the knob was very sensitive to 
> slight movements, and e.g. no giving me the first src at exactly 
> position 1 but at a small "off-1"-position).
> Is there a simple way to get the first example to work or an easy 
> alternative?
>
> Thanks in advance!
>
> Simon


here is how I've implemented a source switcher for 4 channels (first 
channel is a simple pass):

import("music.lib");
import("math.lib");

ch1 = *(0.5);
ch2 = *(1.5);
ch3 = *(2.0);

sel(n) = environment {

  a = min(2, max(0,n));
  b = min(2, max(0,n-1));
  c = min(2, max(0,n-2));
};

selfilter(n)  = _<: a <: b <: c :>_ with {
   a = select3(sel(n).a,_,ch1,_);
   b = select3(sel(n).b,_,ch2,_);
   c = select3(sel(n).c,_,ch3,_);
};


sl   = hslider("select channel",0,0,3,1);

process  =  selfilter(sl);

regards
hermann

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


Re: [Faudiostream-users] sample bank program

2015-09-07 Thread Hermann Meyer
Option 2 is what we do in Guitarix.

For option 1, you may have a look at the faust-stk, in special in 
instrument.h / instrument.lib and it's use.
Maybe you didn't need a external program to get the samples into faust.

regards
hermann

Am 07.09.2015 um 10:45 schrieb Stéphane Letz:
> I would go for 2), but maybe you could describer first a bit more what you 
> are trying to develop :
>
> - on which platform?
>
> - what would be the role of Faust processing into your application?
>
> - would you application need a complete  UI or would it be only remotely 
> controlled? (like with OSC..)
>
> Stéphane
>
>
> Le 7 sept. 2015 à 02:59, Ben Burdette  a écrit :
>
>> Hey all;
>>
>> I'm interesting in writing a program which can load multiple banks of
>> sound samples based on a configuration file.  For a given config file
>> there might be 10 or 15 banks, and (probably) 24 samples per bank.
>>
>> Faust, by design, doesn't have any provisions for this sort of thing as
>> far as I can tell.  So I'll need to do my sample loading outside of faust.
>>
>> What would be a recommended architecture for such a program?  I can
>> think of a couple of possibilities:
>>
>> 1) write a faust program with 24 slots for sounds.  Have an external
>> program put the sounds into faust via osc, perhaps (is this possible?).
>> Each time the sample bank is changed, load new sounds into faust,
>> replacing the old.
>>
>> 2) write a program which uses the faust-generated C++ code as a module.
>> This program would load the samples into its memory, and handle
>> streaming them (and perhaps external sound sources) into the faust code,
>> and then routing the faust code results to an audio device.
>>
>> 3) ??
>>
>> Option 2 certainly involves more responsibility, what with dealing with
>> audio devices and so forth.  Option 1 seems easier, but perhaps a little
>> kludgy - switching from one sound bank to another would be comparatively
>> slow.
>>
>> Anyway, any input would be appreciated!
>>
>> - Ben
>>
>> --
>> ___
>> Faudiostream-users mailing list
>> Faudiostream-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>
> --
> ___
> Faudiostream-users mailing list
> Faudiostream-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users


--
___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


[Faudiostream-users] Faust syntax-highlighting in Geany

2014-12-09 Thread Hermann Meyer

Hi

I mostly use Geany for my projects, so I decide to add 
syntax-highlighting for faust to it.
I put all declared functions from faust/architecture/*.lib's in the 
primary section, and all faust internal functions in the secondary 
section. This gives a nice C/C++ style like syntax-highlight for dsp and 
lib files in geany.
Additional it add Menu-entry’s to the geany/build menu, which allow to 
build and run faust-gtk or faust-qt apps direct from the geany menu.


Attached is a patch which will add filetypes.Faust.conf to 
.config/geany/filedefs/
and add the Faust type as Compiler language to 
.config/geany/filetype_extensions.conf.

You could apply it by put it in your /home and run from your /home directory

|patch -p0 < faustingeany.patch|



regards
hermann
diff -rupN .config/geany.orig/filedefs/filetypes.Faust.conf .config/geany/filedefs/filetypes.Faust.conf
--- .config/geany.orig/filedefs/filetypes.Faust.conf	1970-01-01 01:00:00.0 +0100
+++ .config/geany/filedefs/filetypes.Faust.conf	2014-12-09 19:24:04.707454174 +0100
@@ -0,0 +1,64 @@
+# For complete documentation of this file, please see Geany's main documentation
+
+[styling=C]
+
+[keywords]
+# all items must be in one line
+primary=RMS mean minn maxn sumn reducemap reduce lfnoise lfnoiseN lfnoise0 pink_noise oscr_demo oscrs_demo oscw oscq oscws oscwc oscs oscr oscrc oscrs oscrq oscb virtual_analog_oscillator_demo triangle triangleN imptrain imptrainN impulse diffn square squareN pulsetrain pulsetrainN sawtooth_demo saw2f4 saw2f2 sawtooth saw3 saw2 sawNp sawN saw1 lf_sawpos lf_rawsaw lf_squarewave lf_squarewavepos lf_pulsetrainpos lf_imptrain fl ml chebychevpoly chebychev bsmooth automat bpf TF2 spat gain8 gain7 gain6 gain5 gain4 gain3 gain2 bus8 bus7 bus6 bus5 bus4 bus3 bus2 panner adsr osci osc phase decimal sinwaveform samplingfreq tablesize noises multinoise multirandom noise RANDMAX random linear2db db2linear beat pulsen pulse period tempo sdelay echo43s echo21s echo10s echo5s echo2s echo1s time43s time21s time10s time5s time2s time1s millisec fdelay43s fdelay21s fdelay10s fdelay5s fdelay2s fdelay1s delay43s delay21s delay10s delay5s delay2s delay1s fdelay delay index frac line highShelf lowShelf peakNotch peakingEQ APF notch BPF HPF LPF biquad filtercoeff atodb cross dot hadamard butterfly interleave selector bus countup countdown interpolate subseq take count nextafter isnan fmin fmax fabs Yn Y1 Y0 Jn J1 J0 lgamma gamma erfc erf tanh cosh sinh atanh asinh acosh expm1 ilogb logb log1p scalb ldexp hypot cbrt inv neg PI BS SR rotate map wider optimInPhase optimMaxRe optimBasic decoderStereo decoder encoder mesh_square mesh_square zita_rev1 zita_rev1_ambi zita_rev1_stereo zita_rev_fdn_demo zita_distrib2 zita_in_delay zita_rev_fdn fdnrev0_demo stereo_reverb_tester prime_power_delays fdnrev0 satrev jcrev limiter_1176_R4_stereo limiter_1176_R4_mono compressor_demo gate_demo compression_gain_mono compressor_stereo compressor_mono gate_gain_mono gate_stereo gate_mono amp_follower_ud amp_follower stereo_width phaser2_demo phaser2_stereo phaser2_mono vibrato2_mono flanger_stereo flanger_mono piano_dispersion_filter crybaby_demo crybaby autowah wah4_demo wah4 moog_vcf_demo moog_vcf_2bn moog_vcf_2b moog_vcf exciter cubicnl_demo cubicnl_nodc cubicnl speakerbp levelfilterN levelfilter select2stereo bypass2 bypass1 cross2 log2 hz2pianokey pianokey2hz midikey2hz filterbanki filterbank analyzer filterbank_demo mth_octave_filterbank_demo octave_analyzer octave_filterbank half_octave_filterbank half_octave_analyzer third_octave_filterbank third_octave_analyzer spectral_level_demo mth_octave_spectral_level_demo spectral_level mth_octave_spectral_level_default mth_octave_spectral_level6e mth_octave_filterbank_default mth_octave_filterbank5 mth_octave_filterbank3 mth_octave_filterbank_alt mth_octave_filterbank mth_octave_analyzer_default mth_octave_analyzer5 mth_octave_analyzer3 mth_octave_analyzer mth_octave_analyzer6e fdelay4a fdelay3a fdelay1a fdelay5 fdelay4 fdelay3 fdelay2 fdelay1 parametric_eq_demo peak_eq_rm peak_eq_cq peak_eq highshelf_other_freq high_shelf1_l high_shelf1 high_shelf highshelf lowshelf_other_freq low_shelf1_l low_shelf1 low_shelf lowshelf bandpass12e bandpass6e bandpass0_bandstop1 bandstop bandpass highpass6e highpass3e lowpass6e lowpass3e highpass_minus_lowpass_odd highpass_plus_lowpass_odd highpass_minus_lowpass_even highpass_plus_lowpass_even highpass_minus_lowpass highpass_plus_lowpass lowpass0_highpass1 highpass lowpass resonbp resonhp resonlp tf1sb tf2sb tf1s tf2snp tf2s allpassn1m allpassnkl allpassnns allpassnn allpassn nlf2 wgr tf2np allpassnnlt iir_nl allpassn1mt iir_lat1 allpassnklt iir_kl allpassnt iir_lat2 bvav2nuv av2sv crossn1 crossnn block tf21t tf22t tf22 tf21 tf2 tf1 conv convN fir sub iir rev2 allpass_comb ffbcombfilter fbcombfilter fb_fcomb fb_comb ffcombfilter ff_fcomb ff_comb latch notchw dcblocker dcblockerat smooth tau2pole integrator pole zero environment mem prefix int float rdtable rwtable select2 sele

Re: [Faudiostream-users] Guitarix Tube Emulation

2013-10-19 Thread Hermann Meyer
 
> And here's where the error occurs when running "make jackqt":

error: expected initializer before ‘__rt_data’compilation terminated due to
-Wfatal-errors.
> 
> Can anyone point me in a direction?  I can copy the relevant pieces of
Guitarix code if necessary, but it is the latest unmodified 28.2 Guitarix code.
> 
> 
> Thanks for any help you can provide!


Hi

You need to include the file trunk/src/LV2/DSP/gx_compiler.h
which define this macros.

greets
hermann



--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users