Thank you for the suggestion, Julius! I tried using both fdelay and
si.smoo(), but it worsened the artifact. I guess it's because the phase
changed more often with those approaches, as compared to using just delay.

On a different note, I'm trying to run this on teensy 4.1. I've followed
this approach: https://faustdoc.grame.fr/tutorials/teensy/ . There is a
weird problem, though, where I'm able to create at most three instances of
the triangle. If I create a fourth instance, the code compiles, but doesn't
do anything. Is there really an upper limit on the number of instances that
could be created? How could I change the limit, if any? Here is the code:

#include <Audio.h>

#include "FaustTriangle.h"

FaustTriangle faustTriangle[4];  // "Test" is printed only when the number
of instances here are <= 3

void setup() {

  Serial.begin(115200);

  Serial.println("Test");

}

void loop() {}


Regards,

Tejas

On Thu, Feb 26, 2026 at 1:57 AM Julius Smith <[email protected]> wrote:

> N is the order of interpolation.  It sounds like you want N=1, but maybe
> compare to higher N when everything is done.
>
> Instead of delay, use fdelay, and run its delay parameter through a
> smoother (e.g., si.smoo(), IIRC)
>
> On Thu, Feb 26, 2026 at 12:49 AM Tejas Rode <[email protected]> wrote:
>
>> Thanks for the hint! This is what I have put together. It runs, but I
>> have further questions.
>>
>> import("stdfaust.lib");
>> freq = hslider("freq", 440, 11, 880, 1);
>> N = 1;  // tried up to 4
>> duty = hslider("duty", 0.5, 0, 1, 0.01);
>> phase = hslider("phase", 0.5, 0, 1, 0.001);
>> triangleND(N,freq,duty,phase) = squareND(N,freq,duty,phase) : fi.pole(p)
>> : *(gain) with {
>>   gain = 4.0*freq/ma.SR;
>>   p = 0.999;
>> };
>> squareND(N,freq,duty,phase) = os.pulsetrainN(N,freq,duty) @
>> round(phase*ma.SR/freq);  // phase has audible jumps
>> process = triangleND(N,freq,duty,phase);
>>
>> I have two questions.
>> 1. How does the value of N affect how the output sounds? I tried N=1 to
>> N=4, but didn't hear an audible difference. What value of N should I set as
>> default?
>> 2. When I move the phase slider, there are audible jumps. It's probably
>> because the phase is rounding to the nearest integer. Is there a way to
>> make the phase change sound smooth?
>>
>> I'm quite new to FAUST. Thank you for all the help!
>>
>> Regards,
>> Tejas
>>
>> On Sun, Feb 22, 2026 at 2:11 AM Julius Smith <[email protected]>
>> wrote:
>>
>>> I think I would just use a delay.  Search for "phase" in oscillators.lib
>>> and you'll see various approaches.
>>>
>>> On Sat, Feb 21, 2026 at 9:43 PM Tejas Rode <[email protected]> wrote:
>>>
>>>> Hi Julius,
>>>>
>>>> I have a followup question. If I want to add phase value as an argument
>>>> to this triangleND function, what is the best way to do that?
>>>>
>>>> Thanks!
>>>> Tejas
>>>>
>>>> On Fri, Feb 13, 2026 at 4:08 PM Julius Smith <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi Tejas,
>>>>>
>>>>> You might try modifying os.triangleN(N,freq) to add a duty factor,
>>>>> where N is the order of the aliasing suppression.
>>>>> It's based on the paper "Alias-Suppressed Oscillators based on
>>>>> Differentiated Polynomial Waveforms" by Valimaki et al.
>>>>>
>>>>> My guess:
>>>>>
>>>>> triangleND(N,freq,duty) = squareND(N,freq,duty) : fi.pole(p) : *(gain)
>>>>> with {
>>>>>   gain = 4.0*freq/ma.SR; // for aproximate unit peak amplitude
>>>>>   p = 0.999;
>>>>> };
>>>>> squareND(N,freq,duty) = pulsetrainN(N,freq,duty);
>>>>>
>>>>> Then your 25% case would be os.triangleND(N,freq,0.25);
>>>>>
>>>>> Cheers,
>>>>> - Julius
>>>>>
>>>>>
>>>>> On Fri, Feb 13, 2026 at 10:39 AM Tejas Rode <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I want to create an anti-aliased dfdsdg triangle wave with 25% duty
>>>>>> cycle for use in a teensy project. I'm new to faust. Is there a resource
>>>>>> that I can refer to? Any ideas that can help me start implementing this?
>>>>>>
>>>>>> Thanks,
>>>>>> Tejas
>>>>>> _______________________________________________
>>>>>> Faudiostream-users mailing list
>>>>>> [email protected]
>>>>>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> AI has taken my job, but only I know what it is.
>>>>>
>>>>
>>>
>>> --
>>> AI has taken my job, but only I know what it is.
>>>
>>
>
> --
> AI has taken my job, but only I know what it is.
>
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to