Dear list,

thanks for all the pointers, I spend some time digging and came up with a 
solution using purely faust-native code.

```
delay32(0, x) = x;
delay32(delta, x) = ((x >> delta) | (x' << (32-delta)));
```

all the best
        Till


--
Till Bovermann

https://tai-studio.org | http://lfsaw.de | https://www.instagram.com/_lfsaw/











> On 5. Jun 2020, at 11:00, Matej Fröbe <[email protected]> wrote:
> 
> Hi Till,
> 
> maybe you can do it in Faust with something like this (not tested):
> 
> bitDelay = _ <: >>(1), (%(2) : mem : <<(31)) :> _;
> 
> I am new to Faust and wasn't sure how to test the code above because it uses 
> integers. Any recommnedations how to do this?
> 
> Matej
> 
> 
> 
> Am Fr., 5. Juni 2020 um 07:41 Uhr schrieb Stéphane Letz <[email protected]>:
> Are you really sure this cannot be expressed using the recursive operator ?
> 
> Do you have some already written code to show ?
> 
> Stéphane 
> 
> > Le 4 juin 2020 à 16:58, Till Bovermann <[email protected]> a écrit :
> > 
> > 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
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/faudiostream-users
> 
> 
> 
> _______________________________________________
> Faudiostream-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users



_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to