Re: [Faudiostream-users] Scanned Synthesis

2018-06-08 Thread Oleg Nesterov
On 06/07, Sébastien Clara wrote: > > Unfortunately, my code crashes during compilation and I do not know if my > mistake comes from: may be stack overflow due to infinite recursion, > x = ba.if(gate==1, > par(i, nbMass, ba.if(i==int(nbMass/2),1,ba.take(i+1,x'))), > par(i, nbMass, >

Re: [Faudiostream-users] How to access previous sample?

2018-06-22 Thread Oleg Nesterov
On 06/22, Viacheslav Lotsmanov wrote: > > Hello. > > I'm trying so sum current sample with previous one (multiplied by some > coefficients) f = _ <: _*current_sample_coef + mem*previous_sample_coef; or f = _ <: _,mem : *(current_sample_coef) + *(previous_sample_coef); or

Re: [Faudiostream-users] How to access previous sample?

2018-06-22 Thread Oleg Nesterov
On 06/22, Viacheslav Lotsmanov wrote: > > I think I realized it, I wrote it down like this now: > > f = *(current_sample_coef) : + ~(*(previous_sample_coef)); > > Looking at produced signal it seems to work. Did I get it correctly? This is another thing. Say, f = _ < _ + mem; sums the

[Faudiostream-users] runge-kutta 1-4 order implementation in faust

2017-10-19 Thread Oleg Nesterov
Hello, I implemented it yesterday "just for fun" (it took me the whole day!) and surprisingly the code doesn't look bad to me. It is very concise and easy to extend. Of course this is just a toy, but perhaps it can be useful to someone so I decided to share it. Usage: rk(order,

Re: [Faudiostream-users] Recurrence evaluation question

2017-10-23 Thread Oleg Nesterov
Hi Pierre, I can't answer authoritatively, I am writing this email only because faust developers didn't bother to reply, it seems they tend to ignore all the technical questions ;) > f(0,x) = x; > f(n,x) = alpha*f(n-1,x); > > where alpha is a complicated expression, long to evaluate. > > Now, if

Re: [Faudiostream-users] "ZDF" SVF in C++, could this be converted to FAUST?

2018-08-21 Thread Oleg Nesterov
On 07/19, Oliver Larkin via Faudiostream-users wrote: > > Based on the pseudo code in this paper: > > http://www.cytomic.com/files/dsp/SvfLinearTrapOptimised2.pdf > This pseudo code is very clear, so I think the faust implementation

[Faudiostream-users] mterm normalization bug, integer overflow

2018-08-24 Thread Oleg Nesterov
For example, this program process = no.noise <: *(mem); outputs zeroes due to integer overflow. process = no.noise <: *; the same. This one works correctly process = no.noise : ^(2);

Re: [Faudiostream-users] mterm normalization bug, integer overflow

2018-08-24 Thread Oleg Nesterov
On 08/24, Julius Smith wrote: > > I think this one may have been fixed. I cannot reproduce it in the > latest git master-dev branch: I am on master-dev too, > faust -v > FAUST : DSP to C, C++, Java, JavaScript, old C++, asm.js, WebAssembly > (wast/wasm) compiler, Version 2.8.1 FAUST : DSP to

Re: [Faudiostream-users] "ZDF" SVF in C++, could this be converted to FAUST?

2018-08-22 Thread Oleg Nesterov
On 08/22, Julius Smith wrote: > > Hey, thanks for posting. I made a faust2octave test program > (attached). Everything looks good to me, assuming I guessed all the > names right. Great, thanks. do you think it can live in filters.lib? If yes, then I think "svf = environment" makes sense, so

Re: [Faudiostream-users] "ZDF" SVF in C++, could this be converted to FAUST?

2018-08-23 Thread Oleg Nesterov
Hi Julius, On 08/23, Julius Smith wrote: > > Ok, sounds like they should be compared to the normalized ladder > filter. In Faust / filters.lib, the second order case is called tf2sn > ("transfer function, order 2, s-plane, normalized). I tend to use > tf2snp which adds "p" for "protected". The

Re: [Faudiostream-users] mterm normalization bug, integer overflow

2018-09-09 Thread Oleg Nesterov
Hi Yann, On 09/08, Yann Orlarey wrote: > > Hi, > > In principle, the problem should be solved in version 2.8.6. We have now a > pass of explicit casting before any optimization. and before simplify() ... FYI, the commit 95666e5028134f1d28aaf5976d26e386efeeba28 ("Fix optimisation bug by adding

Re: [Faudiostream-users] Implementing high order FIRs

2018-03-28 Thread Oleg Nesterov
On 03/28, Stéphane Letz wrote: > > > Speaking of internal usage of min/max... checkDelayInterval() blindly > > converts double to int, this looks dangerous and wrong. Honestly I do > > not even know what int(HUGE_VAL+0.5) should return, but apparently the > > result is negative because this code >

Re: [Faudiostream-users] Implementing high order FIRs

2018-03-27 Thread Oleg Nesterov
On 03/27, Oleg Nesterov wrote: > > Finally. > > process = ffunction(float ANYTHINGBEFOREminANYTHINGAFTER(), "",""); > > compiles to > > output0[i] = FAUSTFLOAT(float(min())); > > doesn't look exactly right ;) forgot to mention... this

Re: [Faudiostream-users] Implementing high order FIRs

2018-03-26 Thread Oleg Nesterov
On 03/24, Yann Orlarey wrote: > > Hi, > > The problem has been fixed in version 2.5.26. The compiler now reports > an error instead of an exception. and the fix is much better than I tried to suggest, thanks. OK, let me report another minor/trivial problem. Again, I'm not sure I understand this

[Faudiostream-users] question about the currying

2018-03-29 Thread Oleg Nesterov
I thought that op = _,_; should be equivalent to op(x1,x2) = x1,x2; and since inputs(op) == 2 all these definitions process = op; process = op(_); process = op(_,_); process = op(_)(_); should be equivalent and result in output0[i] =

Re: [Faudiostream-users] Implementing high order FIRs

2018-03-22 Thread Oleg Nesterov
On 03/21, Oleg Nesterov wrote: > > I don't really understand this code, but it seems that the isNumericalTuple() > simplification in realeval() is not right. At least the "patch" below seems > to fix a problem. Yes, I think this is true... So unless you are going to change

Re: [Faudiostream-users] Implementing high order FIRs

2018-03-21 Thread Oleg Nesterov
Speaking of ba.take(), can't we add take ((ns, nns), xs) = take(ns,xs), take(nns, xs); into libraries/basics.lib? see the patch below. This way you can do, say, take((1,3), (1,2,3)); or reverse(list) = take((par(i, ba.count(list), ba.count(list)-i)), list); And it is

Re: [Faudiostream-users] Implementing high order FIRs

2018-03-21 Thread Oleg Nesterov
On 03/21, Oleg Nesterov wrote: > > Ah, no, sorry, this is faustassert(lsig.size()==2) in realPropagate(), > >339 else if (isBoxPrim2(box, )) { >340 // printf("prim2 recoit : "); print(lsig); printf("\n"); >341

Re: [Faudiostream-users] Implementing high order FIRs

2018-03-21 Thread Oleg Nesterov
On 03/21, Oleg Nesterov wrote: > > On 03/21, Oleg Nesterov wrote: > > > > And it is a bit funny that (without the patch) this code > > > > process = ba.take((1,1), (1,1)); > > > > crashes faust: > > > > ... > > faust[0x49

Re: [Faudiostream-users] Implementing high order FIRs

2018-03-23 Thread Oleg Nesterov
On 03/22, CrocoDuck o'Ducks wrote: > > Sorry, I have been sidetracked a bit. See below 2 minimal examples. > firLongTime.dsp takes around 5 minutes to compile, while firShortTime.dsp > takes only a bunch of seconds. I see the difference too. With the "patch" below both versions take the same time

Re: [Faudiostream-users] Implementing high order FIRs

2018-03-21 Thread Oleg Nesterov
On 03/21, Yann Orlarey wrote: > > Interestingly: > > process = 0,0,0 : +; > > crashes, while: > > process = _,0,0 : +; > > correctly reports a sequential composition error. I don't really understand this code, but it seems that the isNumericalTuple() simplification in realeval() is not right. At

[Faudiostream-users] fpp: faust pre/post processor

2018-10-10 Thread Oleg Nesterov
See the attached file. Save it anywhere, make it executable, that is all. I had to make some last minute changes, hopefully this didn't break the code which I didn't touch almost a year... NOTE! I do not want to use any module/library, so it doesn't use File::Temp and simply assumes that the

[Faudiostream-users] kSamp delays: sharing annotation is wrong

2018-10-07 Thread Oleg Nesterov
test-case: // arbitrary kSamp signal delay = ba.time : max(0) : min(10); process = @(delay) <: _,_; result: iRec0[0] = ...; output0[i] = FAUSTFLOAT(fVec0[std::min(10, std::max(0, (iRec0[0] + -1)))]); output1[i] = FAUSTFLOAT(fVec0[std::min(10,

Re: [Faudiostream-users] trouble resolving endless compiler loop

2019-02-27 Thread Oleg Nesterov
On 02/27, David Minnix wrote: > > That's the line that I thought might be the problem. Is there any way to > put those modulators in terms of each other? > > I would like to have the FM modulator architecture to be decided by the > user similar to fm8. Well, I have no idea what are you trying to

Re: [Faudiostream-users] trouble resolving endless compiler loop

2019-02-27 Thread Oleg Nesterov
On 02/26, David Minnix wrote: > > Hi all, > I'm trying to make a 4OP fm synth in faust. Something in my code is > triggering an endless loop. I'm pretty sure its the interdependence of the > operators but I can't see how to resolve it. > > Here is my code: It seems that these lines of your code

Re: [Faudiostream-users] Implementation of a lowpass based on bilinear integration

2019-03-12 Thread Oleg Nesterov
On 03/12, Dario Sanfilippo wrote: > > I'm trying to implement the filters from this book > https://www.discodsp.net/VAFilterDesign_2.1.0.pdf, which are great, but I'm > having some issues getting the right design in Faust. > > I'm trying to implement the diagram 3.31 from page 77. It is a 1p1z LP

Re: [Faudiostream-users] first value of signal defined with letrec{} ?

2019-02-17 Thread Oleg Nesterov
On 02/15, Julius Smith wrote: > > Along these lines, we could have a more efficient impulse as well. We > presently use this all over the place: > > process = 1-1'; > => > for (int i = 0; (i < count); i = (i + 1)) { > iVec0[0] = 1; > output0[i] = FAUSTFLOAT((1 - iVec0[1])); > iVec0[1] =

Re: [Faudiostream-users] first value of signal defined with letrec{} ?

2019-02-15 Thread Oleg Nesterov
On 02/01, Romain Michon wrote: > > We're working on a better solution, Yes, it would be nice to have the ability to initialize delay lines. And reset/re-initialize too, think of goertzel() from analyzers.lib. > initState((init)) = R(0,init) > with{ > R(n,(initn,init)) = +(initn :

[Faudiostream-users] letrec bug && how to name outputs

2019-02-15 Thread Oleg Nesterov
>From https://ccrma.stanford.edu/~jos/aspf/Naming_Output_Signals.html Suppose you have a block diagram bd that outputs two signals, and you would like to give them names. You cannot simply say ``x,y = bd'' as you would in matlab. Instead, use the signal blocking operator

Re: [Faudiostream-users] Different DSP structure when calling a function with prefix notation including a signal symbol ("_")

2019-01-25 Thread Oleg Nesterov
On 01/25, Dario Sanfilippo wrote: > > Hello. > > I see that a function results in a different diagram when called with > prefix having the generic signal symbol. > > For example, let's consider the following function: > > test(x, y) = (x , _ : -) ~ *(y); > > What I thought is that this would

Re: [Faudiostream-users] Routing signals to output

2019-02-01 Thread Oleg Nesterov
On 02/01, Dario Sanfilippo wrote: > > I have a network with several modules and nested feedback loops. I need to > inspect some of the signals which are not part of the main output to make > sure that their behaviour is correct. Well, if you compile .dsp to c/c++ perhaps you can try fpp, at least

Re: [Faudiostream-users] My libraries up on Github

2019-06-03 Thread Oleg Nesterov
On 05/30, Dario Sanfilippo wrote: > > I was meaning to also implement the ZDF 4-pole ladder. Will Pirkle resolved > it into this diagram: > http://www.willpirkle.com/Downloads/AN-4VirtualAnalogFilters.2.0.pdf. I can't read the diagrams, but the code looks simple... the faust implementation is

Re: [Faudiostream-users] My libraries up on Github

2019-06-03 Thread Oleg Nesterov
Hi Dario ;) On 06/03, Dario Sanfilippo wrote: > > with { > > k = 1/2*q; I used k = 4 * (Q - 0.5) / (25 - 0.5); but only because the c++ code does this. this is minor... > u = (in-((s1*(G^3/(1+g))+s2*(G^2/(1+g))+s3*(G/(1+g))+s4 > >

Re: [Faudiostream-users] My libraries up on Github

2019-05-30 Thread Oleg Nesterov
On 05/29, Dario Sanfilippo wrote: > > Dear list, > > it's only been a couple of months into working with Faust but I've written > some stuff and they are now available on Github: > https://github.com/dariosanfilippo/faust. interesting... Thanks for sharing! So far I quickly glanced at

Re: [Faudiostream-users] My libraries up on Github

2019-05-30 Thread Oleg Nesterov
On 05/30, Dario Sanfilippo wrote: > > > And. It seems that the implementation above is "equal" to > > > > lpbi(cf) = fi.tf2s(0,0,1, 1/.707, 1, 2*ma.PI/ma.SR * cf); > > > > ? > > > > or simply > > > > lpbi(cf) = resonlp(cf, .707, 1); > > > > no ? > > > > I must be doing something

Re: [Faudiostream-users] Hilbert filter

2019-06-17 Thread Oleg Nesterov
On 06/15, Dario Sanfilippo wrote: > > I may have missed it but I couldn't find a Hilbert filter in the libraries. > Has any of you implemented one that works well for frequency shifting? perhaps you can try // http://yehar.com/blog/?p=368 hilbert = _ <: H(a1)', H(a2) with {

Re: [Faudiostream-users] Hilbert filter

2019-06-22 Thread Oleg Nesterov
Hi Julius, sorry for late reply, I was busy and didn't read emails from this list. On 06/17, Julius Smith wrote: > > Hi Oleg, > > I just now added a hilbert filter to filters.lib, and (probably what > you really want) ssbf Me? ;) Heh. I know almost nothing about digital filters, to the point I

Re: [Faudiostream-users] Arguably the best recursive quadrature oscillator around

2019-06-23 Thread Oleg Nesterov
On 06/15, Dario Sanfilippo wrote: > > quad_osc(f) = tick ~ (_ , _) > with { > init = 1-1'; > w = 2*ma.PI*f/ma.SR; > k1 = tan(.5*w); > k2 = 2*k1/(1+k1*k1); > tick(u, v) = omega-k1*(v+k2*omega) , v+k2*omega > with { > omega = (u+init)-k1*v; > }; > }; another case when we need to

Re: [Faudiostream-users] Hilbert filter

2019-06-23 Thread Oleg Nesterov
On 06/23, Oleg Nesterov wrote: > > Of course. But as for fi.hilbert, I simply can't imagine any practical > usage of it... Cough... and I just noticed it can't be compiled ;) hilbert = pospass : !,_; won't work, you need hilbert(N) = pospass(N) : !

Re: [Faudiostream-users] Hilbert filter

2019-06-23 Thread Oleg Nesterov
On 06/22, Julius Smith wrote: > > Maybe clearer now? See latest filter.lib. Thanks, the new doc matches my understanding ;) > I presently vote against a scaling by 2, but I am open to arguments. > Right now, pospass simply passes only positive frequencies, and > hilbert is the imaginary part of

Re: [Faudiostream-users] Hilbert filter

2019-07-05 Thread Oleg Nesterov
On 07/05, Dario Sanfilippo wrote: > > Hello, everybody. > > Here's yet another design to obtain analytic signals, taken from Olli's > post: > https://dsp.stackexchange.com/questions/37411/iir-hilbert-transformer/59157#59157 > . > > analytic(x) = real, > > imaginary > > with { > >

Re: [Faudiostream-users] Hilbert filter

2019-07-05 Thread Oleg Nesterov
On 07/05, Dario Sanfilippo wrote: > > https://dsp.stackexchange.com/questions/37411/iir-hilbert-transformer/59157#59157 Heh. Funny that. I too played with hiir library a long ago. I even found the code I wrote hiir_hilber(N, T) = hilbert with { coef = FPP(=N, =T) eval {

Re: [Faudiostream-users] Hilbert filter

2019-07-05 Thread Oleg Nesterov
On 07/05, Julius Smith wrote: > > I like to look at the dB magnitude and phase (in degrees) of the > frequency response. So feed 1-1' to analytic instead of a sinusoid. > The ideal response is 0 dB for the magnitude at all frequencies, and > 90 or -90 degrees for the phase, depending on whether

Re: [Faudiostream-users] Hilbert filter

2019-07-06 Thread Oleg Nesterov
On 07/05, Julius Smith wrote: > > Do we know its copyright status? I think it would > be worth adding to the library if we can determine this and author. I found it here: http://yehar.com/blog/?p=368 But see also the hiir library http://ldesoras.free.fr/src/hiir-1.20.zip from Laurent de Soras

Re: [Faudiostream-users] 4fb8849b833629 ("Fixup quadosc") looks wrong

2020-04-17 Thread Oleg Nesterov
Hi Bart, it seems that you are not convinced, let me try again. On 04/16, Oleg Nesterov wrote: > > On 04/16, Bart Brouns wrote: > > > > Somehow the initial value of `u` got lost in the last commit to this > > function: > > https://github.com/gr

[Faudiostream-users] 4fb8849b833629 ("Fixup quadosc") looks wrong

2020-04-16 Thread Oleg Nesterov
Bart, could you explain the commit 4fb8849b833629 ("Fixup quadosc") ? It looks absolutely wrong. - It removes the 1st output (cosine), why ?? - It makes the 2nd output less precise - It makes the generated C++ code worse. Oleg.

Re: [Faudiostream-users] 4fb8849b833629 ("Fixup quadosc") looks wrong

2020-04-16 Thread Oleg Nesterov
Hi Bart, I am not sure I understand you, but I'll try to answer anyway ;) Please correct me. On 04/16, Bart Brouns wrote: > > Somehow the initial value of `u` got lost in the last commit to this > function: >

Re: [Faudiostream-users] Help with pattern matching to implement an if-then-else-if function

2020-05-20 Thread Oleg Nesterov
On 05/20, Dario Sanfilippo wrote: > > Was there already something like that not that I'm aware of, > or was there a simpler way of doing > it? Sorry, I don't understand... doing what?? why do you want this helper? Oleg. ___ Faudiostream-users

Re: [Faudiostream-users] Help with pattern matching to implement an if-then-else-if function

2020-05-20 Thread Oleg Nesterov
On 05/20, Dario Sanfilippo wrote: > > a_f(f) = ifthenelseif(( f < 25, .532, > f < 31.5, .506, > f < 40, .480, > f < 50, .455, > f < 63, .432, > f < 80, .409, > f < 100, .387, > f < 125, .367, > f < 160, .349, > f < 200, .330, > f < 250, .315, > f < 315, .301, > f < 400, .288, > f < 500, .286, > f

Re: [Faudiostream-users] Help with pattern matching to implement an if-then-else-if function

2020-05-22 Thread Oleg Nesterov
On 05/22, Dario Sanfilippo wrote: > > > As for ifN. Perhaps something like this can work for you: > > > > ifN(N, inp) = par(n, N, line(n,C)) with { > > C = (outputs(inp) - N) / (N + 1); > > take(i) = inp : route(outputs(inp),1,i+1,1); > >

Re: [Faudiostream-users] Help with pattern matching to implement an if-then-else-if function

2020-05-23 Thread Oleg Nesterov
Dario, I'm afraid I can't help. Firstly, I do not really understand your questions. But even if I understood, I am not sure I could answer authoritatively. On 05/22, Dario Sanfilippo wrote: > > On Fri, 22 May 2020 at 20:22, Oleg Nesterov wrote: > > > On 05/22, Dario S

Re: [Faudiostream-users] crossfeedback

2020-05-22 Thread Oleg Nesterov
On 05/21, Sam Pluta wrote: > > I made this crossfeedback synth in Faust: > > import("stdfaust.lib"); > > process(carFreq, modFreq, modModMult, indexMult) = note that the code below doesn't use any of theese inputs. It seems to me you actually want process = ...same code...; Just in

Re: [Faudiostream-users] svf vs tf2snp when modulated

2020-09-01 Thread Oleg Nesterov
On 08/31, Julius Smith wrote: > > That's an interesting comparison. > tf2snp is designed to have constant signal power in the presence of > coefficient modulation. If only I knew what does it mean ;) > How is the svf implementation designed? Constant amplitude? No. Please see

[Faudiostream-users] svf vs tf2snp when modulated

2020-08-31 Thread Oleg Nesterov
Stephane, I wrote this email right after our short discussion on slack.com but somehow I forgot to send it. So I don't really know how to compare this filter with the existing filters forms in filters.lib, but please see the simple, stupid and "non-scientific" test below. Note! all 3 band-pass

Re: [Faudiostream-users] Using a signal to trigger an envelope

2020-10-02 Thread Oleg Nesterov
On 10/02, i...@formuls.co.uk wrote: > > Hello Faust List, > > I’m trying to use a signal to trigger an envelope, in particular Faust's > dx7envelope. However, I keep encountering an error that states the number of > inputs does not match the number of outputs. I’m trying the following code: > >

Re: [Faudiostream-users] demand-rate in faust?

2020-08-25 Thread Oleg Nesterov
Hi Yann, sorry I couldn't reply earlier, On 08/21, Yann Orlarey wrote: > > Hi Oleg, > > Thank you for your example. It is very interesting because it shows that it > is now possible to write pathological Faust programs that cannot be > executed (without infinite memory)! Heh. Thanks, I didn't

Re: [Faudiostream-users] demand-rate in faust?

2020-08-21 Thread Oleg Nesterov
Hi Yann, On 08/21, Yann Orlarey wrote: > > A *very* experimental implementation of the ondemand primitive is available > here : > > https://github.com/grame-cncm/faust/tree/experimental-ondemand > > The implementation is currently only available for -lang ocpp in scalar > mode. Here are some

Re: [Faudiostream-users] Pattern matching and lists in Faust

2020-05-26 Thread Oleg Nesterov
On 05/26, Oleg Nesterov wrote: > > Yann, Stephane, I am curious if it is possible to change the compiler to > make par(i, 0, expr) work? the patch below seems to work ;) but I am sure you can do something better. Oleg. --- a/compiler/evaluate/eval.cpp +++ b/compiler/evaluate/eval.cpp

Re: [Faudiostream-users] Pattern matching and lists in Faust

2020-05-26 Thread Oleg Nesterov
On 05/25, Yann Orlarey wrote: > > For example the expression > `()` or `NIL` in Lisp, which indicates an empty list, does not exist in > Faust. Yes. it's a pity ;) Well, to some degree nil = 0:!; resembles the empty list. Say, output(nil) == 0 and process = sin(nil); works

Re: [Faudiostream-users] Help with pattern matching to implement an if-then-else-if function

2020-05-22 Thread Oleg Nesterov
On 05/22, Dario Sanfilippo wrote: > > > But this doesn't really matter. What (I think) does matter is that, say, > > 1,2 should match (x,xs), no matter how many parentheses you add. > > > > What is the reason why this is not happening? confused... this _is_ happening, iiuc. And again,

Re: [Faudiostream-users] crossfeedback

2020-05-22 Thread Oleg Nesterov
Dario, sorry for noise but I simply can't resist... On 05/22, Dario Sanfilippo wrote: > > process(carFreq, modFreq, modModMult, indexMult) = ( > ( > ( > (_, hslider("modModMult",100,100,1000,1):*), > hslider("modFreq",100,100,1000,1):+ > ):os.osc, hslider("carModMult",100,100,1000,1):* > ) > ,

Re: [Faudiostream-users] Help with pattern matching to implement an if-then-else-if function

2020-05-22 Thread Oleg Nesterov
On 05/22, Dario Sanfilippo wrote: > > Sorry for the confusion. What I wanted to ask is: why aren't the extra > parentheses making a difference? Because (0, (1,2,3)) is parsed as > ((0),((1,2,3)), right? Sorry, can't understand... but in any case, I think that extra parentheses should _only_ make

Re: [Faudiostream-users] Help with pattern matching to implement an if-then-else-if function

2020-05-22 Thread Oleg Nesterov
argh, forgot to comment this part of your email... On 05/22, Dario Sanfilippo wrote: > > On Fri, 22 May 2020 at 08:20, Oleg Nesterov wrote: > > > See above. try > > > > process(3, (_<-100,-1,-1,-1, _==0,0,0,0, _>100,1,1,1, 10,10,10)); > > >

Re: [Faudiostream-users] Help with pattern matching to implement an if-then-else-if function

2020-05-21 Thread Oleg Nesterov
On 05/20, Dario Sanfilippo wrote: > > I use the "ceil" function for the cond in "if" as I want _any_ non-zero > value to result true, whereas ba.if gives false for any fractional > condition < 1. I opened an issue about this but I think that fixing it, if > bad behaviour (bad if thinking of C/C++,

Re: [Faudiostream-users] Help with pattern matching to implement an if-then-else-if function

2020-05-20 Thread Oleg Nesterov
On 05/19, Dario Sanfilippo wrote: > > Hello, list. I hope that you're all well. > > I just started using pattern matching and I'd kindly ask for your help to > better understand how things work. > > The goal is to implement an *ifthenelseif* function that takes cond-then > pairs as arguments

Re: [Faudiostream-users] function dimensionality

2020-07-14 Thread Oleg Nesterov
On 07/14, Till Bovermann wrote: > Dear list, > > I am confused about this. > I have the following function taking a list of arguments (note the inner > brackets; > > ((( input args as list: > reason being that this function will later be encapsulated into a recursion > operator that applies the

Re: [Faudiostream-users] demand-rate in faust?

2020-07-14 Thread Oleg Nesterov
On 07/14, James Mckernon wrote: > > I have some more thoughts on this that are perhaps worth discussing in > a separate thread. Briefly, I feel like a 'dumb' select2, which only > ever evaluates one of its branches, You probably want the "control" primitive. Currently it is only supported by

Re: [Faudiostream-users] demand-rate in faust?

2020-07-14 Thread Oleg Nesterov
On 07/14, Till Bovermann wrote: > > Thanks also to you, Oleg; is there somewhere an example for the control > primitive, Sorry, I do not know. But see below. However, I did "git pull" and it seems that "control/enable" are already supported in FIR scalar mode. Probably the commit

Re: [Faudiostream-users] towards 1-bit DSD dsp in faust — state in a foreign function?

2020-06-04 Thread Oleg Nesterov
On 06/04, Till Bovermann wrote: > > I discovered the `ffunction` primitive that allows to integrate foreign > functions > into the language, however, AFAICS (and according to sletz on slack, and from > what > I got from the documentation at [3]), they need to be stateless. > > the aforementioned

Re: [Faudiostream-users] towards 1-bit DSD dsp in faust — state in a foreign function?

2020-06-04 Thread Oleg Nesterov
On 06/04, James Mckernon wrote: > > I can't tell whether this would be useful to your case, but could you > declare a static variable, c-side, within your foreign function? This > allows some kind of state to be held between calls to that function. Heh ;) OK, suppose we have

Re: [Faudiostream-users] FAUSTPy

2020-06-14 Thread Oleg Nesterov
On 06/13, vince via Faudiostream-users wrote: > > if I try the test_examples.py, it just terminates the process without any > errors and nothing happens. I'd suggest you to contact the author ;) the patch below seems to make $ PYTHONPATH=. python3 FAUSTPy work on my laptop, but the the

Re: [Faudiostream-users] demand-rate in faust?

2020-07-16 Thread Oleg Nesterov
Add Stephane and Yann. At least the 2nd problem is obviously a (minor) compiler bug. On 07/16, Till Bovermann wrote: > > Dear Oleg, James, Dario, all, > > > `control` looks promising, however, it is not as straight-forward as I > thought: Yes. And I think it is still experimental, at least I

Re: [Faudiostream-users] arbitrary channels to recursive definition?

2020-07-17 Thread Oleg Nesterov
Hi Yann, On 07/17, Yann Orlarey wrote: > > Hi Till, > > What about : but is there a generic solution? IOW. Suppose you have a wants_list() function and a constant N. How can you turn N inputs into the N-ary list and pass it to wants_a_list ? wants_list(sig.bus(N)) won't work. Oleg.

Re: [Faudiostream-users] arbitrary channels to recursive definition?

2020-07-18 Thread Oleg Nesterov
Hi Yann, On 07/17, Yann Orlarey wrote: > > I'm not sure that answers your question, No it doesn't ;) probably I wasn't clear, please see below. > but you can do that, for instance: of course, you can always rewrite dsBus2int or anything else, but what if you do not want to change the

Re: [Faudiostream-users] arbitrary channels to recursive definition?

2020-07-16 Thread Oleg Nesterov
On 07/16, Till Bovermann wrote: > > import("stdfaust.lib"); > dsBus2int_6 = si.bus(6) : \(x0, x1, x2, x3, x4, x5).(left_shift((x0, x1, x2, > x3, x4, x5))) with { > left_shift((x, xs)) = left_shift(xs) & ((x > 0) << 1) ; > left_shift(x) = x > 0; > }; not that it matters, but si.bus(6)

Re: [Faudiostream-users] arbitrary channels to recursive definition?

2020-07-19 Thread Oleg Nesterov
On 07/18, Yann Orlarey wrote: > > Hi Oleg, > > Here is an implementation of apply. It's the closest I've found ;-). The > idea is to pass to the op function a list of selectors that simulate the > formal parameters but that can be created in arbitrary numbers. (Heh ;) I tried to do something

Re: [Faudiostream-users] noise from fi.highpass

2020-12-18 Thread Oleg Nesterov
Hi Dario, this motivated me to look at your library again ;) On 12/18, Alik Rustamoff wrote: > > Hi, Dario, I, btw, ended up using blti filter from your edge of chaos > library. Good collection. No noises just does the job. Then I think that fi.svf.hp() should work equally well. Can you try it?

Re: [Faudiostream-users] noise from fi.highpass

2020-12-19 Thread Oleg Nesterov
On 12/19, Alik Rustamoff wrote: > > Today I tested all three. With last two svf filters I don't see any > difference (I use ardour's built in plugin analyser), no noise. > The noisy fi.highpass (the first one) becomes closer to them as cutoff > freq goes higher, but still has different phase

Re: [Faudiostream-users] noise from fi.highpass

2020-12-19 Thread Oleg Nesterov
On 12/19, Dario Sanfilippo wrote: > > > And this probably means that Dario was right, and the problem was caused > > by quantisation. > > > > Because IIUC in theory (and unless you modulate HPFfreq) these 3 filters > > > > fi.highpass(2, f) > > fi.svf.hp(f, 1/sqrt(2)) > >

Re: [Faudiostream-users] noise from fi.highpass

2020-12-19 Thread Oleg Nesterov
On 12/19, Dario Sanfilippo wrote: > > I was following this text: > http://www.willpirkle.com/Downloads/AN-4VirtualAnalogFilters.pdf. Thanks! I will read it later... may be ;) > Julius, would you have a function to calculate the coefficients for > fi.tf2snp? Julius will correct me, but I think

Re: [Faudiostream-users] noise from fi.highpass

2020-12-20 Thread Oleg Nesterov
On 12/19, Julius Smith wrote: > > All we can conclude from this test is that tf2s and svf are closer to each > other than either is to tf2snp. Julius, I can't believe it but it seems that tf2snp is just wrong when cf is low ;) test1: F = 20; w1 = 2*ma.PI*F; a1s =

Re: [Faudiostream-users] noise from fi.highpass

2020-12-20 Thread Oleg Nesterov
On 12/20, Oleg Nesterov wrote: > > On 12/19, Julius Smith wrote: > > > > All we can conclude from this test is that tf2s and svf are closer to each > > other than either is to tf2snp. > > Julius, I can't believe it but it seems that tf2snp is just wrong > when cf

Re: [Faudiostream-users] noise from fi.highpass

2020-12-22 Thread Oleg Nesterov
Julius, et al, sorry for delay, I was busy. And let me apologize in advance, most probably I won't be responsive till next week. On 12/20, Julius Smith wrote: > > In filters.lib, I just now changed (in faustlibraries / master) > smax = 0.; > to > smax = 1.0-ma.EPSILON; OK, I ran the

Re: [Faudiostream-users] noise from fi.highpass

2020-12-20 Thread Oleg Nesterov
On 12/20, Dario Sanfilippo wrote: > > > --- a/filters.lib > > +++ b/filters.lib > > @@ -1004,7 +1004,7 @@ declare tf2np copyright "Copyright (C) 2003-2019 by > > Julius O. Smith III > declare tf2np license "MIT-style STK-4.3 license"; > > tf2np(b0,b1,b2,a1,a2) = allpassnnlt(M,sv) :

Re: [Faudiostream-users] Making a sampler with rwtable

2020-11-13 Thread Oleg Nesterov
On 11/13, Karl Schultheisz via Faudiostream-users wrote: > > process = os.osc(55) : rwtable(1024, 0.1, 42, _, 42); > > The result, as demonstrated using faustide, is that the hypothesis is wrong. > The output signal is a constant 0.1, not a 55Hz sinusoid. I think this is a bug. faust wrongly

Re: [Faudiostream-users] Making a sampler with rwtable

2020-11-13 Thread Oleg Nesterov
On 11/13, Oleg Nesterov wrote: > > I think this is a bug. faust wrongly assumes that if ridx is constant then > the output is constant too. > > Perhaps this is because > > Tree sigWriteReadTable(Tree n, Tree init, Tree widx, Tree wsig, Tree > ridx) > {

Re: [Faudiostream-users] Making a sampler with rwtable

2020-11-13 Thread Oleg Nesterov
On 11/13, Karl Schultheisz wrote: > > Nevertheless, I also encounter difficulties when using variable indices. > Consider the case of using gate signals to control recording and playback. > This example alternately records and then plays back repeatedly. I am already sleeping, perhaps I

Re: [Faudiostream-users] shuffle algorithm for faust lists?

2020-11-13 Thread Oleg Nesterov
On 11/13, Oleg Nesterov wrote: > > Not sure if this is a bug or not, add Stephane and Yann. > > On 11/13, Till Bovermann wrote: > > > > // drop the first i elements > > left_drop(0, (x, xs)) = x, xs; > > left_drop(i, (x, xs)) = left_drop(i-1, xs); > >

Re: [Faudiostream-users] shuffle algorithm for faust lists?

2020-11-13 Thread Oleg Nesterov
Not sure if this is a bug or not, add Stephane and Yann. On 11/13, Till Bovermann wrote: > > // drop the first i elements > left_drop(0, (x, xs)) = x, xs; > left_drop(i, (x, xs)) = left_drop(i-1, xs); > > // reverse a list > reverse((x, xs)) = reverse(xs), x; > reverse(x) = x; > > process =

Re: [Faudiostream-users] ba.parallelOp() needs a fix

2020-10-30 Thread Oleg Nesterov
On 10/30, Bart Brouns wrote: > > As for the naming, reduce is already taken: > https://github.com/grame-cncm/faustlibraries/blob/2efc2d01cb6be4e7eb2ae54fe3f3591782786ed0/reducemaps.lib#L74 > > Not sure what a better name would be. may be lreduce? matches maxima's left-to-right lreduce... But

Re: [Faudiostream-users] Fix ADSR envelope:

2021-05-11 Thread Oleg Nesterov
Hi, I noticed by accident your discussion in https://github.com/grame-cncm/faustlibraries/pull/80 === From @orlarey: Your ADSR uses a variable slope for the release. This induces a different behavior when the gate is shorter than the AD part. That can

Re: [Faudiostream-users] multimode and svf filters

2021-05-29 Thread Oleg Nesterov
On 05/28, Till Bovermann wrote: > > I was thinking to use the fi.svf.lp filter as a building block instead > but it is (AFAICS, it is not mentioned in the doc string...) not a 1st > order design (which is crucial here, partly for consistency with the to > be emulated analog circuitry, partly

Re: [Faudiostream-users] Inputs as arguments

2021-05-01 Thread Oleg Nesterov
Hi Dario, I can't answer authoritatively, but nobody else bothered to reply and I hate the fact this list has a lot of unanswered technical questions. Add Stephane. On 04/25, Dario Sanfilippo wrote: > > Hello, list. > > I may be missing something obvious but would you know why > > process(x) =

Re: [Faudiostream-users] When do int or float numerical entries make a difference?

2021-02-07 Thread Oleg Nesterov
On 02/07, Dario Sanfilippo wrote: > > Other than that, can you tell why -2 or 2 is producing -inf? Runtime integer overflow, I guess. Why didn't you try to simplify your code ? ;) Consider process = 2.0', 2' : par( i, 2, ^(32)); output: 0 0

Re: [Faudiostream-users] When do int or float numerical entries make a difference?

2021-02-08 Thread Oleg Nesterov
On 02/08, Stéphane Letz wrote: > > The ‘pow' operation computed on integer arguments was indeed incorrect at > compile time. Should be fixed in 2.30.12 version on master-dev. commit bb0bf13334e9a1320f0f90b6ae56da277b9d96a5 adds +Type1 ipow(Type1 a, Type2 ex) +{ +if (0 == ex)

Re: [Faudiostream-users] added fractional-index rdtable and rwtable

2021-04-07 Thread Oleg Nesterov
On 04/07, Oleg Nesterov wrote: > > Note also you can use si.dot() instead to simplify the implementation: > > lagrangeN(N, idx) = lagrange_h(N, idx), si.bus(N+1) : si.dot(N+1); Hmm. I actually meant lagrangeN(N, idx) = si.dot(N+1, lagrange_h(N, idx)); which looks

Re: [Faudiostream-users] added fractional-index rdtable and rwtable

2021-04-07 Thread Oleg Nesterov
Hi Dario, Your commit 85201e341bd4e adds lagrangeN() which uses si.bus(), this means you need to add si = library("signals.lib"); into interpolators.lib, otherwise it.lagrangeN(...) won't compile. Note also you can use si.dot() instead to simplify the implementation:

Re: [Faudiostream-users] Faust in Python

2021-11-26 Thread Oleg Nesterov
On 11/26, Stéphane Letz wrote: > > This is a updated version of FAUSTPY, see > https://faustdoc.grame.fr/manual/architectures/#faustpy, > possibly working ? Ah, this one... I tried it once just out of curiosity several years ago, and I had to apply the patch below to make it work. I have no

Re: [Faudiostream-users] Problem about FAUSTPy

2021-11-25 Thread Oleg Nesterov
On 11/26, 佐藤佳希 wrote: > > I would like to use FAUSTPy, but I could not pass "python3 setup.py test". > So, I am wondering if you give me some advice. I can't find FAUSTPy in faust sources, > Also, I attached the errors as error.txt. You didn't ;) Oleg.

Re: [Faudiostream-users] Int signals compiling with -double

2023-10-29 Thread Oleg Nesterov
Dario, I don't understand you, so let me ask... On 10/30, Dario Sanfilippo wrote: > > Perhaps we can include that "^" (pow()) can also be both int or float > depending on the operands. but it already depends on the type of operands ? > perhaps to do everything in > double when using -double,

  1   2   >