On 7/14/20, Till Bovermann <lf...@lfsaw.de> wrote:
> Dear James, all,
>
> your hint helped a lot, thanks, James!

I'm glad.

> However, after reading this paper
>       https://hal.archives-ouvertes.fr/hal-02159011/document
>
> (thanks for the pointer, sletz!)
>
> I think that computation still happens for every sample, despite the input
> value (i.e. previous state) not changing and thus the output also keeping at
> a constant value.
>
> Maybe an expert in faust optimisation could shed some light on this (and
> proof me wrong?)

I can't check it carefully right now, but yes, from a quick inspection
of the code, it seems that in this case f will be recomputed every
sample inside demand_1. It may be possible to avoid this by
rearranging demand_1 such that f is inside the latch? In this
particular case I guess it doesn't matter very much as statemachine is
hardly very computationally intensive.

I will say that if you know C then a glance at the generated C code
can clarify what is being calculated.

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, would be a useful addition to the
language for applications such as this. I am considering trying to
implement it myself, and I wonder whether a patch/pull request for
such a primitive would be accepted? I'll try to write up my thoughts
on this more fully later.

Cheers,
James


_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to