On 6/4/20, Till Bovermann <lf...@lfsaw.de> wrote:
> Dear list,
>
> I am currently trying to implement 1bit-synthesis mechanisms in faust and
> have some sketches on how to implement that:
>
> It basically boils down to interpret a stream of integers (of a given
> bit-depth, say, 32bits) as a stream of blocks (of size 32) of bits.
>
> This is quite close to hardware interfaces such as the i2s implementation of
> the esp32 [1], which has native capabilities to transmit PDM (pulse density
> modulation, aka DSD, aka 1-bit audio) [2].
>
>
> the technical implementation would be to create a series of
> 1-bit-block-specific operations (primitives) that could handle the basics of
> such dsp. This would particularly mean to create a 1-sample delay operator,
> i.e. an operator that turns the bitstream
>
>
> 10110101...
>
> into
>
> 010110101...
>
>
> I discovered the `ffunction` primitive that allows to integrate foreign
> functions into the language, however, AFAICS (and according to sletz on
> slack, and from what I got from the documentation at [3]), they need to be
> stateless.
>
> the aforementioned 1-bit delay, though, requires a state (of one additional
> integer).
>
>
> does anyone know if there is a possibility to implement such a (1-sample)
> delay as a primitive in faust?
>
>
> all the best and thanks for your thoughts
>
>       Till
>
> [1]
> https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf
> [2] search e.g. for "pdm" in this article
> https://hackaday.com/2019/04/18/all-you-need-to-know-about-i2s/
> [3] https://faust.grame.fr/doc/manual/index.html#ffunction
>
> _______________________________________________
> Faudiostream-users mailing list
> Faudiostream-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>

I can't tell whether this would be useful to your case, but could you
declare a static variable, c-side, within your foreign function? This
allows some kind of state to be held between calls to that function.


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

Reply via email to