Yes, also you want to catch a numerical range, something like sinc(x) = select2(abs(x)<1.0e-7, sin(x)/x, 1.0);
On Thu, May 18, 2017 at 1:15 AM, Kjetil Matheussen <k.s.matheus...@gmail.com> wrote: > But I think pattern matching only works if the > compiler can deduce which pattern to use > at compile time... > > > > On Thu, May 18, 2017 at 10:13 AM, Kjetil Matheussen > <k.s.matheus...@gmail.com> wrote: >> >> You can also use pattern matching: >> >> sinc(0) = 1; >> sinc(x) = sin(x)/x; >> >> >> On Thu, May 18, 2017 at 7:08 AM, Julius Smith <j...@ccrma.stanford.edu> >> wrote: >>> >>> I would do this using select2 - Julius >>> >>> >>> On Wed, May 17, 2017 at 7:19 PM, Rasik Srinath <rasi...@gmail.com> wrote: >>> > Hi guys....reasonably new Faust user here. I've looked around and was >>> > unable >>> > to find any information on implementing piecewise functions in faust. >>> > >>> > for example, >>> > sinc(x) = 1, x= 0 >>> > = sin(x)/x, all other values >>> > >>> > I suppose there's a way to do this with select2 or something, but I was >>> > wondering if there was a simpler implementation of this. >>> > >>> > All help is appreciated! >>> > >>> > >>> > ------------------------------------------------------------------------------ >>> > 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 >> >> > -- 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