Thanks folks -- I removed the LPF which did seem to have an effect on the
tuning but didn't entirely correct it. I think I'll take a step back from
this code and learn a bit more from Romain's example instead. I was
initially scared by the length of it but I now see it consists mostly of
helpful comments!

All the best,

Rich

On Wed, Oct 14, 2020 at 8:30 AM Oliver Larkin <olilar...@googlemail.com>
wrote:

> I think it’s the type of low pass filter that you have inserted that is
> the problem. Si.smooth Is an iir, and it’s phase response will cause issues
> with the tuning I think. There are other variations of low pass filter that
> you can use that will be better in this respect
>
> On Wed, 14 Oct 2020 at 07:40, Romain Michon <rmnmic...@gmail.com> wrote:
>
>> Ah, that makes more sense. First thing first, nMax should be a fixed
>> number and you're lucky that your code actually works ;). As for the
>> tuning, that's one of the things with waveguide models: their tuning often
>> has to be adjusted "by hand." This is due to the fact that extra delay is
>> added by the various filters in the algorithm. So your best bet here is to
>> adjust the tuning using an external oscillator and comparing the produced
>> pitch to it.
>>
>> Cheers,
>>
>> Romain
>>
>> On Tue, Oct 13, 2020 at 11:44 PM Rich Cochrane <rich.cochr...@bigi.org.uk>
>> wrote:
>>
>>> Thanks to both of you for replying -- it was probably unhelpful of me
>>> not to post the whole code, which I'm attaching here. The whole thing does
>>> produce a note, but the pitch is off (octaves are very flat).
>>> However, asking you to pick my altered version of someone else's code isn't
>>> very reasonable.
>>>
>>> Romain -- I'll look at the example you suggested, I imagine that's a
>>> better starting-point anyway.
>>>
>>> Cheers,
>>>
>>> Rich
>>>
>>> On Tue, Oct 13, 2020 at 3:10 PM Romain Michon <rmnmic...@gmail.com>
>>> wrote:
>>>
>>>> Hi Rich,
>>>>
>>>> This indeed won't make any sound. The waveguide object of the physical
>>>> modeling library in Faust is just 2 delay lines in parallel : it's just a
>>>> simple waveguide without terminations. For a simple string example, have a
>>>> look at the openString function:
>>>> https://github.com/grame-cncm/faustlibraries/blob/master/physmodels.lib#L471
>>>>
>>>> Cheers,
>>>>
>>>> Romain
>>>>
>>>> On Sat, Oct 10, 2020 at 4:05 AM Julius Smith <julius.sm...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hi Rich,
>>>>>
>>>>> I am not familiar with this code, but thanks for the pointers.
>>>>>
>>>>> You have the right idea.  ma.SR/freq needs to equal the round-trip
>>>>> delay up and down the waveguide, adding up all delay line lengths, all
>>>>> filter delays, and the feedback delay from the Faust compiler (there's
>>>>> always at least one sample of that in any closed loop).
>>>>>
>>>>> Cheers,
>>>>> Julius
>>>>>
>>>>> On Fri, Oct 9, 2020 at 6:55 AM Rich Cochrane <
>>>>> rich.cochr...@bigi.org.uk> wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I'm trying to learn Faust's physical modeling features "by
>>>>>> experimentation" so am blundering around a bit.
>>>>>>
>>>>>> I found the last example on this page comprehensible:
>>>>>> "Waveguide-Strings in Faust":
>>>>>> https://hvc.berlin/Sound_Synthesis/Physical_Modeling/physical-modeling-faust-examples/
>>>>>>
>>>>>> I wanted to be able to play it with a keyboard. I thought this might
>>>>>> work:
>>>>>>
>>>>>> segment(pos) = waveguide(nMax,n)
>>>>>>   with{
>>>>>>   nMax = ma.SR/freq;
>>>>>>   n = pos * nMax;
>>>>>>   };
>>>>>>
>>>>>> Where freq is the usual frequency value triggered by a MIDI keyboard.
>>>>>> But the result is a long way out of tune.
>>>>>>
>>>>>> I tried "nMax = freq : pm.f2l : pm.l2s;" instead but this appears to
>>>>>> have the same net effect -- at least, it's also out of tune.
>>>>>>
>>>>>> What's the proper way to do this? Or is this base code not the right
>>>>>> starting point for this?
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> Rich
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Faudiostream-users mailing list
>>>>>> Faudiostream-users@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> "Anybody who knows all about nothing knows everything" -- Leonard
>>>>> Susskind
>>>>> _______________________________________________
>>>>> Faudiostream-users mailing list
>>>>> Faudiostream-users@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Romain Michon
>>>> +33 (0)7 67 39 72 40http://grame.fr/~michon
>>>>
>>>>
>>
>> --
>>
>> Romain Michon
>> +33 (0)7 67 39 72 40http://grame.fr/~michon
>>
>> _______________________________________________
>> 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

Reply via email to