> On Feb 28, 2018, at 1:39 PM, Julius Smith <j...@ccrma.stanford.edu> wrote: > > Hi Mykle, > > I tried your example with Faust Version 2.5.15 (command line) on a > Mac, and it works as expected (faust2caqt used). Nothing strange to > point to here.
Hi Julius, Thanks very much for testing that. I wish I could say the same. I just built the same code with faust2caqt + faust 2.5.21, compiled from source on my machine (OS 10.11, Apple LLVM version 7.3.0 (clang-703.0.31)) … and the behavior I see is weird. By “weird” i should be specific. I’m expecting that setting the hslider value to 0 will set the selected val to 0, 1 to 1, 2 to 2, et cetera. What it’s doing instead is this: vals: selector: selected val: 0 0 0 1 1 1 2 2 1 3 3 3 4 4 3 5 5 5 6 6 5 7 7 7 I thought this might be a bug with the version of LLVM on my machine … but I just built the same code with the Faust Online Compiler at https://faust.grame.fr/onlinecompiler (C++/OSX/coreaudit-qt-deployed) and got the same results. I also downloaded the pre-built FaustLive version 2.46, (I couldn’t get macports to install newer than version 2.5.17) . When I run this code there, it’s also wrong, but differently wrong: the selected value is always zero, no matter the slider position. And then I put the same code into the online editor at https://faust.grame.fr/editor/, and ran it there. And that gives a third incorrect behavior: all of the val bargraphs equal zero. (selectn() may be working properly in this case, but how can the values not be there?) Maybe one of these behaviors is correct & I just don’t understand the intricacies … but they can’t all be right, can they? Yrs befuddledly, -mykle- > > - Julius > > On Wed, Feb 28, 2018 at 10:07 AM, Mykle Hansen <my...@mykle.com> wrote: >> Hi, >> >> I’m looking closer at this strange behavior of ba.selectn(). >> I’d really like to know if this is expected behavior, >> because it looks like a bug to me. (I’m seeing this in >> FaustLive version 2.5.17, as installed by MacPorts.) >> >> Basically, if I have N inputs to selectn(), and I use a >> hslider with N possible values to select one of those inputs, >> the chosen input is not selected. What happens instead >> is hard to characterize. This code demonstrates the problem: >> >> >> import("stdfaust.lib"); >> N=8; >> process = par(i, N, (i : hbargraph("[%2i]val %i", 0, N))) >> : ba.selectn(N, hslider("selector", 0, 0, N-1, 1) ) >> : hbargraph("selected val", 0, N) >> ; >> >> >> Interestingly, if I use a hslider with N+1 possible values, >> everything seems to work as I’d expect. So that’s a workaround, >> although it requires the slider to have one meaningless value. >> >> Can anyone else confirm this? Is this expected behavior? >> Or maybe I’m running a bad version of FaustLive? Or I’m >> missing some other obvious thing? >> >> Much thanks, >> -mykle- >> >> >>> On Feb 27, 2018, at 4:36 AM, >>> faudiostream-users-requ...@lists.sourceforge.net wrote: >>> >>> Send Faudiostream-users mailing list submissions to >>> faudiostream-users@lists.sourceforge.net >>> >>> To subscribe or unsubscribe via the World Wide Web, visit >>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users >>> or, via email, send a message with subject or body 'help' to >>> faudiostream-users-requ...@lists.sourceforge.net >>> >>> You can reach the person managing the list at >>> faudiostream-users-ow...@lists.sourceforge.net >>> >>> When replying, please edit your Subject line so it is more specific >>> than "Re: Contents of Faudiostream-users digest..." >>> Today's Topics: >>> >>> 1. Re: compiler hangs on this program? (Mykle Hansen) >>> 2. Re: FAUST Compiler for GPGPU? (l...@grame.fr) >>> >>> From: Mykle Hansen <my...@mykle.com> >>> Subject: Re: [Faudiostream-users] compiler hangs on this program? >>> Date: February 26, 2018 at 3:59:32 PM PST >>> To: Julius Smith <j...@ccrma.stanford.edu> >>> Cc: Oleg Nesterov <o...@redhat.com>, faudiostream-users >>> <faudiostream-users@lists.sourceforge.net> >>> >>> >>>> On Feb 23, 2018, at 12:17 PM, Julius Smith <j...@ccrma.stanford.edu> wrote: >>>> >>>> Hi Mykle, >>>> >>>> Yes, iFFT takes spectral-bin signals in parallel. Right now they all >>>> run at the full audio sampling rate, but later we should be able to >>>> downsample as is typical. >>> >>> Thanks. Clearly I have wandered in over my head, math-wise. >>> But after reading all weekend, I think I now (sort of) understand >>> the difference between the real and the complex FFT. Or so I’d like >>> to prove to myself, by making this algorithm work in Faust. =) >>> >>> Nevertheless, I’m still struggling. I expect this to work, and it doesn’t: >>> >>> import("stdfaust.lib”); >>> process = no.noise : an.rtocv(N) : an.fft(N) : par(f, N, (/(denom(f)^beta), >>> _ )) : an.ifft(N) : ba.selectn(N*2, 0) >>> with { >>> N=8; >>> hN = N/2; >>> beta = hslider("beta", 1, 0, 3, 0.01); >>> // Convert par() index to appropriate coefficient for pos & neg freqs >>> produced by complex fft >>> // For instance: 0 1 2 3 4 5 6 7 -> 4 3 2 1 1 2 3 4 >>> denom(f) = ba.if(f < hN, hN-f, f+1 - hN); >>> }; >>> >>> >>> And while trying to debug that myself, I hit an even bigger snag >>> with selectn(). The code below seems pretty straightforward, >>> but it does not work at all like I expect, and I haven’t a clue why not: >>> >>> >>> import("stdfaust.lib"); >>> process = par(i, N, (2*i, 2*i+1)) : par(i, 16, hbargraph("[%2i]value %i", >>> 0, 20)) >>> : ba.selectn(16, pick) : hbargraph("selected value", 0, 20) >>> with { >>> N=8; >>> pick = hslider(“pick a value", 0, 0, 15, 1); >>> }; >>> >>> >>> (Possibly this is because selectn() expects an integer? >>> The SVG shows me that the hslider is producing floats, >>> even though there’s not a decimal point in this program.) >>> >>>> Note that for 1/f noise there is a spectral_tilt function in >>>> filters.lib that will provide a 1/f filter for white noise as a >>>> special case. More generally it can provide 1/f^alpha over the entire >>>> audio band, for any alpha, to any desired degree of accuracy. >>>> Moreover, alpha can be safely modulated over time as that only moves >>>> the zeros of the filter. >>> >>> Thank you! For any sort of practical use, I’m sure that would be ideal. >>> At the moment I’m just researching the various different approaches to >>> synthesizing 1/f noise. I expect this one to be the slowest. >>> I wanted to see if I could code in Faust, as a learning exercise. >>> (Boy, am I learning …) >>> >>> -mykle- >>> >>> >>> >>> >>> >>> >>> >>> From: l...@grame.fr >>> Subject: Re: [Faudiostream-users] FAUST Compiler for GPGPU? >>> Date: February 27, 2018 at 12:35:59 AM PST >>> To: Christoph Kuhr <christoph.k...@web.de> >>> Cc: faudiostream-users@lists.sourceforge.net, Thomas Hofmann >>> <thomas.hofm...@hs-anhalt.de> >>> >>> >>> >>>> Le 27 févr. 2018 à 09:13, Christoph Kuhr <christoph.k...@web.de> a écrit : >>>> >>>> Hey, >>>> >>>> we are trying to implement FAUST in our online environment untill CfP. >>>> Chances are good that we could submit some proof of concept. >>> >>> That would be great yes ! Is your « online environment » visible somewhere? >>> >>>> So, we will try to attend the IFC18. Even if it does not work out, I may >>>> be able to drop by. >>>> >>>> However, I will be present at the LAC 2018. >>>> >>>> >>>> BR, >>>> Ck >>>> >>> >>> OK. >>> >>> Stéphane >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> 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 > > > > -- > Julius O. Smith III <j...@ccrma.stanford.edu> > Professor of Music and, by courtesy, Electrical Engineering > CCRMA, Stanford University > http://ccrma.stanford.edu/~jos/ ------------------------------------------------------------------------------ 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